From 45e860d577dd6a6391fb5e01d353b0741da139f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?= Date: Thu, 10 Oct 2024 16:07:42 +0200 Subject: [PATCH] feat: updated TFHEExecutor to support new types chore: eq-neq bool support and bitwise scalar support chore: overloads for fheEq and fheNe fix: reverts onchain when rhs is 0 in fheDiv-fheRem feat: added support for scalar and,or,xor chore: cleanup codegen feat: adds euint128 and euint256 types chore: removes ebool fheRandBounded and adds manual tests feat: adds new types for fheRand feat: adds trivialEncrypt for ebytesXXX feat: adds fheEq fheNe ifThenElse for new types chore: rename asyncDecrypt() to initGateway() --- codegen/common.ts | 21 +- codegen/generateOverloads.ts | 5 +- codegen/main.ts | 9 +- codegen/operatorsPrices.json | 183 +- codegen/overloads.json | 8108 +++++++++++++++++----- codegen/payments.ts | 20 +- codegen/templates.ts | 481 +- codegen/testgen.ts | 16 +- docs/guides/decrypt.md | 10 +- examples/Rand.sol | 59 +- examples/Reencrypt.sol | 36 +- examples/TestAsyncDecrypt.sol | 99 +- examples/tests/TFHEManualTestSuite.sol | 253 + examples/tests/TFHETestSuite1.sol | 222 +- examples/tests/TFHETestSuite10.sol | 650 ++ examples/tests/TFHETestSuite11.sol | 440 ++ examples/tests/TFHETestSuite2.sol | 688 +- examples/tests/TFHETestSuite3.sol | 808 +-- examples/tests/TFHETestSuite4.sol | 676 +- examples/tests/TFHETestSuite5.sol | 866 ++- examples/tests/TFHETestSuite6.sol | 634 +- examples/tests/TFHETestSuite7.sol | 650 ++ examples/tests/TFHETestSuite8.sol | 650 ++ examples/tests/TFHETestSuite9.sol | 650 ++ gateway/GatewayContract.sol | 4 +- gateway/lib/Gateway.sol | 16 + lib/FHEPayment.sol | 472 +- lib/Impl.sol | 57 +- lib/TFHE.sol | 8396 ++++++++++++++++++----- lib/TFHEExecutor.sol | 189 +- test/asyncDecrypt.ts | 18 +- test/coprocessorUtils.ts | 49 + test/gatewayDecrypt/testAsyncDecrypt.ts | 122 +- test/instance.ts | 90 + test/kmsVerifier/kmsVerifier.ts | 4 +- test/rand/Rand.ts | 196 +- test/reencryption/reencryption.ts | 104 +- test/tfheOperations/manual.ts | 642 ++ test/tfheOperations/tfheOperations1.ts | 3032 ++++++-- test/tfheOperations/tfheOperations10.ts | 4566 ++++++++---- test/tfheOperations/tfheOperations11.ts | 4606 +++++++++---- test/tfheOperations/tfheOperations12.ts | 3684 +++++++--- test/tfheOperations/tfheOperations13.ts | 221 + test/tfheOperations/tfheOperations2.ts | 4290 +++++++++--- test/tfheOperations/tfheOperations3.ts | 4344 +++++++++--- test/tfheOperations/tfheOperations4.ts | 4292 +++++++++--- test/tfheOperations/tfheOperations5.ts | 4540 ++++++++---- test/tfheOperations/tfheOperations6.ts | 4520 +++++++++--- test/tfheOperations/tfheOperations7.ts | 4692 ++++++++++--- test/tfheOperations/tfheOperations8.ts | 4480 +++++++++--- test/tfheOperations/tfheOperations9.ts | 4666 +++++++++---- 51 files changed, 60523 insertions(+), 18003 deletions(-) create mode 100644 examples/tests/TFHETestSuite10.sol create mode 100644 examples/tests/TFHETestSuite11.sol create mode 100644 examples/tests/TFHETestSuite7.sol create mode 100644 examples/tests/TFHETestSuite8.sol create mode 100644 examples/tests/TFHETestSuite9.sol create mode 100644 test/tfheOperations/tfheOperations13.ts diff --git a/codegen/common.ts b/codegen/common.ts index 269081d7..3c40fb65 100644 --- a/codegen/common.ts +++ b/codegen/common.ts @@ -39,7 +39,7 @@ export enum ReturnType { Ebool, } -export const SUPPORTED_BITS: number[] = [4, 8, 16, 32, 64]; +export const SUPPORTED_BITS: number[] = [4, 8, 16, 32, 64, 128, 256]; export const ALL_OPERATORS: Operator[] = [ { @@ -91,7 +91,7 @@ export const ALL_OPERATORS: Operator[] = [ { name: 'and', precompileName: 'BitwiseAnd', - hasScalar: false, + hasScalar: true, hasEncrypted: true, arguments: OperatorArguments.Binary, returnType: ReturnType.Uint, @@ -101,7 +101,7 @@ export const ALL_OPERATORS: Operator[] = [ { name: 'or', precompileName: 'BitwiseOr', - hasScalar: false, + hasScalar: true, hasEncrypted: true, arguments: OperatorArguments.Binary, returnType: ReturnType.Uint, @@ -111,7 +111,7 @@ export const ALL_OPERATORS: Operator[] = [ { name: 'xor', precompileName: 'BitwiseXor', - hasScalar: false, + hasScalar: true, hasEncrypted: true, arguments: OperatorArguments.Binary, returnType: ReturnType.Uint, @@ -260,16 +260,3 @@ export function checks(operators: Operator[]): Operator[] { return operators; } - -export function networkCodegenContext(network: Network): CodegenContext { - switch (network) { - case Network.Evmos: - return { - libFheAddress: '0x000000000000000000000000000000000000005d', - }; - case Network.Network1: - return { - libFheAddress: '0x010000000000000000000000000000000000005D', - }; - } -} diff --git a/codegen/generateOverloads.ts b/codegen/generateOverloads.ts index cc925a5d..48689280 100644 --- a/codegen/generateOverloads.ts +++ b/codegen/generateOverloads.ts @@ -33,7 +33,7 @@ type SupportedFunction = SupportedFunctionParams & }; const SUPPORTED_UINT = [8, 16, 32, 64, 128, 256]; -const SUPPORTED_BITS = [4, 8, 16, 32, 64]; +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]); @@ -183,17 +183,14 @@ export const SUPPORTED_FUNCTIONS: SupportedFunctions = { }, or: { supportedBits: SUPPORTED_BITS, - noScalar: true, evalTest: (lhsNumber, rhsNumber) => lhsNumber | rhsNumber, }, and: { supportedBits: SUPPORTED_BITS, - noScalar: true, evalTest: (lhsNumber, rhsNumber) => lhsNumber & rhsNumber, }, xor: { supportedBits: SUPPORTED_BITS, - noScalar: true, evalTest: (lhsNumber, rhsNumber) => lhsNumber ^ rhsNumber, }, not: { diff --git a/codegen/main.ts b/codegen/main.ts index 241c6445..05025c5c 100644 --- a/codegen/main.ts +++ b/codegen/main.ts @@ -1,6 +1,6 @@ import { mkdirSync, writeFileSync } from 'fs'; -import { ALL_OPERATORS, Network, SUPPORTED_BITS, checks, networkCodegenContext } from './common'; +import { ALL_OPERATORS, SUPPORTED_BITS, checks } from './common'; import operatorsPrices from './operatorsPrices.json'; import { generateFHEPayment } from './payments'; import * as t from './templates'; @@ -9,12 +9,9 @@ import * as testgen from './testgen'; function generateAllFiles() { const numSplits = 12; const operators = checks(ALL_OPERATORS); - - const network = Network[(process.env.TARGET_NETWORK as keyof typeof Network) || 'Evmos']; - const context = networkCodegenContext(network); - const [tfheSolSource, overloads] = t.tfheSol(context, operators, SUPPORTED_BITS, false); + const [tfheSolSource, overloads] = t.tfheSol(operators, SUPPORTED_BITS, false); const ovShards = testgen.splitOverloadsToShards(overloads); - writeFileSync('lib/Impl.sol', t.implSol(context, operators)); + writeFileSync('lib/Impl.sol', t.implSol(operators)); writeFileSync('lib/TFHE.sol', tfheSolSource); writeFileSync('lib/FHEPayment.sol', generateFHEPayment(operatorsPrices)); writeFileSync('payment/Payment.sol', t.paymentSol()); diff --git a/codegen/operatorsPrices.json b/codegen/operatorsPrices.json index 3d61844e..d7f31a6f 100644 --- a/codegen/operatorsPrices.json +++ b/codegen/operatorsPrices.json @@ -1,119 +1,218 @@ { "fheAdd": { "binary": true, - "scalar": { "1": 65000, "2": 94000, "3": 133000, "4": 162000, "5": 188000 }, - "nonScalar": { "1": 65000, "2": 94000, "3": 133000, "4": 162000, "5": 188000 } + "scalar": { "1": 65000, "2": 94000, "3": 133000, "4": 162000, "5": 188000, "6": 218000, "8": 253000 }, + "nonScalar": { "1": 65000, "2": 94000, "3": 133000, "4": 162000, "5": 188000, "6": 218000, "8": 253000 } }, "fheSub": { "binary": true, - "scalar": { "1": 65000, "2": 94000, "3": 133000, "4": 162000, "5": 188000 }, - "nonScalar": { "1": 65000, "2": 94000, "3": 133000, "4": 162000, "5": 188000 } + "scalar": { "1": 65000, "2": 94000, "3": 133000, "4": 162000, "5": 188000, "6": 218000, "8": 253000 }, + "nonScalar": { "1": 65000, "2": 94000, "3": 133000, "4": 162000, "5": 188000, "6": 218000, "8": 253000 } }, "fheMul": { "binary": true, - "scalar": { "1": 88000, "2": 159000, "3": 208000, "4": 264000, "5": 356000 }, - "nonScalar": { "1": 150000, "2": 197000, "3": 262000, "4": 359000, "5": 641000 } + "scalar": { "1": 88000, "2": 159000, "3": 208000, "4": 264000, "5": 356000, "6": 480000, "8": 647000 }, + "nonScalar": { "1": 150000, "2": 197000, "3": 262000, "4": 359000, "5": 641000, "6": 1145000, "8": 2045000 } + }, + "fheDiv": { + "binary": true, + "scalar": { "1": 139000, "2": 238000, "3": 314000, "4": 398000, "5": 584000, "6": 857000, "8": 1258000 } + }, + "fheRem": { + "binary": true, + "scalar": { "1": 286000, "2": 460000, "3": 622000, "4": 805000, "5": 1095000, "6": 1499000, "8": 2052000 } }, - "fheDiv": { "binary": true, "scalar": { "1": 139000, "2": 238000, "3": 314000, "4": 398000, "5": 584000 } }, - "fheRem": { "binary": true, "scalar": { "1": 286000, "2": 460000, "3": 622000, "4": 805000, "5": 1095000 } }, "fheBitAnd": { "binary": true, - "nonScalar": { "0": 26000, "1": 32000, "2": 34000, "3": 34000, "4": 35000, "5": 38000 } + "scalar": { "0": 26000, "1": 32000, "2": 34000, "3": 34000, "4": 35000, "5": 38000, "6": 41000, "8": 44000 }, + "nonScalar": { "0": 26000, "1": 32000, "2": 34000, "3": 34000, "4": 35000, "5": 38000, "6": 41000, "8": 44000 } }, "fheBitOr": { "binary": true, - "nonScalar": { "0": 26000, "1": 32000, "2": 34000, "3": 34000, "4": 35000, "5": 38000 } + "scalar": { "0": 26000, "1": 32000, "2": 34000, "3": 34000, "4": 35000, "5": 38000, "6": 41000, "8": 44000 }, + "nonScalar": { "0": 26000, "1": 32000, "2": 34000, "3": 34000, "4": 35000, "5": 38000, "6": 41000, "8": 44000 } }, "fheBitXor": { "binary": true, - "nonScalar": { "0": 26000, "1": 32000, "2": 34000, "3": 34000, "4": 35000, "5": 38000 } + "scalar": { "0": 26000, "1": 32000, "2": 34000, "3": 34000, "4": 35000, "5": 38000, "6": 41000, "8": 44000 }, + "nonScalar": { "0": 26000, "1": 32000, "2": 34000, "3": 34000, "4": 35000, "5": 38000, "6": 41000, "8": 44000 } }, "fheShl": { "binary": true, - "scalar": { "1": 35000, "2": 35000, "3": 35000, "4": 35000, "5": 38000 }, - "nonScalar": { "1": 116000, "2": 133000, "3": 153000, "4": 183000, "5": 227000 } + "scalar": { "1": 35000, "2": 35000, "3": 35000, "4": 35000, "5": 38000, "6": 41000, "8": 44000 }, + "nonScalar": { "1": 116000, "2": 133000, "3": 153000, "4": 183000, "5": 227000, "6": 282000, "8": 350000 } }, "fheShr": { "binary": true, - "scalar": { "1": 35000, "2": 35000, "3": 35000, "4": 35000, "5": 38000 }, - "nonScalar": { "1": 116000, "2": 133000, "3": 153000, "4": 183000, "5": 227000 } + "scalar": { "1": 35000, "2": 35000, "3": 35000, "4": 35000, "5": 38000, "6": 41000, "8": 44000 }, + "nonScalar": { "1": 116000, "2": 133000, "3": 153000, "4": 183000, "5": 227000, "6": 282000, "8": 350000 } }, "fheRotl": { "binary": true, - "scalar": { "1": 35000, "2": 35000, "3": 35000, "4": 35000, "5": 38000 }, - "nonScalar": { "1": 116000, "2": 133000, "3": 153000, "4": 183000, "5": 227000 } + "scalar": { "1": 35000, "2": 35000, "3": 35000, "4": 35000, "5": 38000, "6": 41000, "8": 44000 }, + "nonScalar": { "1": 116000, "2": 133000, "3": 153000, "4": 183000, "5": 227000, "6": 282000, "8": 350000 } }, "fheRotr": { "binary": true, - "scalar": { "1": 35000, "2": 35000, "3": 35000, "4": 35000, "5": 38000 }, - "nonScalar": { "1": 116000, "2": 133000, "3": 153000, "4": 183000, "5": 227000 } + "scalar": { "1": 35000, "2": 35000, "3": 35000, "4": 35000, "5": 38000, "6": 41000, "8": 44000 }, + "nonScalar": { "1": 116000, "2": 133000, "3": 153000, "4": 183000, "5": 227000, "6": 282000, "8": 350000 } }, "fheEq": { "binary": true, - "scalar": { "1": 51000, "2": 53000, "3": 54000, "4": 82000, "5": 86000, "7": 90000, "11": 300000 }, - "nonScalar": { "1": 51000, "2": 53000, "3": 54000, "4": 82000, "5": 86000, "7": 90000, "11": 300000 } + "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 + }, + "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 + } }, "fheNe": { "binary": true, - "scalar": { "1": 51000, "2": 53000, "3": 54000, "4": 82000, "5": 86000, "7": 90000, "11": 300000 }, - "nonScalar": { "1": 51000, "2": 53000, "3": 54000, "4": 82000, "5": 86000, "7": 90000, "11": 300000 } + "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 + }, + "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 + } }, "fheGe": { "binary": true, - "scalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000 }, - "nonScalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000 } + "scalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000, "6": 190000, "8": 231000 }, + "nonScalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000, "6": 190000, "8": 231000 } }, "fheGt": { "binary": true, - "scalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000 }, - "nonScalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000 } + "scalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000, "6": 190000, "8": 231000 }, + "nonScalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000, "6": 190000, "8": 231000 } }, "fheLe": { "binary": true, - "scalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000 }, - "nonScalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000 } + "scalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000, "6": 190000, "8": 231000 }, + "nonScalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000, "6": 190000, "8": 231000 } }, "fheLt": { "binary": true, - "scalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000 }, - "nonScalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000 } + "scalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000, "6": 190000, "8": 231000 }, + "nonScalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000, "6": 190000, "8": 231000 } }, "fheMin": { "binary": true, - "scalar": { "1": 121000, "2": 128000, "3": 150000, "4": 164000, "5": 192000 }, - "nonScalar": { "1": 121000, "2": 128000, "3": 153000, "4": 183000, "5": 210000 } + "scalar": { "1": 121000, "2": 128000, "3": 150000, "4": 164000, "5": 192000, "6": 225000, "8": 264000 }, + "nonScalar": { "1": 121000, "2": 128000, "3": 153000, "4": 183000, "5": 210000, "6": 241000, "8": 277000 } }, "fheMax": { "binary": true, - "scalar": { "1": 121000, "2": 128000, "3": 150000, "4": 164000, "5": 192000 }, - "nonScalar": { "1": 121000, "2": 128000, "3": 153000, "4": 183000, "5": 210000 } + "scalar": { "1": 121000, "2": 128000, "3": 150000, "4": 164000, "5": 192000, "6": 225000, "8": 264000 }, + "nonScalar": { "1": 121000, "2": 128000, "3": 153000, "4": 183000, "5": 210000, "6": 241000, "8": 277000 } }, "fheNeg": { "binary": false, - "types": { "1": 60000, "2": 95000, "3": 131000, "4": 160000, "5": 199000 } + "types": { "1": 60000, "2": 95000, "3": 131000, "4": 160000, "5": 199000, "6": 248000, "8": 309000 } }, "fheNot": { "binary": false, - "types": { "0": 30000, "1": 33000, "2": 34000, "3": 35000, "4": 36000, "5": 37000 } + "types": { "0": 30000, "1": 33000, "2": 34000, "3": 35000, "4": 36000, "5": 37000, "6": 38000, "8": 39000 } }, "cast": { "binary": false, - "types": { "1": 200, "2": 200, "3": 200, "4": 200, "5": 200 } + "types": { "0": 200, "1": 200, "2": 200, "3": 200, "4": 200, "5": 200, "6": 200, "8": 200 } }, "trivialEncrypt": { "binary": false, - "types": { "0": 100, "1": 100, "2": 100, "3": 200, "4": 300, "5": 600, "7": 700 } + "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 + } }, "ifThenElse": { "binary": false, - "types": { "1": 45000, "2": 47000, "3": 47000, "4": 50000, "5": 53000, "7": 80000 } + "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 + } }, "fheRand": { "binary": false, - "types": { "2": 100000, "3": 100000, "4": 100000, "5": 100000 } + "types": { + "0": 100000, + "1": 100000, + "2": 100000, + "3": 100000, + "4": 100000, + "5": 100000, + "6": 100000, + "8": 100000, + "9": 200000, + "10": 300000, + "11": 400000 + } }, "fheRandBounded": { "binary": false, - "types": { "2": 100000, "3": 100000, "4": 100000, "5": 100000 } + "types": { "1": 100000, "2": 100000, "3": 100000, "4": 100000, "5": 100000, "6": 100000, "8": 100000 } } } diff --git a/codegen/overloads.json b/codegen/overloads.json index 3e8ea336..d810199d 100644 --- a/codegen/overloads.json +++ b/codegen/overloads.json @@ -1,87 +1,111 @@ { "add_euint4_euint4": [ - { "inputs": ["3", "2"], "output": "5" }, + { "inputs": ["2", "7"], "output": "9" }, { "inputs": ["4", "8"], "output": "12" }, { "inputs": ["5", "5"], "output": "10" }, { "inputs": ["8", "4"], "output": "12" } ], "add_euint4_euint8": [ - { "inputs": ["1", "9"], "output": "10" }, - { "inputs": ["4", "8"], "output": "12" }, + { "inputs": ["2", "10"], "output": "12" }, + { "inputs": ["5", "9"], "output": "14" }, { "inputs": ["5", "5"], "output": "10" }, - { "inputs": ["8", "4"], "output": "12" } + { "inputs": ["9", "5"], "output": "14" } ], "add_euint4_uint8": [ - { "inputs": ["1", "1"], "output": "2" }, - { "inputs": ["4", "8"], "output": "12" }, + { "inputs": ["9", "2"], "output": "11" }, + { "inputs": ["5", "9"], "output": "14" }, { "inputs": ["5", "5"], "output": "10" }, - { "inputs": ["8", "4"], "output": "12" } + { "inputs": ["9", "5"], "output": "14" } ], "add_euint4_euint16": [ - { "inputs": ["2", "13"], "output": "15" }, + { "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_euint32": [ - { "inputs": ["2", "8"], "output": "10" }, + "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_euint64": [ + "add_euint4_euint256": [ { "inputs": ["2", "9"], "output": "11" }, - { "inputs": ["6", "8"], "output": "14" }, + { "inputs": ["4", "8"], "output": "12" }, { "inputs": ["5", "5"], "output": "10" }, - { "inputs": ["8", "6"], "output": "14" } + { "inputs": ["8", "4"], "output": "12" } ], "add_euint8_euint4": [ { "inputs": ["10", "2"], "output": "12" }, - { "inputs": ["4", "8"], "output": "12" }, + { "inputs": ["5", "9"], "output": "14" }, { "inputs": ["5", "5"], "output": "10" }, - { "inputs": ["8", "4"], "output": "12" } + { "inputs": ["9", "5"], "output": "14" } ], "add_uint8_euint4": [ - { "inputs": ["1", "2"], "output": "3" }, - { "inputs": ["4", "8"], "output": "12" }, + { "inputs": ["6", "9"], "output": "15" }, + { "inputs": ["5", "9"], "output": "14" }, { "inputs": ["5", "5"], "output": "10" }, - { "inputs": ["8", "4"], "output": "12" } + { "inputs": ["9", "5"], "output": "14" } ], "add_euint8_euint8": [ - { "inputs": ["56", "89"], "output": "145" }, - { "inputs": ["52", "56"], "output": "108" }, - { "inputs": ["56", "56"], "output": "112" }, - { "inputs": ["56", "52"], "output": "108" } + { "inputs": ["219", "18"], "output": "237" }, + { "inputs": ["14", "18"], "output": "32" }, + { "inputs": ["18", "18"], "output": "36" }, + { "inputs": ["18", "14"], "output": "32" } ], "add_euint8_uint8": [ - { "inputs": ["56", "11"], "output": "67" }, - { "inputs": ["52", "56"], "output": "108" }, - { "inputs": ["56", "56"], "output": "112" }, - { "inputs": ["56", "52"], "output": "108" } + { "inputs": ["110", "64"], "output": "174" }, + { "inputs": ["14", "18"], "output": "32" }, + { "inputs": ["18", "18"], "output": "36" }, + { "inputs": ["18", "14"], "output": "32" } ], "add_uint8_euint8": [ - { "inputs": ["69", "11"], "output": "80" }, - { "inputs": ["52", "56"], "output": "108" }, - { "inputs": ["56", "56"], "output": "112" }, - { "inputs": ["56", "52"], "output": "108" } + { "inputs": ["52", "126"], "output": "178" }, + { "inputs": ["14", "18"], "output": "32" }, + { "inputs": ["18", "18"], "output": "36" }, + { "inputs": ["18", "14"], "output": "32" } ], "add_euint8_euint16": [ - { "inputs": ["2", "246"], "output": "248" }, - { "inputs": ["104", "106"], "output": "210" }, - { "inputs": ["106", "106"], "output": "212" }, - { "inputs": ["106", "104"], "output": "210" } + { "inputs": ["2", "132"], "output": "134" }, + { "inputs": ["4", "8"], "output": "12" }, + { "inputs": ["8", "8"], "output": "16" }, + { "inputs": ["8", "4"], "output": "12" } ], "add_euint8_euint32": [ - { "inputs": ["2", "131"], "output": "133" }, - { "inputs": ["88", "92"], "output": "180" }, - { "inputs": ["92", "92"], "output": "184" }, - { "inputs": ["92", "88"], "output": "180" } + { "inputs": ["2", "251"], "output": "253" }, + { "inputs": ["59", "63"], "output": "122" }, + { "inputs": ["63", "63"], "output": "126" }, + { "inputs": ["63", "59"], "output": "122" } ], "add_euint8_euint64": [ { "inputs": ["2", "129"], "output": "131" }, - { "inputs": ["12", "16"], "output": "28" }, - { "inputs": ["16", "16"], "output": "32" }, - { "inputs": ["16", "12"], "output": "28" } + { "inputs": ["87", "91"], "output": "178" }, + { "inputs": ["91", "91"], "output": "182" }, + { "inputs": ["91", "87"], "output": "178" } + ], + "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" }, @@ -90,432 +114,898 @@ { "inputs": ["8", "4"], "output": "12" } ], "add_euint16_euint8": [ - { "inputs": ["147", "3"], "output": "150" }, - { "inputs": ["116", "118"], "output": "234" }, - { "inputs": ["118", "118"], "output": "236" }, - { "inputs": ["118", "116"], "output": "234" } + { "inputs": ["205", "2"], "output": "207" }, + { "inputs": ["90", "94"], "output": "184" }, + { "inputs": ["94", "94"], "output": "188" }, + { "inputs": ["94", "90"], "output": "184" } ], "add_euint16_euint16": [ - { "inputs": ["12135", "15379"], "output": "27514" }, - { "inputs": ["12131", "12135"], "output": "24266" }, - { "inputs": ["12135", "12135"], "output": "24270" }, - { "inputs": ["12135", "12131"], "output": "24266" } + { "inputs": ["26028", "36322"], "output": "62350" }, + { "inputs": ["26024", "26028"], "output": "52052" }, + { "inputs": ["26028", "26028"], "output": "52056" }, + { "inputs": ["26028", "26024"], "output": "52052" } ], "add_euint16_uint16": [ - { "inputs": ["12135", "52126"], "output": "64261" }, - { "inputs": ["12131", "12135"], "output": "24266" }, - { "inputs": ["12135", "12135"], "output": "24270" }, - { "inputs": ["12135", "12131"], "output": "24266" } + { "inputs": ["26028", "15417"], "output": "41445" }, + { "inputs": ["26024", "26028"], "output": "52052" }, + { "inputs": ["26028", "26028"], "output": "52056" }, + { "inputs": ["26028", "26024"], "output": "52052" } ], "add_uint16_euint16": [ - { "inputs": ["12140", "26064"], "output": "38204" }, - { "inputs": ["12131", "12135"], "output": "24266" }, - { "inputs": ["12135", "12135"], "output": "24270" }, - { "inputs": ["12135", "12131"], "output": "24266" } + { "inputs": ["22897", "15417"], "output": "38314" }, + { "inputs": ["26024", "26028"], "output": "52052" }, + { "inputs": ["26028", "26028"], "output": "52056" }, + { "inputs": ["26028", "26024"], "output": "52052" } ], "add_euint16_euint32": [ - { "inputs": ["2", "40496"], "output": "40498" }, - { "inputs": ["18317", "18319"], "output": "36636" }, - { "inputs": ["18319", "18319"], "output": "36638" }, - { "inputs": ["18319", "18317"], "output": "36636" } + { "inputs": ["2", "52896"], "output": "52898" }, + { "inputs": ["19184", "19188"], "output": "38372" }, + { "inputs": ["19188", "19188"], "output": "38376" }, + { "inputs": ["19188", "19184"], "output": "38372" } ], "add_euint16_euint64": [ { "inputs": ["2", "65506"], "output": "65508" }, - { "inputs": ["12725", "12729"], "output": "25454" }, - { "inputs": ["12729", "12729"], "output": "25458" }, - { "inputs": ["12729", "12725"], "output": "25454" } + { "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" } + ], + "add_euint16_euint256": [ + { "inputs": ["2", "32769"], "output": "32771" }, + { "inputs": ["20019", "20021"], "output": "40040" }, + { "inputs": ["20021", "20021"], "output": "40042" }, + { "inputs": ["20021", "20019"], "output": "40040" } ], "add_euint32_euint4": [ - { "inputs": ["12", "2"], "output": "14" }, - { "inputs": ["4", "6"], "output": "10" }, - { "inputs": ["6", "6"], "output": "12" }, - { "inputs": ["6", "4"], "output": "10" } + { "inputs": ["10", "1"], "output": "11" }, + { "inputs": ["4", "8"], "output": "12" }, + { "inputs": ["5", "5"], "output": "10" }, + { "inputs": ["8", "4"], "output": "12" } ], "add_euint32_euint8": [ - { "inputs": ["153", "2"], "output": "155" }, - { "inputs": ["123", "125"], "output": "248" }, - { "inputs": ["125", "125"], "output": "250" }, - { "inputs": ["125", "123"], "output": "248" } + { "inputs": ["129", "2"], "output": "131" }, + { "inputs": ["79", "81"], "output": "160" }, + { "inputs": ["81", "81"], "output": "162" }, + { "inputs": ["81", "79"], "output": "160" } ], "add_euint32_euint16": [ - { "inputs": ["62662", "2"], "output": "62664" }, - { "inputs": ["19188", "19190"], "output": "38378" }, - { "inputs": ["19190", "19190"], "output": "38380" }, - { "inputs": ["19190", "19188"], "output": "38378" } + { "inputs": ["35595", "11"], "output": "35606" }, + { "inputs": ["18477", "18479"], "output": "36956" }, + { "inputs": ["18479", "18479"], "output": "36958" }, + { "inputs": ["18479", "18477"], "output": "36956" } ], "add_euint32_euint32": [ - { "inputs": ["451501910", "1802073207"], "output": "2253575117" }, - { "inputs": ["903003814", "903003818"], "output": "1806007632" }, - { "inputs": ["903003818", "903003818"], "output": "1806007636" }, - { "inputs": ["903003818", "903003814"], "output": "1806007632" } + { "inputs": ["1855544902", "1743021443"], "output": "3598566345" }, + { "inputs": ["1743021441", "1743021443"], "output": "3486042884" }, + { "inputs": ["1743021443", "1743021443"], "output": "3486042886" }, + { "inputs": ["1743021443", "1743021441"], "output": "3486042884" } ], "add_euint32_uint32": [ - { "inputs": ["451501910", "2087738652"], "output": "2539240562" }, - { "inputs": ["903003814", "903003818"], "output": "1806007632" }, - { "inputs": ["903003818", "903003818"], "output": "1806007636" }, - { "inputs": ["903003818", "903003814"], "output": "1806007632" } + { "inputs": ["1855544902", "749023821"], "output": "2604568723" }, + { "inputs": ["1743021441", "1743021443"], "output": "3486042884" }, + { "inputs": ["1743021443", "1743021443"], "output": "3486042886" }, + { "inputs": ["1743021443", "1743021441"], "output": "3486042884" } ], "add_uint32_euint32": [ - { "inputs": ["823987277", "2087738652"], "output": "2911725929" }, - { "inputs": ["903003814", "903003818"], "output": "1806007632" }, - { "inputs": ["903003818", "903003818"], "output": "1806007636" }, - { "inputs": ["903003818", "903003814"], "output": "1806007632" } + { "inputs": ["1745146365", "1498047640"], "output": "3243194005" }, + { "inputs": ["1743021441", "1743021443"], "output": "3486042884" }, + { "inputs": ["1743021443", "1743021443"], "output": "3486042886" }, + { "inputs": ["1743021443", "1743021441"], "output": "3486042884" } ], "add_euint32_euint64": [ - { "inputs": ["2", "4294200415"], "output": "4294200417" }, - { "inputs": ["184177949", "184177953"], "output": "368355902" }, - { "inputs": ["184177953", "184177953"], "output": "368355906" }, - { "inputs": ["184177953", "184177949"], "output": "368355902" } + { "inputs": ["2", "4294187631"], "output": "4294187633" }, + { "inputs": ["1977492101", "1977492105"], "output": "3954984206" }, + { "inputs": ["1977492105", "1977492105"], "output": "3954984210" }, + { "inputs": ["1977492105", "1977492101"], "output": "3954984206" } + ], + "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": ["4", "8"], "output": "12" }, - { "inputs": ["5", "5"], "output": "10" }, - { "inputs": ["8", "4"], "output": "12" } + { "inputs": ["5", "7"], "output": "12" }, + { "inputs": ["7", "7"], "output": "14" }, + { "inputs": ["7", "5"], "output": "12" } ], "add_euint64_euint8": [ { "inputs": ["129", "2"], "output": "131" }, - { "inputs": ["89", "91"], "output": "180" }, - { "inputs": ["91", "91"], "output": "182" }, - { "inputs": ["91", "89"], "output": "180" } + { "inputs": ["66", "70"], "output": "136" }, + { "inputs": ["70", "70"], "output": "140" }, + { "inputs": ["70", "66"], "output": "136" } ], "add_euint64_euint16": [ - { "inputs": ["65527", "2"], "output": "65529" }, - { "inputs": ["22102", "22104"], "output": "44206" }, - { "inputs": ["22104", "22104"], "output": "44208" }, - { "inputs": ["22104", "22102"], "output": "44206" } + { "inputs": ["65532", "2"], "output": "65534" }, + { "inputs": ["23004", "23006"], "output": "46010" }, + { "inputs": ["23006", "23006"], "output": "46012" }, + { "inputs": ["23006", "23004"], "output": "46010" } ], "add_euint64_euint32": [ - { "inputs": ["4293751578", "2"], "output": "4293751580" }, - { "inputs": ["1806019599", "1806019601"], "output": "3612039200" }, - { "inputs": ["1806019601", "1806019601"], "output": "3612039202" }, - { "inputs": ["1806019601", "1806019599"], "output": "3612039200" } + { "inputs": ["4294529095", "2"], "output": "4294529097" }, + { "inputs": ["1772669097", "1772669099"], "output": "3545338196" }, + { "inputs": ["1772669099", "1772669099"], "output": "3545338198" }, + { "inputs": ["1772669099", "1772669097"], "output": "3545338196" } ], "add_euint64_euint64": [ - { "inputs": ["9219336648067240893", "9223239842705786428"], "output": "18442576490773027321" }, - { "inputs": ["9219336648067240891", "9219336648067240893"], "output": "18438673296134481784" }, - { "inputs": ["9219336648067240893", "9219336648067240893"], "output": "18438673296134481786" }, - { "inputs": ["9219336648067240893", "9219336648067240891"], "output": "18438673296134481784" } + { "inputs": ["9222005500490563257", "9222323180954998973"], "output": "18444328681445562230" }, + { "inputs": ["9222005500490563255", "9222005500490563257"], "output": "18444011000981126512" }, + { "inputs": ["9222005500490563257", "9222005500490563257"], "output": "18444011000981126514" }, + { "inputs": ["9222005500490563257", "9222005500490563255"], "output": "18444011000981126512" } ], "add_euint64_uint64": [ - { "inputs": ["9219336648067240893", "9219865027937887870"], "output": "18439201676005128763" }, - { "inputs": ["9219336648067240891", "9219336648067240893"], "output": "18438673296134481784" }, - { "inputs": ["9219336648067240893", "9219336648067240893"], "output": "18438673296134481786" }, - { "inputs": ["9219336648067240893", "9219336648067240891"], "output": "18438673296134481784" } + { "inputs": ["9222005500490563257", "9221821229831123671"], "output": "18443826730321686928" }, + { "inputs": ["9222005500490563255", "9222005500490563257"], "output": "18444011000981126512" }, + { "inputs": ["9222005500490563257", "9222005500490563257"], "output": "18444011000981126514" }, + { "inputs": ["9222005500490563257", "9222005500490563255"], "output": "18444011000981126512" } ], "add_uint64_euint64": [ - { "inputs": ["9221821645145019755", "9219865027937887870"], "output": "18441686673082907625" }, - { "inputs": ["9219336648067240891", "9219336648067240893"], "output": "18438673296134481784" }, - { "inputs": ["9219336648067240893", "9219336648067240893"], "output": "18438673296134481786" }, - { "inputs": ["9219336648067240893", "9219336648067240891"], "output": "18438673296134481784" } + { "inputs": ["9221960957990697049", "9221821229831123671"], "output": "18443782187821820720" }, + { "inputs": ["9222005500490563255", "9222005500490563257"], "output": "18444011000981126512" }, + { "inputs": ["9222005500490563257", "9222005500490563257"], "output": "18444011000981126514" }, + { "inputs": ["9222005500490563257", "9222005500490563255"], "output": "18444011000981126512" } + ], + "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" } + ], + "add_euint128_euint8": [ + { "inputs": ["129", "2"], "output": "131" }, + { "inputs": ["118", "120"], "output": "238" }, + { "inputs": ["120", "120"], "output": "240" }, + { "inputs": ["120", "118"], "output": "238" } + ], + "add_euint128_euint16": [ + { "inputs": ["32769", "2"], "output": "32771" }, + { "inputs": ["31253", "31255"], "output": "62508" }, + { "inputs": ["31255", "31255"], "output": "62510" }, + { "inputs": ["31255", "31253"], "output": "62508" } + ], + "add_euint128_euint32": [ + { "inputs": ["2147483649", "2"], "output": "2147483651" }, + { "inputs": ["417384794", "417384798"], "output": "834769592" }, + { "inputs": ["417384798", "417384798"], "output": "834769596" }, + { "inputs": ["417384798", "417384794"], "output": "834769592" } + ], + "add_euint128_euint64": [ + { "inputs": ["9223372036854775809", "2"], "output": "9223372036854775811" }, + { "inputs": ["9219789077213425563", "9219789077213425565"], "output": "18439578154426851128" }, + { "inputs": ["9219789077213425565", "9219789077213425565"], "output": "18439578154426851130" }, + { "inputs": ["9219789077213425565", "9219789077213425563"], "output": "18439578154426851128" } + ], + "add_euint128_euint128": [ + { + "inputs": ["170141183460469231731685489259224150459", "170141183460469231731686328709125723252"], + "output": "340282366920938463463371817968349873711" + }, + { + "inputs": ["170141183460469231731685489259224150457", "170141183460469231731685489259224150459"], + "output": "340282366920938463463370978518448300916" + }, + { + "inputs": ["170141183460469231731685489259224150459", "170141183460469231731685489259224150459"], + "output": "340282366920938463463370978518448300918" + }, + { + "inputs": ["170141183460469231731685489259224150459", "170141183460469231731685489259224150457"], + "output": "340282366920938463463370978518448300916" + } + ], + "add_euint128_uint128": [ + { + "inputs": ["170141183460469231731685489259224150459", "170141183460469231731685023392215721043"], + "output": "340282366920938463463370512651439871502" + }, + { + "inputs": ["170141183460469231731685489259224150457", "170141183460469231731685489259224150459"], + "output": "340282366920938463463370978518448300916" + }, + { + "inputs": ["170141183460469231731685489259224150459", "170141183460469231731685489259224150459"], + "output": "340282366920938463463370978518448300918" + }, + { + "inputs": ["170141183460469231731685489259224150459", "170141183460469231731685489259224150457"], + "output": "340282366920938463463370978518448300916" + } + ], + "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": [ + "57896044618658097711785492504343953926634992332820282019728788109485910742178", + "57896044618658097711785492504343953926634992332820282019728788109485910742180" + ], + "output": "115792089237316195423570985008687907853269984665640564039457576218971821484358" + }, + { + "inputs": [ + "57896044618658097711785492504343953926634992332820282019728788109485910742180", + "57896044618658097711785492504343953926634992332820282019728788109485910742180" + ], + "output": "115792089237316195423570985008687907853269984665640564039457576218971821484360" + }, + { + "inputs": [ + "57896044618658097711785492504343953926634992332820282019728788109485910742180", + "57896044618658097711785492504343953926634992332820282019728788109485910742178" + ], + "output": "115792089237316195423570985008687907853269984665640564039457576218971821484358" + } ], "sub_euint4_euint4": [ { "inputs": ["8", "8"], "output": "0" }, { "inputs": ["8", "4"], "output": "4" } ], "sub_euint4_euint8": [ - { "inputs": ["10", "10"], "output": "0" }, - { "inputs": ["10", "6"], "output": "4" } + { "inputs": ["8", "8"], "output": "0" }, + { "inputs": ["8", "4"], "output": "4" } ], "sub_euint4_uint8": [ - { "inputs": ["10", "10"], "output": "0" }, - { "inputs": ["10", "6"], "output": "4" } + { "inputs": ["8", "8"], "output": "0" }, + { "inputs": ["8", "4"], "output": "4" } ], "sub_euint4_euint16": [ - { "inputs": ["11", "11"], "output": "0" }, - { "inputs": ["11", "7"], "output": "4" } + { "inputs": ["13", "13"], "output": "0" }, + { "inputs": ["13", "9"], "output": "4" } ], "sub_euint4_euint32": [ - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "4" } + { "inputs": ["13", "13"], "output": "0" }, + { "inputs": ["13", "9"], "output": "4" } ], "sub_euint4_euint64": [ - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "4" } + { "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": ["9", "9"], "output": "0" }, - { "inputs": ["9", "5"], "output": "4" } + { "inputs": ["14", "14"], "output": "0" }, + { "inputs": ["14", "10"], "output": "4" } ], "sub_uint8_euint4": [ - { "inputs": ["9", "9"], "output": "0" }, - { "inputs": ["9", "5"], "output": "4" } + { "inputs": ["14", "14"], "output": "0" }, + { "inputs": ["14", "10"], "output": "4" } ], "sub_euint8_euint8": [ - { "inputs": ["64", "64"], "output": "0" }, - { "inputs": ["64", "60"], "output": "4" } + { "inputs": ["152", "152"], "output": "0" }, + { "inputs": ["152", "148"], "output": "4" } ], "sub_euint8_uint8": [ - { "inputs": ["64", "64"], "output": "0" }, - { "inputs": ["64", "60"], "output": "4" } + { "inputs": ["152", "152"], "output": "0" }, + { "inputs": ["152", "148"], "output": "4" } ], "sub_uint8_euint8": [ - { "inputs": ["64", "64"], "output": "0" }, - { "inputs": ["64", "60"], "output": "4" } + { "inputs": ["152", "152"], "output": "0" }, + { "inputs": ["152", "148"], "output": "4" } ], "sub_euint8_euint16": [ - { "inputs": ["17", "17"], "output": "0" }, - { "inputs": ["17", "13"], "output": "4" } + { "inputs": ["32", "32"], "output": "0" }, + { "inputs": ["32", "28"], "output": "4" } ], "sub_euint8_euint32": [ - { "inputs": ["10", "10"], "output": "0" }, - { "inputs": ["10", "6"], "output": "4" } + { "inputs": ["102", "102"], "output": "0" }, + { "inputs": ["102", "98"], "output": "4" } ], "sub_euint8_euint64": [ - { "inputs": ["15", "15"], "output": "0" }, - { "inputs": ["15", "11"], "output": "4" } + { "inputs": ["8", "8"], "output": "0" }, + { "inputs": ["8", "4"], "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" } ], "sub_euint16_euint8": [ - { "inputs": ["143", "143"], "output": "0" }, - { "inputs": ["143", "139"], "output": "4" } + { "inputs": ["195", "195"], "output": "0" }, + { "inputs": ["195", "191"], "output": "4" } ], "sub_euint16_euint16": [ - { "inputs": ["3171", "3171"], "output": "0" }, - { "inputs": ["3171", "3167"], "output": "4" } + { "inputs": ["14486", "14486"], "output": "0" }, + { "inputs": ["14486", "14482"], "output": "4" } ], "sub_euint16_uint16": [ - { "inputs": ["3171", "3171"], "output": "0" }, - { "inputs": ["3171", "3167"], "output": "4" } + { "inputs": ["14486", "14486"], "output": "0" }, + { "inputs": ["14486", "14482"], "output": "4" } ], "sub_uint16_euint16": [ - { "inputs": ["3171", "3171"], "output": "0" }, - { "inputs": ["3171", "3167"], "output": "4" } + { "inputs": ["14486", "14486"], "output": "0" }, + { "inputs": ["14486", "14482"], "output": "4" } ], "sub_euint16_euint32": [ - { "inputs": ["17812", "17812"], "output": "0" }, - { "inputs": ["17812", "17808"], "output": "4" } + { "inputs": ["32818", "32818"], "output": "0" }, + { "inputs": ["32818", "32814"], "output": "4" } ], "sub_euint16_euint64": [ - { "inputs": ["45021", "45021"], "output": "0" }, - { "inputs": ["45021", "45017"], "output": "4" } + { "inputs": ["12596", "12596"], "output": "0" }, + { "inputs": ["12596", "12592"], "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" } ], "sub_euint32_euint8": [ - { "inputs": ["52", "52"], "output": "0" }, - { "inputs": ["52", "48"], "output": "4" } + { "inputs": ["69", "69"], "output": "0" }, + { "inputs": ["69", "65"], "output": "4" } ], "sub_euint32_euint16": [ - { "inputs": ["35686", "35686"], "output": "0" }, - { "inputs": ["35686", "35682"], "output": "4" } + { "inputs": ["18922", "18922"], "output": "0" }, + { "inputs": ["18922", "18918"], "output": "4" } ], "sub_euint32_euint32": [ - { "inputs": ["296156690", "296156690"], "output": "0" }, - { "inputs": ["296156690", "296156686"], "output": "4" } + { "inputs": ["1818111464", "1818111464"], "output": "0" }, + { "inputs": ["1818111464", "1818111460"], "output": "4" } ], "sub_euint32_uint32": [ - { "inputs": ["296156690", "296156690"], "output": "0" }, - { "inputs": ["296156690", "296156686"], "output": "4" } + { "inputs": ["1818111464", "1818111464"], "output": "0" }, + { "inputs": ["1818111464", "1818111460"], "output": "4" } ], "sub_uint32_euint32": [ - { "inputs": ["296156690", "296156690"], "output": "0" }, - { "inputs": ["296156690", "296156686"], "output": "4" } + { "inputs": ["1818111464", "1818111464"], "output": "0" }, + { "inputs": ["1818111464", "1818111460"], "output": "4" } ], "sub_euint32_euint64": [ - { "inputs": ["2163998221", "2163998221"], "output": "0" }, - { "inputs": ["2163998221", "2163998217"], "output": "4" } + { "inputs": ["2880371585", "2880371585"], "output": "0" }, + { "inputs": ["2880371585", "2880371581"], "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": ["10", "10"], "output": "0" }, - { "inputs": ["10", "6"], "output": "4" } + { "inputs": ["8", "8"], "output": "0" }, + { "inputs": ["8", "4"], "output": "4" } ], "sub_euint64_euint8": [ - { "inputs": ["25", "25"], "output": "0" }, - { "inputs": ["25", "21"], "output": "4" } + { "inputs": ["117", "117"], "output": "0" }, + { "inputs": ["117", "113"], "output": "4" } ], "sub_euint64_euint16": [ - { "inputs": ["45502", "45502"], "output": "0" }, - { "inputs": ["45502", "45498"], "output": "4" } + { "inputs": ["54317", "54317"], "output": "0" }, + { "inputs": ["54317", "54313"], "output": "4" } ], "sub_euint64_euint32": [ - { "inputs": ["3425308729", "3425308729"], "output": "0" }, - { "inputs": ["3425308729", "3425308725"], "output": "4" } + { "inputs": ["148706478", "148706478"], "output": "0" }, + { "inputs": ["148706478", "148706474"], "output": "4" } ], "sub_euint64_euint64": [ - { "inputs": ["18442295292010752223", "18442295292010752223"], "output": "0" }, - { "inputs": ["18442295292010752223", "18442295292010752219"], "output": "4" } + { "inputs": ["18440691834306324731", "18440691834306324731"], "output": "0" }, + { "inputs": ["18440691834306324731", "18440691834306324727"], "output": "4" } ], "sub_euint64_uint64": [ - { "inputs": ["18442295292010752223", "18442295292010752223"], "output": "0" }, - { "inputs": ["18442295292010752223", "18442295292010752219"], "output": "4" } + { "inputs": ["18440691834306324731", "18440691834306324731"], "output": "0" }, + { "inputs": ["18440691834306324731", "18440691834306324727"], "output": "4" } ], "sub_uint64_euint64": [ - { "inputs": ["18442295292010752223", "18442295292010752223"], "output": "0" }, - { "inputs": ["18442295292010752223", "18442295292010752219"], "output": "4" } + { "inputs": ["18440691834306324731", "18440691834306324731"], "output": "0" }, + { "inputs": ["18440691834306324731", "18440691834306324727"], "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" } + ], + "sub_euint128_euint8": [ + { "inputs": ["232", "232"], "output": "0" }, + { "inputs": ["232", "228"], "output": "4" } + ], + "sub_euint128_euint16": [ + { "inputs": ["25392", "25392"], "output": "0" }, + { "inputs": ["25392", "25388"], "output": "4" } + ], + "sub_euint128_euint32": [ + { "inputs": ["373346389", "373346389"], "output": "0" }, + { "inputs": ["373346389", "373346385"], "output": "4" } + ], + "sub_euint128_euint64": [ + { "inputs": ["18441111603467904997", "18441111603467904997"], "output": "0" }, + { "inputs": ["18441111603467904997", "18441111603467904993"], "output": "4" } + ], + "sub_euint128_euint128": [ + { "inputs": ["340282366920938463463366688248127833841", "340282366920938463463366688248127833841"], "output": "0" }, + { "inputs": ["340282366920938463463366688248127833841", "340282366920938463463366688248127833837"], "output": "4" } + ], + "sub_euint128_uint128": [ + { "inputs": ["340282366920938463463366688248127833841", "340282366920938463463366688248127833841"], "output": "0" }, + { "inputs": ["340282366920938463463366688248127833841", "340282366920938463463366688248127833837"], "output": "4" } + ], + "sub_uint128_euint128": [ + { "inputs": ["340282366920938463463366688248127833841", "340282366920938463463366688248127833841"], "output": "0" }, + { "inputs": ["340282366920938463463366688248127833841", "340282366920938463463366688248127833837"], "output": "4" } + ], + "sub_euint128_euint256": [ + { "inputs": ["340282366920938463463369549263218693865", "340282366920938463463369549263218693865"], "output": "0" }, + { "inputs": ["340282366920938463463369549263218693865", "340282366920938463463369549263218693861"], "output": "4" } + ], + "sub_euint256_euint4": [ + { "inputs": ["11", "11"], "output": "0" }, + { "inputs": ["11", "7"], "output": "4" } + ], + "sub_euint256_euint8": [ + { "inputs": ["234", "234"], "output": "0" }, + { "inputs": ["234", "230"], "output": "4" } + ], + "sub_euint256_euint16": [ + { "inputs": ["46280", "46280"], "output": "0" }, + { "inputs": ["46280", "46276"], "output": "4" } + ], + "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": ["3", "3"], "output": "9" }, + { "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": ["3", "3"], "output": "9" }, - { "inputs": ["3", "3"], "output": "9" } + { "inputs": ["5", "3"], "output": "15" } ], "mul_euint4_uint8": [ - { "inputs": ["5", "2"], "output": "10" }, - { "inputs": ["3", "3"], "output": "9" }, + { "inputs": ["3", "4"], "output": "12" }, + { "inputs": ["3", "5"], "output": "15" }, { "inputs": ["3", "3"], "output": "9" }, - { "inputs": ["3", "3"], "output": "9" } + { "inputs": ["5", "3"], "output": "15" } ], "mul_euint4_euint16": [ - { "inputs": ["2", "5"], "output": "10" }, + { "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_euint64": [ + "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": ["5", "2"], "output": "10" }, + { "inputs": ["7", "2"], "output": "14" }, { "inputs": ["3", "5"], "output": "15" }, { "inputs": ["3", "3"], "output": "9" }, { "inputs": ["5", "3"], "output": "15" } ], "mul_uint8_euint4": [ - { "inputs": ["3", "3"], "output": "9" }, + { "inputs": ["2", "4"], "output": "8" }, { "inputs": ["3", "5"], "output": "15" }, { "inputs": ["3", "3"], "output": "9" }, { "inputs": ["5", "3"], "output": "15" } ], "mul_euint8_euint8": [ - { "inputs": ["14", "15"], "output": "210" }, - { "inputs": ["14", "14"], "output": "196" }, + { "inputs": ["8", "12"], "output": "96" }, + { "inputs": ["12", "14"], "output": "168" }, { "inputs": ["14", "14"], "output": "196" }, - { "inputs": ["14", "14"], "output": "196" } + { "inputs": ["14", "12"], "output": "168" } ], "mul_euint8_uint8": [ - { "inputs": ["8", "14"], "output": "112" }, + { "inputs": ["14", "6"], "output": "84" }, + { "inputs": ["12", "14"], "output": "168" }, { "inputs": ["14", "14"], "output": "196" }, - { "inputs": ["14", "14"], "output": "196" }, - { "inputs": ["14", "14"], "output": "196" } + { "inputs": ["14", "12"], "output": "168" } ], "mul_uint8_euint8": [ - { "inputs": ["8", "14"], "output": "112" }, - { "inputs": ["14", "14"], "output": "196" }, + { "inputs": ["12", "11"], "output": "132" }, + { "inputs": ["12", "14"], "output": "168" }, { "inputs": ["14", "14"], "output": "196" }, - { "inputs": ["14", "14"], "output": "196" } + { "inputs": ["14", "12"], "output": "168" } ], "mul_euint8_euint16": [ - { "inputs": ["2", "56"], "output": "112" }, - { "inputs": ["10", "10"], "output": "100" }, - { "inputs": ["10", "10"], "output": "100" }, - { "inputs": ["10", "10"], "output": "100" } + { "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", "11"], "output": "110" }, - { "inputs": ["11", "11"], "output": "121" }, - { "inputs": ["11", "10"], "output": "110" } + { "inputs": ["10", "14"], "output": "140" }, + { "inputs": ["14", "14"], "output": "196" }, + { "inputs": ["14", "10"], "output": "140" } ], "mul_euint8_euint64": [ { "inputs": ["2", "65"], "output": "130" }, - { "inputs": ["13", "13"], "output": "169" }, - { "inputs": ["13", "13"], "output": "169" }, - { "inputs": ["13", "13"], "output": "169" } + { "inputs": ["8", "10"], "output": "80" }, + { "inputs": ["10", "10"], "output": "100" }, + { "inputs": ["10", "8"], "output": "80" } + ], + "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", "4"], "output": "12" }, + { "inputs": ["3", "5"], "output": "15" }, { "inputs": ["3", "3"], "output": "9" }, - { "inputs": ["4", "3"], "output": "12" } + { "inputs": ["5", "3"], "output": "15" } ], "mul_euint16_euint8": [ - { "inputs": ["127", "2"], "output": "254" }, - { "inputs": ["10", "10"], "output": "100" }, + { "inputs": ["87", "2"], "output": "174" }, + { "inputs": ["9", "10"], "output": "90" }, { "inputs": ["10", "10"], "output": "100" }, - { "inputs": ["10", "10"], "output": "100" } + { "inputs": ["10", "9"], "output": "90" } ], "mul_euint16_euint16": [ - { "inputs": ["78", "381"], "output": "29718" }, - { "inputs": ["155", "155"], "output": "24025" }, - { "inputs": ["155", "155"], "output": "24025" }, - { "inputs": ["155", "155"], "output": "24025" } + { "inputs": ["117", "200"], "output": "23400" }, + { "inputs": ["233", "233"], "output": "54289" }, + { "inputs": ["233", "233"], "output": "54289" }, + { "inputs": ["233", "233"], "output": "54289" } ], "mul_euint16_uint16": [ - { "inputs": ["78", "344"], "output": "26832" }, - { "inputs": ["155", "155"], "output": "24025" }, - { "inputs": ["155", "155"], "output": "24025" }, - { "inputs": ["155", "155"], "output": "24025" } + { "inputs": ["233", "168"], "output": "39144" }, + { "inputs": ["233", "233"], "output": "54289" }, + { "inputs": ["233", "233"], "output": "54289" }, + { "inputs": ["233", "233"], "output": "54289" } ], "mul_uint16_euint16": [ - { "inputs": ["256", "173"], "output": "44288" }, - { "inputs": ["155", "155"], "output": "24025" }, - { "inputs": ["155", "155"], "output": "24025" }, - { "inputs": ["155", "155"], "output": "24025" } + { "inputs": ["140", "168"], "output": "23520" }, + { "inputs": ["233", "233"], "output": "54289" }, + { "inputs": ["233", "233"], "output": "54289" }, + { "inputs": ["233", "233"], "output": "54289" } ], "mul_euint16_euint32": [ - { "inputs": ["2", "18411"], "output": "36822" }, - { "inputs": ["139", "139"], "output": "19321" }, - { "inputs": ["139", "139"], "output": "19321" }, - { "inputs": ["139", "139"], "output": "19321" } + { "inputs": ["2", "27164"], "output": "54328" }, + { "inputs": ["244", "244"], "output": "59536" }, + { "inputs": ["244", "244"], "output": "59536" }, + { "inputs": ["244", "244"], "output": "59536" } ], "mul_euint16_euint64": [ - { "inputs": ["2", "32761"], "output": "65522" }, - { "inputs": ["221", "221"], "output": "48841" }, - { "inputs": ["221", "221"], "output": "48841" }, - { "inputs": ["221", "221"], "output": "48841" } + { "inputs": ["2", "32755"], "output": "65510" }, + { "inputs": ["216", "216"], "output": "46656" }, + { "inputs": ["216", "216"], "output": "46656" }, + { "inputs": ["216", "216"], "output": "46656" } + ], + "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": ["5", "2"], "output": "10" }, - { "inputs": ["3", "3"], "output": "9" }, + { "inputs": ["6", "2"], "output": "12" }, + { "inputs": ["3", "5"], "output": "15" }, { "inputs": ["3", "3"], "output": "9" }, - { "inputs": ["3", "3"], "output": "9" } + { "inputs": ["5", "3"], "output": "15" } ], "mul_euint32_euint8": [ - { "inputs": ["102", "2"], "output": "204" }, - { "inputs": ["10", "12"], "output": "120" }, - { "inputs": ["12", "12"], "output": "144" }, - { "inputs": ["12", "10"], "output": "120" } + { "inputs": ["114", "2"], "output": "228" }, + { "inputs": ["15", "16"], "output": "240" }, + { "inputs": ["9", "9"], "output": "81" }, + { "inputs": ["16", "15"], "output": "240" } ], "mul_euint32_euint16": [ - { "inputs": ["22131", "2"], "output": "44262" }, - { "inputs": ["158", "158"], "output": "24964" }, - { "inputs": ["158", "158"], "output": "24964" }, - { "inputs": ["158", "158"], "output": "24964" } + { "inputs": ["30224", "2"], "output": "60448" }, + { "inputs": ["160", "160"], "output": "25600" }, + { "inputs": ["160", "160"], "output": "25600" }, + { "inputs": ["160", "160"], "output": "25600" } ], "mul_euint32_euint32": [ - { "inputs": ["54583", "21224"], "output": "1158469592" }, - { "inputs": ["42446", "42446"], "output": "1801662916" }, - { "inputs": ["42446", "42446"], "output": "1801662916" }, - { "inputs": ["42446", "42446"], "output": "1801662916" } + { "inputs": ["96111", "23856"], "output": "2292824016" }, + { "inputs": ["47710", "47710"], "output": "2276244100" }, + { "inputs": ["47710", "47710"], "output": "2276244100" }, + { "inputs": ["47710", "47710"], "output": "2276244100" } ], "mul_euint32_uint32": [ - { "inputs": ["54583", "52500"], "output": "2865607500" }, - { "inputs": ["42446", "42446"], "output": "1801662916" }, - { "inputs": ["42446", "42446"], "output": "1801662916" }, - { "inputs": ["42446", "42446"], "output": "1801662916" } + { "inputs": ["48056", "45037"], "output": "2164298072" }, + { "inputs": ["47710", "47710"], "output": "2276244100" }, + { "inputs": ["47710", "47710"], "output": "2276244100" }, + { "inputs": ["47710", "47710"], "output": "2276244100" } ], "mul_uint32_euint32": [ - { "inputs": ["39745", "104998"], "output": "4173145510" }, - { "inputs": ["42446", "42446"], "output": "1801662916" }, - { "inputs": ["42446", "42446"], "output": "1801662916" }, - { "inputs": ["42446", "42446"], "output": "1801662916" } + { "inputs": ["25623", "45037"], "output": "1153983051" }, + { "inputs": ["47710", "47710"], "output": "2276244100" }, + { "inputs": ["47710", "47710"], "output": "2276244100" }, + { "inputs": ["47710", "47710"], "output": "2276244100" } ], "mul_euint32_euint64": [ - { "inputs": ["2", "2146443814"], "output": "4292887628" }, - { "inputs": ["61456", "61456"], "output": "3776839936" }, - { "inputs": ["61456", "61456"], "output": "3776839936" }, - { "inputs": ["61456", "61456"], "output": "3776839936" } + { "inputs": ["2", "2146877501"], "output": "4293755002" }, + { "inputs": ["43587", "43587"], "output": "1899826569" }, + { "inputs": ["43587", "43587"], "output": "1899826569" }, + { "inputs": ["43587", "43587"], "output": "1899826569" } + ], + "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" }, @@ -525,39 +1015,195 @@ ], "mul_euint64_euint8": [ { "inputs": ["65", "2"], "output": "130" }, - { "inputs": ["9", "10"], "output": "90" }, - { "inputs": ["10", "10"], "output": "100" }, - { "inputs": ["10", "9"], "output": "90" } + { "inputs": ["12", "13"], "output": "156" }, + { "inputs": ["13", "13"], "output": "169" }, + { "inputs": ["13", "12"], "output": "156" } ], "mul_euint64_euint16": [ - { "inputs": ["32761", "2"], "output": "65522" }, - { "inputs": ["252", "252"], "output": "63504" }, - { "inputs": ["252", "252"], "output": "63504" }, - { "inputs": ["252", "252"], "output": "63504" } + { "inputs": ["32754", "2"], "output": "65508" }, + { "inputs": ["191", "191"], "output": "36481" }, + { "inputs": ["191", "191"], "output": "36481" }, + { "inputs": ["191", "191"], "output": "36481" } ], "mul_euint64_euint32": [ - { "inputs": ["2147367784", "2"], "output": "4294735568" }, - { "inputs": ["50787", "50787"], "output": "2579319369" }, - { "inputs": ["50787", "50787"], "output": "2579319369" }, - { "inputs": ["50787", "50787"], "output": "2579319369" } + { "inputs": ["2147463302", "2"], "output": "4294926604" }, + { "inputs": ["62313", "62313"], "output": "3882909969" }, + { "inputs": ["62313", "62313"], "output": "3882909969" }, + { "inputs": ["62313", "62313"], "output": "3882909969" } ], "mul_euint64_euint64": [ - { "inputs": ["4294744203", "4293841776"], "output": "18440952076075224528" }, - { "inputs": ["4293841776", "4293841776"], "output": "18437077197322834176" }, - { "inputs": ["4293841776", "4293841776"], "output": "18437077197322834176" }, - { "inputs": ["4293841776", "4293841776"], "output": "18437077197322834176" } + { "inputs": ["4294482875", "4294789499"], "output": "18443899955185329625" }, + { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" }, + { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" }, + { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" } ], "mul_euint64_uint64": [ - { "inputs": ["4294744203", "4294589707"], "output": "18444164248401718521" }, - { "inputs": ["4293841776", "4293841776"], "output": "18437077197322834176" }, - { "inputs": ["4293841776", "4293841776"], "output": "18437077197322834176" }, - { "inputs": ["4293841776", "4293841776"], "output": "18437077197322834176" } + { "inputs": ["4294482875", "4294108167"], "output": "18440973986579140125" }, + { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" }, + { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" }, + { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" } ], "mul_uint64_euint64": [ - { "inputs": ["4293263967", "4294589707"], "output": "18437807242112187669" }, - { "inputs": ["4293841776", "4293841776"], "output": "18437077197322834176" }, - { "inputs": ["4293841776", "4293841776"], "output": "18437077197322834176" }, - { "inputs": ["4293841776", "4293841776"], "output": "18437077197322834176" } + { "inputs": ["4293014414", "4294108167"], "output": "18434668256206119138" }, + { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" }, + { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" }, + { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" } + ], + "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" } + ], + "mul_euint128_euint8": [ + { "inputs": ["65", "2"], "output": "130" }, + { "inputs": ["9", "9"], "output": "81" }, + { "inputs": ["9", "9"], "output": "81" }, + { "inputs": ["9", "9"], "output": "81" } + ], + "mul_euint128_euint16": [ + { "inputs": ["16385", "2"], "output": "32770" }, + { "inputs": ["233", "233"], "output": "54289" }, + { "inputs": ["233", "233"], "output": "54289" }, + { "inputs": ["233", "233"], "output": "54289" } + ], + "mul_euint128_euint32": [ + { "inputs": ["1073741825", "2"], "output": "2147483650" }, + { "inputs": ["46331", "46331"], "output": "2146561561" }, + { "inputs": ["46331", "46331"], "output": "2146561561" }, + { "inputs": ["46331", "46331"], "output": "2146561561" } + ], + "mul_euint128_euint64": [ + { "inputs": ["4611686018427387905", "2"], "output": "9223372036854775810" }, + { "inputs": ["4294304633", "4294304633"], "output": "18441052281005264689" }, + { "inputs": ["4294304633", "4294304633"], "output": "18441052281005264689" }, + { "inputs": ["4294304633", "4294304633"], "output": "18441052281005264689" } + ], + "mul_euint128_euint128": [ + { "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" } + ], + "mul_uint128_euint128": [ + { "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" } + ], + "mul_euint256_euint4": [ + { "inputs": ["5", "2"], "output": "10" }, + { "inputs": ["3", "5"], "output": "15" }, + { "inputs": ["3", "3"], "output": "9" }, + { "inputs": ["5", "3"], "output": "15" } + ], + "mul_euint256_euint8": [ + { "inputs": ["65", "2"], "output": "130" }, + { "inputs": ["13", "14"], "output": "182" }, + { "inputs": ["14", "14"], "output": "196" }, + { "inputs": ["14", "13"], "output": "182" } + ], + "mul_euint256_euint16": [ + { "inputs": ["16385", "2"], "output": "32770" }, + { "inputs": ["233", "233"], "output": "54289" }, + { "inputs": ["233", "233"], "output": "54289" }, + { "inputs": ["233", "233"], "output": "54289" } + ], + "mul_euint256_euint32": [ + { "inputs": ["1073741825", "2"], "output": "2147483650" }, + { "inputs": ["60165", "60165"], "output": "3619827225" }, + { "inputs": ["60165", "60165"], "output": "3619827225" }, + { "inputs": ["60165", "60165"], "output": "3619827225" } + ], + "mul_euint256_euint64": [ + { "inputs": ["4611686018427387905", "2"], "output": "9223372036854775810" }, + { "inputs": ["4292912378", "4292912378"], "output": "18429096685185614884" }, + { "inputs": ["4292912378", "4292912378"], "output": "18429096685185614884" }, + { "inputs": ["4292912378", "4292912378"], "output": "18429096685185614884" } + ], + "mul_euint256_euint128": [ + { "inputs": ["85070591730234615865843651857942052865", "2"], "output": "170141183460469231731687303715884105730" }, + { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" }, + { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" }, + { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" } + ], + "mul_euint256_euint256": [ + { + "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], + "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + }, + { + "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], + "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + }, + { + "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], + "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + }, + { + "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], + "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + } + ], + "mul_euint256_uint256": [ + { + "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], + "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + }, + { + "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], + "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + }, + { + "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], + "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + }, + { + "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], + "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + } + ], + "mul_uint256_euint256": [ + { + "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], + "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + }, + { + "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], + "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + }, + { + "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], + "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + }, + { + "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], + "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + } ], "div_euint4_uint8": [ { "inputs": ["14", "14"], "output": "1" }, @@ -566,2413 +1212,6573 @@ { "inputs": ["14", "10"], "output": "1" } ], "div_euint8_uint8": [ - { "inputs": ["168", "148"], "output": "1" }, - { "inputs": ["164", "168"], "output": "0" }, - { "inputs": ["168", "168"], "output": "1" }, - { "inputs": ["168", "164"], "output": "1" } + { "inputs": ["87", "167"], "output": "0" }, + { "inputs": ["31", "35"], "output": "0" }, + { "inputs": ["35", "35"], "output": "1" }, + { "inputs": ["35", "31"], "output": "1" } ], "div_euint16_uint16": [ - { "inputs": ["8852", "38586"], "output": "0" }, - { "inputs": ["8848", "8852"], "output": "0" }, - { "inputs": ["8852", "8852"], "output": "1" }, - { "inputs": ["8852", "8848"], "output": "1" } + { "inputs": ["20304", "59132"], "output": "0" }, + { "inputs": ["20300", "20304"], "output": "0" }, + { "inputs": ["20304", "20304"], "output": "1" }, + { "inputs": ["20304", "20300"], "output": "1" } ], "div_euint32_uint32": [ - { "inputs": ["1758653773", "1926631032"], "output": "0" }, - { "inputs": ["569518498", "569518502"], "output": "0" }, - { "inputs": ["569518502", "569518502"], "output": "1" }, - { "inputs": ["569518502", "569518498"], "output": "1" } + { "inputs": ["1492630984", "1624831749"], "output": "0" }, + { "inputs": ["1492630980", "1492630984"], "output": "0" }, + { "inputs": ["1492630984", "1492630984"], "output": "1" }, + { "inputs": ["1492630984", "1492630980"], "output": "1" } ], "div_euint64_uint64": [ - { "inputs": ["18442885434890559161", "18443612733078410209"], "output": "0" }, - { "inputs": ["18442885434890559157", "18442885434890559161"], "output": "0" }, - { "inputs": ["18442885434890559161", "18442885434890559161"], "output": "1" }, - { "inputs": ["18442885434890559161", "18442885434890559157"], "output": "1" } + { "inputs": ["18444804438871636581", "18440669978814863107"], "output": "1" }, + { "inputs": ["18444804438871636577", "18444804438871636581"], "output": "0" }, + { "inputs": ["18444804438871636581", "18444804438871636581"], "output": "1" }, + { "inputs": ["18444804438871636581", "18444804438871636577"], "output": "1" } + ], + "div_euint128_uint128": [ + { "inputs": ["340282366920938463463372619792959880891", "340282366920938463463368477899733272407"], "output": "1" }, + { "inputs": ["340282366920938463463372619792959880887", "340282366920938463463372619792959880891"], "output": "0" }, + { "inputs": ["340282366920938463463372619792959880891", "340282366920938463463372619792959880891"], "output": "1" }, + { "inputs": ["340282366920938463463372619792959880891", "340282366920938463463372619792959880887"], "output": "1" } + ], + "div_euint256_uint256": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457583310417243027629", + "115792089237316195423570985008687907853269984665640564039457577919950085050983" + ], + "output": "1" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457576535097376895415", + "115792089237316195423570985008687907853269984665640564039457576535097376895419" + ], + "output": "0" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457576535097376895419", + "115792089237316195423570985008687907853269984665640564039457576535097376895419" + ], + "output": "1" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457576535097376895419", + "115792089237316195423570985008687907853269984665640564039457576535097376895415" + ], + "output": "1" + } ], "rem_euint4_uint8": [ - { "inputs": ["9", "5"], "output": "4" }, - { "inputs": ["5", "9"], "output": "5" }, - { "inputs": ["9", "9"], "output": "0" }, - { "inputs": ["9", "5"], "output": "4" } + { "inputs": ["13", "2"], "output": "1" }, + { "inputs": ["9", "13"], "output": "9" }, + { "inputs": ["13", "13"], "output": "0" }, + { "inputs": ["13", "9"], "output": "4" } ], "rem_euint8_uint8": [ - { "inputs": ["225", "242"], "output": "225" }, - { "inputs": ["183", "187"], "output": "183" }, - { "inputs": ["187", "187"], "output": "0" }, - { "inputs": ["187", "183"], "output": "4" } + { "inputs": ["85", "232"], "output": "85" }, + { "inputs": ["38", "42"], "output": "38" }, + { "inputs": ["42", "42"], "output": "0" }, + { "inputs": ["42", "38"], "output": "4" } ], "rem_euint16_uint16": [ - { "inputs": ["53463", "2321"], "output": "80" }, - { "inputs": ["20898", "20902"], "output": "20898" }, - { "inputs": ["20902", "20902"], "output": "0" }, - { "inputs": ["20902", "20898"], "output": "4" } + { "inputs": ["41581", "40239"], "output": "1342" }, + { "inputs": ["40817", "40821"], "output": "40817" }, + { "inputs": ["40821", "40821"], "output": "0" }, + { "inputs": ["40821", "40817"], "output": "4" } ], "rem_euint32_uint32": [ - { "inputs": ["514826887", "2242906184"], "output": "514826887" }, - { "inputs": ["514826883", "514826887"], "output": "514826883" }, - { "inputs": ["514826887", "514826887"], "output": "0" }, - { "inputs": ["514826887", "514826883"], "output": "4" } + { "inputs": ["631407091", "2150413493"], "output": "631407091" }, + { "inputs": ["631407087", "631407091"], "output": "631407087" }, + { "inputs": ["631407091", "631407091"], "output": "0" }, + { "inputs": ["631407091", "631407087"], "output": "4" } ], "rem_euint64_uint64": [ - { "inputs": ["18445299104872939013", "18441298343819074757"], "output": "4000761053864256" }, - { "inputs": ["18441202573467232859", "18441202573467232863"], "output": "18441202573467232859" }, - { "inputs": ["18441202573467232863", "18441202573467232863"], "output": "0" }, - { "inputs": ["18441202573467232863", "18441202573467232859"], "output": "4" } + { "inputs": ["18446008186519174615", "18445049964172995155"], "output": "958222346179460" }, + { "inputs": ["18443920463081385689", "18443920463081385693"], "output": "18443920463081385689" }, + { "inputs": ["18443920463081385693", "18443920463081385693"], "output": "0" }, + { "inputs": ["18443920463081385693", "18443920463081385689"], "output": "4" } + ], + "rem_euint128_uint128": [ + { + "inputs": ["340282366920938463463367984231624733459", "340282366920938463463368025855706253793"], + "output": "340282366920938463463367984231624733459" + }, + { + "inputs": ["340282366920938463463367984231624733455", "340282366920938463463367984231624733459"], + "output": "340282366920938463463367984231624733455" + }, + { "inputs": ["340282366920938463463367984231624733459", "340282366920938463463367984231624733459"], "output": "0" }, + { "inputs": ["340282366920938463463367984231624733459", "340282366920938463463367984231624733455"], "output": "4" } + ], + "rem_euint256_uint256": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457578502975350831453", + "115792089237316195423570985008687907853269984665640564039457581127377285906497" + ], + "output": "115792089237316195423570985008687907853269984665640564039457578502975350831453" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457577137781640958323", + "115792089237316195423570985008687907853269984665640564039457577137781640958327" + ], + "output": "115792089237316195423570985008687907853269984665640564039457577137781640958323" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457577137781640958327", + "115792089237316195423570985008687907853269984665640564039457577137781640958327" + ], + "output": "0" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457577137781640958327", + "115792089237316195423570985008687907853269984665640564039457577137781640958323" + ], + "output": "4" + } ], "le_euint4_euint4": [ - { "inputs": ["10", "9"], "output": false }, - { "inputs": ["5", "9"], "output": true }, - { "inputs": ["9", "9"], "output": true }, - { "inputs": ["9", "5"], "output": false } + { "inputs": ["6", "6"], "output": true }, + { "inputs": ["4", "8"], "output": true }, + { "inputs": ["8", "8"], "output": true }, + { "inputs": ["8", "4"], "output": false } ], "le_euint4_euint8": [ - { "inputs": ["13", "94"], "output": true }, - { "inputs": ["9", "13"], "output": true }, - { "inputs": ["13", "13"], "output": true }, - { "inputs": ["13", "9"], "output": false } + { "inputs": ["1", "98"], "output": true }, + { "inputs": ["4", "8"], "output": true }, + { "inputs": ["8", "8"], "output": true }, + { "inputs": ["8", "4"], "output": false } ], "le_euint4_uint8": [ - { "inputs": ["13", "9"], "output": false }, - { "inputs": ["9", "13"], "output": true }, - { "inputs": ["13", "13"], "output": true }, - { "inputs": ["13", "9"], "output": false } - ], - "le_euint4_euint16": [ - { "inputs": ["3", "38645"], "output": true }, + { "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": ["5", "3704560179"], "output": true }, + { "inputs": ["4", "1782114748"], "output": true }, { "inputs": ["4", "8"], "output": true }, { "inputs": ["8", "8"], "output": true }, { "inputs": ["8", "4"], "output": false } ], "le_euint4_euint64": [ - { "inputs": ["9", "18445100928210525947"], "output": true }, - { "inputs": ["5", "9"], "output": true }, - { "inputs": ["9", "9"], "output": true }, - { "inputs": ["9", "5"], "output": false } + { "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": ["92", "13"], "output": false }, - { "inputs": ["9", "13"], "output": true }, - { "inputs": ["13", "13"], "output": true }, - { "inputs": ["13", "9"], "output": false } + { "inputs": ["26", "10"], "output": false }, + { "inputs": ["6", "10"], "output": true }, + { "inputs": ["10", "10"], "output": true }, + { "inputs": ["10", "6"], "output": false } ], "le_uint8_euint4": [ - { "inputs": ["8", "13"], "output": true }, - { "inputs": ["9", "13"], "output": true }, - { "inputs": ["13", "13"], "output": true }, - { "inputs": ["13", "9"], "output": false } + { "inputs": ["11", "10"], "output": false }, + { "inputs": ["6", "10"], "output": true }, + { "inputs": ["10", "10"], "output": true }, + { "inputs": ["10", "6"], "output": false } ], "le_euint8_euint8": [ - { "inputs": ["182", "238"], "output": true }, - { "inputs": ["178", "182"], "output": true }, - { "inputs": ["182", "182"], "output": true }, - { "inputs": ["182", "178"], "output": false } + { "inputs": ["124", "71"], "output": false }, + { "inputs": ["67", "71"], "output": true }, + { "inputs": ["71", "71"], "output": true }, + { "inputs": ["71", "67"], "output": false } ], "le_euint8_uint8": [ - { "inputs": ["182", "83"], "output": false }, - { "inputs": ["178", "182"], "output": true }, - { "inputs": ["182", "182"], "output": true }, - { "inputs": ["182", "178"], "output": false } + { "inputs": ["124", "152"], "output": true }, + { "inputs": ["67", "71"], "output": true }, + { "inputs": ["71", "71"], "output": true }, + { "inputs": ["71", "67"], "output": false } ], "le_uint8_euint8": [ - { "inputs": ["14", "83"], "output": true }, - { "inputs": ["178", "182"], "output": true }, - { "inputs": ["182", "182"], "output": true }, - { "inputs": ["182", "178"], "output": false } + { "inputs": ["25", "152"], "output": true }, + { "inputs": ["67", "71"], "output": true }, + { "inputs": ["71", "71"], "output": true }, + { "inputs": ["71", "67"], "output": false } ], "le_euint8_euint16": [ - { "inputs": ["157", "25391"], "output": true }, - { "inputs": ["153", "157"], "output": true }, - { "inputs": ["157", "157"], "output": true }, - { "inputs": ["157", "153"], "output": false } + { "inputs": ["32", "25116"], "output": true }, + { "inputs": ["28", "32"], "output": true }, + { "inputs": ["32", "32"], "output": true }, + { "inputs": ["32", "28"], "output": false } ], "le_euint8_euint32": [ - { "inputs": ["217", "193633124"], "output": true }, - { "inputs": ["213", "217"], "output": true }, - { "inputs": ["217", "217"], "output": true }, - { "inputs": ["217", "213"], "output": false } + { "inputs": ["162", "1086789383"], "output": true }, + { "inputs": ["158", "162"], "output": true }, + { "inputs": ["162", "162"], "output": true }, + { "inputs": ["162", "158"], "output": false } ], "le_euint8_euint64": [ - { "inputs": ["18", "18442364533783886901"], "output": true }, - { "inputs": ["14", "18"], "output": true }, - { "inputs": ["18", "18"], "output": true }, - { "inputs": ["18", "14"], "output": false } + { "inputs": ["124", "18443185604881328715"], "output": true }, + { "inputs": ["120", "124"], "output": true }, + { "inputs": ["124", "124"], "output": true }, + { "inputs": ["124", "120"], "output": false } + ], + "le_euint8_euint128": [ + { "inputs": ["108", "340282366920938463463369577015243486211"], "output": true }, + { "inputs": ["104", "108"], "output": true }, + { "inputs": ["108", "108"], "output": true }, + { "inputs": ["108", "104"], "output": false } + ], + "le_euint8_euint256": [ + { + "inputs": ["133", "115792089237316195423570985008687907853269984665640564039457576630649713670389"], + "output": true + }, + { "inputs": ["129", "133"], "output": true }, + { "inputs": ["133", "133"], "output": true }, + { "inputs": ["133", "129"], "output": false } ], "le_euint16_euint4": [ - { "inputs": ["39104", "8"], "output": false }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": false } + { "inputs": ["26735", "12"], "output": false }, + { "inputs": ["8", "12"], "output": true }, + { "inputs": ["12", "12"], "output": true }, + { "inputs": ["12", "8"], "output": false } ], "le_euint16_euint8": [ - { "inputs": ["53893", "183"], "output": false }, - { "inputs": ["179", "183"], "output": true }, - { "inputs": ["183", "183"], "output": true }, - { "inputs": ["183", "179"], "output": false } + { "inputs": ["7541", "42"], "output": false }, + { "inputs": ["38", "42"], "output": true }, + { "inputs": ["42", "42"], "output": true }, + { "inputs": ["42", "38"], "output": false } ], "le_euint16_euint16": [ - { "inputs": ["38605", "53936"], "output": true }, - { "inputs": ["38601", "38605"], "output": true }, - { "inputs": ["38605", "38605"], "output": true }, - { "inputs": ["38605", "38601"], "output": false } + { "inputs": ["20803", "873"], "output": false }, + { "inputs": ["869", "873"], "output": true }, + { "inputs": ["873", "873"], "output": true }, + { "inputs": ["873", "869"], "output": false } ], "le_euint16_uint16": [ - { "inputs": ["38605", "15668"], "output": false }, - { "inputs": ["38601", "38605"], "output": true }, - { "inputs": ["38605", "38605"], "output": true }, - { "inputs": ["38605", "38601"], "output": false } + { "inputs": ["20803", "27442"], "output": true }, + { "inputs": ["869", "873"], "output": true }, + { "inputs": ["873", "873"], "output": true }, + { "inputs": ["873", "869"], "output": false } ], "le_uint16_euint16": [ - { "inputs": ["26564", "15668"], "output": false }, - { "inputs": ["38601", "38605"], "output": true }, - { "inputs": ["38605", "38605"], "output": true }, - { "inputs": ["38605", "38601"], "output": false } + { "inputs": ["36363", "27442"], "output": false }, + { "inputs": ["869", "873"], "output": true }, + { "inputs": ["873", "873"], "output": true }, + { "inputs": ["873", "869"], "output": false } ], "le_euint16_euint32": [ - { "inputs": ["32489", "2097840840"], "output": true }, - { "inputs": ["32485", "32489"], "output": true }, - { "inputs": ["32489", "32489"], "output": true }, - { "inputs": ["32489", "32485"], "output": false } + { "inputs": ["44937", "2020262580"], "output": true }, + { "inputs": ["44933", "44937"], "output": true }, + { "inputs": ["44937", "44937"], "output": true }, + { "inputs": ["44937", "44933"], "output": false } ], "le_euint16_euint64": [ - { "inputs": ["46492", "18439416152876310159"], "output": true }, - { "inputs": ["46488", "46492"], "output": true }, - { "inputs": ["46492", "46492"], "output": true }, - { "inputs": ["46492", "46488"], "output": false } + { "inputs": ["33530", "18441393339688273439"], "output": true }, + { "inputs": ["33526", "33530"], "output": true }, + { "inputs": ["33530", "33530"], "output": true }, + { "inputs": ["33530", "33526"], "output": false } + ], + "le_euint16_euint128": [ + { "inputs": ["63634", "340282366920938463463365626120025172451"], "output": true }, + { "inputs": ["63630", "63634"], "output": true }, + { "inputs": ["63634", "63634"], "output": true }, + { "inputs": ["63634", "63630"], "output": false } + ], + "le_euint16_euint256": [ + { + "inputs": ["10398", "115792089237316195423570985008687907853269984665640564039457582877023510899415"], + "output": true + }, + { "inputs": ["10394", "10398"], "output": true }, + { "inputs": ["10398", "10398"], "output": true }, + { "inputs": ["10398", "10394"], "output": false } ], "le_euint32_euint4": [ - { "inputs": ["681177958", "4"], "output": false }, + { "inputs": ["1297036148", "2"], "output": false }, { "inputs": ["4", "8"], "output": true }, { "inputs": ["8", "8"], "output": true }, { "inputs": ["8", "4"], "output": false } ], "le_euint32_euint8": [ - { "inputs": ["804391035", "133"], "output": false }, - { "inputs": ["129", "133"], "output": true }, - { "inputs": ["133", "133"], "output": true }, - { "inputs": ["133", "129"], "output": false } + { "inputs": ["884339915", "183"], "output": false }, + { "inputs": ["179", "183"], "output": true }, + { "inputs": ["183", "183"], "output": true }, + { "inputs": ["183", "179"], "output": false } ], "le_euint32_euint16": [ - { "inputs": ["1660443539", "63916"], "output": false }, - { "inputs": ["63912", "63916"], "output": true }, - { "inputs": ["63916", "63916"], "output": true }, - { "inputs": ["63916", "63912"], "output": false } + { "inputs": ["787386715", "25220"], "output": false }, + { "inputs": ["25216", "25220"], "output": true }, + { "inputs": ["25220", "25220"], "output": true }, + { "inputs": ["25220", "25216"], "output": false } ], "le_euint32_euint32": [ - { "inputs": ["2708913268", "1446383134"], "output": false }, - { "inputs": ["1446383130", "1446383134"], "output": true }, - { "inputs": ["1446383134", "1446383134"], "output": true }, - { "inputs": ["1446383134", "1446383130"], "output": false } + { "inputs": ["1814515265", "1215301262"], "output": false }, + { "inputs": ["1215301258", "1215301262"], "output": true }, + { "inputs": ["1215301262", "1215301262"], "output": true }, + { "inputs": ["1215301262", "1215301258"], "output": false } ], "le_euint32_uint32": [ - { "inputs": ["2708913268", "3120465053"], "output": true }, - { "inputs": ["1446383130", "1446383134"], "output": true }, - { "inputs": ["1446383134", "1446383134"], "output": true }, - { "inputs": ["1446383134", "1446383130"], "output": false } + { "inputs": ["1814515265", "524803703"], "output": false }, + { "inputs": ["1215301258", "1215301262"], "output": true }, + { "inputs": ["1215301262", "1215301262"], "output": true }, + { "inputs": ["1215301262", "1215301258"], "output": false } ], "le_uint32_euint32": [ - { "inputs": ["518556131", "3120465053"], "output": true }, - { "inputs": ["1446383130", "1446383134"], "output": true }, - { "inputs": ["1446383134", "1446383134"], "output": true }, - { "inputs": ["1446383134", "1446383130"], "output": false } + { "inputs": ["1873209457", "524803703"], "output": false }, + { "inputs": ["1215301258", "1215301262"], "output": true }, + { "inputs": ["1215301262", "1215301262"], "output": true }, + { "inputs": ["1215301262", "1215301258"], "output": false } ], "le_euint32_euint64": [ - { "inputs": ["557237517", "18442682499983449751"], "output": true }, - { "inputs": ["557237513", "557237517"], "output": true }, - { "inputs": ["557237517", "557237517"], "output": true }, - { "inputs": ["557237517", "557237513"], "output": false } + { "inputs": ["1718048813", "18439987431102861375"], "output": true }, + { "inputs": ["1718048809", "1718048813"], "output": true }, + { "inputs": ["1718048813", "1718048813"], "output": true }, + { "inputs": ["1718048813", "1718048809"], "output": false } + ], + "le_euint32_euint128": [ + { "inputs": ["867198677", "340282366920938463463369757600308236313"], "output": true }, + { "inputs": ["867198673", "867198677"], "output": true }, + { "inputs": ["867198677", "867198677"], "output": true }, + { "inputs": ["867198677", "867198673"], "output": false } + ], + "le_euint32_euint256": [ + { + "inputs": ["2709381066", "115792089237316195423570985008687907853269984665640564039457582000267248354603"], + "output": true + }, + { "inputs": ["2709381062", "2709381066"], "output": true }, + { "inputs": ["2709381066", "2709381066"], "output": true }, + { "inputs": ["2709381066", "2709381062"], "output": false } ], "le_euint64_euint4": [ - { "inputs": ["18438089675582739325", "8"], "output": false }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": false } + { "inputs": ["18443622047758317419", "13"], "output": false }, + { "inputs": ["9", "13"], "output": true }, + { "inputs": ["13", "13"], "output": true }, + { "inputs": ["13", "9"], "output": false } ], "le_euint64_euint8": [ - { "inputs": ["18443934013808426023", "129"], "output": false }, - { "inputs": ["125", "129"], "output": true }, - { "inputs": ["129", "129"], "output": true }, - { "inputs": ["129", "125"], "output": false } + { "inputs": ["18443904556846943161", "36"], "output": false }, + { "inputs": ["32", "36"], "output": true }, + { "inputs": ["36", "36"], "output": true }, + { "inputs": ["36", "32"], "output": false } ], "le_euint64_euint16": [ - { "inputs": ["18445404390633548443", "34855"], "output": false }, - { "inputs": ["34851", "34855"], "output": true }, - { "inputs": ["34855", "34855"], "output": true }, - { "inputs": ["34855", "34851"], "output": false } + { "inputs": ["18437883313011515679", "51774"], "output": false }, + { "inputs": ["51770", "51774"], "output": true }, + { "inputs": ["51774", "51774"], "output": true }, + { "inputs": ["51774", "51770"], "output": false } ], "le_euint64_euint32": [ - { "inputs": ["18443133688534935497", "622548585"], "output": false }, - { "inputs": ["622548581", "622548585"], "output": true }, - { "inputs": ["622548585", "622548585"], "output": true }, - { "inputs": ["622548585", "622548581"], "output": false } + { "inputs": ["18442023388952183851", "1762835382"], "output": false }, + { "inputs": ["1762835378", "1762835382"], "output": true }, + { "inputs": ["1762835382", "1762835382"], "output": true }, + { "inputs": ["1762835382", "1762835378"], "output": false } ], "le_euint64_euint64": [ - { "inputs": ["18443782238591650169", "18441978790273961913"], "output": false }, - { "inputs": ["18441978790273961909", "18441978790273961913"], "output": true }, - { "inputs": ["18441978790273961913", "18441978790273961913"], "output": true }, - { "inputs": ["18441978790273961913", "18441978790273961909"], "output": false } + { "inputs": ["18440402951089431437", "18444684457474043493"], "output": true }, + { "inputs": ["18440402951089431433", "18440402951089431437"], "output": true }, + { "inputs": ["18440402951089431437", "18440402951089431437"], "output": true }, + { "inputs": ["18440402951089431437", "18440402951089431433"], "output": false } ], "le_euint64_uint64": [ - { "inputs": ["18443782238591650169", "18439298139086159343"], "output": false }, - { "inputs": ["18441978790273961909", "18441978790273961913"], "output": true }, - { "inputs": ["18441978790273961913", "18441978790273961913"], "output": true }, - { "inputs": ["18441978790273961913", "18441978790273961909"], "output": false } + { "inputs": ["18440402951089431437", "18443808705297812893"], "output": true }, + { "inputs": ["18440402951089431433", "18440402951089431437"], "output": true }, + { "inputs": ["18440402951089431437", "18440402951089431437"], "output": true }, + { "inputs": ["18440402951089431437", "18440402951089431433"], "output": false } ], "le_uint64_euint64": [ - { "inputs": ["18438386930936343347", "18439298139086159343"], "output": true }, - { "inputs": ["18441978790273961909", "18441978790273961913"], "output": true }, - { "inputs": ["18441978790273961913", "18441978790273961913"], "output": true }, - { "inputs": ["18441978790273961913", "18441978790273961909"], "output": false } + { "inputs": ["18443941229431137849", "18443808705297812893"], "output": false }, + { "inputs": ["18440402951089431433", "18440402951089431437"], "output": true }, + { "inputs": ["18440402951089431437", "18440402951089431437"], "output": true }, + { "inputs": ["18440402951089431437", "18440402951089431433"], "output": false } + ], + "le_euint64_euint128": [ + { "inputs": ["18443662339869468477", "340282366920938463463371042076884293495"], "output": true }, + { "inputs": ["18443662339869468473", "18443662339869468477"], "output": true }, + { "inputs": ["18443662339869468477", "18443662339869468477"], "output": true }, + { "inputs": ["18443662339869468477", "18443662339869468473"], "output": false } + ], + "le_euint64_euint256": [ + { + "inputs": [ + "18443803742985479181", + "115792089237316195423570985008687907853269984665640564039457581800529684723115" + ], + "output": true + }, + { "inputs": ["18443803742985479177", "18443803742985479181"], "output": true }, + { "inputs": ["18443803742985479181", "18443803742985479181"], "output": true }, + { "inputs": ["18443803742985479181", "18443803742985479177"], "output": false } + ], + "le_euint128_euint4": [ + { "inputs": ["340282366920938463463373221658110991435", "1"], "output": false }, + { "inputs": ["4", "8"], "output": true }, + { "inputs": ["8", "8"], "output": true }, + { "inputs": ["8", "4"], "output": false } + ], + "le_euint128_euint8": [ + { "inputs": ["340282366920938463463373663014854424779", "48"], "output": false }, + { "inputs": ["44", "48"], "output": true }, + { "inputs": ["48", "48"], "output": true }, + { "inputs": ["48", "44"], "output": false } + ], + "le_euint128_euint16": [ + { "inputs": ["340282366920938463463371412966556965647", "54237"], "output": false }, + { "inputs": ["54233", "54237"], "output": true }, + { "inputs": ["54237", "54237"], "output": true }, + { "inputs": ["54237", "54233"], "output": false } + ], + "le_euint128_euint32": [ + { "inputs": ["340282366920938463463372847665266392859", "623901814"], "output": false }, + { "inputs": ["623901810", "623901814"], "output": true }, + { "inputs": ["623901814", "623901814"], "output": true }, + { "inputs": ["623901814", "623901810"], "output": false } + ], + "le_euint128_euint64": [ + { "inputs": ["340282366920938463463366067679463384359", "18440549964651513569"], "output": false }, + { "inputs": ["18440549964651513565", "18440549964651513569"], "output": true }, + { "inputs": ["18440549964651513569", "18440549964651513569"], "output": true }, + { "inputs": ["18440549964651513569", "18440549964651513565"], "output": false } + ], + "le_euint128_euint128": [ + { + "inputs": ["340282366920938463463373992528465349581", "340282366920938463463372840104721436799"], + "output": false + }, + { + "inputs": ["340282366920938463463372840104721436795", "340282366920938463463372840104721436799"], + "output": true + }, + { + "inputs": ["340282366920938463463372840104721436799", "340282366920938463463372840104721436799"], + "output": true + }, + { + "inputs": ["340282366920938463463372840104721436799", "340282366920938463463372840104721436795"], + "output": false + } + ], + "le_euint128_uint128": [ + { + "inputs": ["340282366920938463463373992528465349581", "340282366920938463463373835012809081201"], + "output": false + }, + { + "inputs": ["340282366920938463463372840104721436795", "340282366920938463463372840104721436799"], + "output": true + }, + { + "inputs": ["340282366920938463463372840104721436799", "340282366920938463463372840104721436799"], + "output": true + }, + { + "inputs": ["340282366920938463463372840104721436799", "340282366920938463463372840104721436795"], + "output": false + } + ], + "le_uint128_euint128": [ + { + "inputs": ["340282366920938463463374153561991926979", "340282366920938463463373835012809081201"], + "output": false + }, + { + "inputs": ["340282366920938463463372840104721436795", "340282366920938463463372840104721436799"], + "output": true + }, + { + "inputs": ["340282366920938463463372840104721436799", "340282366920938463463372840104721436799"], + "output": true + }, + { + "inputs": ["340282366920938463463372840104721436799", "340282366920938463463372840104721436795"], + "output": false + } + ], + "le_euint128_euint256": [ + { + "inputs": [ + "340282366920938463463370154534182411951", + "115792089237316195423570985008687907853269984665640564039457582642838670062225" + ], + "output": true + }, + { + "inputs": ["340282366920938463463370154534182411947", "340282366920938463463370154534182411951"], + "output": true + }, + { + "inputs": ["340282366920938463463370154534182411951", "340282366920938463463370154534182411951"], + "output": true + }, + { + "inputs": ["340282366920938463463370154534182411951", "340282366920938463463370154534182411947"], + "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": [ + { + "inputs": ["115792089237316195423570985008687907853269984665640564039457580743279895693245", "161"], + "output": false + }, + { "inputs": ["157", "161"], "output": true }, + { "inputs": ["161", "161"], "output": true }, + { "inputs": ["161", "157"], "output": false } + ], + "le_euint256_euint16": [ + { + "inputs": ["115792089237316195423570985008687907853269984665640564039457582351250639102167", "47994"], + "output": false + }, + { "inputs": ["47990", "47994"], "output": true }, + { "inputs": ["47994", "47994"], "output": true }, + { "inputs": ["47994", "47990"], "output": false } + ], + "le_euint256_euint32": [ + { + "inputs": ["115792089237316195423570985008687907853269984665640564039457582845443410851747", "1340548693"], + "output": false + }, + { "inputs": ["1340548689", "1340548693"], "output": true }, + { "inputs": ["1340548693", "1340548693"], "output": true }, + { "inputs": ["1340548693", "1340548689"], "output": false } + ], + "le_euint256_euint64": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457576194967854445761", + "18441295092771573001" + ], + "output": false + }, + { "inputs": ["18441295092771572997", "18441295092771573001"], "output": true }, + { "inputs": ["18441295092771573001", "18441295092771573001"], "output": true }, + { "inputs": ["18441295092771573001", "18441295092771572997"], "output": false } + ], + "le_euint256_euint128": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457580916980779426235", + "340282366920938463463367434270493244717" + ], + "output": false + }, + { + "inputs": ["340282366920938463463367434270493244713", "340282366920938463463367434270493244717"], + "output": true + }, + { + "inputs": ["340282366920938463463367434270493244717", "340282366920938463463367434270493244717"], + "output": true + }, + { + "inputs": ["340282366920938463463367434270493244717", "340282366920938463463367434270493244713"], + "output": false + } + ], + "le_euint256_euint256": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457583300217912499775", + "115792089237316195423570985008687907853269984665640564039457582857952818399809" + ], + "output": false + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457582857952818399805", + "115792089237316195423570985008687907853269984665640564039457582857952818399809" + ], + "output": true + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457582857952818399809", + "115792089237316195423570985008687907853269984665640564039457582857952818399809" + ], + "output": true + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457582857952818399809", + "115792089237316195423570985008687907853269984665640564039457582857952818399805" + ], + "output": false + } + ], + "le_euint256_uint256": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457583300217912499775", + "115792089237316195423570985008687907853269984665640564039457580310546116642945" + ], + "output": false + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457582857952818399805", + "115792089237316195423570985008687907853269984665640564039457582857952818399809" + ], + "output": true + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457582857952818399809", + "115792089237316195423570985008687907853269984665640564039457582857952818399809" + ], + "output": true + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457582857952818399809", + "115792089237316195423570985008687907853269984665640564039457582857952818399805" + ], + "output": false + } + ], + "le_uint256_euint256": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579919776168086147", + "115792089237316195423570985008687907853269984665640564039457580310546116642945" + ], + "output": true + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457582857952818399805", + "115792089237316195423570985008687907853269984665640564039457582857952818399809" + ], + "output": true + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457582857952818399809", + "115792089237316195423570985008687907853269984665640564039457582857952818399809" + ], + "output": true + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457582857952818399809", + "115792089237316195423570985008687907853269984665640564039457582857952818399805" + ], + "output": false + } ], "lt_euint4_euint4": [ - { "inputs": ["4", "10"], "output": true }, + { "inputs": ["2", "6"], "output": true }, { "inputs": ["4", "8"], "output": true }, { "inputs": ["8", "8"], "output": false }, { "inputs": ["8", "4"], "output": false } ], "lt_euint4_euint8": [ - { "inputs": ["13", "128"], "output": true }, - { "inputs": ["9", "13"], "output": true }, - { "inputs": ["13", "13"], "output": false }, - { "inputs": ["13", "9"], "output": false } + { "inputs": ["12", "31"], "output": true }, + { "inputs": ["8", "12"], "output": true }, + { "inputs": ["12", "12"], "output": false }, + { "inputs": ["12", "8"], "output": false } ], "lt_euint4_uint8": [ - { "inputs": ["13", "1"], "output": false }, - { "inputs": ["9", "13"], "output": true }, - { "inputs": ["13", "13"], "output": false }, - { "inputs": ["13", "9"], "output": false } + { "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", "15096"], "output": true }, + { "inputs": ["10", "24653"], "output": true }, { "inputs": ["6", "10"], "output": true }, { "inputs": ["10", "10"], "output": false }, { "inputs": ["10", "6"], "output": false } ], "lt_euint4_euint32": [ - { "inputs": ["6", "2034411051"], "output": true }, + { "inputs": ["1", "3154883490"], "output": true }, { "inputs": ["4", "8"], "output": true }, { "inputs": ["8", "8"], "output": false }, { "inputs": ["8", "4"], "output": false } ], "lt_euint4_euint64": [ - { "inputs": ["7", "18445391148064274615"], "output": true }, + { "inputs": ["13", "18441885120383916401"], "output": true }, + { "inputs": ["9", "13"], "output": true }, + { "inputs": ["13", "13"], "output": false }, + { "inputs": ["13", "9"], "output": false } + ], + "lt_euint4_euint128": [ + { "inputs": ["8", "340282366920938463463367828600285579945"], "output": true }, { "inputs": ["4", "8"], "output": true }, { "inputs": ["8", "8"], "output": false }, { "inputs": ["8", "4"], "output": false } ], + "lt_euint4_euint256": [ + { + "inputs": ["11", "115792089237316195423570985008687907853269984665640564039457582432165171824629"], + "output": true + }, + { "inputs": ["7", "11"], "output": true }, + { "inputs": ["11", "11"], "output": false }, + { "inputs": ["11", "7"], "output": false } + ], "lt_euint8_euint4": [ - { "inputs": ["195", "14"], "output": false }, - { "inputs": ["10", "14"], "output": true }, - { "inputs": ["14", "14"], "output": false }, - { "inputs": ["14", "10"], "output": false } + { "inputs": ["163", "11"], "output": false }, + { "inputs": ["7", "11"], "output": true }, + { "inputs": ["11", "11"], "output": false }, + { "inputs": ["11", "7"], "output": false } ], "lt_uint8_euint4": [ - { "inputs": ["11", "14"], "output": true }, - { "inputs": ["10", "14"], "output": true }, - { "inputs": ["14", "14"], "output": false }, - { "inputs": ["14", "10"], "output": false } + { "inputs": ["5", "11"], "output": true }, + { "inputs": ["7", "11"], "output": true }, + { "inputs": ["11", "11"], "output": false }, + { "inputs": ["11", "7"], "output": false } ], "lt_euint8_euint8": [ - { "inputs": ["44", "62"], "output": true }, - { "inputs": ["40", "44"], "output": true }, - { "inputs": ["44", "44"], "output": false }, - { "inputs": ["44", "40"], "output": false } + { "inputs": ["221", "45"], "output": false }, + { "inputs": ["41", "45"], "output": true }, + { "inputs": ["45", "45"], "output": false }, + { "inputs": ["45", "41"], "output": false } ], "lt_euint8_uint8": [ - { "inputs": ["44", "12"], "output": false }, - { "inputs": ["40", "44"], "output": true }, - { "inputs": ["44", "44"], "output": false }, - { "inputs": ["44", "40"], "output": false } + { "inputs": ["221", "96"], "output": false }, + { "inputs": ["41", "45"], "output": true }, + { "inputs": ["45", "45"], "output": false }, + { "inputs": ["45", "41"], "output": false } ], "lt_uint8_euint8": [ - { "inputs": ["106", "12"], "output": false }, - { "inputs": ["40", "44"], "output": true }, - { "inputs": ["44", "44"], "output": false }, - { "inputs": ["44", "40"], "output": false } + { "inputs": ["225", "96"], "output": false }, + { "inputs": ["41", "45"], "output": true }, + { "inputs": ["45", "45"], "output": false }, + { "inputs": ["45", "41"], "output": false } ], "lt_euint8_euint16": [ - { "inputs": ["115", "9566"], "output": true }, - { "inputs": ["111", "115"], "output": true }, - { "inputs": ["115", "115"], "output": false }, - { "inputs": ["115", "111"], "output": false } + { "inputs": ["31", "45682"], "output": true }, + { "inputs": ["27", "31"], "output": true }, + { "inputs": ["31", "31"], "output": false }, + { "inputs": ["31", "27"], "output": false } ], "lt_euint8_euint32": [ - { "inputs": ["97", "73387652"], "output": true }, - { "inputs": ["93", "97"], "output": true }, - { "inputs": ["97", "97"], "output": false }, - { "inputs": ["97", "93"], "output": false } + { "inputs": ["111", "1481942282"], "output": true }, + { "inputs": ["107", "111"], "output": true }, + { "inputs": ["111", "111"], "output": false }, + { "inputs": ["111", "107"], "output": false } ], "lt_euint8_euint64": [ - { "inputs": ["1", "18442662886837590601"], "output": true }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": false } + { "inputs": ["213", "18441867518419136505"], "output": true }, + { "inputs": ["209", "213"], "output": true }, + { "inputs": ["213", "213"], "output": false }, + { "inputs": ["213", "209"], "output": false } + ], + "lt_euint8_euint128": [ + { "inputs": ["90", "340282366920938463463366855244560424809"], "output": true }, + { "inputs": ["86", "90"], "output": true }, + { "inputs": ["90", "90"], "output": false }, + { "inputs": ["90", "86"], "output": false } + ], + "lt_euint8_euint256": [ + { + "inputs": ["142", "115792089237316195423570985008687907853269984665640564039457583972137475354729"], + "output": true + }, + { "inputs": ["138", "142"], "output": true }, + { "inputs": ["142", "142"], "output": false }, + { "inputs": ["142", "138"], "output": false } ], "lt_euint16_euint4": [ - { "inputs": ["57762", "4"], "output": false }, + { "inputs": ["38459", "3"], "output": false }, { "inputs": ["4", "8"], "output": true }, { "inputs": ["8", "8"], "output": false }, { "inputs": ["8", "4"], "output": false } ], "lt_euint16_euint8": [ - { "inputs": ["14349", "199"], "output": false }, - { "inputs": ["195", "199"], "output": true }, - { "inputs": ["199", "199"], "output": false }, - { "inputs": ["199", "195"], "output": false } + { "inputs": ["6772", "147"], "output": false }, + { "inputs": ["143", "147"], "output": true }, + { "inputs": ["147", "147"], "output": false }, + { "inputs": ["147", "143"], "output": false } ], "lt_euint16_euint16": [ - { "inputs": ["59332", "12427"], "output": false }, - { "inputs": ["12423", "12427"], "output": true }, - { "inputs": ["12427", "12427"], "output": false }, - { "inputs": ["12427", "12423"], "output": false } + { "inputs": ["34482", "5146"], "output": false }, + { "inputs": ["5142", "5146"], "output": true }, + { "inputs": ["5146", "5146"], "output": false }, + { "inputs": ["5146", "5142"], "output": false } ], "lt_euint16_uint16": [ - { "inputs": ["59332", "5218"], "output": false }, - { "inputs": ["12423", "12427"], "output": true }, - { "inputs": ["12427", "12427"], "output": false }, - { "inputs": ["12427", "12423"], "output": false } + { "inputs": ["34482", "38499"], "output": true }, + { "inputs": ["5142", "5146"], "output": true }, + { "inputs": ["5146", "5146"], "output": false }, + { "inputs": ["5146", "5142"], "output": false } ], "lt_uint16_euint16": [ - { "inputs": ["8638", "5218"], "output": false }, - { "inputs": ["12423", "12427"], "output": true }, - { "inputs": ["12427", "12427"], "output": false }, - { "inputs": ["12427", "12423"], "output": false } + { "inputs": ["21462", "38499"], "output": true }, + { "inputs": ["5142", "5146"], "output": true }, + { "inputs": ["5146", "5146"], "output": false }, + { "inputs": ["5146", "5142"], "output": false } ], "lt_euint16_euint32": [ - { "inputs": ["46117", "3066026054"], "output": true }, - { "inputs": ["46113", "46117"], "output": true }, - { "inputs": ["46117", "46117"], "output": false }, - { "inputs": ["46117", "46113"], "output": false } + { "inputs": ["31744", "3296344536"], "output": true }, + { "inputs": ["31740", "31744"], "output": true }, + { "inputs": ["31744", "31744"], "output": false }, + { "inputs": ["31744", "31740"], "output": false } ], "lt_euint16_euint64": [ - { "inputs": ["20266", "18439286572290779257"], "output": true }, - { "inputs": ["20262", "20266"], "output": true }, - { "inputs": ["20266", "20266"], "output": false }, - { "inputs": ["20266", "20262"], "output": false } + { "inputs": ["7192", "18440977990475901673"], "output": true }, + { "inputs": ["7188", "7192"], "output": true }, + { "inputs": ["7192", "7192"], "output": false }, + { "inputs": ["7192", "7188"], "output": false } + ], + "lt_euint16_euint128": [ + { "inputs": ["16589", "340282366920938463463371297893972390287"], "output": true }, + { "inputs": ["16585", "16589"], "output": true }, + { "inputs": ["16589", "16589"], "output": false }, + { "inputs": ["16589", "16585"], "output": false } + ], + "lt_euint16_euint256": [ + { + "inputs": ["58145", "115792089237316195423570985008687907853269984665640564039457578303118040864491"], + "output": true + }, + { "inputs": ["58141", "58145"], "output": true }, + { "inputs": ["58145", "58145"], "output": false }, + { "inputs": ["58145", "58141"], "output": false } ], "lt_euint32_euint4": [ - { "inputs": ["928445097", "2"], "output": false }, + { "inputs": ["2282621038", "7"], "output": false }, { "inputs": ["4", "8"], "output": true }, { "inputs": ["8", "8"], "output": false }, { "inputs": ["8", "4"], "output": false } ], "lt_euint32_euint8": [ - { "inputs": ["3782116241", "158"], "output": false }, - { "inputs": ["154", "158"], "output": true }, - { "inputs": ["158", "158"], "output": false }, - { "inputs": ["158", "154"], "output": false } + { "inputs": ["1459989337", "220"], "output": false }, + { "inputs": ["216", "220"], "output": true }, + { "inputs": ["220", "220"], "output": false }, + { "inputs": ["220", "216"], "output": false } ], "lt_euint32_euint16": [ - { "inputs": ["1150183024", "6871"], "output": false }, - { "inputs": ["6867", "6871"], "output": true }, - { "inputs": ["6871", "6871"], "output": false }, - { "inputs": ["6871", "6867"], "output": false } + { "inputs": ["2091084769", "25571"], "output": false }, + { "inputs": ["25567", "25571"], "output": true }, + { "inputs": ["25571", "25571"], "output": false }, + { "inputs": ["25571", "25567"], "output": false } ], "lt_euint32_euint32": [ - { "inputs": ["1837089382", "4089682184"], "output": true }, - { "inputs": ["1837089378", "1837089382"], "output": true }, - { "inputs": ["1837089382", "1837089382"], "output": false }, - { "inputs": ["1837089382", "1837089378"], "output": false } + { "inputs": ["597865082", "2797648845"], "output": true }, + { "inputs": ["597865078", "597865082"], "output": true }, + { "inputs": ["597865082", "597865082"], "output": false }, + { "inputs": ["597865082", "597865078"], "output": false } ], "lt_euint32_uint32": [ - { "inputs": ["1837089382", "2866298985"], "output": true }, - { "inputs": ["1837089378", "1837089382"], "output": true }, - { "inputs": ["1837089382", "1837089382"], "output": false }, - { "inputs": ["1837089382", "1837089378"], "output": false } + { "inputs": ["597865082", "459499324"], "output": false }, + { "inputs": ["597865078", "597865082"], "output": true }, + { "inputs": ["597865082", "597865082"], "output": false }, + { "inputs": ["597865082", "597865078"], "output": false } ], "lt_uint32_euint32": [ - { "inputs": ["391192733", "2866298985"], "output": true }, - { "inputs": ["1837089378", "1837089382"], "output": true }, - { "inputs": ["1837089382", "1837089382"], "output": false }, - { "inputs": ["1837089382", "1837089378"], "output": false } + { "inputs": ["4239340674", "459499324"], "output": false }, + { "inputs": ["597865078", "597865082"], "output": true }, + { "inputs": ["597865082", "597865082"], "output": false }, + { "inputs": ["597865082", "597865078"], "output": false } ], "lt_euint32_euint64": [ - { "inputs": ["1941297565", "18438856464497751915"], "output": true }, - { "inputs": ["1941297561", "1941297565"], "output": true }, - { "inputs": ["1941297565", "1941297565"], "output": false }, - { "inputs": ["1941297565", "1941297561"], "output": false } + { "inputs": ["3259927115", "18445091130782070813"], "output": true }, + { "inputs": ["3259927111", "3259927115"], "output": true }, + { "inputs": ["3259927115", "3259927115"], "output": false }, + { "inputs": ["3259927115", "3259927111"], "output": false } + ], + "lt_euint32_euint128": [ + { "inputs": ["2093199071", "340282366920938463463370622002914075235"], "output": true }, + { "inputs": ["2093199067", "2093199071"], "output": true }, + { "inputs": ["2093199071", "2093199071"], "output": false }, + { "inputs": ["2093199071", "2093199067"], "output": false } + ], + "lt_euint32_euint256": [ + { + "inputs": ["3016190595", "115792089237316195423570985008687907853269984665640564039457583853908247743739"], + "output": true + }, + { "inputs": ["3016190591", "3016190595"], "output": true }, + { "inputs": ["3016190595", "3016190595"], "output": false }, + { "inputs": ["3016190595", "3016190591"], "output": false } ], "lt_euint64_euint4": [ - { "inputs": ["18443056909764585511", "1"], "output": false }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": false } + { "inputs": ["18444247959988442675", "10"], "output": false }, + { "inputs": ["6", "10"], "output": true }, + { "inputs": ["10", "10"], "output": false }, + { "inputs": ["10", "6"], "output": false } ], "lt_euint64_euint8": [ - { "inputs": ["18444118039600142421", "79"], "output": false }, - { "inputs": ["75", "79"], "output": true }, - { "inputs": ["79", "79"], "output": false }, - { "inputs": ["79", "75"], "output": false } + { "inputs": ["18444886637718481993", "57"], "output": false }, + { "inputs": ["53", "57"], "output": true }, + { "inputs": ["57", "57"], "output": false }, + { "inputs": ["57", "53"], "output": false } ], "lt_euint64_euint16": [ - { "inputs": ["18438335232029320935", "10564"], "output": false }, - { "inputs": ["10560", "10564"], "output": true }, - { "inputs": ["10564", "10564"], "output": false }, - { "inputs": ["10564", "10560"], "output": false } + { "inputs": ["18440546263819960189", "42672"], "output": false }, + { "inputs": ["42668", "42672"], "output": true }, + { "inputs": ["42672", "42672"], "output": false }, + { "inputs": ["42672", "42668"], "output": false } ], "lt_euint64_euint32": [ - { "inputs": ["18446696862115863979", "853267915"], "output": false }, - { "inputs": ["853267911", "853267915"], "output": true }, - { "inputs": ["853267915", "853267915"], "output": false }, - { "inputs": ["853267915", "853267911"], "output": false } + { "inputs": ["18441377707016357467", "2876988629"], "output": false }, + { "inputs": ["2876988625", "2876988629"], "output": true }, + { "inputs": ["2876988629", "2876988629"], "output": false }, + { "inputs": ["2876988629", "2876988625"], "output": false } ], "lt_euint64_euint64": [ - { "inputs": ["18445972196307174659", "18438760003066140571"], "output": false }, - { "inputs": ["18438760003066140567", "18438760003066140571"], "output": true }, - { "inputs": ["18438760003066140571", "18438760003066140571"], "output": false }, - { "inputs": ["18438760003066140571", "18438760003066140567"], "output": false } + { "inputs": ["18443308354694945505", "18438494040818835505"], "output": false }, + { "inputs": ["18438494040818835501", "18438494040818835505"], "output": true }, + { "inputs": ["18438494040818835505", "18438494040818835505"], "output": false }, + { "inputs": ["18438494040818835505", "18438494040818835501"], "output": false } ], "lt_euint64_uint64": [ - { "inputs": ["18445972196307174659", "18441359463085216855"], "output": false }, - { "inputs": ["18438760003066140567", "18438760003066140571"], "output": true }, - { "inputs": ["18438760003066140571", "18438760003066140571"], "output": false }, - { "inputs": ["18438760003066140571", "18438760003066140567"], "output": false } + { "inputs": ["18443308354694945505", "18438426856220799235"], "output": false }, + { "inputs": ["18438494040818835501", "18438494040818835505"], "output": true }, + { "inputs": ["18438494040818835505", "18438494040818835505"], "output": false }, + { "inputs": ["18438494040818835505", "18438494040818835501"], "output": false } ], "lt_uint64_euint64": [ - { "inputs": ["18440565799944043085", "18441359463085216855"], "output": true }, - { "inputs": ["18438760003066140567", "18438760003066140571"], "output": true }, - { "inputs": ["18438760003066140571", "18438760003066140571"], "output": false }, - { "inputs": ["18438760003066140571", "18438760003066140567"], "output": false } + { "inputs": ["18444682732892858227", "18438426856220799235"], "output": false }, + { "inputs": ["18438494040818835501", "18438494040818835505"], "output": true }, + { "inputs": ["18438494040818835505", "18438494040818835505"], "output": false }, + { "inputs": ["18438494040818835505", "18438494040818835501"], "output": false } + ], + "lt_euint64_euint128": [ + { "inputs": ["18444814117403628673", "340282366920938463463365637360413874149"], "output": true }, + { "inputs": ["18444814117403628669", "18444814117403628673"], "output": true }, + { "inputs": ["18444814117403628673", "18444814117403628673"], "output": false }, + { "inputs": ["18444814117403628673", "18444814117403628669"], "output": false } + ], + "lt_euint64_euint256": [ + { + "inputs": [ + "18440844601726997069", + "115792089237316195423570985008687907853269984665640564039457578884493044868087" + ], + "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"], "output": true }, + { "inputs": ["18446437448475645327", "18446437448475645327"], "output": false }, + { "inputs": ["18446437448475645327", "18446437448475645323"], "output": false } + ], + "lt_euint128_euint128": [ + { + "inputs": ["340282366920938463463368309276517872429", "340282366920938463463372024309642476529"], + "output": true + }, + { + "inputs": ["340282366920938463463368309276517872425", "340282366920938463463368309276517872429"], + "output": true + }, + { + "inputs": ["340282366920938463463368309276517872429", "340282366920938463463368309276517872429"], + "output": false + }, + { + "inputs": ["340282366920938463463368309276517872429", "340282366920938463463368309276517872425"], + "output": false + } + ], + "lt_euint128_uint128": [ + { + "inputs": ["340282366920938463463368309276517872429", "340282366920938463463366305725915183957"], + "output": false + }, + { + "inputs": ["340282366920938463463368309276517872425", "340282366920938463463368309276517872429"], + "output": true + }, + { + "inputs": ["340282366920938463463368309276517872429", "340282366920938463463368309276517872429"], + "output": false + }, + { + "inputs": ["340282366920938463463368309276517872429", "340282366920938463463368309276517872425"], + "output": false + } + ], + "lt_uint128_euint128": [ + { + "inputs": ["340282366920938463463371881592186712743", "340282366920938463463366305725915183957"], + "output": false + }, + { + "inputs": ["340282366920938463463368309276517872425", "340282366920938463463368309276517872429"], + "output": true + }, + { + "inputs": ["340282366920938463463368309276517872429", "340282366920938463463368309276517872429"], + "output": false + }, + { + "inputs": ["340282366920938463463368309276517872429", "340282366920938463463368309276517872425"], + "output": false + } + ], + "lt_euint128_euint256": [ + { + "inputs": [ + "340282366920938463463373024758287549459", + "115792089237316195423570985008687907853269984665640564039457580686028388504291" + ], + "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 } + ], + "lt_euint256_euint64": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457577348858503949249", + "18446356831740760619" + ], + "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"], + "output": true + }, + { + "inputs": ["340282366920938463463367486483424293599", "340282366920938463463367486483424293599"], + "output": false + }, + { + "inputs": ["340282366920938463463367486483424293599", "340282366920938463463367486483424293595"], + "output": false + } + ], + "lt_euint256_euint256": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579345439988102233", + "115792089237316195423570985008687907853269984665640564039457575518813902238261" + ], + "output": false + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457575518813902238257", + "115792089237316195423570985008687907853269984665640564039457575518813902238261" + ], + "output": true + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457575518813902238261", + "115792089237316195423570985008687907853269984665640564039457575518813902238261" + ], + "output": false + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457575518813902238261", + "115792089237316195423570985008687907853269984665640564039457575518813902238257" + ], + "output": false + } + ], + "lt_euint256_uint256": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579345439988102233", + "115792089237316195423570985008687907853269984665640564039457581362267810923471" + ], + "output": true + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457575518813902238257", + "115792089237316195423570985008687907853269984665640564039457575518813902238261" + ], + "output": true + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457575518813902238261", + "115792089237316195423570985008687907853269984665640564039457575518813902238261" + ], + "output": false + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457575518813902238261", + "115792089237316195423570985008687907853269984665640564039457575518813902238257" + ], + "output": false + } + ], + "lt_uint256_euint256": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457578628645763210627", + "115792089237316195423570985008687907853269984665640564039457581362267810923471" + ], + "output": true + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457575518813902238257", + "115792089237316195423570985008687907853269984665640564039457575518813902238261" + ], + "output": true + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457575518813902238261", + "115792089237316195423570985008687907853269984665640564039457575518813902238261" + ], + "output": false + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457575518813902238261", + "115792089237316195423570985008687907853269984665640564039457575518813902238257" + ], + "output": false + } ], "ge_euint4_euint4": [ - { "inputs": ["9", "9"], "output": true }, - { "inputs": ["5", "9"], "output": false }, - { "inputs": ["9", "9"], "output": true }, - { "inputs": ["9", "5"], "output": true } + { "inputs": ["6", "11"], "output": false }, + { "inputs": ["4", "8"], "output": false }, + { "inputs": ["8", "8"], "output": true }, + { "inputs": ["8", "4"], "output": true } ], "ge_euint4_euint8": [ - { "inputs": ["13", "91"], "output": false }, - { "inputs": ["9", "13"], "output": false }, - { "inputs": ["13", "13"], "output": true }, - { "inputs": ["13", "9"], "output": true } + { "inputs": ["3", "79"], "output": false }, + { "inputs": ["4", "8"], "output": false }, + { "inputs": ["8", "8"], "output": true }, + { "inputs": ["8", "4"], "output": true } ], "ge_euint4_uint8": [ - { "inputs": ["13", "2"], "output": true }, - { "inputs": ["9", "13"], "output": false }, - { "inputs": ["13", "13"], "output": true }, - { "inputs": ["13", "9"], "output": true } + { "inputs": ["3", "5"], "output": false }, + { "inputs": ["4", "8"], "output": false }, + { "inputs": ["8", "8"], "output": true }, + { "inputs": ["8", "4"], "output": true } ], "ge_euint4_euint16": [ - { "inputs": ["5", "34397"], "output": false }, + { "inputs": ["1", "53247"], "output": false }, { "inputs": ["4", "8"], "output": false }, { "inputs": ["8", "8"], "output": true }, { "inputs": ["8", "4"], "output": true } ], "ge_euint4_euint32": [ - { "inputs": ["3", "735253791"], "output": false }, + { "inputs": ["1", "2262617776"], "output": false }, { "inputs": ["4", "8"], "output": false }, { "inputs": ["8", "8"], "output": true }, { "inputs": ["8", "4"], "output": true } ], "ge_euint4_euint64": [ - { "inputs": ["7", "18446430329213146395"], "output": false }, + { "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 } + ], + "ge_euint4_euint256": [ + { + "inputs": ["5", "115792089237316195423570985008687907853269984665640564039457582400238586978263"], + "output": false + }, { "inputs": ["4", "8"], "output": false }, { "inputs": ["8", "8"], "output": true }, { "inputs": ["8", "4"], "output": true } ], "ge_euint8_euint4": [ - { "inputs": ["85", "12"], "output": true }, - { "inputs": ["8", "12"], "output": false }, - { "inputs": ["12", "12"], "output": true }, - { "inputs": ["12", "8"], "output": true } + { "inputs": ["53", "1"], "output": true }, + { "inputs": ["4", "8"], "output": false }, + { "inputs": ["8", "8"], "output": true }, + { "inputs": ["8", "4"], "output": true } ], "ge_uint8_euint4": [ - { "inputs": ["1", "12"], "output": false }, - { "inputs": ["8", "12"], "output": false }, - { "inputs": ["12", "12"], "output": true }, - { "inputs": ["12", "8"], "output": true } + { "inputs": ["14", "1"], "output": true }, + { "inputs": ["4", "8"], "output": false }, + { "inputs": ["8", "8"], "output": true }, + { "inputs": ["8", "4"], "output": true } ], "ge_euint8_euint8": [ - { "inputs": ["89", "227"], "output": false }, - { "inputs": ["85", "89"], "output": false }, - { "inputs": ["89", "89"], "output": true }, - { "inputs": ["89", "85"], "output": true } + { "inputs": ["63", "190"], "output": false }, + { "inputs": ["59", "63"], "output": false }, + { "inputs": ["63", "63"], "output": true }, + { "inputs": ["63", "59"], "output": true } ], "ge_euint8_uint8": [ - { "inputs": ["89", "157"], "output": false }, - { "inputs": ["85", "89"], "output": false }, - { "inputs": ["89", "89"], "output": true }, - { "inputs": ["89", "85"], "output": true } + { "inputs": ["63", "223"], "output": false }, + { "inputs": ["59", "63"], "output": false }, + { "inputs": ["63", "63"], "output": true }, + { "inputs": ["63", "59"], "output": true } ], "ge_uint8_euint8": [ - { "inputs": ["164", "157"], "output": true }, - { "inputs": ["85", "89"], "output": false }, - { "inputs": ["89", "89"], "output": true }, - { "inputs": ["89", "85"], "output": true } + { "inputs": ["3", "223"], "output": false }, + { "inputs": ["59", "63"], "output": false }, + { "inputs": ["63", "63"], "output": true }, + { "inputs": ["63", "59"], "output": true } ], "ge_euint8_euint16": [ - { "inputs": ["12", "41571"], "output": false }, - { "inputs": ["8", "12"], "output": false }, - { "inputs": ["12", "12"], "output": true }, - { "inputs": ["12", "8"], "output": true } + { "inputs": ["93", "62769"], "output": false }, + { "inputs": ["89", "93"], "output": false }, + { "inputs": ["93", "93"], "output": true }, + { "inputs": ["93", "89"], "output": true } ], "ge_euint8_euint32": [ - { "inputs": ["222", "4025894176"], "output": false }, - { "inputs": ["218", "222"], "output": false }, - { "inputs": ["222", "222"], "output": true }, - { "inputs": ["222", "218"], "output": true } + { "inputs": ["108", "54055221"], "output": false }, + { "inputs": ["104", "108"], "output": false }, + { "inputs": ["108", "108"], "output": true }, + { "inputs": ["108", "104"], "output": true } ], "ge_euint8_euint64": [ - { "inputs": ["201", "18443640492228529453"], "output": false }, - { "inputs": ["197", "201"], "output": false }, - { "inputs": ["201", "201"], "output": true }, - { "inputs": ["201", "197"], "output": true } + { "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": ["27268", "4"], "output": true }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": true } + { "inputs": ["60257", "13"], "output": true }, + { "inputs": ["9", "13"], "output": false }, + { "inputs": ["13", "13"], "output": true }, + { "inputs": ["13", "9"], "output": true } ], "ge_euint16_euint8": [ - { "inputs": ["24994", "118"], "output": true }, - { "inputs": ["114", "118"], "output": false }, - { "inputs": ["118", "118"], "output": true }, - { "inputs": ["118", "114"], "output": true } + { "inputs": ["8192", "143"], "output": true }, + { "inputs": ["139", "143"], "output": false }, + { "inputs": ["143", "143"], "output": true }, + { "inputs": ["143", "139"], "output": true } ], "ge_euint16_euint16": [ - { "inputs": ["8825", "39131"], "output": false }, - { "inputs": ["8821", "8825"], "output": false }, - { "inputs": ["8825", "8825"], "output": true }, - { "inputs": ["8825", "8821"], "output": true } + { "inputs": ["51651", "13068"], "output": true }, + { "inputs": ["13064", "13068"], "output": false }, + { "inputs": ["13068", "13068"], "output": true }, + { "inputs": ["13068", "13064"], "output": true } ], "ge_euint16_uint16": [ - { "inputs": ["8825", "23737"], "output": false }, - { "inputs": ["8821", "8825"], "output": false }, - { "inputs": ["8825", "8825"], "output": true }, - { "inputs": ["8825", "8821"], "output": true } + { "inputs": ["51651", "48781"], "output": true }, + { "inputs": ["13064", "13068"], "output": false }, + { "inputs": ["13068", "13068"], "output": true }, + { "inputs": ["13068", "13064"], "output": true } ], "ge_uint16_euint16": [ - { "inputs": ["43508", "23737"], "output": true }, - { "inputs": ["8821", "8825"], "output": false }, - { "inputs": ["8825", "8825"], "output": true }, - { "inputs": ["8825", "8821"], "output": true } + { "inputs": ["60450", "48781"], "output": true }, + { "inputs": ["13064", "13068"], "output": false }, + { "inputs": ["13068", "13068"], "output": true }, + { "inputs": ["13068", "13064"], "output": true } ], "ge_euint16_euint32": [ - { "inputs": ["23826", "3191695510"], "output": false }, - { "inputs": ["23822", "23826"], "output": false }, - { "inputs": ["23826", "23826"], "output": true }, - { "inputs": ["23826", "23822"], "output": true } + { "inputs": ["63432", "458410498"], "output": false }, + { "inputs": ["63428", "63432"], "output": false }, + { "inputs": ["63432", "63432"], "output": true }, + { "inputs": ["63432", "63428"], "output": true } ], "ge_euint16_euint64": [ - { "inputs": ["63199", "18444428591303537867"], "output": false }, - { "inputs": ["63195", "63199"], "output": false }, - { "inputs": ["63199", "63199"], "output": true }, - { "inputs": ["63199", "63195"], "output": true } + { "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": ["1601227311", "14"], "output": true }, - { "inputs": ["10", "14"], "output": false }, - { "inputs": ["14", "14"], "output": true }, - { "inputs": ["14", "10"], "output": true } + { "inputs": ["417230890", "6"], "output": true }, + { "inputs": ["4", "8"], "output": false }, + { "inputs": ["8", "8"], "output": true }, + { "inputs": ["8", "4"], "output": true } ], "ge_euint32_euint8": [ - { "inputs": ["1799963609", "233"], "output": true }, - { "inputs": ["229", "233"], "output": false }, - { "inputs": ["233", "233"], "output": true }, - { "inputs": ["233", "229"], "output": true } + { "inputs": ["1009223821", "187"], "output": true }, + { "inputs": ["183", "187"], "output": false }, + { "inputs": ["187", "187"], "output": true }, + { "inputs": ["187", "183"], "output": true } ], "ge_euint32_euint16": [ - { "inputs": ["1742405068", "56059"], "output": true }, - { "inputs": ["56055", "56059"], "output": false }, - { "inputs": ["56059", "56059"], "output": true }, - { "inputs": ["56059", "56055"], "output": true } + { "inputs": ["3233856655", "54626"], "output": true }, + { "inputs": ["54622", "54626"], "output": false }, + { "inputs": ["54626", "54626"], "output": true }, + { "inputs": ["54626", "54622"], "output": true } ], "ge_euint32_euint32": [ - { "inputs": ["1736787381", "970577162"], "output": true }, - { "inputs": ["970577158", "970577162"], "output": false }, - { "inputs": ["970577162", "970577162"], "output": true }, - { "inputs": ["970577162", "970577158"], "output": true } + { "inputs": ["929694790", "907768232"], "output": true }, + { "inputs": ["907768228", "907768232"], "output": false }, + { "inputs": ["907768232", "907768232"], "output": true }, + { "inputs": ["907768232", "907768228"], "output": true } ], "ge_euint32_uint32": [ - { "inputs": ["1736787381", "3290514741"], "output": false }, - { "inputs": ["970577158", "970577162"], "output": false }, - { "inputs": ["970577162", "970577162"], "output": true }, - { "inputs": ["970577162", "970577158"], "output": true } + { "inputs": ["929694790", "603878469"], "output": true }, + { "inputs": ["907768228", "907768232"], "output": false }, + { "inputs": ["907768232", "907768232"], "output": true }, + { "inputs": ["907768232", "907768228"], "output": true } ], "ge_uint32_euint32": [ - { "inputs": ["586395582", "3290514741"], "output": false }, - { "inputs": ["970577158", "970577162"], "output": false }, - { "inputs": ["970577162", "970577162"], "output": true }, - { "inputs": ["970577162", "970577158"], "output": true } + { "inputs": ["2155494187", "603878469"], "output": true }, + { "inputs": ["907768228", "907768232"], "output": false }, + { "inputs": ["907768232", "907768232"], "output": true }, + { "inputs": ["907768232", "907768228"], "output": true } ], "ge_euint32_euint64": [ - { "inputs": ["2551620349", "18444102078323452175"], "output": false }, - { "inputs": ["2551620345", "2551620349"], "output": false }, - { "inputs": ["2551620349", "2551620349"], "output": true }, - { "inputs": ["2551620349", "2551620345"], "output": true } + { "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": ["18439251641807718563", "9"], "output": true }, - { "inputs": ["5", "9"], "output": false }, - { "inputs": ["9", "9"], "output": true }, - { "inputs": ["9", "5"], "output": true } + { "inputs": ["18438015014584183031", "11"], "output": true }, + { "inputs": ["7", "11"], "output": false }, + { "inputs": ["11", "11"], "output": true }, + { "inputs": ["11", "7"], "output": true } ], "ge_euint64_euint8": [ - { "inputs": ["18444294270645254277", "229"], "output": true }, - { "inputs": ["225", "229"], "output": false }, - { "inputs": ["229", "229"], "output": true }, - { "inputs": ["229", "225"], "output": true } + { "inputs": ["18444176095713623219", "248"], "output": true }, + { "inputs": ["244", "248"], "output": false }, + { "inputs": ["248", "248"], "output": true }, + { "inputs": ["248", "244"], "output": true } ], "ge_euint64_euint16": [ - { "inputs": ["18437766862316060605", "31992"], "output": true }, - { "inputs": ["31988", "31992"], "output": false }, - { "inputs": ["31992", "31992"], "output": true }, - { "inputs": ["31992", "31988"], "output": true } + { "inputs": ["18445173411231141809", "29055"], "output": true }, + { "inputs": ["29051", "29055"], "output": false }, + { "inputs": ["29055", "29055"], "output": true }, + { "inputs": ["29055", "29051"], "output": true } ], "ge_euint64_euint32": [ - { "inputs": ["18440264286866387829", "85256317"], "output": true }, - { "inputs": ["85256313", "85256317"], "output": false }, - { "inputs": ["85256317", "85256317"], "output": true }, - { "inputs": ["85256317", "85256313"], "output": true } + { "inputs": ["18439654895803536359", "1948462184"], "output": true }, + { "inputs": ["1948462180", "1948462184"], "output": false }, + { "inputs": ["1948462184", "1948462184"], "output": true }, + { "inputs": ["1948462184", "1948462180"], "output": true } ], "ge_euint64_euint64": [ - { "inputs": ["18441951286640352465", "18443086804815428517"], "output": false }, - { "inputs": ["18441951286640352461", "18441951286640352465"], "output": false }, - { "inputs": ["18441951286640352465", "18441951286640352465"], "output": true }, - { "inputs": ["18441951286640352465", "18441951286640352461"], "output": true } + { "inputs": ["18444613618003912273", "18441817383047397973"], "output": true }, + { "inputs": ["18441817383047397969", "18441817383047397973"], "output": false }, + { "inputs": ["18441817383047397973", "18441817383047397973"], "output": true }, + { "inputs": ["18441817383047397973", "18441817383047397969"], "output": true } ], "ge_euint64_uint64": [ - { "inputs": ["18441951286640352465", "18443569233121144247"], "output": false }, - { "inputs": ["18441951286640352461", "18441951286640352465"], "output": false }, - { "inputs": ["18441951286640352465", "18441951286640352465"], "output": true }, - { "inputs": ["18441951286640352465", "18441951286640352461"], "output": true } + { "inputs": ["18444613618003912273", "18444784193665775113"], "output": false }, + { "inputs": ["18441817383047397969", "18441817383047397973"], "output": false }, + { "inputs": ["18441817383047397973", "18441817383047397973"], "output": true }, + { "inputs": ["18441817383047397973", "18441817383047397969"], "output": true } ], "ge_uint64_euint64": [ - { "inputs": ["18439035083186430691", "18443569233121144247"], "output": false }, - { "inputs": ["18441951286640352461", "18441951286640352465"], "output": false }, - { "inputs": ["18441951286640352465", "18441951286640352465"], "output": true }, - { "inputs": ["18441951286640352465", "18441951286640352461"], "output": true } + { "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 } ], - "gt_euint4_euint4": [ - { "inputs": ["4", "14"], "output": false }, + "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": 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": ["14", "199"], "output": false }, - { "inputs": ["10", "14"], "output": false }, - { "inputs": ["14", "14"], "output": false }, - { "inputs": ["14", "10"], "output": true } + { "inputs": ["1", "59"], "output": false }, + { "inputs": ["4", "8"], "output": false }, + { "inputs": ["8", "8"], "output": false }, + { "inputs": ["8", "4"], "output": true } ], "gt_euint4_uint8": [ - { "inputs": ["14", "13"], "output": true }, - { "inputs": ["10", "14"], "output": false }, - { "inputs": ["14", "14"], "output": false }, - { "inputs": ["14", "10"], "output": true } + { "inputs": ["1", "3"], "output": false }, + { "inputs": ["4", "8"], "output": false }, + { "inputs": ["8", "8"], "output": false }, + { "inputs": ["8", "4"], "output": true } ], "gt_euint4_euint16": [ - { "inputs": ["10", "34348"], "output": false }, - { "inputs": ["6", "10"], "output": false }, - { "inputs": ["10", "10"], "output": false }, - { "inputs": ["10", "6"], "output": true } + { "inputs": ["13", "43765"], "output": false }, + { "inputs": ["9", "13"], "output": false }, + { "inputs": ["13", "13"], "output": false }, + { "inputs": ["13", "9"], "output": true } ], "gt_euint4_euint32": [ - { "inputs": ["1", "2112514560"], "output": false }, + { "inputs": ["8", "1791761269"], "output": false }, { "inputs": ["4", "8"], "output": false }, { "inputs": ["8", "8"], "output": false }, { "inputs": ["8", "4"], "output": true } ], "gt_euint4_euint64": [ - { "inputs": ["10", "18442574847292216251"], "output": false }, - { "inputs": ["6", "10"], "output": false }, - { "inputs": ["10", "10"], "output": false }, - { "inputs": ["10", "6"], "output": true } + { "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": ["248", "2"], "output": true }, + { "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", "2"], "output": false }, + { "inputs": ["1", "5"], "output": false }, { "inputs": ["4", "8"], "output": false }, { "inputs": ["8", "8"], "output": false }, { "inputs": ["8", "4"], "output": true } ], "gt_euint8_euint8": [ - { "inputs": ["247", "56"], "output": true }, - { "inputs": ["52", "56"], "output": false }, - { "inputs": ["56", "56"], "output": false }, - { "inputs": ["56", "52"], "output": true } + { "inputs": ["239", "212"], "output": true }, + { "inputs": ["208", "212"], "output": false }, + { "inputs": ["212", "212"], "output": false }, + { "inputs": ["212", "208"], "output": true } ], "gt_euint8_uint8": [ - { "inputs": ["247", "141"], "output": true }, - { "inputs": ["52", "56"], "output": false }, - { "inputs": ["56", "56"], "output": false }, - { "inputs": ["56", "52"], "output": true } + { "inputs": ["239", "184"], "output": true }, + { "inputs": ["208", "212"], "output": false }, + { "inputs": ["212", "212"], "output": false }, + { "inputs": ["212", "208"], "output": true } ], "gt_uint8_euint8": [ - { "inputs": ["186", "141"], "output": true }, - { "inputs": ["52", "56"], "output": false }, - { "inputs": ["56", "56"], "output": false }, - { "inputs": ["56", "52"], "output": true } + { "inputs": ["188", "184"], "output": true }, + { "inputs": ["208", "212"], "output": false }, + { "inputs": ["212", "212"], "output": false }, + { "inputs": ["212", "208"], "output": true } ], "gt_euint8_euint16": [ - { "inputs": ["67", "34612"], "output": false }, - { "inputs": ["63", "67"], "output": false }, - { "inputs": ["67", "67"], "output": false }, - { "inputs": ["67", "63"], "output": true } + { "inputs": ["207", "17375"], "output": false }, + { "inputs": ["203", "207"], "output": false }, + { "inputs": ["207", "207"], "output": false }, + { "inputs": ["207", "203"], "output": true } ], "gt_euint8_euint32": [ - { "inputs": ["193", "1536979513"], "output": false }, - { "inputs": ["189", "193"], "output": false }, - { "inputs": ["193", "193"], "output": false }, - { "inputs": ["193", "189"], "output": true } + { "inputs": ["16", "2217853328"], "output": false }, + { "inputs": ["12", "16"], "output": false }, + { "inputs": ["16", "16"], "output": false }, + { "inputs": ["16", "12"], "output": true } ], "gt_euint8_euint64": [ - { "inputs": ["237", "18441103586480031265"], "output": false }, - { "inputs": ["233", "237"], "output": false }, - { "inputs": ["237", "237"], "output": false }, - { "inputs": ["237", "233"], "output": true } + { "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": ["6870", "8"], "output": true }, + { "inputs": ["57987", "5"], "output": true }, { "inputs": ["4", "8"], "output": false }, { "inputs": ["8", "8"], "output": false }, { "inputs": ["8", "4"], "output": true } ], "gt_euint16_euint8": [ - { "inputs": ["15548", "171"], "output": true }, - { "inputs": ["167", "171"], "output": false }, - { "inputs": ["171", "171"], "output": false }, - { "inputs": ["171", "167"], "output": true } + { "inputs": ["18049", "102"], "output": true }, + { "inputs": ["98", "102"], "output": false }, + { "inputs": ["102", "102"], "output": false }, + { "inputs": ["102", "98"], "output": true } ], "gt_euint16_euint16": [ - { "inputs": ["33735", "54333"], "output": false }, - { "inputs": ["33731", "33735"], "output": false }, - { "inputs": ["33735", "33735"], "output": false }, - { "inputs": ["33735", "33731"], "output": true } + { "inputs": ["49523", "63498"], "output": false }, + { "inputs": ["49519", "49523"], "output": false }, + { "inputs": ["49523", "49523"], "output": false }, + { "inputs": ["49523", "49519"], "output": true } ], "gt_euint16_uint16": [ - { "inputs": ["33735", "40439"], "output": false }, - { "inputs": ["33731", "33735"], "output": false }, - { "inputs": ["33735", "33735"], "output": false }, - { "inputs": ["33735", "33731"], "output": true } + { "inputs": ["49523", "10749"], "output": true }, + { "inputs": ["49519", "49523"], "output": false }, + { "inputs": ["49523", "49523"], "output": false }, + { "inputs": ["49523", "49519"], "output": true } ], "gt_uint16_euint16": [ - { "inputs": ["47103", "40439"], "output": true }, - { "inputs": ["33731", "33735"], "output": false }, - { "inputs": ["33735", "33735"], "output": false }, - { "inputs": ["33735", "33731"], "output": true } + { "inputs": ["38042", "10749"], "output": true }, + { "inputs": ["49519", "49523"], "output": false }, + { "inputs": ["49523", "49523"], "output": false }, + { "inputs": ["49523", "49519"], "output": true } ], "gt_euint16_euint32": [ - { "inputs": ["20452", "2742403767"], "output": false }, - { "inputs": ["20448", "20452"], "output": false }, - { "inputs": ["20452", "20452"], "output": false }, - { "inputs": ["20452", "20448"], "output": true } + { "inputs": ["8095", "1426308540"], "output": false }, + { "inputs": ["8091", "8095"], "output": false }, + { "inputs": ["8095", "8095"], "output": false }, + { "inputs": ["8095", "8091"], "output": true } ], "gt_euint16_euint64": [ - { "inputs": ["63105", "18440430414982980885"], "output": false }, - { "inputs": ["63101", "63105"], "output": false }, - { "inputs": ["63105", "63105"], "output": false }, - { "inputs": ["63105", "63101"], "output": true } + { "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": ["3548820179", "1"], "output": true }, + { "inputs": ["3015562136", "7"], "output": true }, { "inputs": ["4", "8"], "output": false }, { "inputs": ["8", "8"], "output": false }, { "inputs": ["8", "4"], "output": true } ], "gt_euint32_euint8": [ - { "inputs": ["3893344872", "37"], "output": true }, - { "inputs": ["33", "37"], "output": false }, - { "inputs": ["37", "37"], "output": false }, - { "inputs": ["37", "33"], "output": true } + { "inputs": ["1381529874", "57"], "output": true }, + { "inputs": ["53", "57"], "output": false }, + { "inputs": ["57", "57"], "output": false }, + { "inputs": ["57", "53"], "output": true } ], "gt_euint32_euint16": [ - { "inputs": ["4017313863", "63284"], "output": true }, - { "inputs": ["63280", "63284"], "output": false }, - { "inputs": ["63284", "63284"], "output": false }, - { "inputs": ["63284", "63280"], "output": true } + { "inputs": ["1059995818", "54018"], "output": true }, + { "inputs": ["54014", "54018"], "output": false }, + { "inputs": ["54018", "54018"], "output": false }, + { "inputs": ["54018", "54014"], "output": true } ], "gt_euint32_euint32": [ - { "inputs": ["212629196", "2875731526"], "output": false }, - { "inputs": ["212629192", "212629196"], "output": false }, - { "inputs": ["212629196", "212629196"], "output": false }, - { "inputs": ["212629196", "212629192"], "output": true } + { "inputs": ["3794643996", "619151916"], "output": true }, + { "inputs": ["619151912", "619151916"], "output": false }, + { "inputs": ["619151916", "619151916"], "output": false }, + { "inputs": ["619151916", "619151912"], "output": true } ], "gt_euint32_uint32": [ - { "inputs": ["212629196", "4059879084"], "output": false }, - { "inputs": ["212629192", "212629196"], "output": false }, - { "inputs": ["212629196", "212629196"], "output": false }, - { "inputs": ["212629196", "212629192"], "output": true } + { "inputs": ["3794643996", "3726690353"], "output": true }, + { "inputs": ["619151912", "619151916"], "output": false }, + { "inputs": ["619151916", "619151916"], "output": false }, + { "inputs": ["619151916", "619151912"], "output": true } ], "gt_uint32_euint32": [ - { "inputs": ["2732454384", "4059879084"], "output": false }, - { "inputs": ["212629192", "212629196"], "output": false }, - { "inputs": ["212629196", "212629196"], "output": false }, - { "inputs": ["212629196", "212629192"], "output": true } + { "inputs": ["3642906183", "3726690353"], "output": false }, + { "inputs": ["619151912", "619151916"], "output": false }, + { "inputs": ["619151916", "619151916"], "output": false }, + { "inputs": ["619151916", "619151912"], "output": true } ], "gt_euint32_euint64": [ - { "inputs": ["2256977835", "18442208006659778105"], "output": false }, - { "inputs": ["2256977831", "2256977835"], "output": false }, - { "inputs": ["2256977835", "2256977835"], "output": false }, - { "inputs": ["2256977835", "2256977831"], "output": true } + { "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": ["18441781451110763323", "1"], "output": true }, + { "inputs": ["18445379539074122583", "7"], "output": true }, { "inputs": ["4", "8"], "output": false }, { "inputs": ["8", "8"], "output": false }, { "inputs": ["8", "4"], "output": true } ], "gt_euint64_euint8": [ - { "inputs": ["18446048537684194985", "113"], "output": true }, - { "inputs": ["109", "113"], "output": false }, - { "inputs": ["113", "113"], "output": false }, - { "inputs": ["113", "109"], "output": true } + { "inputs": ["18445625176027562117", "124"], "output": true }, + { "inputs": ["120", "124"], "output": false }, + { "inputs": ["124", "124"], "output": false }, + { "inputs": ["124", "120"], "output": true } ], "gt_euint64_euint16": [ - { "inputs": ["18446546126614473389", "55175"], "output": true }, - { "inputs": ["55171", "55175"], "output": false }, - { "inputs": ["55175", "55175"], "output": false }, - { "inputs": ["55175", "55171"], "output": true } + { "inputs": ["18444002964571998281", "52124"], "output": true }, + { "inputs": ["52120", "52124"], "output": false }, + { "inputs": ["52124", "52124"], "output": false }, + { "inputs": ["52124", "52120"], "output": true } ], "gt_euint64_euint32": [ - { "inputs": ["18443613995542007651", "1679838761"], "output": true }, - { "inputs": ["1679838757", "1679838761"], "output": false }, - { "inputs": ["1679838761", "1679838761"], "output": false }, - { "inputs": ["1679838761", "1679838757"], "output": true } + { "inputs": ["18445739090666652013", "2575338339"], "output": true }, + { "inputs": ["2575338335", "2575338339"], "output": false }, + { "inputs": ["2575338339", "2575338339"], "output": false }, + { "inputs": ["2575338339", "2575338335"], "output": true } ], "gt_euint64_euint64": [ - { "inputs": ["18443021258691337483", "18443593997946075985"], "output": false }, - { "inputs": ["18443021258691337479", "18443021258691337483"], "output": false }, - { "inputs": ["18443021258691337483", "18443021258691337483"], "output": false }, - { "inputs": ["18443021258691337483", "18443021258691337479"], "output": true } + { "inputs": ["18444129545450155179", "18438304556640407461"], "output": true }, + { "inputs": ["18438304556640407457", "18438304556640407461"], "output": false }, + { "inputs": ["18438304556640407461", "18438304556640407461"], "output": false }, + { "inputs": ["18438304556640407461", "18438304556640407457"], "output": true } ], "gt_euint64_uint64": [ - { "inputs": ["18443021258691337483", "18440565481263531071"], "output": true }, - { "inputs": ["18443021258691337479", "18443021258691337483"], "output": false }, - { "inputs": ["18443021258691337483", "18443021258691337483"], "output": false }, - { "inputs": ["18443021258691337483", "18443021258691337479"], "output": true } + { "inputs": ["18444129545450155179", "18441052996137337147"], "output": true }, + { "inputs": ["18438304556640407457", "18438304556640407461"], "output": false }, + { "inputs": ["18438304556640407461", "18438304556640407461"], "output": false }, + { "inputs": ["18438304556640407461", "18438304556640407457"], "output": true } ], "gt_uint64_euint64": [ - { "inputs": ["18439903764692512057", "18440565481263531071"], "output": false }, - { "inputs": ["18443021258691337479", "18443021258691337483"], "output": false }, - { "inputs": ["18443021258691337483", "18443021258691337483"], "output": false }, - { "inputs": ["18443021258691337483", "18443021258691337479"], "output": true } + { "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": ["6", "11"], "output": false }, + { "inputs": ["2", "2"], "output": true }, { "inputs": ["4", "8"], "output": false }, { "inputs": ["8", "8"], "output": true }, { "inputs": ["8", "4"], "output": false } ], "eq_euint4_euint8": [ - { "inputs": ["4", "5"], "output": false }, + { "inputs": ["14", "3"], "output": false }, { "inputs": ["4", "8"], "output": false }, { "inputs": ["8", "8"], "output": true }, { "inputs": ["8", "4"], "output": false } ], "eq_euint4_uint8": [ - { "inputs": ["4", "1"], "output": false }, + { "inputs": ["14", "7"], "output": false }, { "inputs": ["4", "8"], "output": false }, { "inputs": ["8", "8"], "output": true }, { "inputs": ["8", "4"], "output": false } ], "eq_euint4_euint16": [ - { "inputs": ["10", "41899"], "output": false }, - { "inputs": ["6", "10"], "output": false }, - { "inputs": ["10", "10"], "output": true }, - { "inputs": ["10", "6"], "output": false } + { "inputs": ["11", "40901"], "output": false }, + { "inputs": ["7", "11"], "output": false }, + { "inputs": ["11", "11"], "output": true }, + { "inputs": ["11", "7"], "output": false } ], "eq_euint4_euint32": [ - { "inputs": ["2", "183972195"], "output": false }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": false } - ], - "eq_euint4_euint64": [ - { "inputs": ["9", "18438414163462572393"], "output": false }, + { "inputs": ["9", "1089894566"], "output": false }, { "inputs": ["5", "9"], "output": false }, { "inputs": ["9", "9"], "output": true }, { "inputs": ["9", "5"], "output": false } ], - "eq_euint8_euint4": [ - { "inputs": ["37", "7"], "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": ["2", "7"], "output": false }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": false } + { "inputs": ["1", "9"], "output": false }, + { "inputs": ["5", "9"], "output": false }, + { "inputs": ["9", "9"], "output": true }, + { "inputs": ["9", "5"], "output": false } ], "eq_euint8_euint8": [ - { "inputs": ["51", "70"], "output": false }, - { "inputs": ["47", "51"], "output": false }, - { "inputs": ["51", "51"], "output": true }, - { "inputs": ["51", "47"], "output": false } + { "inputs": ["175", "224"], "output": false }, + { "inputs": ["171", "175"], "output": false }, + { "inputs": ["175", "175"], "output": true }, + { "inputs": ["175", "171"], "output": false } ], "eq_euint8_uint8": [ - { "inputs": ["51", "215"], "output": false }, - { "inputs": ["47", "51"], "output": false }, - { "inputs": ["51", "51"], "output": true }, - { "inputs": ["51", "47"], "output": false } + { "inputs": ["175", "253"], "output": false }, + { "inputs": ["171", "175"], "output": false }, + { "inputs": ["175", "175"], "output": true }, + { "inputs": ["175", "171"], "output": false } ], "eq_uint8_euint8": [ - { "inputs": ["31", "215"], "output": false }, - { "inputs": ["47", "51"], "output": false }, - { "inputs": ["51", "51"], "output": true }, - { "inputs": ["51", "47"], "output": false } + { "inputs": ["158", "253"], "output": false }, + { "inputs": ["171", "175"], "output": false }, + { "inputs": ["175", "175"], "output": true }, + { "inputs": ["175", "171"], "output": false } ], "eq_euint8_euint16": [ - { "inputs": ["22", "5993"], "output": false }, - { "inputs": ["18", "22"], "output": false }, - { "inputs": ["22", "22"], "output": true }, - { "inputs": ["22", "18"], "output": false } + { "inputs": ["205", "56577"], "output": false }, + { "inputs": ["201", "205"], "output": false }, + { "inputs": ["205", "205"], "output": true }, + { "inputs": ["205", "201"], "output": false } ], "eq_euint8_euint32": [ - { "inputs": ["110", "224862953"], "output": false }, - { "inputs": ["106", "110"], "output": false }, - { "inputs": ["110", "110"], "output": true }, - { "inputs": ["110", "106"], "output": false } + { "inputs": ["226", "3320102390"], "output": false }, + { "inputs": ["222", "226"], "output": false }, + { "inputs": ["226", "226"], "output": true }, + { "inputs": ["226", "222"], "output": false } ], "eq_euint8_euint64": [ - { "inputs": ["151", "18441484264494857597"], "output": false }, - { "inputs": ["147", "151"], "output": false }, - { "inputs": ["151", "151"], "output": true }, - { "inputs": ["151", "147"], "output": false } + { "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": ["57152", "3"], "output": false }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": false } + { "inputs": ["51541", "14"], "output": false }, + { "inputs": ["10", "14"], "output": false }, + { "inputs": ["14", "14"], "output": true }, + { "inputs": ["14", "10"], "output": false } ], "eq_euint16_euint8": [ - { "inputs": ["64589", "145"], "output": false }, - { "inputs": ["141", "145"], "output": false }, - { "inputs": ["145", "145"], "output": true }, - { "inputs": ["145", "141"], "output": false } + { "inputs": ["33521", "144"], "output": false }, + { "inputs": ["140", "144"], "output": false }, + { "inputs": ["144", "144"], "output": true }, + { "inputs": ["144", "140"], "output": false } ], "eq_euint16_euint16": [ - { "inputs": ["63705", "3249"], "output": false }, - { "inputs": ["3245", "3249"], "output": false }, - { "inputs": ["3249", "3249"], "output": true }, - { "inputs": ["3249", "3245"], "output": false } + { "inputs": ["45930", "43845"], "output": false }, + { "inputs": ["43841", "43845"], "output": false }, + { "inputs": ["43845", "43845"], "output": true }, + { "inputs": ["43845", "43841"], "output": false } ], "eq_euint16_uint16": [ - { "inputs": ["63705", "39705"], "output": false }, - { "inputs": ["3245", "3249"], "output": false }, - { "inputs": ["3249", "3249"], "output": true }, - { "inputs": ["3249", "3245"], "output": false } + { "inputs": ["45930", "25309"], "output": false }, + { "inputs": ["43841", "43845"], "output": false }, + { "inputs": ["43845", "43845"], "output": true }, + { "inputs": ["43845", "43841"], "output": false } ], "eq_uint16_euint16": [ - { "inputs": ["28254", "39705"], "output": false }, - { "inputs": ["3245", "3249"], "output": false }, - { "inputs": ["3249", "3249"], "output": true }, - { "inputs": ["3249", "3245"], "output": false } + { "inputs": ["50532", "25309"], "output": false }, + { "inputs": ["43841", "43845"], "output": false }, + { "inputs": ["43845", "43845"], "output": true }, + { "inputs": ["43845", "43841"], "output": false } ], "eq_euint16_euint32": [ - { "inputs": ["19428", "3260350416"], "output": false }, - { "inputs": ["19424", "19428"], "output": false }, - { "inputs": ["19428", "19428"], "output": true }, - { "inputs": ["19428", "19424"], "output": false } + { "inputs": ["14585", "2487581396"], "output": false }, + { "inputs": ["14581", "14585"], "output": false }, + { "inputs": ["14585", "14585"], "output": true }, + { "inputs": ["14585", "14581"], "output": false } ], "eq_euint16_euint64": [ - { "inputs": ["15185", "18442214214141554887"], "output": false }, - { "inputs": ["15181", "15185"], "output": false }, - { "inputs": ["15185", "15185"], "output": true }, - { "inputs": ["15185", "15181"], "output": false } + { "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": ["3027950561", "14"], "output": false }, - { "inputs": ["10", "14"], "output": false }, - { "inputs": ["14", "14"], "output": true }, - { "inputs": ["14", "10"], "output": false } + { "inputs": ["1592167767", "2"], "output": false }, + { "inputs": ["4", "8"], "output": false }, + { "inputs": ["8", "8"], "output": true }, + { "inputs": ["8", "4"], "output": false } ], "eq_euint32_euint8": [ - { "inputs": ["1831274090", "104"], "output": false }, - { "inputs": ["100", "104"], "output": false }, - { "inputs": ["104", "104"], "output": true }, - { "inputs": ["104", "100"], "output": false } + { "inputs": ["2371399582", "166"], "output": false }, + { "inputs": ["162", "166"], "output": false }, + { "inputs": ["166", "166"], "output": true }, + { "inputs": ["166", "162"], "output": false } ], "eq_euint32_euint16": [ - { "inputs": ["3944731587", "33929"], "output": false }, - { "inputs": ["33925", "33929"], "output": false }, - { "inputs": ["33929", "33929"], "output": true }, - { "inputs": ["33929", "33925"], "output": false } + { "inputs": ["843782707", "34473"], "output": false }, + { "inputs": ["34469", "34473"], "output": false }, + { "inputs": ["34473", "34473"], "output": true }, + { "inputs": ["34473", "34469"], "output": false } ], "eq_euint32_euint32": [ - { "inputs": ["287391998", "2464993294"], "output": false }, - { "inputs": ["287391994", "287391998"], "output": false }, - { "inputs": ["287391998", "287391998"], "output": true }, - { "inputs": ["287391998", "287391994"], "output": false } + { "inputs": ["3899668665", "3823635226"], "output": false }, + { "inputs": ["3823635222", "3823635226"], "output": false }, + { "inputs": ["3823635226", "3823635226"], "output": true }, + { "inputs": ["3823635226", "3823635222"], "output": false } ], "eq_euint32_uint32": [ - { "inputs": ["287391998", "3065919083"], "output": false }, - { "inputs": ["287391994", "287391998"], "output": false }, - { "inputs": ["287391998", "287391998"], "output": true }, - { "inputs": ["287391998", "287391994"], "output": false } + { "inputs": ["3899668665", "2460864818"], "output": false }, + { "inputs": ["3823635222", "3823635226"], "output": false }, + { "inputs": ["3823635226", "3823635226"], "output": true }, + { "inputs": ["3823635226", "3823635222"], "output": false } ], "eq_uint32_euint32": [ - { "inputs": ["833280044", "3065919083"], "output": false }, - { "inputs": ["287391994", "287391998"], "output": false }, - { "inputs": ["287391998", "287391998"], "output": true }, - { "inputs": ["287391998", "287391994"], "output": false } + { "inputs": ["3310168424", "2460864818"], "output": false }, + { "inputs": ["3823635222", "3823635226"], "output": false }, + { "inputs": ["3823635226", "3823635226"], "output": true }, + { "inputs": ["3823635226", "3823635222"], "output": false } ], "eq_euint32_euint64": [ - { "inputs": ["709957546", "18441724614470442911"], "output": false }, - { "inputs": ["709957542", "709957546"], "output": false }, - { "inputs": ["709957546", "709957546"], "output": true }, - { "inputs": ["709957546", "709957542"], "output": false } + { "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": ["18446728320459652857", "10"], "output": false }, - { "inputs": ["6", "10"], "output": false }, - { "inputs": ["10", "10"], "output": true }, - { "inputs": ["10", "6"], "output": false } + { "inputs": ["18439903646396993533", "7"], "output": false }, + { "inputs": ["4", "8"], "output": false }, + { "inputs": ["8", "8"], "output": true }, + { "inputs": ["8", "4"], "output": false } ], "eq_euint64_euint8": [ - { "inputs": ["18446185668440461367", "98"], "output": false }, - { "inputs": ["94", "98"], "output": false }, - { "inputs": ["98", "98"], "output": true }, - { "inputs": ["98", "94"], "output": false } + { "inputs": ["18439031766765231937", "63"], "output": false }, + { "inputs": ["59", "63"], "output": false }, + { "inputs": ["63", "63"], "output": true }, + { "inputs": ["63", "59"], "output": false } ], "eq_euint64_euint16": [ - { "inputs": ["18439660654359160363", "41883"], "output": false }, - { "inputs": ["41879", "41883"], "output": false }, - { "inputs": ["41883", "41883"], "output": true }, - { "inputs": ["41883", "41879"], "output": false } + { "inputs": ["18445593277781135549", "65299"], "output": false }, + { "inputs": ["65295", "65299"], "output": false }, + { "inputs": ["65299", "65299"], "output": true }, + { "inputs": ["65299", "65295"], "output": false } ], "eq_euint64_euint32": [ - { "inputs": ["18445744067307966387", "926561519"], "output": false }, - { "inputs": ["926561515", "926561519"], "output": false }, - { "inputs": ["926561519", "926561519"], "output": true }, - { "inputs": ["926561519", "926561515"], "output": false } + { "inputs": ["18443073273307378367", "1540281447"], "output": false }, + { "inputs": ["1540281443", "1540281447"], "output": false }, + { "inputs": ["1540281447", "1540281447"], "output": true }, + { "inputs": ["1540281447", "1540281443"], "output": false } ], "eq_euint64_euint64": [ - { "inputs": ["18442470885463520691", "18445888562756211467"], "output": false }, - { "inputs": ["18442470885463520687", "18442470885463520691"], "output": false }, - { "inputs": ["18442470885463520691", "18442470885463520691"], "output": true }, - { "inputs": ["18442470885463520691", "18442470885463520687"], "output": false } + { "inputs": ["18443282870504090991", "18446028700927461615"], "output": false }, + { "inputs": ["18443282870504090987", "18443282870504090991"], "output": false }, + { "inputs": ["18443282870504090991", "18443282870504090991"], "output": true }, + { "inputs": ["18443282870504090991", "18443282870504090987"], "output": false } ], "eq_euint64_uint64": [ - { "inputs": ["18442470885463520691", "18444839379902899701"], "output": false }, - { "inputs": ["18442470885463520687", "18442470885463520691"], "output": false }, - { "inputs": ["18442470885463520691", "18442470885463520691"], "output": true }, - { "inputs": ["18442470885463520691", "18442470885463520687"], "output": false } + { "inputs": ["18443282870504090991", "18439130415590833625"], "output": false }, + { "inputs": ["18443282870504090987", "18443282870504090991"], "output": false }, + { "inputs": ["18443282870504090991", "18443282870504090991"], "output": true }, + { "inputs": ["18443282870504090991", "18443282870504090987"], "output": false } ], "eq_uint64_euint64": [ - { "inputs": ["18446106064654681685", "18444839379902899701"], "output": false }, - { "inputs": ["18442470885463520687", "18442470885463520691"], "output": false }, - { "inputs": ["18442470885463520691", "18442470885463520691"], "output": true }, - { "inputs": ["18442470885463520691", "18442470885463520687"], "output": false } + { "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": ["11", "4"], "output": true }, + { "inputs": ["1", "9"], "output": true }, { "inputs": ["4", "8"], "output": true }, { "inputs": ["8", "8"], "output": false }, { "inputs": ["8", "4"], "output": true } ], "ne_euint4_euint8": [ - { "inputs": ["4", "62"], "output": true }, + { "inputs": ["8", "128"], "output": true }, { "inputs": ["4", "8"], "output": true }, { "inputs": ["8", "8"], "output": false }, { "inputs": ["8", "4"], "output": true } ], "ne_euint4_uint8": [ - { "inputs": ["4", "6"], "output": true }, + { "inputs": ["8", "9"], "output": true }, { "inputs": ["4", "8"], "output": true }, { "inputs": ["8", "8"], "output": false }, { "inputs": ["8", "4"], "output": true } ], "ne_euint4_euint16": [ - { "inputs": ["3", "41708"], "output": true }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } - ], - "ne_euint4_euint32": [ - { "inputs": ["14", "1312265251"], "output": true }, + { "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", "18441024342807508949"], "output": true }, + { "inputs": ["7", "18446555094221865045"], "output": true }, { "inputs": ["4", "8"], "output": true }, { "inputs": ["8", "8"], "output": false }, { "inputs": ["8", "4"], "output": true } ], - "ne_euint8_euint4": [ - { "inputs": ["145", "14"], "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": ["3", "14"], "output": true }, - { "inputs": ["10", "14"], "output": true }, - { "inputs": ["14", "14"], "output": false }, - { "inputs": ["14", "10"], "output": true } + { "inputs": ["9", "13"], "output": true }, + { "inputs": ["9", "13"], "output": true }, + { "inputs": ["13", "13"], "output": false }, + { "inputs": ["13", "9"], "output": true } ], "ne_euint8_euint8": [ - { "inputs": ["236", "26"], "output": true }, - { "inputs": ["22", "26"], "output": true }, - { "inputs": ["26", "26"], "output": false }, - { "inputs": ["26", "22"], "output": true } + { "inputs": ["197", "245"], "output": true }, + { "inputs": ["193", "197"], "output": true }, + { "inputs": ["197", "197"], "output": false }, + { "inputs": ["197", "193"], "output": true } ], "ne_euint8_uint8": [ - { "inputs": ["236", "213"], "output": true }, - { "inputs": ["22", "26"], "output": true }, - { "inputs": ["26", "26"], "output": false }, - { "inputs": ["26", "22"], "output": true } + { "inputs": ["197", "40"], "output": true }, + { "inputs": ["193", "197"], "output": true }, + { "inputs": ["197", "197"], "output": false }, + { "inputs": ["197", "193"], "output": true } ], "ne_uint8_euint8": [ - { "inputs": ["66", "213"], "output": true }, - { "inputs": ["22", "26"], "output": true }, - { "inputs": ["26", "26"], "output": false }, - { "inputs": ["26", "22"], "output": true } + { "inputs": ["243", "40"], "output": true }, + { "inputs": ["193", "197"], "output": true }, + { "inputs": ["197", "197"], "output": false }, + { "inputs": ["197", "193"], "output": true } ], "ne_euint8_euint16": [ - { "inputs": ["201", "56595"], "output": true }, - { "inputs": ["197", "201"], "output": true }, - { "inputs": ["201", "201"], "output": false }, - { "inputs": ["201", "197"], "output": true } + { "inputs": ["128", "47128"], "output": true }, + { "inputs": ["124", "128"], "output": true }, + { "inputs": ["128", "128"], "output": false }, + { "inputs": ["128", "124"], "output": true } ], "ne_euint8_euint32": [ - { "inputs": ["189", "472792825"], "output": true }, - { "inputs": ["185", "189"], "output": true }, - { "inputs": ["189", "189"], "output": false }, - { "inputs": ["189", "185"], "output": true } + { "inputs": ["134", "943645708"], "output": true }, + { "inputs": ["130", "134"], "output": true }, + { "inputs": ["134", "134"], "output": false }, + { "inputs": ["134", "130"], "output": true } ], "ne_euint8_euint64": [ - { "inputs": ["174", "18439836363494569405"], "output": true }, - { "inputs": ["170", "174"], "output": true }, - { "inputs": ["174", "174"], "output": false }, - { "inputs": ["174", "170"], "output": true } + { "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": ["24920", "3"], "output": true }, + { "inputs": ["26709", "5"], "output": true }, { "inputs": ["4", "8"], "output": true }, { "inputs": ["8", "8"], "output": false }, { "inputs": ["8", "4"], "output": true } ], "ne_euint16_euint8": [ - { "inputs": ["59614", "149"], "output": true }, - { "inputs": ["145", "149"], "output": true }, - { "inputs": ["149", "149"], "output": false }, - { "inputs": ["149", "145"], "output": true } + { "inputs": ["13794", "3"], "output": true }, + { "inputs": ["4", "8"], "output": true }, + { "inputs": ["8", "8"], "output": false }, + { "inputs": ["8", "4"], "output": true } ], "ne_euint16_euint16": [ - { "inputs": ["27750", "23851"], "output": true }, - { "inputs": ["23847", "23851"], "output": true }, - { "inputs": ["23851", "23851"], "output": false }, - { "inputs": ["23851", "23847"], "output": true } + { "inputs": ["16378", "60161"], "output": true }, + { "inputs": ["16374", "16378"], "output": true }, + { "inputs": ["16378", "16378"], "output": false }, + { "inputs": ["16378", "16374"], "output": true } ], "ne_euint16_uint16": [ - { "inputs": ["27750", "3479"], "output": true }, - { "inputs": ["23847", "23851"], "output": true }, - { "inputs": ["23851", "23851"], "output": false }, - { "inputs": ["23851", "23847"], "output": true } + { "inputs": ["16378", "35706"], "output": true }, + { "inputs": ["16374", "16378"], "output": true }, + { "inputs": ["16378", "16378"], "output": false }, + { "inputs": ["16378", "16374"], "output": true } ], "ne_uint16_euint16": [ - { "inputs": ["20385", "3479"], "output": true }, - { "inputs": ["23847", "23851"], "output": true }, - { "inputs": ["23851", "23851"], "output": false }, - { "inputs": ["23851", "23847"], "output": true } + { "inputs": ["43595", "35706"], "output": true }, + { "inputs": ["16374", "16378"], "output": true }, + { "inputs": ["16378", "16378"], "output": false }, + { "inputs": ["16378", "16374"], "output": true } ], "ne_euint16_euint32": [ - { "inputs": ["4461", "3322499889"], "output": true }, - { "inputs": ["4457", "4461"], "output": true }, - { "inputs": ["4461", "4461"], "output": false }, - { "inputs": ["4461", "4457"], "output": true } + { "inputs": ["30095", "2933999842"], "output": true }, + { "inputs": ["30091", "30095"], "output": true }, + { "inputs": ["30095", "30095"], "output": false }, + { "inputs": ["30095", "30091"], "output": true } ], "ne_euint16_euint64": [ - { "inputs": ["6072", "18442627728041568827"], "output": true }, - { "inputs": ["6068", "6072"], "output": true }, - { "inputs": ["6072", "6072"], "output": false }, - { "inputs": ["6072", "6068"], "output": true } + { "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": ["2599901708", "3"], "output": true }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } + { "inputs": ["2761853602", "13"], "output": true }, + { "inputs": ["9", "13"], "output": true }, + { "inputs": ["13", "13"], "output": false }, + { "inputs": ["13", "9"], "output": true } ], "ne_euint32_euint8": [ - { "inputs": ["3821365412", "152"], "output": true }, - { "inputs": ["148", "152"], "output": true }, - { "inputs": ["152", "152"], "output": false }, - { "inputs": ["152", "148"], "output": true } + { "inputs": ["1535914080", "80"], "output": true }, + { "inputs": ["76", "80"], "output": true }, + { "inputs": ["80", "80"], "output": false }, + { "inputs": ["80", "76"], "output": true } ], "ne_euint32_euint16": [ - { "inputs": ["3302913406", "10832"], "output": true }, - { "inputs": ["10828", "10832"], "output": true }, - { "inputs": ["10832", "10832"], "output": false }, - { "inputs": ["10832", "10828"], "output": true } + { "inputs": ["3735850389", "7960"], "output": true }, + { "inputs": ["7956", "7960"], "output": true }, + { "inputs": ["7960", "7960"], "output": false }, + { "inputs": ["7960", "7956"], "output": true } ], "ne_euint32_euint32": [ - { "inputs": ["221510600", "3939036059"], "output": true }, - { "inputs": ["221510596", "221510600"], "output": true }, - { "inputs": ["221510600", "221510600"], "output": false }, - { "inputs": ["221510600", "221510596"], "output": true } + { "inputs": ["440396727", "1222940316"], "output": true }, + { "inputs": ["440396723", "440396727"], "output": true }, + { "inputs": ["440396727", "440396727"], "output": false }, + { "inputs": ["440396727", "440396723"], "output": true } ], "ne_euint32_uint32": [ - { "inputs": ["221510600", "454323706"], "output": true }, - { "inputs": ["221510596", "221510600"], "output": true }, - { "inputs": ["221510600", "221510600"], "output": false }, - { "inputs": ["221510600", "221510596"], "output": true } + { "inputs": ["440396727", "826320072"], "output": true }, + { "inputs": ["440396723", "440396727"], "output": true }, + { "inputs": ["440396727", "440396727"], "output": false }, + { "inputs": ["440396727", "440396723"], "output": true } ], "ne_uint32_euint32": [ - { "inputs": ["2107136281", "454323706"], "output": true }, - { "inputs": ["221510596", "221510600"], "output": true }, - { "inputs": ["221510600", "221510600"], "output": false }, - { "inputs": ["221510600", "221510596"], "output": true } + { "inputs": ["3496297299", "826320072"], "output": true }, + { "inputs": ["440396723", "440396727"], "output": true }, + { "inputs": ["440396727", "440396727"], "output": false }, + { "inputs": ["440396727", "440396723"], "output": true } ], "ne_euint32_euint64": [ - { "inputs": ["897008808", "18446223426742336677"], "output": true }, - { "inputs": ["897008804", "897008808"], "output": true }, - { "inputs": ["897008808", "897008808"], "output": false }, - { "inputs": ["897008808", "897008804"], "output": true } + { "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": ["18446041636272307563", "8"], "output": true }, + { "inputs": ["18443746789087798257", "2"], "output": true }, { "inputs": ["4", "8"], "output": true }, { "inputs": ["8", "8"], "output": false }, { "inputs": ["8", "4"], "output": true } ], "ne_euint64_euint8": [ - { "inputs": ["18445474251392791649", "41"], "output": true }, - { "inputs": ["37", "41"], "output": true }, - { "inputs": ["41", "41"], "output": false }, - { "inputs": ["41", "37"], "output": true } + { "inputs": ["18443274666908974803", "120"], "output": true }, + { "inputs": ["116", "120"], "output": true }, + { "inputs": ["120", "120"], "output": false }, + { "inputs": ["120", "116"], "output": true } ], "ne_euint64_euint16": [ - { "inputs": ["18440863971063577997", "29590"], "output": true }, - { "inputs": ["29586", "29590"], "output": true }, - { "inputs": ["29590", "29590"], "output": false }, - { "inputs": ["29590", "29586"], "output": true } + { "inputs": ["18446683880931020495", "9122"], "output": true }, + { "inputs": ["9118", "9122"], "output": true }, + { "inputs": ["9122", "9122"], "output": false }, + { "inputs": ["9122", "9118"], "output": true } ], "ne_euint64_euint32": [ - { "inputs": ["18446476368209552349", "3024704127"], "output": true }, - { "inputs": ["3024704123", "3024704127"], "output": true }, - { "inputs": ["3024704127", "3024704127"], "output": false }, - { "inputs": ["3024704127", "3024704123"], "output": true } + { "inputs": ["18443424543399945811", "2475089443"], "output": true }, + { "inputs": ["2475089439", "2475089443"], "output": true }, + { "inputs": ["2475089443", "2475089443"], "output": false }, + { "inputs": ["2475089443", "2475089439"], "output": true } ], "ne_euint64_euint64": [ - { "inputs": ["18442343533763371027", "18438477816592523453"], "output": true }, - { "inputs": ["18438477816592523449", "18438477816592523453"], "output": true }, - { "inputs": ["18438477816592523453", "18438477816592523453"], "output": false }, - { "inputs": ["18438477816592523453", "18438477816592523449"], "output": true } + { "inputs": ["18445289136242885897", "18441860560804132295"], "output": true }, + { "inputs": ["18441860560804132291", "18441860560804132295"], "output": true }, + { "inputs": ["18441860560804132295", "18441860560804132295"], "output": false }, + { "inputs": ["18441860560804132295", "18441860560804132291"], "output": true } ], "ne_euint64_uint64": [ - { "inputs": ["18442343533763371027", "18445982647402256701"], "output": true }, - { "inputs": ["18438477816592523449", "18438477816592523453"], "output": true }, - { "inputs": ["18438477816592523453", "18438477816592523453"], "output": false }, - { "inputs": ["18438477816592523453", "18438477816592523449"], "output": true } + { "inputs": ["18445289136242885897", "18440743017590143725"], "output": true }, + { "inputs": ["18441860560804132291", "18441860560804132295"], "output": true }, + { "inputs": ["18441860560804132295", "18441860560804132295"], "output": false }, + { "inputs": ["18441860560804132295", "18441860560804132291"], "output": true } ], "ne_uint64_euint64": [ - { "inputs": ["18440875682349733785", "18445982647402256701"], "output": true }, - { "inputs": ["18438477816592523449", "18438477816592523453"], "output": true }, - { "inputs": ["18438477816592523453", "18438477816592523453"], "output": false }, - { "inputs": ["18438477816592523453", "18438477816592523449"], "output": true } + { "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": ["4", "1"], "output": "8" }, + { "inputs": ["1", "2"], "output": "4" }, { "inputs": ["4", "8"], "output": "4" }, { "inputs": ["8", "8"], "output": "8" }, { "inputs": ["8", "4"], "output": "8" } ], "shl_euint8_euint8": [ - { "inputs": ["201", "7"], "output": "128" }, + { "inputs": ["44", "4"], "output": "192" }, { "inputs": ["4", "8"], "output": "4" }, { "inputs": ["8", "8"], "output": "8" }, { "inputs": ["8", "4"], "output": "128" } ], "shl_euint8_uint8": [ - { "inputs": ["201", "7"], "output": "128" }, + { "inputs": ["44", "4"], "output": "192" }, { "inputs": ["4", "8"], "output": "4" }, { "inputs": ["8", "8"], "output": "8" }, { "inputs": ["8", "4"], "output": "128" } ], "shl_euint16_euint8": [ - { "inputs": ["43733", "1"], "output": "21930" }, + { "inputs": ["10029", "5"], "output": "58784" }, { "inputs": ["4", "8"], "output": "1024" }, { "inputs": ["8", "8"], "output": "2048" }, { "inputs": ["8", "4"], "output": "128" } ], "shl_euint16_uint8": [ - { "inputs": ["43733", "1"], "output": "21930" }, + { "inputs": ["10029", "5"], "output": "58784" }, { "inputs": ["4", "8"], "output": "1024" }, { "inputs": ["8", "8"], "output": "2048" }, { "inputs": ["8", "4"], "output": "128" } ], "shl_euint32_euint8": [ - { "inputs": ["1317463952", "4"], "output": "3899554048" }, + { "inputs": ["3189891720", "4"], "output": "3793627264" }, { "inputs": ["4", "8"], "output": "1024" }, { "inputs": ["8", "8"], "output": "2048" }, { "inputs": ["8", "4"], "output": "128" } ], "shl_euint32_uint8": [ - { "inputs": ["1317463952", "4"], "output": "3899554048" }, + { "inputs": ["3189891720", "4"], "output": "3793627264" }, { "inputs": ["4", "8"], "output": "1024" }, { "inputs": ["8", "8"], "output": "2048" }, { "inputs": ["8", "4"], "output": "128" } ], "shl_euint64_euint8": [ - { "inputs": ["18445637206389853441", "6"], "output": "18375904565248868416" }, + { "inputs": ["18438852048643145403", "6"], "output": "17941654469459553984" }, { "inputs": ["4", "8"], "output": "1024" }, { "inputs": ["8", "8"], "output": "2048" }, { "inputs": ["8", "4"], "output": "128" } ], "shl_euint64_uint8": [ - { "inputs": ["18445637206389853441", "6"], "output": "18375904565248868416" }, + { "inputs": ["18438852048643145403", "6"], "output": "17941654469459553984" }, { "inputs": ["4", "8"], "output": "1024" }, { "inputs": ["8", "8"], "output": "2048" }, { "inputs": ["8", "4"], "output": "128" } ], - "shr_euint4_uint8": [ - { "inputs": ["7", "7"], "output": "0" }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "8" } + "shl_euint128_euint8": [ + { "inputs": ["340282366920938463463366293596486217477", "5"], "output": "340282366920938463463108564702744404128" }, + { "inputs": ["4", "8"], "output": "1024" }, + { "inputs": ["8", "8"], "output": "2048" }, + { "inputs": ["8", "4"], "output": "128" } ], - "shr_euint8_euint8": [ - { "inputs": ["15", "4"], "output": "0" }, - { "inputs": ["4", "8"], "output": "4" }, + "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": ["15", "4"], "output": "0" }, + { "inputs": ["160", "3"], "output": "20" }, { "inputs": ["4", "8"], "output": "4" }, { "inputs": ["8", "8"], "output": "8" }, { "inputs": ["8", "4"], "output": "0" } ], "shr_euint16_euint8": [ - { "inputs": ["55114", "1"], "output": "27557" }, + { "inputs": ["63034", "6"], "output": "984" }, { "inputs": ["4", "8"], "output": "0" }, { "inputs": ["8", "8"], "output": "0" }, { "inputs": ["8", "4"], "output": "0" } ], "shr_euint16_uint8": [ - { "inputs": ["55114", "1"], "output": "27557" }, + { "inputs": ["63034", "6"], "output": "984" }, { "inputs": ["4", "8"], "output": "0" }, { "inputs": ["8", "8"], "output": "0" }, { "inputs": ["8", "4"], "output": "0" } ], "shr_euint32_euint8": [ - { "inputs": ["3048369776", "1"], "output": "1524184888" }, + { "inputs": ["1720949149", "4"], "output": "107559321" }, { "inputs": ["4", "8"], "output": "0" }, { "inputs": ["8", "8"], "output": "0" }, { "inputs": ["8", "4"], "output": "0" } ], "shr_euint32_uint8": [ - { "inputs": ["3048369776", "1"], "output": "1524184888" }, + { "inputs": ["1720949149", "4"], "output": "107559321" }, { "inputs": ["4", "8"], "output": "0" }, { "inputs": ["8", "8"], "output": "0" }, { "inputs": ["8", "4"], "output": "0" } ], "shr_euint64_euint8": [ - { "inputs": ["18438869893773583255", "5"], "output": "576214684180424476" }, + { "inputs": ["18444486134915793097", "6"], "output": "288195095858059267" }, { "inputs": ["4", "8"], "output": "0" }, { "inputs": ["8", "8"], "output": "0" }, { "inputs": ["8", "4"], "output": "0" } ], "shr_euint64_uint8": [ - { "inputs": ["18438869893773583255", "5"], "output": "576214684180424476" }, + { "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": ["14", "7"], "output": "7" }, + { "inputs": ["1", "2"], "output": "4" }, { "inputs": ["4", "8"], "output": "4" }, { "inputs": ["8", "8"], "output": "8" }, { "inputs": ["8", "4"], "output": "8" } ], "rotl_euint8_euint8": [ - { "inputs": ["52", "1"], "output": "104" }, + { "inputs": ["150", "4"], "output": "105" }, { "inputs": ["4", "8"], "output": "4" }, { "inputs": ["8", "8"], "output": "8" }, { "inputs": ["8", "4"], "output": "128" } ], "rotl_euint8_uint8": [ - { "inputs": ["52", "1"], "output": "104" }, + { "inputs": ["150", "4"], "output": "105" }, { "inputs": ["4", "8"], "output": "4" }, { "inputs": ["8", "8"], "output": "8" }, { "inputs": ["8", "4"], "output": "128" } ], "rotl_euint16_euint8": [ - { "inputs": ["12143", "3"], "output": "31609" }, + { "inputs": ["34007", "4"], "output": "19832" }, { "inputs": ["4", "8"], "output": "1024" }, { "inputs": ["8", "8"], "output": "2048" }, { "inputs": ["8", "4"], "output": "128" } ], "rotl_euint16_uint8": [ - { "inputs": ["12143", "3"], "output": "31609" }, + { "inputs": ["34007", "4"], "output": "19832" }, { "inputs": ["4", "8"], "output": "1024" }, { "inputs": ["8", "8"], "output": "2048" }, { "inputs": ["8", "4"], "output": "128" } ], "rotl_euint32_euint8": [ - { "inputs": ["2219902125", "2"], "output": "289673910" }, + { "inputs": ["10430463", "3"], "output": "83443704" }, { "inputs": ["4", "8"], "output": "1024" }, { "inputs": ["8", "8"], "output": "2048" }, { "inputs": ["8", "4"], "output": "128" } ], "rotl_euint32_uint8": [ - { "inputs": ["2219902125", "2"], "output": "289673910" }, + { "inputs": ["10430463", "3"], "output": "83443704" }, { "inputs": ["4", "8"], "output": "1024" }, { "inputs": ["8", "8"], "output": "2048" }, { "inputs": ["8", "4"], "output": "128" } ], "rotl_euint64_euint8": [ - { "inputs": ["18442278686771288481", "1"], "output": "18437813299833025347" }, + { "inputs": ["18440494415218168649", "7"], "output": "17646787786812531967" }, { "inputs": ["4", "8"], "output": "1024" }, { "inputs": ["8", "8"], "output": "2048" }, { "inputs": ["8", "4"], "output": "128" } ], "rotl_euint64_uint8": [ - { "inputs": ["18442278686771288481", "1"], "output": "18437813299833025347" }, + { "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", "7"], "output": "13" }, + { "inputs": ["14", "1"], "output": "7" }, { "inputs": ["4", "8"], "output": "4" }, { "inputs": ["8", "8"], "output": "8" }, { "inputs": ["8", "4"], "output": "8" } ], "rotr_euint8_euint8": [ - { "inputs": ["50", "4"], "output": "35" }, + { "inputs": ["52", "6"], "output": "208" }, { "inputs": ["4", "8"], "output": "4" }, { "inputs": ["8", "8"], "output": "8" }, { "inputs": ["8", "4"], "output": "128" } ], "rotr_euint8_uint8": [ - { "inputs": ["50", "4"], "output": "35" }, + { "inputs": ["52", "6"], "output": "208" }, { "inputs": ["4", "8"], "output": "4" }, { "inputs": ["8", "8"], "output": "8" }, { "inputs": ["8", "4"], "output": "128" } ], "rotr_euint16_euint8": [ - { "inputs": ["63583", "1"], "output": "64559" }, + { "inputs": ["32201", "3"], "output": "12217" }, { "inputs": ["4", "8"], "output": "1024" }, { "inputs": ["8", "8"], "output": "2048" }, { "inputs": ["8", "4"], "output": "32768" } ], "rotr_euint16_uint8": [ - { "inputs": ["63583", "1"], "output": "64559" }, + { "inputs": ["32201", "3"], "output": "12217" }, { "inputs": ["4", "8"], "output": "1024" }, { "inputs": ["8", "8"], "output": "2048" }, { "inputs": ["8", "4"], "output": "32768" } ], "rotr_euint32_euint8": [ - { "inputs": ["4127207673", "5"], "output": "3484418439" }, + { "inputs": ["3489309750", "7"], "output": "1839199560" }, { "inputs": ["4", "8"], "output": "67108864" }, { "inputs": ["8", "8"], "output": "134217728" }, { "inputs": ["8", "4"], "output": "2147483648" } ], "rotr_euint32_uint8": [ - { "inputs": ["4127207673", "5"], "output": "3484418439" }, + { "inputs": ["3489309750", "7"], "output": "1839199560" }, { "inputs": ["4", "8"], "output": "67108864" }, { "inputs": ["8", "8"], "output": "134217728" }, { "inputs": ["8", "4"], "output": "2147483648" } ], "rotr_euint64_euint8": [ - { "inputs": ["18441051342909802901", "3"], "output": "13834346463932195122" }, + { "inputs": ["18444475066789617897", "3"], "output": "4611402392562396189" }, { "inputs": ["4", "8"], "output": "288230376151711744" }, { "inputs": ["8", "8"], "output": "576460752303423488" }, { "inputs": ["8", "4"], "output": "9223372036854775808" } ], "rotr_euint64_uint8": [ - { "inputs": ["18441051342909802901", "3"], "output": "13834346463932195122" }, + { "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": ["3", "1"], "output": "3" }, - { "inputs": ["4", "8"], "output": "8" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "8" } + { "inputs": ["9", "13"], "output": "13" }, + { "inputs": ["5", "9"], "output": "9" }, + { "inputs": ["9", "9"], "output": "9" }, + { "inputs": ["9", "5"], "output": "9" } ], "max_euint4_euint8": [ - { "inputs": ["1", "157"], "output": "157" }, - { "inputs": ["4", "8"], "output": "8" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "8" } + { "inputs": ["14", "226"], "output": "226" }, + { "inputs": ["10", "14"], "output": "14" }, + { "inputs": ["14", "14"], "output": "14" }, + { "inputs": ["14", "10"], "output": "14" } ], "max_euint4_uint8": [ - { "inputs": ["1", "2"], "output": "2" }, - { "inputs": ["4", "8"], "output": "8" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "8" } + { "inputs": ["14", "7"], "output": "14" }, + { "inputs": ["10", "14"], "output": "14" }, + { "inputs": ["14", "14"], "output": "14" }, + { "inputs": ["14", "10"], "output": "14" } ], "max_euint4_euint16": [ - { "inputs": ["6", "62382"], "output": "62382" }, - { "inputs": ["4", "8"], "output": "8" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "8" } + { "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", "3887686486"], "output": "3887686486" }, + { "inputs": ["12", "623453237"], "output": "623453237" }, { "inputs": ["8", "12"], "output": "12" }, { "inputs": ["12", "12"], "output": "12" }, { "inputs": ["12", "8"], "output": "12" } ], "max_euint4_euint64": [ - { "inputs": ["5", "18446478225770660877"], "output": "18446478225770660877" }, + { "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": ["41", "11"], "output": "41" }, - { "inputs": ["7", "11"], "output": "11" }, - { "inputs": ["11", "11"], "output": "11" }, - { "inputs": ["11", "7"], "output": "11" } + { "inputs": ["62", "13"], "output": "62" }, + { "inputs": ["9", "13"], "output": "13" }, + { "inputs": ["13", "13"], "output": "13" }, + { "inputs": ["13", "9"], "output": "13" } ], "max_uint8_euint4": [ - { "inputs": ["10", "11"], "output": "11" }, - { "inputs": ["7", "11"], "output": "11" }, - { "inputs": ["11", "11"], "output": "11" }, - { "inputs": ["11", "7"], "output": "11" } + { "inputs": ["14", "13"], "output": "14" }, + { "inputs": ["9", "13"], "output": "13" }, + { "inputs": ["13", "13"], "output": "13" }, + { "inputs": ["13", "9"], "output": "13" } ], "max_euint8_euint8": [ - { "inputs": ["227", "29"], "output": "227" }, - { "inputs": ["25", "29"], "output": "29" }, - { "inputs": ["29", "29"], "output": "29" }, - { "inputs": ["29", "25"], "output": "29" } + { "inputs": ["17", "182"], "output": "182" }, + { "inputs": ["13", "17"], "output": "17" }, + { "inputs": ["17", "17"], "output": "17" }, + { "inputs": ["17", "13"], "output": "17" } ], "max_euint8_uint8": [ - { "inputs": ["227", "27"], "output": "227" }, - { "inputs": ["25", "29"], "output": "29" }, - { "inputs": ["29", "29"], "output": "29" }, - { "inputs": ["29", "25"], "output": "29" } + { "inputs": ["17", "83"], "output": "83" }, + { "inputs": ["13", "17"], "output": "17" }, + { "inputs": ["17", "17"], "output": "17" }, + { "inputs": ["17", "13"], "output": "17" } ], "max_uint8_euint8": [ - { "inputs": ["174", "27"], "output": "174" }, - { "inputs": ["25", "29"], "output": "29" }, - { "inputs": ["29", "29"], "output": "29" }, - { "inputs": ["29", "25"], "output": "29" } + { "inputs": ["46", "83"], "output": "83" }, + { "inputs": ["13", "17"], "output": "17" }, + { "inputs": ["17", "17"], "output": "17" }, + { "inputs": ["17", "13"], "output": "17" } ], "max_euint8_euint16": [ - { "inputs": ["76", "60931"], "output": "60931" }, - { "inputs": ["72", "76"], "output": "76" }, - { "inputs": ["76", "76"], "output": "76" }, - { "inputs": ["76", "72"], "output": "76" } + { "inputs": ["252", "21942"], "output": "21942" }, + { "inputs": ["248", "252"], "output": "252" }, + { "inputs": ["252", "252"], "output": "252" }, + { "inputs": ["252", "248"], "output": "252" } ], "max_euint8_euint32": [ - { "inputs": ["103", "990460263"], "output": "990460263" }, - { "inputs": ["99", "103"], "output": "103" }, - { "inputs": ["103", "103"], "output": "103" }, - { "inputs": ["103", "99"], "output": "103" } + { "inputs": ["31", "3976371021"], "output": "3976371021" }, + { "inputs": ["27", "31"], "output": "31" }, + { "inputs": ["31", "31"], "output": "31" }, + { "inputs": ["31", "27"], "output": "31" } ], "max_euint8_euint64": [ - { "inputs": ["180", "18445785341899355785"], "output": "18445785341899355785" }, - { "inputs": ["176", "180"], "output": "180" }, - { "inputs": ["180", "180"], "output": "180" }, - { "inputs": ["180", "176"], "output": "180" } + { "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": ["58569", "10"], "output": "58569" }, - { "inputs": ["6", "10"], "output": "10" }, - { "inputs": ["10", "10"], "output": "10" }, - { "inputs": ["10", "6"], "output": "10" } + { "inputs": ["22967", "8"], "output": "22967" }, + { "inputs": ["4", "8"], "output": "8" }, + { "inputs": ["8", "8"], "output": "8" }, + { "inputs": ["8", "4"], "output": "8" } ], "max_euint16_euint8": [ - { "inputs": ["46663", "31"], "output": "46663" }, - { "inputs": ["27", "31"], "output": "31" }, - { "inputs": ["31", "31"], "output": "31" }, - { "inputs": ["31", "27"], "output": "31" } + { "inputs": ["22246", "39"], "output": "22246" }, + { "inputs": ["35", "39"], "output": "39" }, + { "inputs": ["39", "39"], "output": "39" }, + { "inputs": ["39", "35"], "output": "39" } ], "max_euint16_euint16": [ - { "inputs": ["35722", "7688"], "output": "35722" }, - { "inputs": ["7684", "7688"], "output": "7688" }, - { "inputs": ["7688", "7688"], "output": "7688" }, - { "inputs": ["7688", "7684"], "output": "7688" } + { "inputs": ["37775", "22432"], "output": "37775" }, + { "inputs": ["22428", "22432"], "output": "22432" }, + { "inputs": ["22432", "22432"], "output": "22432" }, + { "inputs": ["22432", "22428"], "output": "22432" } ], "max_euint16_uint16": [ - { "inputs": ["35722", "5145"], "output": "35722" }, - { "inputs": ["7684", "7688"], "output": "7688" }, - { "inputs": ["7688", "7688"], "output": "7688" }, - { "inputs": ["7688", "7684"], "output": "7688" } + { "inputs": ["37775", "25405"], "output": "37775" }, + { "inputs": ["22428", "22432"], "output": "22432" }, + { "inputs": ["22432", "22432"], "output": "22432" }, + { "inputs": ["22432", "22428"], "output": "22432" } ], "max_uint16_euint16": [ - { "inputs": ["56359", "5145"], "output": "56359" }, - { "inputs": ["7684", "7688"], "output": "7688" }, - { "inputs": ["7688", "7688"], "output": "7688" }, - { "inputs": ["7688", "7684"], "output": "7688" } + { "inputs": ["1122", "25405"], "output": "25405" }, + { "inputs": ["22428", "22432"], "output": "22432" }, + { "inputs": ["22432", "22432"], "output": "22432" }, + { "inputs": ["22432", "22428"], "output": "22432" } ], "max_euint16_euint32": [ - { "inputs": ["34046", "3126513605"], "output": "3126513605" }, - { "inputs": ["34042", "34046"], "output": "34046" }, - { "inputs": ["34046", "34046"], "output": "34046" }, - { "inputs": ["34046", "34042"], "output": "34046" } + { "inputs": ["6434", "2918687585"], "output": "2918687585" }, + { "inputs": ["6430", "6434"], "output": "6434" }, + { "inputs": ["6434", "6434"], "output": "6434" }, + { "inputs": ["6434", "6430"], "output": "6434" } ], "max_euint16_euint64": [ - { "inputs": ["28367", "18440532375906129937"], "output": "18440532375906129937" }, - { "inputs": ["28363", "28367"], "output": "28367" }, - { "inputs": ["28367", "28367"], "output": "28367" }, - { "inputs": ["28367", "28363"], "output": "28367" } + { "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": ["1272584917", "14"], "output": "1272584917" }, - { "inputs": ["10", "14"], "output": "14" }, - { "inputs": ["14", "14"], "output": "14" }, - { "inputs": ["14", "10"], "output": "14" } + { "inputs": ["1089745104", "2"], "output": "1089745104" }, + { "inputs": ["4", "8"], "output": "8" }, + { "inputs": ["8", "8"], "output": "8" }, + { "inputs": ["8", "4"], "output": "8" } ], "max_euint32_euint8": [ - { "inputs": ["2001471362", "68"], "output": "2001471362" }, - { "inputs": ["64", "68"], "output": "68" }, - { "inputs": ["68", "68"], "output": "68" }, - { "inputs": ["68", "64"], "output": "68" } + { "inputs": ["2231185000", "65"], "output": "2231185000" }, + { "inputs": ["61", "65"], "output": "65" }, + { "inputs": ["65", "65"], "output": "65" }, + { "inputs": ["65", "61"], "output": "65" } ], "max_euint32_euint16": [ - { "inputs": ["4156714889", "5440"], "output": "4156714889" }, - { "inputs": ["5436", "5440"], "output": "5440" }, - { "inputs": ["5440", "5440"], "output": "5440" }, - { "inputs": ["5440", "5436"], "output": "5440" } + { "inputs": ["1606859063", "42684"], "output": "1606859063" }, + { "inputs": ["42680", "42684"], "output": "42684" }, + { "inputs": ["42684", "42684"], "output": "42684" }, + { "inputs": ["42684", "42680"], "output": "42684" } ], "max_euint32_euint32": [ - { "inputs": ["3535438432", "2851290845"], "output": "3535438432" }, - { "inputs": ["2851290841", "2851290845"], "output": "2851290845" }, - { "inputs": ["2851290845", "2851290845"], "output": "2851290845" }, - { "inputs": ["2851290845", "2851290841"], "output": "2851290845" } + { "inputs": ["1310408559", "1943659319"], "output": "1943659319" }, + { "inputs": ["1310408555", "1310408559"], "output": "1310408559" }, + { "inputs": ["1310408559", "1310408559"], "output": "1310408559" }, + { "inputs": ["1310408559", "1310408555"], "output": "1310408559" } ], "max_euint32_uint32": [ - { "inputs": ["3535438432", "1480992326"], "output": "3535438432" }, - { "inputs": ["2851290841", "2851290845"], "output": "2851290845" }, - { "inputs": ["2851290845", "2851290845"], "output": "2851290845" }, - { "inputs": ["2851290845", "2851290841"], "output": "2851290845" } + { "inputs": ["1310408559", "1676413628"], "output": "1676413628" }, + { "inputs": ["1310408555", "1310408559"], "output": "1310408559" }, + { "inputs": ["1310408559", "1310408559"], "output": "1310408559" }, + { "inputs": ["1310408559", "1310408555"], "output": "1310408559" } ], "max_uint32_euint32": [ - { "inputs": ["760733114", "1480992326"], "output": "1480992326" }, - { "inputs": ["2851290841", "2851290845"], "output": "2851290845" }, - { "inputs": ["2851290845", "2851290845"], "output": "2851290845" }, - { "inputs": ["2851290845", "2851290841"], "output": "2851290845" } + { "inputs": ["870136392", "1676413628"], "output": "1676413628" }, + { "inputs": ["1310408555", "1310408559"], "output": "1310408559" }, + { "inputs": ["1310408559", "1310408559"], "output": "1310408559" }, + { "inputs": ["1310408559", "1310408555"], "output": "1310408559" } ], "max_euint32_euint64": [ - { "inputs": ["821915788", "18441217303884363213"], "output": "18441217303884363213" }, - { "inputs": ["821915784", "821915788"], "output": "821915788" }, - { "inputs": ["821915788", "821915788"], "output": "821915788" }, - { "inputs": ["821915788", "821915784"], "output": "821915788" } + { "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": ["18445668950732298129", "5"], "output": "18445668950732298129" }, - { "inputs": ["4", "8"], "output": "8" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "8" } + { "inputs": ["18446600326518934469", "12"], "output": "18446600326518934469" }, + { "inputs": ["8", "12"], "output": "12" }, + { "inputs": ["12", "12"], "output": "12" }, + { "inputs": ["12", "8"], "output": "12" } ], "max_euint64_euint8": [ - { "inputs": ["18446007384031513667", "44"], "output": "18446007384031513667" }, - { "inputs": ["40", "44"], "output": "44" }, - { "inputs": ["44", "44"], "output": "44" }, - { "inputs": ["44", "40"], "output": "44" } + { "inputs": ["18437818308322976495", "86"], "output": "18437818308322976495" }, + { "inputs": ["82", "86"], "output": "86" }, + { "inputs": ["86", "86"], "output": "86" }, + { "inputs": ["86", "82"], "output": "86" } ], "max_euint64_euint16": [ - { "inputs": ["18444284510736997839", "51628"], "output": "18444284510736997839" }, - { "inputs": ["51624", "51628"], "output": "51628" }, - { "inputs": ["51628", "51628"], "output": "51628" }, - { "inputs": ["51628", "51624"], "output": "51628" } + { "inputs": ["18446109140882718991", "19434"], "output": "18446109140882718991" }, + { "inputs": ["19430", "19434"], "output": "19434" }, + { "inputs": ["19434", "19434"], "output": "19434" }, + { "inputs": ["19434", "19430"], "output": "19434" } ], "max_euint64_euint32": [ - { "inputs": ["18445662984886583599", "303914102"], "output": "18445662984886583599" }, - { "inputs": ["303914098", "303914102"], "output": "303914102" }, - { "inputs": ["303914102", "303914102"], "output": "303914102" }, - { "inputs": ["303914102", "303914098"], "output": "303914102" } + { "inputs": ["18438142521959169981", "4265760124"], "output": "18438142521959169981" }, + { "inputs": ["4265760120", "4265760124"], "output": "4265760124" }, + { "inputs": ["4265760124", "4265760124"], "output": "4265760124" }, + { "inputs": ["4265760124", "4265760120"], "output": "4265760124" } ], "max_euint64_euint64": [ - { "inputs": ["18438631683554897479", "18438807769877774597"], "output": "18438807769877774597" }, - { "inputs": ["18438631683554897475", "18438631683554897479"], "output": "18438631683554897479" }, - { "inputs": ["18438631683554897479", "18438631683554897479"], "output": "18438631683554897479" }, - { "inputs": ["18438631683554897479", "18438631683554897475"], "output": "18438631683554897479" } + { "inputs": ["18445852065991763771", "18440937538047974893"], "output": "18445852065991763771" }, + { "inputs": ["18440937538047974889", "18440937538047974893"], "output": "18440937538047974893" }, + { "inputs": ["18440937538047974893", "18440937538047974893"], "output": "18440937538047974893" }, + { "inputs": ["18440937538047974893", "18440937538047974889"], "output": "18440937538047974893" } ], "max_euint64_uint64": [ - { "inputs": ["18438631683554897479", "18445384533883180417"], "output": "18445384533883180417" }, - { "inputs": ["18438631683554897475", "18438631683554897479"], "output": "18438631683554897479" }, - { "inputs": ["18438631683554897479", "18438631683554897479"], "output": "18438631683554897479" }, - { "inputs": ["18438631683554897479", "18438631683554897475"], "output": "18438631683554897479" } + { "inputs": ["18445852065991763771", "18440623444591001569"], "output": "18445852065991763771" }, + { "inputs": ["18440937538047974889", "18440937538047974893"], "output": "18440937538047974893" }, + { "inputs": ["18440937538047974893", "18440937538047974893"], "output": "18440937538047974893" }, + { "inputs": ["18440937538047974893", "18440937538047974889"], "output": "18440937538047974893" } ], "max_uint64_euint64": [ - { "inputs": ["18440833161069655121", "18445384533883180417"], "output": "18445384533883180417" }, - { "inputs": ["18438631683554897475", "18438631683554897479"], "output": "18438631683554897479" }, - { "inputs": ["18438631683554897479", "18438631683554897479"], "output": "18438631683554897479" }, - { "inputs": ["18438631683554897479", "18438631683554897475"], "output": "18438631683554897479" } + { "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" } ], - "min_euint4_euint4": [ - { "inputs": ["7", "10"], "output": "7" }, - { "inputs": ["4", "8"], "output": "4" }, + "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": "4" } + { "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" } ], "min_euint4_euint8": [ - { "inputs": ["8", "124"], "output": "8" }, + { "inputs": ["5", "254"], "output": "5" }, { "inputs": ["4", "8"], "output": "4" }, { "inputs": ["8", "8"], "output": "8" }, { "inputs": ["8", "4"], "output": "4" } ], "min_euint4_uint8": [ - { "inputs": ["8", "7"], "output": "7" }, + { "inputs": ["5", "5"], "output": "5" }, { "inputs": ["4", "8"], "output": "4" }, { "inputs": ["8", "8"], "output": "8" }, { "inputs": ["8", "4"], "output": "4" } ], "min_euint4_euint16": [ - { "inputs": ["12", "47994"], "output": "12" }, - { "inputs": ["8", "12"], "output": "8" }, - { "inputs": ["12", "12"], "output": "12" }, - { "inputs": ["12", "8"], "output": "8" } + { "inputs": ["1", "50108"], "output": "1" }, + { "inputs": ["4", "8"], "output": "4" }, + { "inputs": ["8", "8"], "output": "8" }, + { "inputs": ["8", "4"], "output": "4" } ], "min_euint4_euint32": [ - { "inputs": ["10", "421626494"], "output": "10" }, - { "inputs": ["6", "10"], "output": "6" }, - { "inputs": ["10", "10"], "output": "10" }, - { "inputs": ["10", "6"], "output": "6" } + { "inputs": ["9", "2831156674"], "output": "9" }, + { "inputs": ["5", "9"], "output": "5" }, + { "inputs": ["9", "9"], "output": "9" }, + { "inputs": ["9", "5"], "output": "5" } ], "min_euint4_euint64": [ - { "inputs": ["12", "18438956406288597713"], "output": "12" }, + { "inputs": ["12", "18440035039683442233"], "output": "12" }, { "inputs": ["8", "12"], "output": "8" }, { "inputs": ["12", "12"], "output": "12" }, { "inputs": ["12", "8"], "output": "8" } ], - "min_euint8_euint4": [ - { "inputs": ["55", "3"], "output": "3" }, + "min_euint4_euint128": [ + { "inputs": ["14", "340282366920938463463373484167219835469"], "output": "14" }, + { "inputs": ["10", "14"], "output": "10" }, + { "inputs": ["14", "14"], "output": "14" }, + { "inputs": ["14", "10"], "output": "10" } + ], + "min_euint4_euint256": [ + { + "inputs": ["1", "115792089237316195423570985008687907853269984665640564039457580584483222103041"], + "output": "1" + }, { "inputs": ["4", "8"], "output": "4" }, { "inputs": ["8", "8"], "output": "8" }, { "inputs": ["8", "4"], "output": "4" } ], + "min_euint8_euint4": [ + { "inputs": ["51", "11"], "output": "11" }, + { "inputs": ["7", "11"], "output": "7" }, + { "inputs": ["11", "11"], "output": "11" }, + { "inputs": ["11", "7"], "output": "7" } + ], "min_uint8_euint4": [ - { "inputs": ["5", "3"], "output": "3" }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "4" } + { "inputs": ["5", "11"], "output": "5" }, + { "inputs": ["7", "11"], "output": "7" }, + { "inputs": ["11", "11"], "output": "11" }, + { "inputs": ["11", "7"], "output": "7" } ], "min_euint8_euint8": [ - { "inputs": ["254", "73"], "output": "73" }, - { "inputs": ["69", "73"], "output": "69" }, - { "inputs": ["73", "73"], "output": "73" }, - { "inputs": ["73", "69"], "output": "69" } + { "inputs": ["183", "84"], "output": "84" }, + { "inputs": ["80", "84"], "output": "80" }, + { "inputs": ["84", "84"], "output": "84" }, + { "inputs": ["84", "80"], "output": "80" } ], "min_euint8_uint8": [ - { "inputs": ["254", "134"], "output": "134" }, - { "inputs": ["69", "73"], "output": "69" }, - { "inputs": ["73", "73"], "output": "73" }, - { "inputs": ["73", "69"], "output": "69" } + { "inputs": ["183", "152"], "output": "152" }, + { "inputs": ["80", "84"], "output": "80" }, + { "inputs": ["84", "84"], "output": "84" }, + { "inputs": ["84", "80"], "output": "80" } ], "min_uint8_euint8": [ - { "inputs": ["48", "134"], "output": "48" }, - { "inputs": ["69", "73"], "output": "69" }, - { "inputs": ["73", "73"], "output": "73" }, - { "inputs": ["73", "69"], "output": "69" } + { "inputs": ["22", "152"], "output": "22" }, + { "inputs": ["80", "84"], "output": "80" }, + { "inputs": ["84", "84"], "output": "84" }, + { "inputs": ["84", "80"], "output": "80" } ], "min_euint8_euint16": [ - { "inputs": ["59", "17033"], "output": "59" }, - { "inputs": ["55", "59"], "output": "55" }, - { "inputs": ["59", "59"], "output": "59" }, - { "inputs": ["59", "55"], "output": "55" } + { "inputs": ["83", "49187"], "output": "83" }, + { "inputs": ["79", "83"], "output": "79" }, + { "inputs": ["83", "83"], "output": "83" }, + { "inputs": ["83", "79"], "output": "79" } ], "min_euint8_euint32": [ - { "inputs": ["47", "1833760772"], "output": "47" }, - { "inputs": ["43", "47"], "output": "43" }, - { "inputs": ["47", "47"], "output": "47" }, - { "inputs": ["47", "43"], "output": "43" } + { "inputs": ["248", "4182541699"], "output": "248" }, + { "inputs": ["244", "248"], "output": "244" }, + { "inputs": ["248", "248"], "output": "248" }, + { "inputs": ["248", "244"], "output": "244" } ], "min_euint8_euint64": [ - { "inputs": ["240", "18439345293201198903"], "output": "240" }, - { "inputs": ["236", "240"], "output": "236" }, - { "inputs": ["240", "240"], "output": "240" }, - { "inputs": ["240", "236"], "output": "236" } + { "inputs": ["6", "18443833870782244811"], "output": "6" }, + { "inputs": ["4", "8"], "output": "4" }, + { "inputs": ["8", "8"], "output": "8" }, + { "inputs": ["8", "4"], "output": "4" } + ], + "min_euint8_euint128": [ + { "inputs": ["143", "340282366920938463463368314352737250889"], "output": "143" }, + { "inputs": ["139", "143"], "output": "139" }, + { "inputs": ["143", "143"], "output": "143" }, + { "inputs": ["143", "139"], "output": "139" } + ], + "min_euint8_euint256": [ + { + "inputs": ["227", "115792089237316195423570985008687907853269984665640564039457575642377411188527"], + "output": "227" + }, + { "inputs": ["223", "227"], "output": "223" }, + { "inputs": ["227", "227"], "output": "227" }, + { "inputs": ["227", "223"], "output": "223" } ], "min_euint16_euint4": [ - { "inputs": ["10884", "9"], "output": "9" }, - { "inputs": ["5", "9"], "output": "5" }, - { "inputs": ["9", "9"], "output": "9" }, - { "inputs": ["9", "5"], "output": "5" } + { "inputs": ["35993", "14"], "output": "14" }, + { "inputs": ["10", "14"], "output": "10" }, + { "inputs": ["14", "14"], "output": "14" }, + { "inputs": ["14", "10"], "output": "10" } ], "min_euint16_euint8": [ - { "inputs": ["29386", "59"], "output": "59" }, - { "inputs": ["55", "59"], "output": "55" }, - { "inputs": ["59", "59"], "output": "59" }, - { "inputs": ["59", "55"], "output": "55" } + { "inputs": ["16954", "238"], "output": "238" }, + { "inputs": ["234", "238"], "output": "234" }, + { "inputs": ["238", "238"], "output": "238" }, + { "inputs": ["238", "234"], "output": "234" } ], "min_euint16_euint16": [ - { "inputs": ["18209", "14696"], "output": "14696" }, - { "inputs": ["14692", "14696"], "output": "14692" }, - { "inputs": ["14696", "14696"], "output": "14696" }, - { "inputs": ["14696", "14692"], "output": "14692" } + { "inputs": ["32718", "8269"], "output": "8269" }, + { "inputs": ["8265", "8269"], "output": "8265" }, + { "inputs": ["8269", "8269"], "output": "8269" }, + { "inputs": ["8269", "8265"], "output": "8265" } ], "min_euint16_uint16": [ - { "inputs": ["18209", "9598"], "output": "9598" }, - { "inputs": ["14692", "14696"], "output": "14692" }, - { "inputs": ["14696", "14696"], "output": "14696" }, - { "inputs": ["14696", "14692"], "output": "14692" } + { "inputs": ["32718", "54097"], "output": "32718" }, + { "inputs": ["8265", "8269"], "output": "8265" }, + { "inputs": ["8269", "8269"], "output": "8269" }, + { "inputs": ["8269", "8265"], "output": "8265" } ], "min_uint16_euint16": [ - { "inputs": ["16454", "9598"], "output": "9598" }, - { "inputs": ["14692", "14696"], "output": "14692" }, - { "inputs": ["14696", "14696"], "output": "14696" }, - { "inputs": ["14696", "14692"], "output": "14692" } + { "inputs": ["24240", "54097"], "output": "24240" }, + { "inputs": ["8265", "8269"], "output": "8265" }, + { "inputs": ["8269", "8269"], "output": "8269" }, + { "inputs": ["8269", "8265"], "output": "8265" } ], "min_euint16_euint32": [ - { "inputs": ["5231", "2030449754"], "output": "5231" }, - { "inputs": ["5227", "5231"], "output": "5227" }, - { "inputs": ["5231", "5231"], "output": "5231" }, - { "inputs": ["5231", "5227"], "output": "5227" } + { "inputs": ["8199", "2465008600"], "output": "8199" }, + { "inputs": ["8195", "8199"], "output": "8195" }, + { "inputs": ["8199", "8199"], "output": "8199" }, + { "inputs": ["8199", "8195"], "output": "8195" } ], "min_euint16_euint64": [ - { "inputs": ["44251", "18443711845572494969"], "output": "44251" }, - { "inputs": ["44247", "44251"], "output": "44247" }, - { "inputs": ["44251", "44251"], "output": "44251" }, - { "inputs": ["44251", "44247"], "output": "44247" } + { "inputs": ["64768", "18439640713575288835"], "output": "64768" }, + { "inputs": ["64764", "64768"], "output": "64764" }, + { "inputs": ["64768", "64768"], "output": "64768" }, + { "inputs": ["64768", "64764"], "output": "64764" } + ], + "min_euint16_euint128": [ + { "inputs": ["47213", "340282366920938463463367215507048923025"], "output": "47213" }, + { "inputs": ["47209", "47213"], "output": "47209" }, + { "inputs": ["47213", "47213"], "output": "47213" }, + { "inputs": ["47213", "47209"], "output": "47209" } + ], + "min_euint16_euint256": [ + { + "inputs": ["56701", "115792089237316195423570985008687907853269984665640564039457576701213568693639"], + "output": "56701" + }, + { "inputs": ["56697", "56701"], "output": "56697" }, + { "inputs": ["56701", "56701"], "output": "56701" }, + { "inputs": ["56701", "56697"], "output": "56697" } ], "min_euint32_euint4": [ - { "inputs": ["2403125524", "11"], "output": "11" }, + { "inputs": ["52471261", "11"], "output": "11" }, { "inputs": ["7", "11"], "output": "7" }, { "inputs": ["11", "11"], "output": "11" }, { "inputs": ["11", "7"], "output": "7" } ], "min_euint32_euint8": [ - { "inputs": ["2689679661", "114"], "output": "114" }, - { "inputs": ["110", "114"], "output": "110" }, - { "inputs": ["114", "114"], "output": "114" }, - { "inputs": ["114", "110"], "output": "110" } + { "inputs": ["2070023085", "28"], "output": "28" }, + { "inputs": ["24", "28"], "output": "24" }, + { "inputs": ["28", "28"], "output": "28" }, + { "inputs": ["28", "24"], "output": "24" } ], "min_euint32_euint16": [ - { "inputs": ["2355937467", "15361"], "output": "15361" }, - { "inputs": ["15357", "15361"], "output": "15357" }, - { "inputs": ["15361", "15361"], "output": "15361" }, - { "inputs": ["15361", "15357"], "output": "15357" } + { "inputs": ["3265803083", "25661"], "output": "25661" }, + { "inputs": ["25657", "25661"], "output": "25657" }, + { "inputs": ["25661", "25661"], "output": "25661" }, + { "inputs": ["25661", "25657"], "output": "25657" } ], "min_euint32_euint32": [ - { "inputs": ["4226618007", "2940808913"], "output": "2940808913" }, - { "inputs": ["2940808909", "2940808913"], "output": "2940808909" }, - { "inputs": ["2940808913", "2940808913"], "output": "2940808913" }, - { "inputs": ["2940808913", "2940808909"], "output": "2940808909" } + { "inputs": ["3167993396", "3198148813"], "output": "3167993396" }, + { "inputs": ["3167993392", "3167993396"], "output": "3167993392" }, + { "inputs": ["3167993396", "3167993396"], "output": "3167993396" }, + { "inputs": ["3167993396", "3167993392"], "output": "3167993392" } ], "min_euint32_uint32": [ - { "inputs": ["4226618007", "2039277146"], "output": "2039277146" }, - { "inputs": ["2940808909", "2940808913"], "output": "2940808909" }, - { "inputs": ["2940808913", "2940808913"], "output": "2940808913" }, - { "inputs": ["2940808913", "2940808909"], "output": "2940808909" } + { "inputs": ["3167993396", "1826176221"], "output": "1826176221" }, + { "inputs": ["3167993392", "3167993396"], "output": "3167993392" }, + { "inputs": ["3167993396", "3167993396"], "output": "3167993396" }, + { "inputs": ["3167993396", "3167993392"], "output": "3167993392" } ], "min_uint32_euint32": [ - { "inputs": ["1778120575", "2039277146"], "output": "1778120575" }, - { "inputs": ["2940808909", "2940808913"], "output": "2940808909" }, - { "inputs": ["2940808913", "2940808913"], "output": "2940808913" }, - { "inputs": ["2940808913", "2940808909"], "output": "2940808909" } + { "inputs": ["591129059", "1826176221"], "output": "591129059" }, + { "inputs": ["3167993392", "3167993396"], "output": "3167993392" }, + { "inputs": ["3167993396", "3167993396"], "output": "3167993396" }, + { "inputs": ["3167993396", "3167993392"], "output": "3167993392" } ], "min_euint32_euint64": [ - { "inputs": ["3364933042", "18443534177311383841"], "output": "3364933042" }, - { "inputs": ["3364933038", "3364933042"], "output": "3364933038" }, - { "inputs": ["3364933042", "3364933042"], "output": "3364933042" }, - { "inputs": ["3364933042", "3364933038"], "output": "3364933038" } + { "inputs": ["1841925700", "18442933982305840083"], "output": "1841925700" }, + { "inputs": ["1841925696", "1841925700"], "output": "1841925696" }, + { "inputs": ["1841925700", "1841925700"], "output": "1841925700" }, + { "inputs": ["1841925700", "1841925696"], "output": "1841925696" } + ], + "min_euint32_euint128": [ + { "inputs": ["4003399201", "340282366920938463463365902462339741051"], "output": "4003399201" }, + { "inputs": ["4003399197", "4003399201"], "output": "4003399197" }, + { "inputs": ["4003399201", "4003399201"], "output": "4003399201" }, + { "inputs": ["4003399201", "4003399197"], "output": "4003399197" } + ], + "min_euint32_euint256": [ + { + "inputs": ["3608929890", "115792089237316195423570985008687907853269984665640564039457579751481725336191"], + "output": "3608929890" + }, + { "inputs": ["3608929886", "3608929890"], "output": "3608929886" }, + { "inputs": ["3608929890", "3608929890"], "output": "3608929890" }, + { "inputs": ["3608929890", "3608929886"], "output": "3608929886" } ], "min_euint64_euint4": [ - { "inputs": ["18446705827641256747", "10"], "output": "10" }, - { "inputs": ["6", "10"], "output": "6" }, - { "inputs": ["10", "10"], "output": "10" }, - { "inputs": ["10", "6"], "output": "6" } + { "inputs": ["18440660497360576819", "14"], "output": "14" }, + { "inputs": ["10", "14"], "output": "10" }, + { "inputs": ["14", "14"], "output": "14" }, + { "inputs": ["14", "10"], "output": "10" } ], "min_euint64_euint8": [ - { "inputs": ["18440761228336909285", "170"], "output": "170" }, - { "inputs": ["166", "170"], "output": "166" }, - { "inputs": ["170", "170"], "output": "170" }, - { "inputs": ["170", "166"], "output": "166" } + { "inputs": ["18442702391560231447", "64"], "output": "64" }, + { "inputs": ["60", "64"], "output": "60" }, + { "inputs": ["64", "64"], "output": "64" }, + { "inputs": ["64", "60"], "output": "60" } ], "min_euint64_euint16": [ - { "inputs": ["18438622448280376415", "51692"], "output": "51692" }, - { "inputs": ["51688", "51692"], "output": "51688" }, - { "inputs": ["51692", "51692"], "output": "51692" }, - { "inputs": ["51692", "51688"], "output": "51688" } + { "inputs": ["18440389921895932333", "42816"], "output": "42816" }, + { "inputs": ["42812", "42816"], "output": "42812" }, + { "inputs": ["42816", "42816"], "output": "42816" }, + { "inputs": ["42816", "42812"], "output": "42812" } ], "min_euint64_euint32": [ - { "inputs": ["18440186743754430625", "4137891061"], "output": "4137891061" }, - { "inputs": ["4137891057", "4137891061"], "output": "4137891057" }, - { "inputs": ["4137891061", "4137891061"], "output": "4137891061" }, - { "inputs": ["4137891061", "4137891057"], "output": "4137891057" } + { "inputs": ["18439611592084278651", "1078993829"], "output": "1078993829" }, + { "inputs": ["1078993825", "1078993829"], "output": "1078993825" }, + { "inputs": ["1078993829", "1078993829"], "output": "1078993829" }, + { "inputs": ["1078993829", "1078993825"], "output": "1078993825" } ], "min_euint64_euint64": [ - { "inputs": ["18446277918636147641", "18439099819121701507"], "output": "18439099819121701507" }, - { "inputs": ["18439099819121701503", "18439099819121701507"], "output": "18439099819121701503" }, - { "inputs": ["18439099819121701507", "18439099819121701507"], "output": "18439099819121701507" }, - { "inputs": ["18439099819121701507", "18439099819121701503"], "output": "18439099819121701503" } + { "inputs": ["18438422972288340001", "18441615262395055283"], "output": "18438422972288340001" }, + { "inputs": ["18438422972288339997", "18438422972288340001"], "output": "18438422972288339997" }, + { "inputs": ["18438422972288340001", "18438422972288340001"], "output": "18438422972288340001" }, + { "inputs": ["18438422972288340001", "18438422972288339997"], "output": "18438422972288339997" } ], "min_euint64_uint64": [ - { "inputs": ["18446277918636147641", "18444361908116912137"], "output": "18444361908116912137" }, - { "inputs": ["18439099819121701503", "18439099819121701507"], "output": "18439099819121701503" }, - { "inputs": ["18439099819121701507", "18439099819121701507"], "output": "18439099819121701507" }, - { "inputs": ["18439099819121701507", "18439099819121701503"], "output": "18439099819121701503" } + { "inputs": ["18438422972288340001", "18439986643027034037"], "output": "18438422972288340001" }, + { "inputs": ["18438422972288339997", "18438422972288340001"], "output": "18438422972288339997" }, + { "inputs": ["18438422972288340001", "18438422972288340001"], "output": "18438422972288340001" }, + { "inputs": ["18438422972288340001", "18438422972288339997"], "output": "18438422972288339997" } ], "min_uint64_euint64": [ - { "inputs": ["18445356693251014369", "18444361908116912137"], "output": "18444361908116912137" }, - { "inputs": ["18439099819121701503", "18439099819121701507"], "output": "18439099819121701503" }, - { "inputs": ["18439099819121701507", "18439099819121701507"], "output": "18439099819121701507" }, - { "inputs": ["18439099819121701507", "18439099819121701503"], "output": "18439099819121701503" } + { "inputs": ["18443338893508802671", "18439986643027034037"], "output": "18439986643027034037" }, + { "inputs": ["18438422972288339997", "18438422972288340001"], "output": "18438422972288339997" }, + { "inputs": ["18438422972288340001", "18438422972288340001"], "output": "18438422972288340001" }, + { "inputs": ["18438422972288340001", "18438422972288339997"], "output": "18438422972288339997" } + ], + "min_euint64_euint128": [ + { "inputs": ["18444900314492723695", "340282366920938463463367540489775579127"], "output": "18444900314492723695" }, + { "inputs": ["18444900314492723691", "18444900314492723695"], "output": "18444900314492723691" }, + { "inputs": ["18444900314492723695", "18444900314492723695"], "output": "18444900314492723695" }, + { "inputs": ["18444900314492723695", "18444900314492723691"], "output": "18444900314492723691" } + ], + "min_euint64_euint256": [ + { + "inputs": [ + "18446426094775234589", + "115792089237316195423570985008687907853269984665640564039457578688132986416989" + ], + "output": "18446426094775234589" + }, + { "inputs": ["18446426094775234585", "18446426094775234589"], "output": "18446426094775234585" }, + { "inputs": ["18446426094775234589", "18446426094775234589"], "output": "18446426094775234589" }, + { "inputs": ["18446426094775234589", "18446426094775234585"], "output": "18446426094775234585" } + ], + "min_euint128_euint4": [ + { "inputs": ["340282366920938463463373617043976262819", "6"], "output": "6" }, + { "inputs": ["4", "8"], "output": "4" }, + { "inputs": ["8", "8"], "output": "8" }, + { "inputs": ["8", "4"], "output": "4" } + ], + "min_euint128_euint8": [ + { "inputs": ["340282366920938463463366071622027178861", "33"], "output": "33" }, + { "inputs": ["29", "33"], "output": "29" }, + { "inputs": ["33", "33"], "output": "33" }, + { "inputs": ["33", "29"], "output": "29" } + ], + "min_euint128_euint16": [ + { "inputs": ["340282366920938463463368542801038101753", "9714"], "output": "9714" }, + { "inputs": ["9710", "9714"], "output": "9710" }, + { "inputs": ["9714", "9714"], "output": "9714" }, + { "inputs": ["9714", "9710"], "output": "9710" } + ], + "min_euint128_euint32": [ + { "inputs": ["340282366920938463463373948652081205153", "4076998775"], "output": "4076998775" }, + { "inputs": ["4076998771", "4076998775"], "output": "4076998771" }, + { "inputs": ["4076998775", "4076998775"], "output": "4076998775" }, + { "inputs": ["4076998775", "4076998771"], "output": "4076998771" } + ], + "min_euint128_euint64": [ + { "inputs": ["340282366920938463463372700048433567093", "18437970528445398453"], "output": "18437970528445398453" }, + { "inputs": ["18437970528445398449", "18437970528445398453"], "output": "18437970528445398449" }, + { "inputs": ["18437970528445398453", "18437970528445398453"], "output": "18437970528445398453" }, + { "inputs": ["18437970528445398453", "18437970528445398449"], "output": "18437970528445398449" } + ], + "min_euint128_euint128": [ + { + "inputs": ["340282366920938463463369507025632955721", "340282366920938463463371759125181075731"], + "output": "340282366920938463463369507025632955721" + }, + { + "inputs": ["340282366920938463463369507025632955717", "340282366920938463463369507025632955721"], + "output": "340282366920938463463369507025632955717" + }, + { + "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369507025632955721"], + "output": "340282366920938463463369507025632955721" + }, + { + "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369507025632955717"], + "output": "340282366920938463463369507025632955717" + } + ], + "min_euint128_uint128": [ + { + "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369479362880511843"], + "output": "340282366920938463463369479362880511843" + }, + { + "inputs": ["340282366920938463463369507025632955717", "340282366920938463463369507025632955721"], + "output": "340282366920938463463369507025632955717" + }, + { + "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369507025632955721"], + "output": "340282366920938463463369507025632955721" + }, + { + "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369507025632955717"], + "output": "340282366920938463463369507025632955717" + } + ], + "min_uint128_euint128": [ + { + "inputs": ["340282366920938463463367460119738968177", "340282366920938463463369479362880511843"], + "output": "340282366920938463463367460119738968177" + }, + { + "inputs": ["340282366920938463463369507025632955717", "340282366920938463463369507025632955721"], + "output": "340282366920938463463369507025632955717" + }, + { + "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369507025632955721"], + "output": "340282366920938463463369507025632955721" + }, + { + "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369507025632955717"], + "output": "340282366920938463463369507025632955717" + } + ], + "min_euint128_euint256": [ + { + "inputs": [ + "340282366920938463463370734691749234713", + "115792089237316195423570985008687907853269984665640564039457579316332311519059" + ], + "output": "340282366920938463463370734691749234713" + }, + { + "inputs": ["340282366920938463463370734691749234709", "340282366920938463463370734691749234713"], + "output": "340282366920938463463370734691749234709" + }, + { + "inputs": ["340282366920938463463370734691749234713", "340282366920938463463370734691749234713"], + "output": "340282366920938463463370734691749234713" + }, + { + "inputs": ["340282366920938463463370734691749234713", "340282366920938463463370734691749234709"], + "output": "340282366920938463463370734691749234709" + } + ], + "min_euint256_euint4": [ + { + "inputs": ["115792089237316195423570985008687907853269984665640564039457582664799758938101", "2"], + "output": "2" + }, + { "inputs": ["4", "8"], "output": "4" }, + { "inputs": ["8", "8"], "output": "8" }, + { "inputs": ["8", "4"], "output": "4" } + ], + "min_euint256_euint8": [ + { + "inputs": ["115792089237316195423570985008687907853269984665640564039457577026640283682165", "103"], + "output": "103" + }, + { "inputs": ["99", "103"], "output": "99" }, + { "inputs": ["103", "103"], "output": "103" }, + { "inputs": ["103", "99"], "output": "99" } + ], + "min_euint256_euint16": [ + { + "inputs": ["115792089237316195423570985008687907853269984665640564039457579076951559173157", "24679"], + "output": "24679" + }, + { "inputs": ["24675", "24679"], "output": "24675" }, + { "inputs": ["24679", "24679"], "output": "24679" }, + { "inputs": ["24679", "24675"], "output": "24675" } + ], + "min_euint256_euint32": [ + { + "inputs": ["115792089237316195423570985008687907853269984665640564039457582240718630307135", "1248940496"], + "output": "1248940496" + }, + { "inputs": ["1248940492", "1248940496"], "output": "1248940492" }, + { "inputs": ["1248940496", "1248940496"], "output": "1248940496" }, + { "inputs": ["1248940496", "1248940492"], "output": "1248940492" } + ], + "min_euint256_euint64": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579813847565218665", + "18443636668516069273" + ], + "output": "18443636668516069273" + }, + { "inputs": ["18443636668516069269", "18443636668516069273"], "output": "18443636668516069269" }, + { "inputs": ["18443636668516069273", "18443636668516069273"], "output": "18443636668516069273" }, + { "inputs": ["18443636668516069273", "18443636668516069269"], "output": "18443636668516069269" } + ], + "min_euint256_euint128": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457578748486524440321", + "340282366920938463463370032475222092647" + ], + "output": "340282366920938463463370032475222092647" + }, + { + "inputs": ["340282366920938463463370032475222092643", "340282366920938463463370032475222092647"], + "output": "340282366920938463463370032475222092643" + }, + { + "inputs": ["340282366920938463463370032475222092647", "340282366920938463463370032475222092647"], + "output": "340282366920938463463370032475222092647" + }, + { + "inputs": ["340282366920938463463370032475222092647", "340282366920938463463370032475222092643"], + "output": "340282366920938463463370032475222092643" + } + ], + "min_euint256_euint256": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579091097262441647", + "115792089237316195423570985008687907853269984665640564039457577447088911778291" + ], + "output": "115792089237316195423570985008687907853269984665640564039457577447088911778291" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457577447088911778287", + "115792089237316195423570985008687907853269984665640564039457577447088911778291" + ], + "output": "115792089237316195423570985008687907853269984665640564039457577447088911778287" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457577447088911778291", + "115792089237316195423570985008687907853269984665640564039457577447088911778291" + ], + "output": "115792089237316195423570985008687907853269984665640564039457577447088911778291" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457577447088911778291", + "115792089237316195423570985008687907853269984665640564039457577447088911778287" + ], + "output": "115792089237316195423570985008687907853269984665640564039457577447088911778287" + } + ], + "min_euint256_uint256": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579091097262441647", + "115792089237316195423570985008687907853269984665640564039457576915935387349417" + ], + "output": "115792089237316195423570985008687907853269984665640564039457576915935387349417" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457577447088911778287", + "115792089237316195423570985008687907853269984665640564039457577447088911778291" + ], + "output": "115792089237316195423570985008687907853269984665640564039457577447088911778287" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457577447088911778291", + "115792089237316195423570985008687907853269984665640564039457577447088911778291" + ], + "output": "115792089237316195423570985008687907853269984665640564039457577447088911778291" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457577447088911778291", + "115792089237316195423570985008687907853269984665640564039457577447088911778287" + ], + "output": "115792089237316195423570985008687907853269984665640564039457577447088911778287" + } + ], + "min_uint256_euint256": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579127166009597401", + "115792089237316195423570985008687907853269984665640564039457576915935387349417" + ], + "output": "115792089237316195423570985008687907853269984665640564039457576915935387349417" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457577447088911778287", + "115792089237316195423570985008687907853269984665640564039457577447088911778291" + ], + "output": "115792089237316195423570985008687907853269984665640564039457577447088911778287" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457577447088911778291", + "115792089237316195423570985008687907853269984665640564039457577447088911778291" + ], + "output": "115792089237316195423570985008687907853269984665640564039457577447088911778291" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457577447088911778291", + "115792089237316195423570985008687907853269984665640564039457577447088911778287" + ], + "output": "115792089237316195423570985008687907853269984665640564039457577447088911778287" + } ], "or_euint4_euint4": [ - { "inputs": ["7", "10"], "output": "15" }, + { "inputs": ["10", "6"], "output": "14" }, { "inputs": ["4", "8"], "output": "12" }, { "inputs": ["8", "8"], "output": "8" }, { "inputs": ["8", "4"], "output": "12" } ], "or_euint4_euint8": [ - { "inputs": ["12", "18"], "output": "30" }, - { "inputs": ["8", "12"], "output": "12" }, - { "inputs": ["12", "12"], "output": "12" }, - { "inputs": ["12", "8"], "output": "12" } + { "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": ["12", "197"], "output": "205" }, - { "inputs": ["8", "12"], "output": "12" }, - { "inputs": ["12", "12"], "output": "12" }, - { "inputs": ["12", "8"], "output": "12" } + { "inputs": ["9", "28733"], "output": "28733" }, + { "inputs": ["5", "9"], "output": "13" }, + { "inputs": ["9", "9"], "output": "9" }, + { "inputs": ["9", "5"], "output": "13" } ], "or_euint4_euint32": [ - { "inputs": ["12", "3045135587"], "output": "3045135599" }, - { "inputs": ["8", "12"], "output": "12" }, - { "inputs": ["12", "12"], "output": "12" }, - { "inputs": ["12", "8"], "output": "12" } + { "inputs": ["13", "371092847"], "output": "371092847" }, + { "inputs": ["9", "13"], "output": "13" }, + { "inputs": ["13", "13"], "output": "13" }, + { "inputs": ["13", "9"], "output": "13" } ], "or_euint4_euint64": [ - { "inputs": ["5", "18439458059788568419"], "output": "18439458059788568423" }, + { "inputs": ["14", "18440698678220010551"], "output": "18440698678220010559" }, + { "inputs": ["10", "14"], "output": "14" }, + { "inputs": ["14", "14"], "output": "14" }, + { "inputs": ["14", "10"], "output": "14" } + ], + "or_euint4_euint128": [ + { "inputs": ["4", "340282366920938463463366343089484611447"], "output": "340282366920938463463366343089484611447" }, + { "inputs": ["4", "8"], "output": "12" }, + { "inputs": ["8", "8"], "output": "8" }, + { "inputs": ["8", "4"], "output": "12" } + ], + "or_euint4_euint256": [ + { + "inputs": ["8", "115792089237316195423570985008687907853269984665640564039457583166606888282231"], + "output": "115792089237316195423570985008687907853269984665640564039457583166606888282239" + }, { "inputs": ["4", "8"], "output": "12" }, { "inputs": ["8", "8"], "output": "8" }, { "inputs": ["8", "4"], "output": "12" } ], "or_euint8_euint4": [ - { "inputs": ["37", "6"], "output": "39" }, + { "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" } ], "or_euint8_euint8": [ - { "inputs": ["245", "47"], "output": "255" }, - { "inputs": ["43", "47"], "output": "47" }, - { "inputs": ["47", "47"], "output": "47" }, - { "inputs": ["47", "43"], "output": "47" } + { "inputs": ["189", "251"], "output": "255" }, + { "inputs": ["185", "189"], "output": "189" }, + { "inputs": ["189", "189"], "output": "189" }, + { "inputs": ["189", "185"], "output": "189" } + ], + "or_euint8_uint8": [ + { "inputs": ["189", "140"], "output": "189" }, + { "inputs": ["185", "189"], "output": "189" }, + { "inputs": ["189", "189"], "output": "189" }, + { "inputs": ["189", "185"], "output": "189" } + ], + "or_uint8_euint8": [ + { "inputs": ["139", "140"], "output": "143" }, + { "inputs": ["185", "189"], "output": "189" }, + { "inputs": ["189", "189"], "output": "189" }, + { "inputs": ["189", "185"], "output": "189" } ], "or_euint8_euint16": [ - { "inputs": ["140", "39215"], "output": "39343" }, - { "inputs": ["136", "140"], "output": "140" }, - { "inputs": ["140", "140"], "output": "140" }, - { "inputs": ["140", "136"], "output": "140" } + { "inputs": ["20", "28056"], "output": "28060" }, + { "inputs": ["16", "20"], "output": "20" }, + { "inputs": ["20", "20"], "output": "20" }, + { "inputs": ["20", "16"], "output": "20" } ], "or_euint8_euint32": [ - { "inputs": ["99", "1264632675"], "output": "1264632675" }, - { "inputs": ["95", "99"], "output": "127" }, - { "inputs": ["99", "99"], "output": "99" }, - { "inputs": ["99", "95"], "output": "127" } + { "inputs": ["64", "694910711"], "output": "694910711" }, + { "inputs": ["60", "64"], "output": "124" }, + { "inputs": ["64", "64"], "output": "64" }, + { "inputs": ["64", "60"], "output": "124" } ], "or_euint8_euint64": [ - { "inputs": ["66", "18439693911625769587"], "output": "18439693911625769587" }, - { "inputs": ["62", "66"], "output": "126" }, - { "inputs": ["66", "66"], "output": "66" }, - { "inputs": ["66", "62"], "output": "126" } + { "inputs": ["22", "18446578065470955215"], "output": "18446578065470955231" }, + { "inputs": ["18", "22"], "output": "22" }, + { "inputs": ["22", "22"], "output": "22" }, + { "inputs": ["22", "18"], "output": "22" } + ], + "or_euint8_euint128": [ + { "inputs": ["1", "340282366920938463463371478178042182733"], "output": "340282366920938463463371478178042182733" }, + { "inputs": ["4", "8"], "output": "12" }, + { "inputs": ["8", "8"], "output": "8" }, + { "inputs": ["8", "4"], "output": "12" } + ], + "or_euint8_euint256": [ + { + "inputs": ["46", "115792089237316195423570985008687907853269984665640564039457582375126935756687"], + "output": "115792089237316195423570985008687907853269984665640564039457582375126935756719" + }, + { "inputs": ["42", "46"], "output": "46" }, + { "inputs": ["46", "46"], "output": "46" }, + { "inputs": ["46", "42"], "output": "46" } ], "or_euint16_euint4": [ - { "inputs": ["40123", "11"], "output": "40123" }, - { "inputs": ["7", "11"], "output": "15" }, - { "inputs": ["11", "11"], "output": "11" }, - { "inputs": ["11", "7"], "output": "15" } + { "inputs": ["31310", "6"], "output": "31310" }, + { "inputs": ["4", "8"], "output": "12" }, + { "inputs": ["8", "8"], "output": "8" }, + { "inputs": ["8", "4"], "output": "12" } ], "or_euint16_euint8": [ - { "inputs": ["37227", "88"], "output": "37243" }, - { "inputs": ["84", "88"], "output": "92" }, - { "inputs": ["88", "88"], "output": "88" }, - { "inputs": ["88", "84"], "output": "92" } + { "inputs": ["20350", "200"], "output": "20478" }, + { "inputs": ["196", "200"], "output": "204" }, + { "inputs": ["200", "200"], "output": "200" }, + { "inputs": ["200", "196"], "output": "204" } ], "or_euint16_euint16": [ - { "inputs": ["33634", "27003"], "output": "60283" }, - { "inputs": ["26999", "27003"], "output": "27007" }, - { "inputs": ["27003", "27003"], "output": "27003" }, - { "inputs": ["27003", "26999"], "output": "27007" } + { "inputs": ["41436", "37567"], "output": "46079" }, + { "inputs": ["37563", "37567"], "output": "37567" }, + { "inputs": ["37567", "37567"], "output": "37567" }, + { "inputs": ["37567", "37563"], "output": "37567" } + ], + "or_euint16_uint16": [ + { "inputs": ["41436", "27184"], "output": "60412" }, + { "inputs": ["37563", "37567"], "output": "37567" }, + { "inputs": ["37567", "37567"], "output": "37567" }, + { "inputs": ["37567", "37563"], "output": "37567" } + ], + "or_uint16_euint16": [ + { "inputs": ["65174", "27184"], "output": "65206" }, + { "inputs": ["37563", "37567"], "output": "37567" }, + { "inputs": ["37567", "37567"], "output": "37567" }, + { "inputs": ["37567", "37563"], "output": "37567" } ], "or_euint16_euint32": [ - { "inputs": ["440", "1863142416"], "output": "1863142840" }, - { "inputs": ["436", "440"], "output": "444" }, - { "inputs": ["440", "440"], "output": "440" }, - { "inputs": ["440", "436"], "output": "444" } + { "inputs": ["36595", "3887874863"], "output": "3887910911" }, + { "inputs": ["36591", "36595"], "output": "36607" }, + { "inputs": ["36595", "36595"], "output": "36595" }, + { "inputs": ["36595", "36591"], "output": "36607" } ], "or_euint16_euint64": [ - { "inputs": ["12837", "18444850378165005521"], "output": "18444850378165010165" }, - { "inputs": ["12833", "12837"], "output": "12837" }, - { "inputs": ["12837", "12837"], "output": "12837" }, - { "inputs": ["12837", "12833"], "output": "12837" } + { "inputs": ["8318", "18443891473910549169"], "output": "18443891473910557439" }, + { "inputs": ["8314", "8318"], "output": "8318" }, + { "inputs": ["8318", "8318"], "output": "8318" }, + { "inputs": ["8318", "8314"], "output": "8318" } + ], + "or_euint16_euint128": [ + { + "inputs": ["65101", "340282366920938463463368378388212688025"], + "output": "340282366920938463463368378388212743901" + }, + { "inputs": ["65097", "65101"], "output": "65101" }, + { "inputs": ["65101", "65101"], "output": "65101" }, + { "inputs": ["65101", "65097"], "output": "65101" } + ], + "or_euint16_euint256": [ + { + "inputs": ["31079", "115792089237316195423570985008687907853269984665640564039457575275996784888971"], + "output": "115792089237316195423570985008687907853269984665640564039457575275996784917999" + }, + { "inputs": ["31075", "31079"], "output": "31079" }, + { "inputs": ["31079", "31079"], "output": "31079" }, + { "inputs": ["31079", "31075"], "output": "31079" } ], "or_euint32_euint4": [ - { "inputs": ["2761097401", "13"], "output": "2761097405" }, - { "inputs": ["9", "13"], "output": "13" }, - { "inputs": ["13", "13"], "output": "13" }, - { "inputs": ["13", "9"], "output": "13" } + { "inputs": ["1671920698", "3"], "output": "1671920699" }, + { "inputs": ["4", "8"], "output": "12" }, + { "inputs": ["8", "8"], "output": "8" }, + { "inputs": ["8", "4"], "output": "12" } ], "or_euint32_euint8": [ - { "inputs": ["1062322837", "212"], "output": "1062322901" }, - { "inputs": ["208", "212"], "output": "212" }, - { "inputs": ["212", "212"], "output": "212" }, - { "inputs": ["212", "208"], "output": "212" } + { "inputs": ["143668880", "184"], "output": "143668920" }, + { "inputs": ["180", "184"], "output": "188" }, + { "inputs": ["184", "184"], "output": "184" }, + { "inputs": ["184", "180"], "output": "188" } ], "or_euint32_euint16": [ - { "inputs": ["1914437939", "49825"], "output": "1914487731" }, - { "inputs": ["49821", "49825"], "output": "49853" }, - { "inputs": ["49825", "49825"], "output": "49825" }, - { "inputs": ["49825", "49821"], "output": "49853" } + { "inputs": ["68701034", "41103"], "output": "68742127" }, + { "inputs": ["41099", "41103"], "output": "41103" }, + { "inputs": ["41103", "41103"], "output": "41103" }, + { "inputs": ["41103", "41099"], "output": "41103" } ], "or_euint32_euint32": [ - { "inputs": ["1757798833", "311935858"], "output": "2060968947" }, - { "inputs": ["311935854", "311935858"], "output": "311935870" }, - { "inputs": ["311935858", "311935858"], "output": "311935858" }, - { "inputs": ["311935858", "311935854"], "output": "311935870" } + { "inputs": ["1707541891", "1244554527"], "output": "1877960095" }, + { "inputs": ["1244554523", "1244554527"], "output": "1244554527" }, + { "inputs": ["1244554527", "1244554527"], "output": "1244554527" }, + { "inputs": ["1244554527", "1244554523"], "output": "1244554527" } + ], + "or_euint32_uint32": [ + { "inputs": ["1707541891", "1007760424"], "output": "2111255979" }, + { "inputs": ["1244554523", "1244554527"], "output": "1244554527" }, + { "inputs": ["1244554527", "1244554527"], "output": "1244554527" }, + { "inputs": ["1244554527", "1244554523"], "output": "1244554527" } + ], + "or_uint32_euint32": [ + { "inputs": ["1405809228", "1007760424"], "output": "2145121900" }, + { "inputs": ["1244554523", "1244554527"], "output": "1244554527" }, + { "inputs": ["1244554527", "1244554527"], "output": "1244554527" }, + { "inputs": ["1244554527", "1244554523"], "output": "1244554527" } ], "or_euint32_euint64": [ - { "inputs": ["1312726121", "18440203558036734807"], "output": "18440203559245881215" }, - { "inputs": ["1312726117", "1312726121"], "output": "1312726125" }, - { "inputs": ["1312726121", "1312726121"], "output": "1312726121" }, - { "inputs": ["1312726121", "1312726117"], "output": "1312726125" } + { "inputs": ["1546853992", "18445417582546475671"], "output": "18445417583755615999" }, + { "inputs": ["1546853988", "1546853992"], "output": "1546853996" }, + { "inputs": ["1546853992", "1546853992"], "output": "1546853992" }, + { "inputs": ["1546853992", "1546853988"], "output": "1546853996" } + ], + "or_euint32_euint128": [ + { + "inputs": ["1775515615", "340282366920938463463365726409727391809"], + "output": "340282366920938463463365726409758064607" + }, + { "inputs": ["1775515611", "1775515615"], "output": "1775515615" }, + { "inputs": ["1775515615", "1775515615"], "output": "1775515615" }, + { "inputs": ["1775515615", "1775515611"], "output": "1775515615" } + ], + "or_euint32_euint256": [ + { + "inputs": ["2321952704", "115792089237316195423570985008687907853269984665640564039457581516412469896587"], + "output": "115792089237316195423570985008687907853269984665640564039457581516414655131595" + }, + { "inputs": ["2321952700", "2321952704"], "output": "2321952764" }, + { "inputs": ["2321952704", "2321952704"], "output": "2321952704" }, + { "inputs": ["2321952704", "2321952700"], "output": "2321952764" } ], "or_euint64_euint4": [ - { "inputs": ["18443742079082438219", "5"], "output": "18443742079082438223" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "12" } + { "inputs": ["18443718017569117131", "9"], "output": "18443718017569117131" }, + { "inputs": ["5", "9"], "output": "13" }, + { "inputs": ["9", "9"], "output": "9" }, + { "inputs": ["9", "5"], "output": "13" } ], "or_euint64_euint8": [ - { "inputs": ["18442062213086556497", "168"], "output": "18442062213086556665" }, - { "inputs": ["164", "168"], "output": "172" }, - { "inputs": ["168", "168"], "output": "168" }, - { "inputs": ["168", "164"], "output": "172" } + { "inputs": ["18442034297780989323", "254"], "output": "18442034297780989439" }, + { "inputs": ["250", "254"], "output": "254" }, + { "inputs": ["254", "254"], "output": "254" }, + { "inputs": ["254", "250"], "output": "254" } ], "or_euint64_euint16": [ - { "inputs": ["18437769114436402597", "8954"], "output": "18437769114436403199" }, - { "inputs": ["8950", "8954"], "output": "8958" }, - { "inputs": ["8954", "8954"], "output": "8954" }, - { "inputs": ["8954", "8950"], "output": "8958" } + { "inputs": ["18445256696814040973", "63476"], "output": "18445256696814041085" }, + { "inputs": ["63472", "63476"], "output": "63476" }, + { "inputs": ["63476", "63476"], "output": "63476" }, + { "inputs": ["63476", "63472"], "output": "63476" } ], "or_euint64_euint32": [ - { "inputs": ["18438806940040470143", "729835566"], "output": "18438806940585754239" }, - { "inputs": ["729835562", "729835566"], "output": "729835566" }, - { "inputs": ["729835566", "729835566"], "output": "729835566" }, - { "inputs": ["729835566", "729835562"], "output": "729835566" } + { "inputs": ["18441305633946386479", "1651927522"], "output": "18441305635594103279" }, + { "inputs": ["1651927518", "1651927522"], "output": "1651927550" }, + { "inputs": ["1651927522", "1651927522"], "output": "1651927522" }, + { "inputs": ["1651927522", "1651927518"], "output": "1651927550" } ], "or_euint64_euint64": [ - { "inputs": ["18442105052999173891", "18440193626964063709"], "output": "18442168970778769375" }, - { "inputs": ["18440193626964063705", "18440193626964063709"], "output": "18440193626964063709" }, - { "inputs": ["18440193626964063709", "18440193626964063709"], "output": "18440193626964063709" }, - { "inputs": ["18440193626964063709", "18440193626964063705"], "output": "18440193626964063709" } + { "inputs": ["18445851190683093315", "18440297605680046453"], "output": "18446141532670781815" }, + { "inputs": ["18440297605680046449", "18440297605680046453"], "output": "18440297605680046453" }, + { "inputs": ["18440297605680046453", "18440297605680046453"], "output": "18440297605680046453" }, + { "inputs": ["18440297605680046453", "18440297605680046449"], "output": "18440297605680046453" } + ], + "or_euint64_uint64": [ + { "inputs": ["18445851190683093315", "18441158928097514419"], "output": "18445895250664217587" }, + { "inputs": ["18440297605680046449", "18440297605680046453"], "output": "18440297605680046453" }, + { "inputs": ["18440297605680046453", "18440297605680046453"], "output": "18440297605680046453" }, + { "inputs": ["18440297605680046453", "18440297605680046449"], "output": "18440297605680046453" } + ], + "or_uint64_euint64": [ + { "inputs": ["18444816838000851275", "18441158928097514419"], "output": "18445951836858858491" }, + { "inputs": ["18440297605680046449", "18440297605680046453"], "output": "18440297605680046453" }, + { "inputs": ["18440297605680046453", "18440297605680046453"], "output": "18440297605680046453" }, + { "inputs": ["18440297605680046453", "18440297605680046449"], "output": "18440297605680046453" } + ], + "or_euint64_euint128": [ + { + "inputs": ["18444253937643069461", "340282366920938463463369573351070308735"], + "output": "340282366920938463463374396049659246975" + }, + { "inputs": ["18444253937643069457", "18444253937643069461"], "output": "18444253937643069461" }, + { "inputs": ["18444253937643069461", "18444253937643069461"], "output": "18444253937643069461" }, + { "inputs": ["18444253937643069461", "18444253937643069457"], "output": "18444253937643069461" } + ], + "or_euint64_euint256": [ + { + "inputs": [ + "18444891827197945405", + "115792089237316195423570985008687907853269984665640564039457581376324451236725" + ], + "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" + }, + { "inputs": ["8", "12"], "output": "12" }, + { "inputs": ["12", "12"], "output": "12" }, + { "inputs": ["12", "8"], "output": "12" } + ], + "or_euint128_euint8": [ + { + "inputs": ["340282366920938463463374227521343598445", "112"], + "output": "340282366920938463463374227521343598461" + }, + { "inputs": ["108", "112"], "output": "124" }, + { "inputs": ["112", "112"], "output": "112" }, + { "inputs": ["112", "108"], "output": "124" } + ], + "or_euint128_euint16": [ + { + "inputs": ["340282366920938463463366623321205018087", "7136"], + "output": "340282366920938463463366623321205022695" + }, + { "inputs": ["7132", "7136"], "output": "7164" }, + { "inputs": ["7136", "7136"], "output": "7136" }, + { "inputs": ["7136", "7132"], "output": "7164" } + ], + "or_euint128_euint32": [ + { + "inputs": ["340282366920938463463370714852003960045", "1823556556"], + "output": "340282366920938463463370714853213034477" + }, + { "inputs": ["1823556552", "1823556556"], "output": "1823556556" }, + { "inputs": ["1823556556", "1823556556"], "output": "1823556556" }, + { "inputs": ["1823556556", "1823556552"], "output": "1823556556" } + ], + "or_euint128_euint64": [ + { + "inputs": ["340282366920938463463370949519145006273", "18439052795332501691"], + "output": "340282366920938463463372265437599364347" + }, + { "inputs": ["18439052795332501687", "18439052795332501691"], "output": "18439052795332501695" }, + { "inputs": ["18439052795332501691", "18439052795332501691"], "output": "18439052795332501691" }, + { "inputs": ["18439052795332501691", "18439052795332501687"], "output": "18439052795332501695" } + ], + "or_euint128_euint128": [ + { + "inputs": ["340282366920938463463367655063545859643", "340282366920938463463373469661379852713"], + "output": "340282366920938463463374605231434923963" + }, + { + "inputs": ["340282366920938463463367655063545859639", "340282366920938463463367655063545859643"], + "output": "340282366920938463463367655063545859647" + }, + { + "inputs": ["340282366920938463463367655063545859643", "340282366920938463463367655063545859643"], + "output": "340282366920938463463367655063545859643" + }, + { + "inputs": ["340282366920938463463367655063545859643", "340282366920938463463367655063545859639"], + "output": "340282366920938463463367655063545859647" + } + ], + "or_euint128_uint128": [ + { + "inputs": ["340282366920938463463367655063545859643", "340282366920938463463373853783183776929"], + "output": "340282366920938463463374430271410986683" + }, + { + "inputs": ["340282366920938463463367655063545859639", "340282366920938463463367655063545859643"], + "output": "340282366920938463463367655063545859647" + }, + { + "inputs": ["340282366920938463463367655063545859643", "340282366920938463463367655063545859643"], + "output": "340282366920938463463367655063545859643" + }, + { + "inputs": ["340282366920938463463367655063545859643", "340282366920938463463367655063545859639"], + "output": "340282366920938463463367655063545859647" + } + ], + "or_uint128_euint128": [ + { + "inputs": ["340282366920938463463370547981929977503", "340282366920938463463373853783183776929"], + "output": "340282366920938463463373996101960916671" + }, + { + "inputs": ["340282366920938463463367655063545859639", "340282366920938463463367655063545859643"], + "output": "340282366920938463463367655063545859647" + }, + { + "inputs": ["340282366920938463463367655063545859643", "340282366920938463463367655063545859643"], + "output": "340282366920938463463367655063545859643" + }, + { + "inputs": ["340282366920938463463367655063545859643", "340282366920938463463367655063545859639"], + "output": "340282366920938463463367655063545859647" + } + ], + "or_euint128_euint256": [ + { + "inputs": [ + "340282366920938463463366429103695675815", + "115792089237316195423570985008687907853269984665640564039457583383018428109749" + ], + "output": "115792089237316195423570985008687907853269984665640564039457583999099276579767" + }, + { + "inputs": ["340282366920938463463366429103695675811", "340282366920938463463366429103695675815"], + "output": "340282366920938463463366429103695675815" + }, + { + "inputs": ["340282366920938463463366429103695675815", "340282366920938463463366429103695675815"], + "output": "340282366920938463463366429103695675815" + }, + { + "inputs": ["340282366920938463463366429103695675815", "340282366920938463463366429103695675811"], + "output": "340282366920938463463366429103695675815" + } + ], + "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": ["21", "25"], "output": "29" }, + { "inputs": ["25", "25"], "output": "25" }, + { "inputs": ["25", "21"], "output": "29" } + ], + "or_euint256_euint16": [ + { + "inputs": ["115792089237316195423570985008687907853269984665640564039457582624616109811381", "9754"], + "output": "115792089237316195423570985008687907853269984665640564039457582624616109811391" + }, + { "inputs": ["9750", "9754"], "output": "9758" }, + { "inputs": ["9754", "9754"], "output": "9754" }, + { "inputs": ["9754", "9750"], "output": "9758" } + ], + "or_euint256_euint32": [ + { + "inputs": ["115792089237316195423570985008687907853269984665640564039457577374322978195673", "2490018786"], + "output": "115792089237316195423570985008687907853269984665640564039457577374323247328251" + }, + { "inputs": ["2490018782", "2490018786"], "output": "2490018814" }, + { "inputs": ["2490018786", "2490018786"], "output": "2490018786" }, + { "inputs": ["2490018786", "2490018782"], "output": "2490018814" } + ], + "or_euint256_euint64": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457575138878497255467", + "18441296418739792919" + ], + "output": "115792089237316195423570985008687907853269984665640564039457578657599316786239" + }, + { "inputs": ["18441296418739792915", "18441296418739792919"], "output": "18441296418739792919" }, + { "inputs": ["18441296418739792919", "18441296418739792919"], "output": "18441296418739792919" }, + { "inputs": ["18441296418739792919", "18441296418739792915"], "output": "18441296418739792919" } + ], + "or_euint256_euint128": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457581776378743047187", + "340282366920938463463373551062299472959" + ], + "output": "115792089237316195423570985008687907853269984665640564039457582951827808547903" + }, + { + "inputs": ["340282366920938463463373551062299472955", "340282366920938463463373551062299472959"], + "output": "340282366920938463463373551062299472959" + }, + { + "inputs": ["340282366920938463463373551062299472959", "340282366920938463463373551062299472959"], + "output": "340282366920938463463373551062299472959" + }, + { + "inputs": ["340282366920938463463373551062299472959", "340282366920938463463373551062299472955"], + "output": "340282366920938463463373551062299472959" + } + ], + "or_euint256_euint256": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579093390716184697", + "115792089237316195423570985008687907853269984665640564039457580393822758166581" + ], + "output": "115792089237316195423570985008687907853269984665640564039457583914753535699069" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579093390716184693", + "115792089237316195423570985008687907853269984665640564039457579093390716184697" + ], + "output": "115792089237316195423570985008687907853269984665640564039457579093390716184701" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579093390716184697", + "115792089237316195423570985008687907853269984665640564039457579093390716184697" + ], + "output": "115792089237316195423570985008687907853269984665640564039457579093390716184697" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579093390716184697", + "115792089237316195423570985008687907853269984665640564039457579093390716184693" + ], + "output": "115792089237316195423570985008687907853269984665640564039457579093390716184701" + } + ], + "or_euint256_uint256": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579093390716184697", + "115792089237316195423570985008687907853269984665640564039457575617602160724601" + ], + "output": "115792089237316195423570985008687907853269984665640564039457579147311516134009" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579093390716184693", + "115792089237316195423570985008687907853269984665640564039457579093390716184697" + ], + "output": "115792089237316195423570985008687907853269984665640564039457579093390716184701" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579093390716184697", + "115792089237316195423570985008687907853269984665640564039457579093390716184697" + ], + "output": "115792089237316195423570985008687907853269984665640564039457579093390716184697" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579093390716184697", + "115792089237316195423570985008687907853269984665640564039457579093390716184693" + ], + "output": "115792089237316195423570985008687907853269984665640564039457579093390716184701" + } + ], + "or_uint256_euint256": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457580060042571469423", + "115792089237316195423570985008687907853269984665640564039457575617602160724601" + ], + "output": "115792089237316195423570985008687907853269984665640564039457580622993567439487" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579093390716184693", + "115792089237316195423570985008687907853269984665640564039457579093390716184697" + ], + "output": "115792089237316195423570985008687907853269984665640564039457579093390716184701" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579093390716184697", + "115792089237316195423570985008687907853269984665640564039457579093390716184697" + ], + "output": "115792089237316195423570985008687907853269984665640564039457579093390716184697" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579093390716184697", + "115792089237316195423570985008687907853269984665640564039457579093390716184693" + ], + "output": "115792089237316195423570985008687907853269984665640564039457579093390716184701" + } ], "and_euint4_euint4": [ - { "inputs": ["8", "8"], "output": "8" }, + { "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", "6"], "output": "2" }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "0" } + { "inputs": ["10", "116"], "output": "0" }, + { "inputs": ["6", "10"], "output": "2" }, + { "inputs": ["10", "10"], "output": "10" }, + { "inputs": ["10", "6"], "output": "2" } ], - "and_euint4_euint16": [ - { "inputs": ["10", "28165"], "output": "0" }, + "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": ["1", "1067388092"], "output": "0" }, + { "inputs": ["6", "3666388192"], "output": "0" }, { "inputs": ["4", "8"], "output": "0" }, { "inputs": ["8", "8"], "output": "8" }, { "inputs": ["8", "4"], "output": "0" } ], "and_euint4_euint64": [ - { "inputs": ["11", "18444970625118669221"], "output": "1" }, - { "inputs": ["7", "11"], "output": "3" }, - { "inputs": ["11", "11"], "output": "11" }, - { "inputs": ["11", "7"], "output": "3" } + { "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": ["185", "9"], "output": "9" }, - { "inputs": ["5", "9"], "output": "1" }, - { "inputs": ["9", "9"], "output": "9" }, - { "inputs": ["9", "5"], "output": "1" } + { "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": ["68", "245"], "output": "68" }, - { "inputs": ["64", "68"], "output": "64" }, - { "inputs": ["68", "68"], "output": "68" }, - { "inputs": ["68", "64"], "output": "64" } + { "inputs": ["183", "135"], "output": "135" }, + { "inputs": ["131", "135"], "output": "131" }, + { "inputs": ["135", "135"], "output": "135" }, + { "inputs": ["135", "131"], "output": "131" } + ], + "and_euint8_uint8": [ + { "inputs": ["183", "70"], "output": "6" }, + { "inputs": ["131", "135"], "output": "131" }, + { "inputs": ["135", "135"], "output": "135" }, + { "inputs": ["135", "131"], "output": "131" } + ], + "and_uint8_euint8": [ + { "inputs": ["146", "70"], "output": "2" }, + { "inputs": ["131", "135"], "output": "131" }, + { "inputs": ["135", "135"], "output": "135" }, + { "inputs": ["135", "131"], "output": "131" } ], "and_euint8_euint16": [ - { "inputs": ["140", "15292"], "output": "140" }, - { "inputs": ["136", "140"], "output": "136" }, - { "inputs": ["140", "140"], "output": "140" }, - { "inputs": ["140", "136"], "output": "136" } + { "inputs": ["225", "29113"], "output": "161" }, + { "inputs": ["221", "225"], "output": "193" }, + { "inputs": ["225", "225"], "output": "225" }, + { "inputs": ["225", "221"], "output": "193" } ], "and_euint8_euint32": [ - { "inputs": ["39", "58691136"], "output": "0" }, - { "inputs": ["35", "39"], "output": "35" }, - { "inputs": ["39", "39"], "output": "39" }, - { "inputs": ["39", "35"], "output": "35" } + { "inputs": ["114", "3684671928"], "output": "48" }, + { "inputs": ["110", "114"], "output": "98" }, + { "inputs": ["114", "114"], "output": "114" }, + { "inputs": ["114", "110"], "output": "98" } ], "and_euint8_euint64": [ - { "inputs": ["62", "18441742416037218435"], "output": "2" }, - { "inputs": ["58", "62"], "output": "58" }, - { "inputs": ["62", "62"], "output": "62" }, - { "inputs": ["62", "58"], "output": "58" } + { "inputs": ["203", "18443868996555285517"], "output": "9" }, + { "inputs": ["199", "203"], "output": "195" }, + { "inputs": ["203", "203"], "output": "203" }, + { "inputs": ["203", "199"], "output": "195" } + ], + "and_euint8_euint128": [ + { "inputs": ["72", "340282366920938463463369134248162755643"], "output": "8" }, + { "inputs": ["68", "72"], "output": "64" }, + { "inputs": ["72", "72"], "output": "72" }, + { "inputs": ["72", "68"], "output": "64" } + ], + "and_euint8_euint256": [ + { + "inputs": ["180", "115792089237316195423570985008687907853269984665640564039457579349353950071771"], + "output": "144" + }, + { "inputs": ["176", "180"], "output": "176" }, + { "inputs": ["180", "180"], "output": "180" }, + { "inputs": ["180", "176"], "output": "176" } ], "and_euint16_euint4": [ - { "inputs": ["62185", "11"], "output": "9" }, - { "inputs": ["7", "11"], "output": "3" }, - { "inputs": ["11", "11"], "output": "11" }, - { "inputs": ["11", "7"], "output": "3" } - ], - "and_euint16_euint8": [ - { "inputs": ["19261", "5"], "output": "5" }, + { "inputs": ["57634", "7"], "output": "2" }, { "inputs": ["4", "8"], "output": "0" }, { "inputs": ["8", "8"], "output": "8" }, { "inputs": ["8", "4"], "output": "0" } ], + "and_euint16_euint8": [ + { "inputs": ["41347", "138"], "output": "130" }, + { "inputs": ["134", "138"], "output": "130" }, + { "inputs": ["138", "138"], "output": "138" }, + { "inputs": ["138", "134"], "output": "130" } + ], "and_euint16_euint16": [ - { "inputs": ["3535", "5032"], "output": "392" }, - { "inputs": ["3531", "3535"], "output": "3531" }, - { "inputs": ["3535", "3535"], "output": "3535" }, - { "inputs": ["3535", "3531"], "output": "3531" } + { "inputs": ["25969", "38750"], "output": "1360" }, + { "inputs": ["25965", "25969"], "output": "25953" }, + { "inputs": ["25969", "25969"], "output": "25969" }, + { "inputs": ["25969", "25965"], "output": "25953" } + ], + "and_euint16_uint16": [ + { "inputs": ["25969", "39616"], "output": "64" }, + { "inputs": ["25965", "25969"], "output": "25953" }, + { "inputs": ["25969", "25969"], "output": "25969" }, + { "inputs": ["25969", "25965"], "output": "25953" } + ], + "and_uint16_euint16": [ + { "inputs": ["12551", "39616"], "output": "4096" }, + { "inputs": ["25965", "25969"], "output": "25953" }, + { "inputs": ["25969", "25969"], "output": "25969" }, + { "inputs": ["25969", "25965"], "output": "25953" } ], "and_euint16_euint32": [ - { "inputs": ["27862", "1736690738"], "output": "19474" }, - { "inputs": ["27858", "27862"], "output": "27858" }, - { "inputs": ["27862", "27862"], "output": "27862" }, - { "inputs": ["27862", "27858"], "output": "27858" } + { "inputs": ["10444", "4022047212"], "output": "204" }, + { "inputs": ["10440", "10444"], "output": "10440" }, + { "inputs": ["10444", "10444"], "output": "10444" }, + { "inputs": ["10444", "10440"], "output": "10440" } ], "and_euint16_euint64": [ - { "inputs": ["17953", "18443736631892089939"], "output": "1025" }, - { "inputs": ["17949", "17953"], "output": "17921" }, - { "inputs": ["17953", "17953"], "output": "17953" }, - { "inputs": ["17953", "17949"], "output": "17921" } + { "inputs": ["46498", "18443921867836499841"], "output": "9600" }, + { "inputs": ["46494", "46498"], "output": "46466" }, + { "inputs": ["46498", "46498"], "output": "46498" }, + { "inputs": ["46498", "46494"], "output": "46466" } + ], + "and_euint16_euint128": [ + { "inputs": ["10041", "340282366920938463463370138658990657653"], "output": "49" }, + { "inputs": ["10037", "10041"], "output": "10033" }, + { "inputs": ["10041", "10041"], "output": "10041" }, + { "inputs": ["10041", "10037"], "output": "10033" } + ], + "and_euint16_euint256": [ + { + "inputs": ["12579", "115792089237316195423570985008687907853269984665640564039457582458858424079051"], + "output": "4099" + }, + { "inputs": ["12575", "12579"], "output": "12547" }, + { "inputs": ["12579", "12579"], "output": "12579" }, + { "inputs": ["12579", "12575"], "output": "12547" } ], "and_euint32_euint4": [ - { "inputs": ["2599330540", "1"], "output": "0" }, + { "inputs": ["3337809992", "2"], "output": "0" }, { "inputs": ["4", "8"], "output": "0" }, { "inputs": ["8", "8"], "output": "8" }, { "inputs": ["8", "4"], "output": "0" } ], "and_euint32_euint8": [ - { "inputs": ["2756559333", "33"], "output": "33" }, - { "inputs": ["29", "33"], "output": "1" }, - { "inputs": ["33", "33"], "output": "33" }, - { "inputs": ["33", "29"], "output": "1" } + { "inputs": ["2846739700", "34"], "output": "32" }, + { "inputs": ["30", "34"], "output": "2" }, + { "inputs": ["34", "34"], "output": "34" }, + { "inputs": ["34", "30"], "output": "2" } ], "and_euint32_euint16": [ - { "inputs": ["46593294", "4785"], "output": "4096" }, - { "inputs": ["4781", "4785"], "output": "4769" }, - { "inputs": ["4785", "4785"], "output": "4785" }, - { "inputs": ["4785", "4781"], "output": "4769" } + { "inputs": ["1681139161", "6880"], "output": "192" }, + { "inputs": ["6876", "6880"], "output": "6848" }, + { "inputs": ["6880", "6880"], "output": "6880" }, + { "inputs": ["6880", "6876"], "output": "6848" } ], "and_euint32_euint32": [ - { "inputs": ["2522719500", "2344855070"], "output": "2185339916" }, - { "inputs": ["2344855066", "2344855070"], "output": "2344855066" }, - { "inputs": ["2344855070", "2344855070"], "output": "2344855070" }, - { "inputs": ["2344855070", "2344855066"], "output": "2344855066" } + { "inputs": ["3317288822", "1342588191"], "output": "1073759510" }, + { "inputs": ["1342588187", "1342588191"], "output": "1342588187" }, + { "inputs": ["1342588191", "1342588191"], "output": "1342588191" }, + { "inputs": ["1342588191", "1342588187"], "output": "1342588187" } + ], + "and_euint32_uint32": [ + { "inputs": ["3317288822", "510484248"], "output": "69816080" }, + { "inputs": ["1342588187", "1342588191"], "output": "1342588187" }, + { "inputs": ["1342588191", "1342588191"], "output": "1342588191" }, + { "inputs": ["1342588191", "1342588187"], "output": "1342588187" } + ], + "and_uint32_euint32": [ + { "inputs": ["3731064608", "510484248"], "output": "509675264" }, + { "inputs": ["1342588187", "1342588191"], "output": "1342588187" }, + { "inputs": ["1342588191", "1342588191"], "output": "1342588191" }, + { "inputs": ["1342588191", "1342588187"], "output": "1342588187" } ], "and_euint32_euint64": [ - { "inputs": ["595906685", "18438632387690440007"], "output": "537133125" }, - { "inputs": ["595906681", "595906685"], "output": "595906681" }, - { "inputs": ["595906685", "595906685"], "output": "595906685" }, - { "inputs": ["595906685", "595906681"], "output": "595906681" } + { "inputs": ["1745478480", "18442616126135451977"], "output": "1208074560" }, + { "inputs": ["1745478476", "1745478480"], "output": "1745478464" }, + { "inputs": ["1745478480", "1745478480"], "output": "1745478480" }, + { "inputs": ["1745478480", "1745478476"], "output": "1745478464" } + ], + "and_euint32_euint128": [ + { "inputs": ["2659354872", "340282366920938463463373182215335994821"], "output": "2424307904" }, + { "inputs": ["2659354868", "2659354872"], "output": "2659354864" }, + { "inputs": ["2659354872", "2659354872"], "output": "2659354872" }, + { "inputs": ["2659354872", "2659354868"], "output": "2659354864" } + ], + "and_euint32_euint256": [ + { + "inputs": ["3994882895", "115792089237316195423570985008687907853269984665640564039457577397354470817443"], + "output": "1310528003" + }, + { "inputs": ["3994882891", "3994882895"], "output": "3994882891" }, + { "inputs": ["3994882895", "3994882895"], "output": "3994882895" }, + { "inputs": ["3994882895", "3994882891"], "output": "3994882891" } ], "and_euint64_euint4": [ - { "inputs": ["18444456172028398167", "8"], "output": "0" }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "0" } + { "inputs": ["18438614995227733505", "14"], "output": "0" }, + { "inputs": ["10", "14"], "output": "10" }, + { "inputs": ["14", "14"], "output": "14" }, + { "inputs": ["14", "10"], "output": "10" } ], "and_euint64_euint8": [ - { "inputs": ["18441413446268134663", "40"], "output": "0" }, - { "inputs": ["36", "40"], "output": "32" }, - { "inputs": ["40", "40"], "output": "40" }, - { "inputs": ["40", "36"], "output": "32" } + { "inputs": ["18443952274371967793", "221"], "output": "17" }, + { "inputs": ["217", "221"], "output": "217" }, + { "inputs": ["221", "221"], "output": "221" }, + { "inputs": ["221", "217"], "output": "217" } ], "and_euint64_euint16": [ - { "inputs": ["18446210605213941359", "52123"], "output": "51723" }, - { "inputs": ["52119", "52123"], "output": "52115" }, - { "inputs": ["52123", "52123"], "output": "52123" }, - { "inputs": ["52123", "52119"], "output": "52115" } + { "inputs": ["18443322659758757933", "48184"], "output": "6184" }, + { "inputs": ["48180", "48184"], "output": "48176" }, + { "inputs": ["48184", "48184"], "output": "48184" }, + { "inputs": ["48184", "48180"], "output": "48176" } ], "and_euint64_euint32": [ - { "inputs": ["18442857416785747441", "1547691532"], "output": "137446400" }, - { "inputs": ["1547691528", "1547691532"], "output": "1547691528" }, - { "inputs": ["1547691532", "1547691532"], "output": "1547691532" }, - { "inputs": ["1547691532", "1547691528"], "output": "1547691528" } + { "inputs": ["18439406521573141853", "840706883"], "output": "33564993" }, + { "inputs": ["840706879", "840706883"], "output": "840706819" }, + { "inputs": ["840706883", "840706883"], "output": "840706883" }, + { "inputs": ["840706883", "840706879"], "output": "840706819" } ], "and_euint64_euint64": [ - { "inputs": ["18444924635377016941", "18446173308524975411"], "output": "18444923419899985953" }, - { "inputs": ["18444924635377016937", "18444924635377016941"], "output": "18444924635377016937" }, - { "inputs": ["18444924635377016941", "18444924635377016941"], "output": "18444924635377016941" }, - { "inputs": ["18444924635377016941", "18444924635377016937"], "output": "18444924635377016937" } + { "inputs": ["18444124970074897317", "18442657213736743287"], "output": "18442294351260348709" }, + { "inputs": ["18442657213736743283", "18442657213736743287"], "output": "18442657213736743283" }, + { "inputs": ["18442657213736743287", "18442657213736743287"], "output": "18442657213736743287" }, + { "inputs": ["18442657213736743287", "18442657213736743283"], "output": "18442657213736743283" } + ], + "and_euint64_uint64": [ + { "inputs": ["18444124970074897317", "18444452212053822561"], "output": "18444089373216524321" }, + { "inputs": ["18442657213736743283", "18442657213736743287"], "output": "18442657213736743283" }, + { "inputs": ["18442657213736743287", "18442657213736743287"], "output": "18442657213736743287" }, + { "inputs": ["18442657213736743287", "18442657213736743283"], "output": "18442657213736743283" } + ], + "and_uint64_euint64": [ + { "inputs": ["18445812436048048525", "18444452212053822561"], "output": "18443525253958221825" }, + { "inputs": ["18442657213736743283", "18442657213736743287"], "output": "18442657213736743283" }, + { "inputs": ["18442657213736743287", "18442657213736743287"], "output": "18442657213736743287" }, + { "inputs": ["18442657213736743287", "18442657213736743283"], "output": "18442657213736743283" } + ], + "and_euint64_euint128": [ + { "inputs": ["18438964653643998977", "340282366920938463463371580179294281733"], "output": "18438894284827860993" }, + { "inputs": ["18438964653643998973", "18438964653643998977"], "output": "18438964653643998721" }, + { "inputs": ["18438964653643998977", "18438964653643998977"], "output": "18438964653643998977" }, + { "inputs": ["18438964653643998977", "18438964653643998973"], "output": "18438964653643998721" } + ], + "and_euint64_euint256": [ + { + "inputs": [ + "18443960605514453875", + "115792089237316195423570985008687907853269984665640564039457575145704576396421" + ], + "output": "18437737227820728321" + }, + { "inputs": ["18443960605514453871", "18443960605514453875"], "output": "18443960605514453859" }, + { "inputs": ["18443960605514453875", "18443960605514453875"], "output": "18443960605514453875" }, + { "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" } ], - "xor_euint4_euint4": [ - { "inputs": ["13", "14"], "output": "3" }, - { "inputs": ["9", "13"], "output": "4" }, - { "inputs": ["13", "13"], "output": "0" }, - { "inputs": ["13", "9"], "output": "4" } + "and_euint128_euint8": [ + { "inputs": ["340282366920938463463366313789187731763", "114"], "output": "50" }, + { "inputs": ["110", "114"], "output": "98" }, + { "inputs": ["114", "114"], "output": "114" }, + { "inputs": ["114", "110"], "output": "98" } + ], + "and_euint128_euint16": [ + { "inputs": ["340282366920938463463371274545487982339", "11460"], "output": "11264" }, + { "inputs": ["11456", "11460"], "output": "11456" }, + { "inputs": ["11460", "11460"], "output": "11460" }, + { "inputs": ["11460", "11456"], "output": "11456" } + ], + "and_euint128_euint32": [ + { "inputs": ["340282366920938463463372796408614652419", "1038177724"], "output": "272629760" }, + { "inputs": ["1038177720", "1038177724"], "output": "1038177720" }, + { "inputs": ["1038177724", "1038177724"], "output": "1038177724" }, + { "inputs": ["1038177724", "1038177720"], "output": "1038177720" } + ], + "and_euint128_euint64": [ + { "inputs": ["340282366920938463463368706571541146173", "18442558600081086197"], "output": "18438019519441568309" }, + { "inputs": ["18442558600081086193", "18442558600081086197"], "output": "18442558600081086193" }, + { "inputs": ["18442558600081086197", "18442558600081086197"], "output": "18442558600081086197" }, + { "inputs": ["18442558600081086197", "18442558600081086193"], "output": "18442558600081086193" } + ], + "and_euint128_euint128": [ + { + "inputs": ["340282366920938463463365754576278416105", "340282366920938463463366665489173165177"], + "output": "340282366920938463463365750145734418537" + }, + { + "inputs": ["340282366920938463463365754576278416101", "340282366920938463463365754576278416105"], + "output": "340282366920938463463365754576278416097" + }, + { + "inputs": ["340282366920938463463365754576278416105", "340282366920938463463365754576278416105"], + "output": "340282366920938463463365754576278416105" + }, + { + "inputs": ["340282366920938463463365754576278416105", "340282366920938463463365754576278416101"], + "output": "340282366920938463463365754576278416097" + } + ], + "and_euint128_uint128": [ + { + "inputs": ["340282366920938463463365754576278416105", "340282366920938463463366410191459861233"], + "output": "340282366920938463463365741001161851617" + }, + { + "inputs": ["340282366920938463463365754576278416101", "340282366920938463463365754576278416105"], + "output": "340282366920938463463365754576278416097" + }, + { + "inputs": ["340282366920938463463365754576278416105", "340282366920938463463365754576278416105"], + "output": "340282366920938463463365754576278416105" + }, + { + "inputs": ["340282366920938463463365754576278416105", "340282366920938463463365754576278416101"], + "output": "340282366920938463463365754576278416097" + } + ], + "and_uint128_euint128": [ + { + "inputs": ["340282366920938463463371836375477224759", "340282366920938463463366410191459861233"], + "output": "340282366920938463463366199075542663217" + }, + { + "inputs": ["340282366920938463463365754576278416101", "340282366920938463463365754576278416105"], + "output": "340282366920938463463365754576278416097" + }, + { + "inputs": ["340282366920938463463365754576278416105", "340282366920938463463365754576278416105"], + "output": "340282366920938463463365754576278416105" + }, + { + "inputs": ["340282366920938463463365754576278416105", "340282366920938463463365754576278416101"], + "output": "340282366920938463463365754576278416097" + } + ], + "and_euint128_euint256": [ + { + "inputs": [ + "340282366920938463463366718158519885511", + "115792089237316195423570985008687907853269984665640564039457581748247155679323" + ], + "output": "340282366920938463463366717989234606147" + }, + { + "inputs": ["340282366920938463463366718158519885507", "340282366920938463463366718158519885511"], + "output": "340282366920938463463366718158519885507" + }, + { + "inputs": ["340282366920938463463366718158519885511", "340282366920938463463366718158519885511"], + "output": "340282366920938463463366718158519885511" + }, + { + "inputs": ["340282366920938463463366718158519885511", "340282366920938463463366718158519885507"], + "output": "340282366920938463463366718158519885507" + } + ], + "and_euint256_euint4": [ + { + "inputs": ["115792089237316195423570985008687907853269984665640564039457579364828919798977", "5"], + "output": "1" + }, + { "inputs": ["4", "8"], "output": "0" }, + { "inputs": ["8", "8"], "output": "8" }, + { "inputs": ["8", "4"], "output": "0" } ], - "xor_euint4_euint8": [ - { "inputs": ["5", "19"], "output": "22" }, + "and_euint256_euint8": [ + { + "inputs": ["115792089237316195423570985008687907853269984665640564039457580200311934752389", "160"], + "output": "128" + }, + { "inputs": ["156", "160"], "output": "128" }, + { "inputs": ["160", "160"], "output": "160" }, + { "inputs": ["160", "156"], "output": "128" } + ], + "and_euint256_euint16": [ + { + "inputs": ["115792089237316195423570985008687907853269984665640564039457581238581042328907", "21842"], + "output": "5442" + }, + { "inputs": ["21838", "21842"], "output": "21826" }, + { "inputs": ["21842", "21842"], "output": "21842" }, + { "inputs": ["21842", "21838"], "output": "21826" } + ], + "and_euint256_euint32": [ + { + "inputs": ["115792089237316195423570985008687907853269984665640564039457579114687562092581", "2312861009"], + "output": "1642497" + }, + { "inputs": ["2312861005", "2312861009"], "output": "2312860993" }, + { "inputs": ["2312861009", "2312861009"], "output": "2312861009" }, + { "inputs": ["2312861009", "2312861005"], "output": "2312860993" } + ], + "and_euint256_euint64": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457578396814970518645", + "18439393076952901085" + ], + "output": "18438862826454918229" + }, + { "inputs": ["18439393076952901081", "18439393076952901085"], "output": "18439393076952901081" }, + { "inputs": ["18439393076952901085", "18439393076952901085"], "output": "18439393076952901085" }, + { "inputs": ["18439393076952901085", "18439393076952901081"], "output": "18439393076952901081" } + ], + "and_euint256_euint128": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457582929951159672455", + "340282366920938463463365847322826293787" + ], + "output": "340282366920938463463365636070292242947" + }, + { + "inputs": ["340282366920938463463365847322826293783", "340282366920938463463365847322826293787"], + "output": "340282366920938463463365847322826293779" + }, + { + "inputs": ["340282366920938463463365847322826293787", "340282366920938463463365847322826293787"], + "output": "340282366920938463463365847322826293787" + }, + { + "inputs": ["340282366920938463463365847322826293787", "340282366920938463463365847322826293783"], + "output": "340282366920938463463365847322826293779" + } + ], + "and_euint256_euint256": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457580473854578773963", + "115792089237316195423570985008687907853269984665640564039457579064265044491325" + ], + "output": "115792089237316195423570985008687907853269984665640564039457575671150140541961" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579064265044491321", + "115792089237316195423570985008687907853269984665640564039457579064265044491325" + ], + "output": "115792089237316195423570985008687907853269984665640564039457579064265044491321" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579064265044491325", + "115792089237316195423570985008687907853269984665640564039457579064265044491325" + ], + "output": "115792089237316195423570985008687907853269984665640564039457579064265044491325" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579064265044491325", + "115792089237316195423570985008687907853269984665640564039457579064265044491321" + ], + "output": "115792089237316195423570985008687907853269984665640564039457579064265044491321" + } + ], + "and_euint256_uint256": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457580473854578773963", + "115792089237316195423570985008687907853269984665640564039457581816489991853517" + ], + "output": "115792089237316195423570985008687907853269984665640564039457579557951374476745" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579064265044491321", + "115792089237316195423570985008687907853269984665640564039457579064265044491325" + ], + "output": "115792089237316195423570985008687907853269984665640564039457579064265044491321" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579064265044491325", + "115792089237316195423570985008687907853269984665640564039457579064265044491325" + ], + "output": "115792089237316195423570985008687907853269984665640564039457579064265044491325" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579064265044491325", + "115792089237316195423570985008687907853269984665640564039457579064265044491321" + ], + "output": "115792089237316195423570985008687907853269984665640564039457579064265044491321" + } + ], + "and_uint256_euint256": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457576516611416206839", + "115792089237316195423570985008687907853269984665640564039457581816489991853517" + ], + "output": "115792089237316195423570985008687907853269984665640564039457575038788798842309" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579064265044491321", + "115792089237316195423570985008687907853269984665640564039457579064265044491325" + ], + "output": "115792089237316195423570985008687907853269984665640564039457579064265044491321" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579064265044491325", + "115792089237316195423570985008687907853269984665640564039457579064265044491325" + ], + "output": "115792089237316195423570985008687907853269984665640564039457579064265044491325" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579064265044491325", + "115792089237316195423570985008687907853269984665640564039457579064265044491321" + ], + "output": "115792089237316195423570985008687907853269984665640564039457579064265044491321" + } + ], + "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_euint16": [ - { "inputs": ["10", "13907"], "output": "13913" }, + "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": ["6", "1855370868"], "output": "1855370866" }, + { "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", "18446366816185499095"], "output": "18446366816185499093" }, + { "inputs": ["2", "18438078325844207475"], "output": "18438078325844207473" }, { "inputs": ["4", "8"], "output": "12" }, { "inputs": ["8", "8"], "output": "0" }, { "inputs": ["8", "4"], "output": "12" } ], - "xor_euint8_euint4": [ - { "inputs": ["253", "3"], "output": "254" }, + "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_euint8": [ - { "inputs": ["213", "62"], "output": "235" }, - { "inputs": ["58", "62"], "output": "4" }, - { "inputs": ["62", "62"], "output": "0" }, - { "inputs": ["62", "58"], "output": "4" } + "xor_euint8_euint4": [ + { "inputs": ["104", "4"], "output": "108" }, + { "inputs": ["4", "8"], "output": "12" }, + { "inputs": ["8", "8"], "output": "0" }, + { "inputs": ["8", "4"], "output": "12" } ], - "xor_euint8_euint16": [ - { "inputs": ["2", "64716"], "output": "64718" }, + "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" } + ], + "xor_euint8_uint8": [ + { "inputs": ["234", "201"], "output": "35" }, + { "inputs": ["146", "150"], "output": "4" }, + { "inputs": ["150", "150"], "output": "0" }, + { "inputs": ["150", "146"], "output": "4" } + ], + "xor_uint8_euint8": [ + { "inputs": ["181", "201"], "output": "124" }, + { "inputs": ["146", "150"], "output": "4" }, + { "inputs": ["150", "150"], "output": "0" }, + { "inputs": ["150", "146"], "output": "4" } + ], + "xor_euint8_euint16": [ + { "inputs": ["233", "6463"], "output": "6614" }, + { "inputs": ["229", "233"], "output": "12" }, + { "inputs": ["233", "233"], "output": "0" }, + { "inputs": ["233", "229"], "output": "12" } + ], "xor_euint8_euint32": [ - { "inputs": ["184", "3590065955"], "output": "3590066075" }, - { "inputs": ["180", "184"], "output": "12" }, - { "inputs": ["184", "184"], "output": "0" }, - { "inputs": ["184", "180"], "output": "12" } + { "inputs": ["200", "3474428988"], "output": "3474429172" }, + { "inputs": ["196", "200"], "output": "12" }, + { "inputs": ["200", "200"], "output": "0" }, + { "inputs": ["200", "196"], "output": "12" } ], "xor_euint8_euint64": [ - { "inputs": ["212", "18437987864856647089"], "output": "18437987864856647013" }, - { "inputs": ["208", "212"], "output": "4" }, - { "inputs": ["212", "212"], "output": "0" }, - { "inputs": ["212", "208"], "output": "4" } + { "inputs": ["250", "18438760776575021013"], "output": "18438760776575020847" }, + { "inputs": ["246", "250"], "output": "12" }, + { "inputs": ["250", "250"], "output": "0" }, + { "inputs": ["250", "246"], "output": "12" } + ], + "xor_euint8_euint128": [ + { + "inputs": ["142", "340282366920938463463373089327559876459"], + "output": "340282366920938463463373089327559876581" + }, + { "inputs": ["138", "142"], "output": "4" }, + { "inputs": ["142", "142"], "output": "0" }, + { "inputs": ["142", "138"], "output": "4" } + ], + "xor_euint8_euint256": [ + { + "inputs": ["244", "115792089237316195423570985008687907853269984665640564039457578624058101395789"], + "output": "115792089237316195423570985008687907853269984665640564039457578624058101395897" + }, + { "inputs": ["240", "244"], "output": "4" }, + { "inputs": ["244", "244"], "output": "0" }, + { "inputs": ["244", "240"], "output": "4" } ], "xor_euint16_euint4": [ - { "inputs": ["34235", "7"], "output": "34236" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "12" } + { "inputs": ["57076", "14"], "output": "57082" }, + { "inputs": ["10", "14"], "output": "4" }, + { "inputs": ["14", "14"], "output": "0" }, + { "inputs": ["14", "10"], "output": "4" } ], "xor_euint16_euint8": [ - { "inputs": ["43168", "233"], "output": "43081" }, - { "inputs": ["229", "233"], "output": "12" }, - { "inputs": ["233", "233"], "output": "0" }, - { "inputs": ["233", "229"], "output": "12" } + { "inputs": ["14933", "231"], "output": "15026" }, + { "inputs": ["227", "231"], "output": "4" }, + { "inputs": ["231", "231"], "output": "0" }, + { "inputs": ["231", "227"], "output": "4" } ], "xor_euint16_euint16": [ - { "inputs": ["64619", "2520"], "output": "62899" }, - { "inputs": ["2516", "2520"], "output": "12" }, - { "inputs": ["2520", "2520"], "output": "0" }, - { "inputs": ["2520", "2516"], "output": "12" } + { "inputs": ["65327", "25546"], "output": "40165" }, + { "inputs": ["25542", "25546"], "output": "12" }, + { "inputs": ["25546", "25546"], "output": "0" }, + { "inputs": ["25546", "25542"], "output": "12" } + ], + "xor_euint16_uint16": [ + { "inputs": ["65327", "31297"], "output": "34158" }, + { "inputs": ["25542", "25546"], "output": "12" }, + { "inputs": ["25546", "25546"], "output": "0" }, + { "inputs": ["25546", "25542"], "output": "12" } + ], + "xor_uint16_euint16": [ + { "inputs": ["33651", "31297"], "output": "63794" }, + { "inputs": ["25542", "25546"], "output": "12" }, + { "inputs": ["25546", "25546"], "output": "0" }, + { "inputs": ["25546", "25542"], "output": "12" } ], "xor_euint16_euint32": [ - { "inputs": ["51717", "501889469"], "output": "501937080" }, - { "inputs": ["51713", "51717"], "output": "4" }, - { "inputs": ["51717", "51717"], "output": "0" }, - { "inputs": ["51717", "51713"], "output": "4" } + { "inputs": ["23121", "1351735572"], "output": "1351713605" }, + { "inputs": ["23117", "23121"], "output": "28" }, + { "inputs": ["23121", "23121"], "output": "0" }, + { "inputs": ["23121", "23117"], "output": "28" } ], "xor_euint16_euint64": [ - { "inputs": ["12673", "18438027026491597713"], "output": "18438027026491593232" }, - { "inputs": ["12669", "12673"], "output": "252" }, - { "inputs": ["12673", "12673"], "output": "0" }, - { "inputs": ["12673", "12669"], "output": "252" } + { "inputs": ["47675", "18446725910384356169"], "output": "18446725910384382322" }, + { "inputs": ["47671", "47675"], "output": "12" }, + { "inputs": ["47675", "47675"], "output": "0" }, + { "inputs": ["47675", "47671"], "output": "12" } + ], + "xor_euint16_euint128": [ + { + "inputs": ["57137", "340282366920938463463372706296613530555"], + "output": "340282366920938463463372706296613549194" + }, + { "inputs": ["57133", "57137"], "output": "28" }, + { "inputs": ["57137", "57137"], "output": "0" }, + { "inputs": ["57137", "57133"], "output": "28" } + ], + "xor_euint16_euint256": [ + { + "inputs": ["21805", "115792089237316195423570985008687907853269984665640564039457581252703610907733"], + "output": "115792089237316195423570985008687907853269984665640564039457581252703610927480" + }, + { "inputs": ["21801", "21805"], "output": "4" }, + { "inputs": ["21805", "21805"], "output": "0" }, + { "inputs": ["21805", "21801"], "output": "4" } ], "xor_euint32_euint4": [ - { "inputs": ["2588014920", "3"], "output": "2588014923" }, + { "inputs": ["4009369108", "6"], "output": "4009369106" }, { "inputs": ["4", "8"], "output": "12" }, { "inputs": ["8", "8"], "output": "0" }, { "inputs": ["8", "4"], "output": "12" } ], "xor_euint32_euint8": [ - { "inputs": ["2442028658", "23"], "output": "2442028645" }, - { "inputs": ["19", "23"], "output": "4" }, - { "inputs": ["23", "23"], "output": "0" }, - { "inputs": ["23", "19"], "output": "4" } + { "inputs": ["1756250914", "211"], "output": "1756251121" }, + { "inputs": ["207", "211"], "output": "28" }, + { "inputs": ["211", "211"], "output": "0" }, + { "inputs": ["211", "207"], "output": "28" } ], "xor_euint32_euint16": [ - { "inputs": ["4035221230", "58371"], "output": "4035212013" }, - { "inputs": ["58367", "58371"], "output": "2044" }, - { "inputs": ["58371", "58371"], "output": "0" }, - { "inputs": ["58371", "58367"], "output": "2044" } + { "inputs": ["3818112177", "23871"], "output": "3818101134" }, + { "inputs": ["23867", "23871"], "output": "4" }, + { "inputs": ["23871", "23871"], "output": "0" }, + { "inputs": ["23871", "23867"], "output": "4" } ], "xor_euint32_euint32": [ - { "inputs": ["3321450403", "449148535"], "output": "3745266132" }, - { "inputs": ["449148531", "449148535"], "output": "4" }, - { "inputs": ["449148535", "449148535"], "output": "0" }, - { "inputs": ["449148535", "449148531"], "output": "4" } + { "inputs": ["3766539452", "3557659859"], "output": "881672303" }, + { "inputs": ["3557659855", "3557659859"], "output": "28" }, + { "inputs": ["3557659859", "3557659859"], "output": "0" }, + { "inputs": ["3557659859", "3557659855"], "output": "28" } + ], + "xor_euint32_uint32": [ + { "inputs": ["3766539452", "3890491814"], "output": "124052762" }, + { "inputs": ["3557659855", "3557659859"], "output": "28" }, + { "inputs": ["3557659859", "3557659859"], "output": "0" }, + { "inputs": ["3557659859", "3557659855"], "output": "28" } + ], + "xor_uint32_euint32": [ + { "inputs": ["1940474497", "3890491814"], "output": "2488105767" }, + { "inputs": ["3557659855", "3557659859"], "output": "28" }, + { "inputs": ["3557659859", "3557659859"], "output": "0" }, + { "inputs": ["3557659859", "3557659855"], "output": "28" } ], "xor_euint32_euint64": [ - { "inputs": ["3933920874", "18441384818446198365"], "output": "18441384821297952823" }, - { "inputs": ["3933920870", "3933920874"], "output": "12" }, - { "inputs": ["3933920874", "3933920874"], "output": "0" }, - { "inputs": ["3933920874", "3933920870"], "output": "12" } + { "inputs": ["390302983", "18441970713749353087"], "output": "18441970713904316280" }, + { "inputs": ["390302979", "390302983"], "output": "4" }, + { "inputs": ["390302983", "390302983"], "output": "0" }, + { "inputs": ["390302983", "390302979"], "output": "4" } + ], + "xor_euint32_euint128": [ + { + "inputs": ["3049009589", "340282366920938463463368216078619273371"], + "output": "340282366920938463463368216080538425646" + }, + { "inputs": ["3049009585", "3049009589"], "output": "4" }, + { "inputs": ["3049009589", "3049009589"], "output": "0" }, + { "inputs": ["3049009589", "3049009585"], "output": "4" } + ], + "xor_euint32_euint256": [ + { + "inputs": ["3706671686", "115792089237316195423570985008687907853269984665640564039457578090382088595177"], + "output": "115792089237316195423570985008687907853269984665640564039457578090383101310127" + }, + { "inputs": ["3706671682", "3706671686"], "output": "4" }, + { "inputs": ["3706671686", "3706671686"], "output": "0" }, + { "inputs": ["3706671686", "3706671682"], "output": "4" } ], "xor_euint64_euint4": [ - { "inputs": ["18442015029052104347", "10"], "output": "18442015029052104337" }, - { "inputs": ["6", "10"], "output": "12" }, - { "inputs": ["10", "10"], "output": "0" }, - { "inputs": ["10", "6"], "output": "12" } + { "inputs": ["18442021950386427623", "8"], "output": "18442021950386427631" }, + { "inputs": ["4", "8"], "output": "12" }, + { "inputs": ["8", "8"], "output": "0" }, + { "inputs": ["8", "4"], "output": "12" } ], "xor_euint64_euint8": [ - { "inputs": ["18443626965217997733", "213"], "output": "18443626965217997680" }, - { "inputs": ["209", "213"], "output": "4" }, - { "inputs": ["213", "213"], "output": "0" }, - { "inputs": ["213", "209"], "output": "4" } + { "inputs": ["18439050232368801565", "12"], "output": "18439050232368801553" }, + { "inputs": ["8", "12"], "output": "4" }, + { "inputs": ["12", "12"], "output": "0" }, + { "inputs": ["12", "8"], "output": "4" } ], "xor_euint64_euint16": [ - { "inputs": ["18442272025927693303", "37790"], "output": "18442272025927721065" }, - { "inputs": ["37786", "37790"], "output": "4" }, - { "inputs": ["37790", "37790"], "output": "0" }, - { "inputs": ["37790", "37786"], "output": "4" } + { "inputs": ["18446196219353056271", "45319"], "output": "18446196219353101576" }, + { "inputs": ["45315", "45319"], "output": "4" }, + { "inputs": ["45319", "45319"], "output": "0" }, + { "inputs": ["45319", "45315"], "output": "4" } ], "xor_euint64_euint32": [ - { "inputs": ["18444516407156523745", "3421158537"], "output": "18444516404054425192" }, - { "inputs": ["3421158533", "3421158537"], "output": "12" }, - { "inputs": ["3421158537", "3421158537"], "output": "0" }, - { "inputs": ["3421158537", "3421158533"], "output": "12" } + { "inputs": ["18440012895744339301", "1085979490"], "output": "18440012896823678471" }, + { "inputs": ["1085979486", "1085979490"], "output": "60" }, + { "inputs": ["1085979490", "1085979490"], "output": "0" }, + { "inputs": ["1085979490", "1085979486"], "output": "60" } ], "xor_euint64_euint64": [ - { "inputs": ["18440379911699358599", "18444259094994538125"], "output": "8523658389368074" }, - { "inputs": ["18440379911699358595", "18440379911699358599"], "output": "4" }, - { "inputs": ["18440379911699358599", "18440379911699358599"], "output": "0" }, - { "inputs": ["18440379911699358599", "18440379911699358595"], "output": "4" } + { "inputs": ["18439520894560746701", "18440669858368892063"], "output": "3444795783188562" }, + { "inputs": ["18439520894560746697", "18439520894560746701"], "output": "4" }, + { "inputs": ["18439520894560746701", "18439520894560746701"], "output": "0" }, + { "inputs": ["18439520894560746701", "18439520894560746697"], "output": "4" } + ], + "xor_euint64_uint64": [ + { "inputs": ["18439520894560746701", "18445914762272407037"], "output": "7700087946789168" }, + { "inputs": ["18439520894560746697", "18439520894560746701"], "output": "4" }, + { "inputs": ["18439520894560746701", "18439520894560746701"], "output": "0" }, + { "inputs": ["18439520894560746701", "18439520894560746697"], "output": "4" } + ], + "xor_uint64_euint64": [ + { "inputs": ["18446426713533628951", "18445914762272407037"], "output": "1076293857951722" }, + { "inputs": ["18439520894560746697", "18439520894560746701"], "output": "4" }, + { "inputs": ["18439520894560746701", "18439520894560746701"], "output": "0" }, + { "inputs": ["18439520894560746701", "18439520894560746697"], "output": "4" } + ], + "xor_euint64_euint128": [ + { + "inputs": ["18445744178466976977", "340282366920938463463371486789808692655"], + "output": "340282366920938463444930285940062611838" + }, + { "inputs": ["18445744178466976973", "18445744178466976977"], "output": "28" }, + { "inputs": ["18445744178466976977", "18445744178466976977"], "output": "0" }, + { "inputs": ["18445744178466976977", "18445744178466976973"], "output": "28" } + ], + "xor_euint64_euint256": [ + { + "inputs": [ + "18438921176678700429", + "115792089237316195423570985008687907853269984665640564039457575984328616481271" + ], + "output": "115792089237316195423570985008687907853269984665640564039439139317222450136186" + }, + { "inputs": ["18438921176678700425", "18438921176678700429"], "output": "4" }, + { "inputs": ["18438921176678700429", "18438921176678700429"], "output": "0" }, + { "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" } + ], + "xor_euint128_euint8": [ + { + "inputs": ["340282366920938463463373857001835170765", "82"], + "output": "340282366920938463463373857001835170719" + }, + { "inputs": ["78", "82"], "output": "28" }, + { "inputs": ["82", "82"], "output": "0" }, + { "inputs": ["82", "78"], "output": "28" } + ], + "xor_euint128_euint16": [ + { + "inputs": ["340282366920938463463371581047560381685", "64364"], + "output": "340282366920938463463371581047560363929" + }, + { "inputs": ["64360", "64364"], "output": "4" }, + { "inputs": ["64364", "64364"], "output": "0" }, + { "inputs": ["64364", "64360"], "output": "4" } + ], + "xor_euint128_euint32": [ + { + "inputs": ["340282366920938463463372336872535218607", "2309231003"], + "output": "340282366920938463463372336874538256436" + }, + { "inputs": ["2309230999", "2309231003"], "output": "12" }, + { "inputs": ["2309231003", "2309231003"], "output": "0" }, + { "inputs": ["2309231003", "2309230999"], "output": "12" } + ], + "xor_euint128_euint64": [ + { + "inputs": ["340282366920938463463368977308831072123", "18442960701720483125"], + "output": "340282366920938463444935023814972271182" + }, + { "inputs": ["18442960701720483121", "18442960701720483125"], "output": "4" }, + { "inputs": ["18442960701720483125", "18442960701720483125"], "output": "0" }, + { "inputs": ["18442960701720483125", "18442960701720483121"], "output": "4" } + ], + "xor_euint128_euint128": [ + { + "inputs": ["340282366920938463463372080691181989981", "340282366920938463463368941059346865329"], + "output": "8122674366786796" + }, + { + "inputs": ["340282366920938463463368941059346865325", "340282366920938463463368941059346865329"], + "output": "28" + }, + { "inputs": ["340282366920938463463368941059346865329", "340282366920938463463368941059346865329"], "output": "0" }, + { "inputs": ["340282366920938463463368941059346865329", "340282366920938463463368941059346865325"], "output": "28" } + ], + "xor_euint128_uint128": [ + { + "inputs": ["340282366920938463463372080691181989981", "340282366920938463463368386031692563719"], + "output": "8690927368893786" + }, + { + "inputs": ["340282366920938463463368941059346865325", "340282366920938463463368941059346865329"], + "output": "28" + }, + { "inputs": ["340282366920938463463368941059346865329", "340282366920938463463368941059346865329"], "output": "0" }, + { "inputs": ["340282366920938463463368941059346865329", "340282366920938463463368941059346865325"], "output": "28" } + ], + "xor_uint128_euint128": [ + { + "inputs": ["340282366920938463463374269120313762865", "340282366920938463463368386031692563719"], + "output": "6519991538245942" + }, + { + "inputs": ["340282366920938463463368941059346865325", "340282366920938463463368941059346865329"], + "output": "28" + }, + { "inputs": ["340282366920938463463368941059346865329", "340282366920938463463368941059346865329"], "output": "0" }, + { "inputs": ["340282366920938463463368941059346865329", "340282366920938463463368941059346865325"], "output": "28" } + ], + "xor_euint128_euint256": [ + { + "inputs": [ + "340282366920938463463370357504982561043", + "115792089237316195423570985008687907853269984665640564039457576209743222065387" + ], + "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" + }, + { "inputs": ["8", "12"], "output": "4" }, + { "inputs": ["12", "12"], "output": "0" }, + { "inputs": ["12", "8"], "output": "4" } + ], + "xor_euint256_euint8": [ + { + "inputs": ["115792089237316195423570985008687907853269984665640564039457576224347045805665", "175"], + "output": "115792089237316195423570985008687907853269984665640564039457576224347045805774" + }, + { "inputs": ["171", "175"], "output": "4" }, + { "inputs": ["175", "175"], "output": "0" }, + { "inputs": ["175", "171"], "output": "4" } + ], + "xor_euint256_euint16": [ + { + "inputs": ["115792089237316195423570985008687907853269984665640564039457583698273346637887", "24298"], + "output": "115792089237316195423570985008687907853269984665640564039457583698273346621141" + }, + { "inputs": ["24294", "24298"], "output": "12" }, + { "inputs": ["24298", "24298"], "output": "0" }, + { "inputs": ["24298", "24294"], "output": "12" } + ], + "xor_euint256_euint32": [ + { + "inputs": ["115792089237316195423570985008687907853269984665640564039457575870021368542809", "1137098251"], + "output": "115792089237316195423570985008687907853269984665640564039457575870020349413458" + }, + { "inputs": ["1137098247", "1137098251"], "output": "12" }, + { "inputs": ["1137098251", "1137098251"], "output": "0" }, + { "inputs": ["1137098251", "1137098247"], "output": "12" } + ], + "xor_euint256_euint64": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457581449682348833995", + "18444753228810258299" + ], + "output": "115792089237316195423570985008687907853269984665640564039439141209004043664304" + }, + { "inputs": ["18444753228810258295", "18444753228810258299"], "output": "12" }, + { "inputs": ["18444753228810258299", "18444753228810258299"], "output": "0" }, + { "inputs": ["18444753228810258299", "18444753228810258295"], "output": "12" } + ], + "xor_euint256_euint128": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457582608158223098943", + "340282366920938463463373070389452427715" + ], + "output": "115792089237316195423570985008687907852929702298719625575994209836984672105980" + }, + { + "inputs": ["340282366920938463463373070389452427711", "340282366920938463463373070389452427715"], + "output": "124" + }, + { "inputs": ["340282366920938463463373070389452427715", "340282366920938463463373070389452427715"], "output": "0" }, + { + "inputs": ["340282366920938463463373070389452427715", "340282366920938463463373070389452427711"], + "output": "124" + } + ], + "xor_euint256_euint256": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457582495469225451093", + "115792089237316195423570985008687907853269984665640564039457581801761034193859" + ], + "output": "714633272808854" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457581801761034193855", + "115792089237316195423570985008687907853269984665640564039457581801761034193859" + ], + "output": "124" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457581801761034193859", + "115792089237316195423570985008687907853269984665640564039457581801761034193859" + ], + "output": "0" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457581801761034193859", + "115792089237316195423570985008687907853269984665640564039457581801761034193855" + ], + "output": "124" + } + ], + "xor_euint256_uint256": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457582495469225451093", + "115792089237316195423570985008687907853269984665640564039457579143464719512889" + ], + "output": "5655612635835244" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457581801761034193855", + "115792089237316195423570985008687907853269984665640564039457581801761034193859" + ], + "output": "124" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457581801761034193859", + "115792089237316195423570985008687907853269984665640564039457581801761034193859" + ], + "output": "0" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457581801761034193859", + "115792089237316195423570985008687907853269984665640564039457581801761034193855" + ], + "output": "124" + } + ], + "xor_uint256_euint256": [ + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457579014577469369511", + "115792089237316195423570985008687907853269984665640564039457579143464719512889" + ], + "output": "269763301726622" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457581801761034193855", + "115792089237316195423570985008687907853269984665640564039457581801761034193859" + ], + "output": "124" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457581801761034193859", + "115792089237316195423570985008687907853269984665640564039457581801761034193859" + ], + "output": "0" + }, + { + "inputs": [ + "115792089237316195423570985008687907853269984665640564039457581801761034193859", + "115792089237316195423570985008687907853269984665640564039457581801761034193855" + ], + "output": "124" + } ], "not_euint4": [{ "inputs": ["4"], "output": "11" }], - "not_euint8": [{ "inputs": ["29"], "output": "226" }], - "not_euint16": [{ "inputs": ["47885"], "output": "17650" }], - "not_euint32": [{ "inputs": ["3731607282"], "output": "563360013" }], - "not_euint64": [{ "inputs": ["18443812023863287611"], "output": "2932049846264004" }], - "neg_euint4": [{ "inputs": ["6"], "output": "10" }], - "neg_euint8": [{ "inputs": ["186"], "output": "70" }], - "neg_euint16": [{ "inputs": ["3993"], "output": "61543" }], - "neg_euint32": [{ "inputs": ["2747701293"], "output": "1547266003" }], - "neg_euint64": [{ "inputs": ["18446646312005372999"], "output": "97761704178617" }] + "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" }], + "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" }], + "neg_euint256": [ + { + "inputs": ["115792089237316195423570985008687907853269984665640564039457578680357072424439"], + "output": "5327556057215497" + } + ] } diff --git a/codegen/payments.ts b/codegen/payments.ts index 875ff024..9556fda8 100644 --- a/codegen/payments.ts +++ b/codegen/payments.ts @@ -18,9 +18,9 @@ export function generateFHEPayment(priceData: PriceData): string { import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol"; error FHEGasBlockLimitExceeded(); + error UnsupportedOperation(); error CallerMustBeTFHEExecutorContract(); error OnlyScalarOperationsAreSupported(); - error OnlyNonScalarOperationsAreSupported(); error RecoveryFailed(); error WithdrawalFailed(); error AccountNotEnoughFunded(); @@ -62,7 +62,8 @@ export function generateFHEPayment(priceData: PriceData): string { $.slot := FHEPaymentStorageLocation } } - + + /// @notice Getter function for the TFHEExecutor contract address function getTFHEExecutorAddress() public view virtual returns (address) { return tfheExecutorAddress; } @@ -194,7 +195,7 @@ export function generateFHEPayment(priceData: PriceData): string { function checkIfNewBlock() internal virtual { FHEPaymentStorage storage $ = _getFHEPaymentStorage(); uint256 lastBlock_ = block.number; - if (block.number > $.lastBlock) { + if (lastBlock_ > $.lastBlock) { $.lastBlock = lastBlock_; $.currentBlockConsumption = 0; } @@ -215,6 +216,7 @@ export function generateFHEPayment(priceData: PriceData): string { } else { output += ` function ${functionName}(address payer, uint8 resultType) external virtual { if(msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + checkIfNewBlock(); `; } @@ -261,11 +263,13 @@ ${generatePriceChecks(data.nonScalar)} } function generatePriceChecks(prices: { [key: string]: number }): string { - return Object.entries(prices) - .map( - ([resultType, price]) => ` if (resultType == ${resultType}) { + return ( + Object.entries(prices) + .map( + ([resultType, price]) => ` if (resultType == ${resultType}) { updateFunding(payer, ${price}); }`, - ) - .join(' else '); + ) + .join(' else ') + 'else { revert UnsupportedOperation();}' + ); } diff --git a/codegen/templates.ts b/codegen/templates.ts index 20cb372c..8fe74ee5 100644 --- a/codegen/templates.ts +++ b/codegen/templates.ts @@ -1,6 +1,6 @@ import { assert } from 'console'; -import { CodegenContext, Operator, OperatorArguments, ReturnType } from './common'; +import { Operator, OperatorArguments, ReturnType } from './common'; import { ArgumentType, OverloadSignature } from './testgen'; import { getUint } from './utils'; @@ -12,7 +12,11 @@ type euint8 is uint256; type euint16 is uint256; type euint32 is uint256; type euint64 is uint256; +type euint128 is uint256; +type euint256 is uint256; type eaddress is uint256; +type ebytes64 is uint256; +type ebytes128 is uint256; type ebytes256 is uint256; type einput is bytes32; @@ -57,7 +61,7 @@ function binaryOperatorImpl(op: Operator): string { ); } -export function implSol(ctx: CodegenContext, operators: Operator[]): string { +export function implSol(operators: Operator[]): string { const res: string[] = []; const coprocessorInterface = generateImplCoprocessorInterface(operators); @@ -105,7 +109,7 @@ library Impl { } }); - res.push(implCustomMethods(ctx)); + res.push(implCustomMethods()); res.push('}\n'); @@ -190,6 +194,9 @@ function coprocessorInterfaceCustomFunctions(): string { function verifyCiphertext(bytes32 inputHandle, address callerAddress, bytes memory inputProof, bytes1 inputType) external returns (uint256 result); function cast(uint256 ct, bytes1 toType) external returns (uint256 result); function trivialEncrypt(uint256 ct, bytes1 toType) external returns (uint256 result); + function trivialEncrypt(bytes memory ct, bytes1 toType) external returns (uint256 result); + function fheEq(uint256 lhs, bytes memory rhs, bytes1 scalarByte) external returns (uint256 result); + function fheNe(uint256 lhs, bytes memory rhs, bytes1 scalarByte) external returns (uint256 result); function fheIfThenElse(uint256 control, uint256 ifTrue, uint256 ifFalse) external returns (uint256 result); function fheRand(bytes1 randType) external returns (uint256 result); function fheRandBounded(uint256 upperBound, bytes1 randType) external returns (uint256 result); @@ -209,7 +216,6 @@ function generateACLInterface(): string { } export function tfheSol( - ctx: CodegenContext, operators: Operator[], supportedBits: number[], mocked: boolean, @@ -298,7 +304,7 @@ library TFHE { supportedBits.forEach((bits) => res.push(tfheUnaryOperators(bits, operators, signatures))); supportedBits.forEach((bits) => res.push(tfheCustomUnaryOperators(bits, signatures, mocked))); - res.push(tfheCustomMethods(ctx, mocked)); + res.push(tfheCustomMethods()); res.push(tfheAclMethods(supportedBits)); @@ -588,17 +594,47 @@ function tfheAsEboolUnaryCast(bits: number): string { // Evaluate and(a, b) and return the result. function and(ebool a, ebool b) internal returns (ebool) { - return ebool.wrap(Impl.and(ebool.unwrap(a), ebool.unwrap(b))); + return ebool.wrap(Impl.and(ebool.unwrap(a), ebool.unwrap(b), false)); + } + + // Evaluate and(a, b) and return the result. + function and(ebool a, bool b) internal returns (ebool) { + return ebool.wrap(Impl.and(ebool.unwrap(a), b?1:0, true)); + } + + // Evaluate and(a, b) and return the result. + function and(bool a, ebool b) internal returns (ebool) { + return ebool.wrap(Impl.and(ebool.unwrap(b), a?1:0, true)); } // Evaluate or(a, b) and return the result. function or(ebool a, ebool b) internal returns (ebool) { - return ebool.wrap(Impl.or(ebool.unwrap(a), ebool.unwrap(b))); + return ebool.wrap(Impl.or(ebool.unwrap(a), ebool.unwrap(b), false)); + } + + // Evaluate or(a, b) and return the result. + function or(ebool a, bool b) internal returns (ebool) { + return ebool.wrap(Impl.or(ebool.unwrap(a), b?1:0, true)); + } + + // Evaluate or(a, b) and return the result. + function or(bool a, ebool b) internal returns (ebool) { + return ebool.wrap(Impl.or(ebool.unwrap(b), a?1:0, true)); } // Evaluate xor(a, b) and return the result. function xor(ebool a, ebool b) internal returns (ebool) { - return ebool.wrap(Impl.xor(ebool.unwrap(a), ebool.unwrap(b))); + return ebool.wrap(Impl.xor(ebool.unwrap(a), ebool.unwrap(b), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(ebool a, bool b) internal returns (ebool) { + return ebool.wrap(Impl.xor(ebool.unwrap(a), b?1:0, true)); + } + + // Evaluate xor(a, b) and return the result. + function xor(bool a, ebool b) internal returns (ebool) { + return ebool.wrap(Impl.xor(ebool.unwrap(b), a?1:0, true)); } function not(ebool a) internal returns (ebool) { @@ -762,6 +798,22 @@ function tfheAclMethods(supportedBits: number[]): string { Impl.allow(eaddress.unwrap(value), address(this)); } + function allow(ebytes64 value, address account) internal { + Impl.allow(ebytes64.unwrap(value), account); + } + + function allowThis(ebytes64 value) internal { + Impl.allow(ebytes64.unwrap(value), address(this)); + } + + function allow(ebytes128 value, address account) internal { + Impl.allow(ebytes128.unwrap(value), account); + } + + function allowThis(ebytes128 value) internal { + Impl.allow(ebytes128.unwrap(value), address(this)); + } + function allow(ebytes256 value, address account) internal { Impl.allow(ebytes256.unwrap(value), account); } @@ -805,85 +857,266 @@ function tfheAclMethods(supportedBits: number[]): string { return res.join(''); } -function tfheCustomMethods(ctx: CodegenContext, mocked: boolean): string { +function tfheCustomMethods(): string { let result = ` + // Generates a random encrypted boolean. + function randEbool() internal returns (ebool) { + return ebool.wrap(Impl.rand(Common.ebool_t)); + } + + // Generates a random encrypted 4-bit unsigned integer. + function randEuint4() internal returns (euint4) { + return euint4.wrap(Impl.rand(Common.euint4_t)); + } + + // 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)); + } + // Generates a random encrypted 8-bit unsigned integer. - // Important: The random integer is generated in the plain! An FHE-based version is coming soon. function randEuint8() internal returns (euint8) { return euint8.wrap(Impl.rand(Common.euint8_t)); } // Generates a random encrypted 8-bit unsigned integer in the [0, upperBound) range. // The upperBound must be a power of 2. - // Important: The random integer is generated in the plain! An FHE-based version is coming soon. function randEuint8(uint8 upperBound) internal returns (euint8) { return euint8.wrap(Impl.randBounded(upperBound, Common.euint8_t)); } // Generates a random encrypted 16-bit unsigned integer. - // Important: The random integer is generated in the plain! An FHE-based version is coming soon. function randEuint16() internal returns (euint16) { return euint16.wrap(Impl.rand(Common.euint16_t)); } // Generates a random encrypted 16-bit unsigned integer in the [0, upperBound) range. // The upperBound must be a power of 2. - // Important: The random integer is generated in the plain! An FHE-based version is coming soon. function randEuint16(uint16 upperBound) internal returns (euint16) { return euint16.wrap(Impl.randBounded(upperBound, Common.euint16_t)); } // Generates a random encrypted 32-bit unsigned integer. - // Important: The random integer is generated in the plain! An FHE-based version is coming soon. function randEuint32() internal returns (euint32) { return euint32.wrap(Impl.rand(Common.euint32_t)); } // Generates a random encrypted 32-bit unsigned integer in the [0, upperBound) range. // The upperBound must be a power of 2. - // Important: The random integer is generated in the plain! An FHE-based version is coming soon. function randEuint32(uint32 upperBound) internal returns (euint32) { return euint32.wrap(Impl.randBounded(upperBound, Common.euint32_t)); } // Generates a random encrypted 64-bit unsigned integer. - // Important: The random integer is generated in the plain! An FHE-based version is coming soon. function randEuint64() internal returns (euint64) { return euint64.wrap(Impl.rand(Common.euint64_t)); } // Generates a random encrypted 64-bit unsigned integer in the [0, upperBound) range. // The upperBound must be a power of 2. - // Important: The random integer is generated in the plain! An FHE-based version is coming soon. function randEuint64(uint64 upperBound) internal returns (euint64) { return euint64.wrap(Impl.randBounded(upperBound, Common.euint64_t)); } + // Generates a random encrypted 128-bit unsigned integer. + function randEuint128() internal returns (euint128) { + return euint128.wrap(Impl.rand(Common.euint128_t)); + } + + // 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)); + } + + // Generates a random encrypted 256-bit unsigned integer. + function randEuint256() internal returns (euint256) { + return euint256.wrap(Impl.rand(Common.euint256_t)); + } + + // 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)); + } + + // Generates a random encrypted 512-bit unsigned integer. + function randEbytes64() internal returns (ebytes64) { + return ebytes64.wrap(Impl.rand(Common.ebytes64_t)); + } + + // Generates a random encrypted 1024-bit unsigned integer. + function randEbytes128() internal returns (ebytes128) { + return ebytes128.wrap(Impl.rand(Common.ebytes128_t)); + } + + // Generates a random encrypted 2048-bit unsigned integer. + function randEbytes256() internal returns (ebytes256) { + return ebytes256.wrap(Impl.rand(Common.ebytes256_t)); + } + // 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)); } - // Convert a plaintext value to an encrypted asEaddress. + // 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)); } + + + // 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)); + } + + // Left-pad a bytes array with zeros such that it becomes of length 64. + function padToBytes64(bytes memory input) internal pure returns (bytes memory) { + require(input.length <= 64, "Input exceeds 64 bytes"); + bytes memory result = new bytes(64); + uint256 paddingLength = 64 - input.length; + for (uint256 i = 0; i < paddingLength; i++) { + result[i] = 0; + } + for (uint256 i = 0; i < input.length; i++) { + result[paddingLength + i] = input[i]; + } + return result; + } + + // 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)); + } + + // 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)); + } + + // Left-pad a bytes array with zeros such that it becomes of length 128. + function padToBytes128(bytes memory input) internal pure returns (bytes memory) { + require(input.length <= 128, "Input exceeds 128 bytes"); + bytes memory result = new bytes(128); + uint256 paddingLength = 128 - input.length; + for (uint256 i = 0; i < paddingLength; i++) { + result[i] = 0; + } + for (uint256 i = 0; i < input.length; i++) { + result[paddingLength + i] = input[i]; + } + return result; + } + + // 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)); + } // 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)); } + // Left-pad a bytes array with zeros such that it becomes of length 256. + function padToBytes256(bytes memory input) internal pure returns (bytes memory) { + require(input.length <= 256, "Input exceeds 256 bytes"); + bytes memory result = new bytes(256); + uint256 paddingLength = 256 - input.length; + for (uint256 i = 0; i < paddingLength; i++) { + result[i] = 0; + } + for (uint256 i = 0; i < input.length; i++) { + result[paddingLength + i] = input[i]; + } + return result; + } + + // 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)); + } + // Return true if the enrypted address is initialized and false otherwise. function isInitialized(eaddress v) internal pure returns (bool) { return eaddress.unwrap(v) != 0; } + + // Return true if the enrypted value is initialized and false otherwise. + function isInitialized(ebytes64 v) internal pure returns (bool) { + return ebytes64.unwrap(v) != 0; + } + + // Return true if the enrypted value is initialized and false otherwise. + function isInitialized(ebytes128 v) internal pure returns (bool) { + return ebytes128.unwrap(v) != 0; + } // Return true if the enrypted value is initialized and false otherwise. function isInitialized(ebytes256 v) internal pure returns (bool) { return ebytes256.unwrap(v) != 0; } + // Evaluate eq(a, b) and return 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)); + } + + // Evaluate ne(a, b) and return 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)); + } + + // Evaluate eq(a, b) and return 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), bProc, true)); + } + + // Evaluate eq(a, b) and return 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), bProc, true)); + } + + // Evaluate ne(a, b) and return 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), bProc, true)); + } + + // Evaluate ne(a, b) and return 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), bProc, true)); + } + // Evaluate eq(a, b) and return the result. function eq(eaddress a, eaddress b) internal returns (ebool) { if (!isInitialized(a)) { @@ -942,30 +1175,202 @@ function tfheCustomMethods(ctx: CodegenContext, mocked: boolean): string { return ebool.wrap(Impl.ne(eaddress.unwrap(a), bProc, true)); } + // 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))); + } + // 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))); } + // 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, ebytes64 a, ebytes64 b) internal returns (ebytes64) { + return ebytes64.wrap(Impl.select(ebool.unwrap(control), ebytes64.unwrap(a), ebytes64.unwrap(b))); + } + + // 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))); + } + + // 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))); + } + + // Evaluate eq(a, b) and return 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)); + } + + // Evaluate eq(a, b) and return 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)); + } + + // Evaluate eq(a, b) and return 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)); + } + + // Evaluate ne(a, b) and return 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)); + } + + // Evaluate ne(a, b) and return 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)); + } + + // Evaluate ne(a, b) and return 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)); + } + + // Evaluate eq(a, b) and return 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)); + } + + // Evaluate eq(a, b) and return 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)); + } + + // Evaluate eq(a, b) and return 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)); + } + + // Evaluate ne(a, b) and return 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)); + } + + // Evaluate ne(a, b) and return the result. + 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)); + } + + // Evaluate ne(a, b) and return the result. + 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)); + } + // Evaluate eq(a, b) and return the result. function eq(ebytes256 a, ebytes256 b) internal returns (ebool) { - require(isInitialized(a), "a is uninitialized"); - require(isInitialized(b), "b is uninitialized"); + 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)); } + // Evaluate eq(a, b) and return 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)); + } + + // Evaluate eq(a, b) and return 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)); + } + // Evaluate ne(a, b) and return the result. function ne(ebytes256 a, ebytes256 b) internal returns (ebool) { - require(isInitialized(a), "a is uninitialized"); - require(isInitialized(b), "b is uninitialized"); + 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)); } + + // Evaluate ne(a, b) and return 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)); + } + + // Evaluate ne(a, b) and return the result. + function ne(bytes memory a, ebytes256 b) internal returns (ebool) { + if (!isInitialized(b)) { + b = asEbytes256(padToBytes256(hex'')); + } + return ebool.wrap(Impl.ne(ebytes256.unwrap(b), a, true)); + } `; return result; } -function implCustomMethods(ctx: CodegenContext): string { +function implCustomMethods(): string { return ` // 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'. @@ -1000,6 +1405,36 @@ function implCustomMethods(ctx: CodegenContext): string { result = ITFHEExecutor($.TFHEExecutorAddress).trivialEncrypt(value, bytes1(toType)); } + function trivialEncrypt( + bytes memory value, + uint8 toType + ) internal returns (uint256 result) { + FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig(); + result = ITFHEExecutor($.TFHEExecutorAddress).trivialEncrypt(value, bytes1(toType)); + } + + function eq(uint256 lhs, bytes memory rhs, bool scalar) internal returns (uint256 result) { + bytes1 scalarByte; + if (scalar) { + scalarByte = 0x01; + } else { + scalarByte = 0x00; + } + FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig(); + result = ITFHEExecutor($.TFHEExecutorAddress).fheEq(lhs, rhs, scalarByte); + } + + function ne(uint256 lhs, bytes memory rhs, bool scalar) internal returns (uint256 result) { + bytes1 scalarByte; + if (scalar) { + scalarByte = 0x01; + } else { + scalarByte = 0x00; + } + FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig(); + result = ITFHEExecutor($.TFHEExecutorAddress).fheNe(lhs, rhs, scalarByte); + } + function rand(uint8 randType) internal returns(uint256 result) { FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig(); result = ITFHEExecutor($.TFHEExecutorAddress).fheRand(bytes1(randType)); diff --git a/codegen/testgen.ts b/codegen/testgen.ts index 088a3fd3..1e4ca03b 100644 --- a/codegen/testgen.ts +++ b/codegen/testgen.ts @@ -32,7 +32,7 @@ export type OverloadShard = { * of a smart contract you can deploy */ export function splitOverloadsToShards(overloads: OverloadSignature[]): OverloadShard[] { - const MAX_SHARD_SIZE = 100; + const MAX_SHARD_SIZE = 90; const res: OverloadShard[] = []; var shardNo = 1; @@ -64,7 +64,7 @@ function generateIntroTestCode(shards: OverloadShard[], idxSplit: number): strin intro.push(` import { expect } from 'chai'; import { ethers } from 'hardhat'; - import { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance'; + import { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decrypt128, decrypt256, decryptBool } from '../instance'; import { getSigners, initSigners } from '../signers'; `); @@ -212,12 +212,18 @@ function ensureNumberAcceptableInBitRange(bits: number, input: number | bigint) 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, max: number) { +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`); } @@ -237,6 +243,8 @@ export function generateSmartContract(os: OverloadShard): string { euint16 public res16; euint32 public res32; euint64 public res64; + euint128 public res128; + euint256 public res256; constructor() { TFHE.setFHEVM(FHEVMConfig.defaultConfig()); @@ -260,6 +268,8 @@ const stateVar = { euint16: 'res16', euint32: 'res32', euint64: 'res64', + euint128: 'res128', + euint256: 'res256', }; function generateLibCallTest(os: OverloadShard, res: string[]) { diff --git a/docs/guides/decrypt.md b/docs/guides/decrypt.md index c3ba5423..842f95fb 100644 --- a/docs/guides/decrypt.md +++ b/docs/guides/decrypt.md @@ -180,17 +180,17 @@ event ResultCallback(uint256 indexed requestID, bool success, bytes result); The first argument is the `requestID` of the corresponding decryption request, `success` is a boolean assessing if the call to the callback succeeded, and `result` is the bytes array corresponding the to return data from the callback. -In your hardhat tests, if you sent some transactions which are requesting one or several decryptions and you wish to await the fulfilment of those decryptions, you should import the two helper methods `asyncDecrypt` and `awaitAllDecryptionResults` from the `asyncDecrypt.ts` utility file. This would work both when testing on an fhEVM node or in mocked mode. Here is a simple hardhat test for the previous `TestAsyncDecrypt` contract (more examples can be seen [here](../../test/gatewayDecrypt/testAsyncDecrypt.ts)): +In your hardhat tests, if you sent some transactions which are requesting one or several decryptions and you wish to await the fulfilment of those decryptions, you should import the two helper methods `initGateway` and `awaitAllDecryptionResults` from the `asyncDecrypt.ts` utility file. This would work both when testing on an fhEVM node or in mocked mode. Here is a simple hardhat test for the previous `TestAsyncDecrypt` contract (more examples can be seen [here](../../test/gatewayDecrypt/testAsyncDecrypt.ts)): ```js -import { asyncDecrypt, awaitAllDecryptionResults } from "../asyncDecrypt"; +import { initGateway, awaitAllDecryptionResults } from "../asyncDecrypt"; import { getSigners, initSigners } from "../signers"; import { expect } from "chai"; import { ethers } from "hardhat"; describe("TestAsyncDecrypt", function () { before(async function () { - await asyncDecrypt(); + await initGateway(); await initSigners(3); this.signers = await getSigners(); }); @@ -210,5 +210,5 @@ describe("TestAsyncDecrypt", function () { }); ``` -You should setup the gateway handler by calling `asyncDecrypt` at the top of the `before` block. -Notice that when testing on the fhEVM, a decryption is fulfilled usually 2 blocks after the request, while in mocked mode the fulfilment will always happen as soon as you call the `awaitAllDecryptionResults` helper function. A good way to standardize hardhat tests is hence to always call`awaitAllDecryptionResults` which will ensure that all pending decryptions are fulfilled in both modes. +You should initialize the gateway by calling `initGateway` at the top of the `before` block - more specifically, before doing any transaction which could involve a decryption request. +Notice that when testing on the fhEVM, a decryption is fulfilled usually 2 blocks after the request, while in mocked mode the fulfilment will always happen as soon as you call the `awaitAllDecryptionResults` helper function. A good way to standardize hardhat tests is hence to always call the `awaitAllDecryptionResults` function which will ensure that all pending decryptions are fulfilled in both modes. diff --git a/examples/Rand.sol b/examples/Rand.sol index d84e62be..a02f118a 100644 --- a/examples/Rand.sol +++ b/examples/Rand.sol @@ -5,16 +5,38 @@ pragma solidity ^0.8.24; import "../lib/TFHE.sol"; contract Rand { + ebool public valueb; + euint4 public value4; euint8 public value8; euint16 public value16; euint32 public value32; euint64 public value64; euint64 public value64Bounded; + euint128 public value128; + euint256 public value256; + ebytes64 public value512; + ebytes128 public value1024; + ebytes256 public value2048; constructor() { TFHE.setFHEVM(FHEVMConfig.defaultConfig()); } + 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); + } + function generate8() public { value8 = TFHE.randEuint8(); TFHE.allowThis(value8); @@ -50,7 +72,7 @@ contract Rand { TFHE.allowThis(value64); } - function generate64UpperBound(uint32 upperBound) public { + function generate64UpperBound(uint64 upperBound) public { value64 = TFHE.randEuint64(upperBound); TFHE.allowThis(value64); } @@ -66,4 +88,39 @@ contract Rand { TFHE.allowThis(value64); revert(); } + + function generate128() public { + value128 = TFHE.randEuint128(); + TFHE.allowThis(value128); + } + + function generate128UpperBound(uint128 upperBound) public { + value128 = TFHE.randEuint128(upperBound); + TFHE.allowThis(value128); + } + + function generate256() public { + value256 = TFHE.randEuint256(); + TFHE.allowThis(value256); + } + + function generate256UpperBound(uint256 upperBound) public { + value256 = TFHE.randEuint256(upperBound); + TFHE.allowThis(value256); + } + + function generate512() public { + value512 = TFHE.randEbytes64(); + TFHE.allowThis(value512); + } + + function generate1024() public { + value1024 = TFHE.randEbytes128(); + TFHE.allowThis(value1024); + } + + function generate2048() public { + value2048 = TFHE.randEbytes256(); + TFHE.allowThis(value2048); + } } diff --git a/examples/Reencrypt.sol b/examples/Reencrypt.sol index 44e7ace3..1c6175a3 100644 --- a/examples/Reencrypt.sol +++ b/examples/Reencrypt.sol @@ -11,7 +11,11 @@ contract Reencrypt { euint16 public xUint16; euint32 public xUint32; euint64 public xUint64; + euint128 public xUint128; eaddress public xAddress; + euint256 public xUint256; + ebytes64 public yBytes64; + ebytes128 public yBytes128; ebytes256 public yBytes256; constructor() { @@ -41,13 +45,39 @@ contract Reencrypt { TFHE.allowThis(xUint64); TFHE.allow(xUint64, msg.sender); + xUint128 = TFHE.asEuint128(145275933516363203950142179850024740765); + TFHE.allowThis(xUint128); + TFHE.allow(xUint128, msg.sender); + xAddress = TFHE.asEaddress(0x8ba1f109551bD432803012645Ac136ddd64DBA72); TFHE.allowThis(xAddress); TFHE.allow(xAddress, msg.sender); - } - function setEBytes256(einput inputHandleEBytes256, bytes memory inputProofEBytes256) external { - yBytes256 = TFHE.asEbytes256(inputHandleEBytes256, inputProofEBytes256); + xUint256 = TFHE.asEuint256(74285495974541385002137713624115238327312291047062397922780925695323480915729); + TFHE.allowThis(xUint256); + TFHE.allow(xUint256, msg.sender); + + yBytes64 = TFHE.asEbytes64( + TFHE.padToBytes64( + hex"19d179e0cc7e816dc944582ed4f5652f5951900098fc2e0a15a7ea4dc8cfa4e3b6c54beea5ee95e56b728762f659347ce1d4aa1b05fcc5" + ) + ); + TFHE.allowThis(yBytes64); + TFHE.allow(yBytes64, msg.sender); + + yBytes128 = TFHE.asEbytes128( + TFHE.padToBytes128( + hex"13e7819123de6e2870c7e83bb764508e22d7c3ab8a5aee6bdfb26355ef0d3f1977d651b83bf5f78634fa360aa14debdc3daa6a587b5c2fb1710ab4d6677e62a8577f2d9fecc190ad8b11c9f0a5ec3138b27da1f055437af8c90a9495dad230" + ) + ); + TFHE.allowThis(yBytes128); + TFHE.allow(yBytes128, msg.sender); + + yBytes256 = TFHE.asEbytes256( + TFHE.padToBytes256( + hex"d179e0cc7e816dc944582ed4f5652f5951900098fc2e0a15a7ea4dc8cfa4e3b6c54beea5ee95e56b728762f659347ce1d4aa1b05fcc513e7819123de6e2870c7e83bb764508e22d7c3ab8a5aee6bdfb26355ef0d3f1977d651b83bf5f78634fa360aa14debdc3daa6a587b5c2fb1710ab4d6677e62a8577f2d9fecc190ad8b11c9f0a5ec3138b27da1f055437af8c90a9495dad230" + ) + ); TFHE.allowThis(yBytes256); TFHE.allow(yBytes256, msg.sender); } diff --git a/examples/TestAsyncDecrypt.sol b/examples/TestAsyncDecrypt.sol index 6d81b9ec..a393863f 100644 --- a/examples/TestAsyncDecrypt.sol +++ b/examples/TestAsyncDecrypt.sol @@ -14,8 +14,10 @@ contract TestAsyncDecrypt is GatewayCaller { euint64 xUint64; euint64 xUint64_2; euint64 xUint64_3; + euint128 xUint128; eaddress xAddress; eaddress xAddress2; + euint256 xUint256; bool public yBool; uint8 public yUint4; @@ -25,8 +27,12 @@ contract TestAsyncDecrypt is GatewayCaller { uint64 public yUint64; uint64 public yUint64_2; uint64 public yUint64_3; + uint128 public yUint128; address public yAddress; address public yAddress2; + uint256 public yUint256; + bytes public yBytes64; + bytes public yBytes128; bytes public yBytes256; uint256 public latestRequestID; @@ -50,6 +56,10 @@ contract TestAsyncDecrypt is GatewayCaller { 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); @@ -226,6 +236,87 @@ contract TestAsyncDecrypt is GatewayCaller { return decryptedInput; } + function requestUint128() public { + uint256[] memory cts = new uint256[](1); + cts[0] = Gateway.toUint256(xUint128); + Gateway.requestDecryption(cts, this.callbackUint128.selector, 0, block.timestamp + 100, false); + } + + function requestUint128NonTrivial(einput inputHandle, bytes calldata inputProof) public { + euint128 inputNonTrivial = TFHE.asEuint128(inputHandle, inputProof); + uint256[] memory cts = new uint256[](1); + cts[0] = Gateway.toUint256(inputNonTrivial); + Gateway.requestDecryption(cts, this.callbackUint128.selector, 0, block.timestamp + 100, false); + } + + function callbackUint128(uint256, uint128 decryptedInput) public onlyGateway returns (uint128) { + yUint128 = decryptedInput; + return decryptedInput; + } + + function requestUint256() public { + uint256[] memory cts = new uint256[](1); + cts[0] = Gateway.toUint256(xUint256); + Gateway.requestDecryption(cts, this.callbackUint256.selector, 0, block.timestamp + 100, false); + } + + function requestUint256NonTrivial(einput inputHandle, bytes calldata inputProof) public { + euint256 inputNonTrivial = TFHE.asEuint256(inputHandle, inputProof); + uint256[] memory cts = new uint256[](1); + cts[0] = Gateway.toUint256(inputNonTrivial); + Gateway.requestDecryption(cts, this.callbackUint256.selector, 0, block.timestamp + 100, false); + } + + function callbackUint256(uint256, uint256 decryptedInput) public onlyGateway returns (uint256) { + yUint256 = decryptedInput; + return decryptedInput; + } + + function requestEbytes64NonTrivial(einput inputHandle, bytes calldata inputProof) public { + ebytes64 inputNonTrivial = TFHE.asEbytes64(inputHandle, inputProof); + uint256[] memory cts = new uint256[](1); + cts[0] = Gateway.toUint256(inputNonTrivial); + Gateway.requestDecryption(cts, this.callbackBytes64.selector, 0, block.timestamp + 100, false); + } + + function requestEbytes64Trivial(bytes calldata value) public { + ebytes64 inputTrivial = TFHE.asEbytes64(TFHE.padToBytes64(value)); + uint256[] memory cts = new uint256[](1); + cts[0] = Gateway.toUint256(inputTrivial); + Gateway.requestDecryption(cts, this.callbackBytes64.selector, 0, block.timestamp + 100, false); + } + + function callbackBytes64(uint256, bytes calldata decryptedInput) public onlyGateway returns (bytes memory) { + yBytes64 = decryptedInput; + return decryptedInput; + } + + function requestEbytes128NonTrivial(einput inputHandle, bytes calldata inputProof) public { + ebytes128 inputNonTrivial = TFHE.asEbytes128(inputHandle, inputProof); + uint256[] memory cts = new uint256[](1); + cts[0] = Gateway.toUint256(inputNonTrivial); + Gateway.requestDecryption(cts, this.callbackBytes128.selector, 0, block.timestamp + 100, false); + } + + function requestEbytes128Trivial(bytes calldata value) public { + ebytes128 inputTrivial = TFHE.asEbytes128(TFHE.padToBytes128(value)); + uint256[] memory cts = new uint256[](1); + cts[0] = Gateway.toUint256(inputTrivial); + Gateway.requestDecryption(cts, this.callbackBytes128.selector, 0, block.timestamp + 100, false); + } + + function callbackBytes128(uint256, bytes calldata decryptedInput) public onlyGateway returns (bytes memory) { + yBytes128 = decryptedInput; + return decryptedInput; + } + + function requestEbytes256Trivial(bytes calldata value) public { + ebytes256 inputTrivial = TFHE.asEbytes256(TFHE.padToBytes256(value)); + uint256[] memory cts = new uint256[](1); + cts[0] = Gateway.toUint256(inputTrivial); + Gateway.requestDecryption(cts, this.callbackBytes256.selector, 0, block.timestamp + 100, false); + } + function requestEbytes256NonTrivial(einput inputHandle, bytes calldata inputProof) public { ebytes256 inputNonTrivial = TFHE.asEbytes256(inputHandle, inputProof); uint256[] memory cts = new uint256[](1); @@ -326,10 +417,12 @@ contract TestAsyncDecrypt is GatewayCaller { function requestMixedBytes256(einput inputHandle, bytes calldata inputProof) public { ebytes256 xBytes256 = TFHE.asEbytes256(inputHandle, inputProof); - uint256[] memory cts = new uint256[](3); + uint256[] memory cts = new uint256[](4); cts[0] = Gateway.toUint256(xBool); cts[1] = Gateway.toUint256(xAddress); cts[2] = Gateway.toUint256(xBytes256); + ebytes64 input64Bytes = TFHE.asEbytes64(TFHE.padToBytes64(hex"aaff42")); + cts[3] = Gateway.toUint256(input64Bytes); Gateway.requestDecryption(cts, this.callbackMixedBytes256.selector, 0, block.timestamp + 100, false); } @@ -337,11 +430,13 @@ contract TestAsyncDecrypt is GatewayCaller { uint256, bool decBool, address decAddress, - bytes memory bytesRes + bytes memory bytesRes, + bytes memory bytesRes2 ) public onlyGateway { yBool = decBool; yAddress = decAddress; yBytes256 = bytesRes; + yBytes64 = bytesRes2; } function requestEbytes256NonTrivialTrustless(einput inputHandle, bytes calldata inputProof) public { diff --git a/examples/tests/TFHEManualTestSuite.sol b/examples/tests/TFHEManualTestSuite.sol index 4a7eb45d..7721ac9d 100644 --- a/examples/tests/TFHEManualTestSuite.sol +++ b/examples/tests/TFHEManualTestSuite.sol @@ -10,12 +10,61 @@ contract TFHEManualTestSuite { euint16 public res16; euint32 public res32; euint64 public res64; + euint128 public res128; + euint256 public res256; eaddress public resAdd; + ebytes64 public resB64; + ebytes128 public resB128; + ebytes256 public resB256; constructor() { TFHE.setFHEVM(FHEVMConfig.defaultConfig()); } + 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; + } + + function eqEboolScalarL(bool a, bool b) external { + ebool input2 = TFHE.asEbool(b); + ebool result = TFHE.eq(a, input2); + TFHE.allowThis(result); + resb = result; + } + + function eqEboolScalarR(bool a, bool b) external { + ebool input1 = TFHE.asEbool(a); + ebool result = TFHE.eq(input1, b); + TFHE.allowThis(result); + resb = 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; + } + + function neEboolScalarL(bool a, bool b) external { + ebool input2 = TFHE.asEbool(b); + ebool result = TFHE.ne(a, input2); + TFHE.allowThis(result); + resb = result; + } + + function neEboolScalarR(bool a, bool b) external { + ebool input1 = TFHE.asEbool(a); + ebool result = TFHE.ne(input1, b); + TFHE.allowThis(result); + resb = 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); @@ -32,6 +81,170 @@ contract TFHEManualTestSuite { resb = 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + 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); @@ -114,6 +327,22 @@ contract TFHEManualTestSuite { res64 = TFHE.asEuint64(TFHE.asEbool(input)); } + function test_ebool_to_euint128_cast(bool input) public { + res128 = TFHE.asEuint128(TFHE.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)); + } + + function test_euint128_to_euint8_cast(uint128 input) public { + res8 = TFHE.asEuint8(TFHE.asEuint128(input)); + } + function test_ebool_not(bool input) public { resb = TFHE.not(TFHE.asEbool(input)); } @@ -122,11 +351,35 @@ contract TFHEManualTestSuite { resb = TFHE.and(TFHE.asEbool(a), TFHE.asEbool(b)); } + function test_ebool_and_scalarL(bool a, bool b) public { + resb = TFHE.and(a, TFHE.asEbool(b)); + } + + function test_ebool_and_scalarR(bool a, bool b) public { + resb = TFHE.and(TFHE.asEbool(a), b); + } + function test_ebool_or(bool a, bool b) public { resb = TFHE.or(TFHE.asEbool(a), TFHE.asEbool(b)); } + function test_ebool_or_scalarL(bool a, bool b) public { + resb = TFHE.or(a, TFHE.asEbool(b)); + } + + function test_ebool_or_scalarR(bool a, bool b) public { + resb = TFHE.or(TFHE.asEbool(a), b); + } + function test_ebool_xor(bool a, bool b) public { resb = TFHE.xor(TFHE.asEbool(a), TFHE.asEbool(b)); } + + function test_ebool_xor_scalarL(bool a, bool b) public { + resb = TFHE.xor(a, TFHE.asEbool(b)); + } + + function test_ebool_xor_scalarR(bool a, bool b) public { + resb = TFHE.xor(TFHE.asEbool(a), b); + } } diff --git a/examples/tests/TFHETestSuite1.sol b/examples/tests/TFHETestSuite1.sol index 9ddd40aa..3f4ba493 100644 --- a/examples/tests/TFHETestSuite1.sol +++ b/examples/tests/TFHETestSuite1.sol @@ -10,6 +10,8 @@ contract TFHETestSuite1 { euint16 public res16; euint32 public res32; euint64 public res64; + euint128 public res128; + euint256 public res256; constructor() { TFHE.setFHEVM(FHEVMConfig.defaultConfig()); @@ -505,214 +507,144 @@ contract TFHETestSuite1 { TFHE.allowThis(result); res64 = result; } - function add_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { + function add_euint4_euint128(einput a, einput 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); + euint128 bProc = TFHE.asEuint128(b, inputProof); + euint128 result = TFHE.add(aProc, bProc); TFHE.allowThis(result); - res4 = result; + res128 = result; } - function sub_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { + function sub_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - euint4 result = TFHE.sub(aProc, bProc); + euint128 bProc = TFHE.asEuint128(b, inputProof); + euint128 result = TFHE.sub(aProc, bProc); TFHE.allowThis(result); - res4 = result; + res128 = 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 { + function mul_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - euint4 result = TFHE.mul(aProc, bProc); + euint128 bProc = TFHE.asEuint128(b, inputProof); + euint128 result = TFHE.mul(aProc, bProc); TFHE.allowThis(result); - res4 = result; + res128 = 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 { + function and_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - euint4 result = TFHE.div(aProc, bProc); + euint128 bProc = TFHE.asEuint128(b, inputProof); + euint128 result = TFHE.and(aProc, bProc); TFHE.allowThis(result); - res4 = result; + res128 = result; } - function rem_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { + function or_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - euint4 result = TFHE.rem(aProc, bProc); + euint128 bProc = TFHE.asEuint128(b, inputProof); + euint128 result = TFHE.or(aProc, bProc); TFHE.allowThis(result); - res4 = result; + res128 = result; } - function eq_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { + function xor_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - ebool result = TFHE.eq(aProc, bProc); + euint128 bProc = TFHE.asEuint128(b, inputProof); + euint128 result = TFHE.xor(aProc, bProc); TFHE.allowThis(result); - resb = result; + res128 = result; } - function eq_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b, inputProof); + 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_uint8(einput a, uint8 b, bytes calldata inputProof) public { + function ne_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; + euint128 bProc = TFHE.asEuint128(b, inputProof); 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 { + function ge_euint4_euint128(einput a, einput 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); + euint128 bProc = TFHE.asEuint128(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 { + function gt_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; + euint128 bProc = TFHE.asEuint128(b, inputProof); 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 { + function le_euint4_euint128(einput a, einput 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); + euint128 bProc = TFHE.asEuint128(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 { + function lt_euint4_euint128(einput a, einput 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); + euint128 bProc = TFHE.asEuint128(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 { + function min_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - euint4 result = TFHE.min(aProc, bProc); + euint128 bProc = TFHE.asEuint128(b, inputProof); + euint128 result = TFHE.min(aProc, bProc); TFHE.allowThis(result); - res4 = result; + res128 = 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 { + function max_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - euint4 result = TFHE.max(aProc, bProc); + euint128 bProc = TFHE.asEuint128(b, inputProof); + euint128 result = TFHE.max(aProc, bProc); TFHE.allowThis(result); - res4 = result; + res128 = 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); + 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); - res8 = result; + res256 = 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); + 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); - res8 = result; + res256 = 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); + 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); - res8 = result; + res256 = 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); + 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); - res8 = result; + res256 = 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); + 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); - res8 = result; + res256 = 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); + 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); - res8 = result; + res256 = result; } } diff --git a/examples/tests/TFHETestSuite10.sol b/examples/tests/TFHETestSuite10.sol new file mode 100644 index 00000000..e1f9f8b0 --- /dev/null +++ b/examples/tests/TFHETestSuite10.sol @@ -0,0 +1,650 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +pragma solidity ^0.8.24; + +import "../../lib/TFHE.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/examples/tests/TFHETestSuite11.sol b/examples/tests/TFHETestSuite11.sol new file mode 100644 index 00000000..d036a281 --- /dev/null +++ b/examples/tests/TFHETestSuite11.sol @@ -0,0 +1,440 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +pragma solidity ^0.8.24; + +import "../../lib/TFHE.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/examples/tests/TFHETestSuite2.sol b/examples/tests/TFHETestSuite2.sol index 715d8caa..f0871a7a 100644 --- a/examples/tests/TFHETestSuite2.sol +++ b/examples/tests/TFHETestSuite2.sol @@ -10,11 +10,321 @@ contract TFHETestSuite2 { 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); @@ -337,382 +647,4 @@ contract TFHETestSuite2 { TFHE.allowThis(result); resb = result; } - 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_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 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; - } } diff --git a/examples/tests/TFHETestSuite3.sol b/examples/tests/TFHETestSuite3.sol index c3836358..cd2a3825 100644 --- a/examples/tests/TFHETestSuite3.sol +++ b/examples/tests/TFHETestSuite3.sol @@ -10,709 +10,641 @@ contract TFHETestSuite3 { euint16 public res16; euint32 public res32; euint64 public res64; + euint128 public res128; + euint256 public res256; constructor() { TFHE.setFHEVM(FHEVMConfig.defaultConfig()); } - 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); + 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); - res16 = result; + resb = 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); + 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); - res16 = result; + resb = result; } - 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); + 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); - res16 = result; + res32 = 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); + 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); - res16 = result; + res32 = 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); + 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); - res16 = result; + res64 = 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); + 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); - res16 = result; + res64 = 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); + 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); - res16 = result; + res64 = 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); + 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); - res16 = result; + res64 = 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); + 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_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); + 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_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); + 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_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); + 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_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); + 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_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); + 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_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); + 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); - res16 = result; + res64 = 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); + 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); - res16 = result; + res64 = 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); + 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); - res16 = result; + res128 = 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); + 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); - res16 = result; + res128 = 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); + 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); - res16 = result; + res128 = 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); + 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); - res16 = result; + res128 = 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); + 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); - res16 = result; + res128 = 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); + 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); - res16 = result; + res128 = 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); + 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_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); + 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_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); + 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_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); + 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_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); + 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_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); + 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_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); + 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); - res16 = result; + res128 = 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); + 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); - res16 = result; + res128 = 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); + 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); - res32 = result; + res256 = 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); + 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); - res32 = result; + res256 = 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); + 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); - res32 = result; + res256 = 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); + 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); - res32 = result; + res256 = 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); + 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); - res32 = result; + res256 = 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); + 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); - res32 = result; + res256 = 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); + 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_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); + 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_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); + 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_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); + 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_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); + 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_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); + 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_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); + 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); - res32 = result; + res256 = 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); + 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); - res32 = result; + res256 = 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); + 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); - res64 = result; + res8 = 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); + 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); - resb = result; + res8 = 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); + 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); - resb = result; + res8 = 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); + 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); - resb = result; + res8 = 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); + 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); - resb = result; + res8 = 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); + 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); - resb = result; + res8 = 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); + 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); - res64 = result; + res8 = 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); + 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); - res64 = result; + res8 = 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); + 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); - res16 = result; + res8 = 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); + 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); - res16 = result; + res8 = 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); + 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); - res16 = result; + res8 = 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); + 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); - res16 = result; + res8 = 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); + 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); - res16 = result; + res8 = result; } - 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); + 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); - res16 = result; + res8 = result; } - function eq_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; + 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_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { - uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b, inputProof); + 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_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; + 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_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { - uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b, inputProof); + 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_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; + 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_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { - uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b, inputProof); + 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_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; + 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_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { - uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b, inputProof); + 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_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; + 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_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { - uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b, inputProof); + 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_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; + 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_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { - uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b, inputProof); + 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_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); + 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); - res16 = result; + res8 = 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); + 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); - res16 = result; + res8 = 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); + 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); - res16 = result; + res8 = 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); + 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); - res16 = result; + res8 = result; } - function add_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + function add_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint4 bProc = TFHE.asEuint4(b, inputProof); - euint32 result = TFHE.add(aProc, bProc); + euint16 result = TFHE.add(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res16 = result; } - function sub_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + function sub_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint4 bProc = TFHE.asEuint4(b, inputProof); - euint32 result = TFHE.sub(aProc, bProc); + euint16 result = TFHE.sub(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res16 = result; } - function mul_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + function mul_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint4 bProc = TFHE.asEuint4(b, inputProof); - euint32 result = TFHE.mul(aProc, bProc); + euint16 result = TFHE.mul(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res16 = result; } - function and_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + function and_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint4 bProc = TFHE.asEuint4(b, inputProof); - euint32 result = TFHE.and(aProc, bProc); + euint16 result = TFHE.and(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res16 = result; } - function or_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + function or_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint4 bProc = TFHE.asEuint4(b, inputProof); - euint32 result = TFHE.or(aProc, bProc); + euint16 result = TFHE.or(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res16 = result; } - function xor_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + function xor_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint4 bProc = TFHE.asEuint4(b, inputProof); - euint32 result = TFHE.xor(aProc, bProc); + euint16 result = TFHE.xor(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res16 = result; } - function eq_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + function min_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint4 bProc = TFHE.asEuint4(b, inputProof); - euint32 result = TFHE.min(aProc, bProc); + euint16 result = TFHE.min(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res16 = result; } - function max_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + function max_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = TFHE.asEuint16(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); + euint16 result = TFHE.max(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res16 = result; } } diff --git a/examples/tests/TFHETestSuite4.sol b/examples/tests/TFHETestSuite4.sol index 9224da21..d4def3c5 100644 --- a/examples/tests/TFHETestSuite4.sol +++ b/examples/tests/TFHETestSuite4.sol @@ -10,709 +10,641 @@ contract TFHETestSuite4 { euint16 public res16; euint32 public res32; euint64 public res64; + euint128 public res128; + euint256 public res256; constructor() { TFHE.setFHEVM(FHEVMConfig.defaultConfig()); } - function or_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + function add_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint8 bProc = TFHE.asEuint8(b, inputProof); - euint32 result = TFHE.or(aProc, bProc); + euint16 result = TFHE.add(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res16 = result; } - function xor_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + function sub_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint8 bProc = TFHE.asEuint8(b, inputProof); - euint32 result = TFHE.xor(aProc, bProc); + euint16 result = TFHE.sub(aProc, bProc); TFHE.allowThis(result); - res32 = 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 eq_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + function min_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint8 bProc = TFHE.asEuint8(b, inputProof); - euint32 result = TFHE.min(aProc, bProc); + euint16 result = TFHE.min(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res16 = result; } - function max_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + function max_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint8 bProc = TFHE.asEuint8(b, inputProof); - euint32 result = TFHE.max(aProc, bProc); + euint16 result = TFHE.max(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res16 = result; } - function add_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + function add_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint16 bProc = TFHE.asEuint16(b, inputProof); - euint32 result = TFHE.add(aProc, bProc); + euint16 result = TFHE.add(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res16 = result; } - function sub_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + function sub_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint16 bProc = TFHE.asEuint16(b, inputProof); - euint32 result = TFHE.sub(aProc, bProc); + euint16 result = TFHE.sub(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res16 = result; } - function mul_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + function mul_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint16 bProc = TFHE.asEuint16(b, inputProof); - euint32 result = TFHE.mul(aProc, bProc); + euint16 result = TFHE.mul(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res16 = result; } - function and_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + function and_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint16 bProc = TFHE.asEuint16(b, inputProof); - euint32 result = TFHE.and(aProc, bProc); + euint16 result = TFHE.and(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res16 = result; } - function or_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + function or_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint16 bProc = TFHE.asEuint16(b, inputProof); - euint32 result = TFHE.or(aProc, bProc); + euint16 result = TFHE.or(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res16 = result; } - function xor_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + function xor_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint16 bProc = TFHE.asEuint16(b, inputProof); - euint32 result = TFHE.xor(aProc, bProc); + euint16 result = TFHE.xor(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res16 = result; } - function eq_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + function min_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint16 bProc = TFHE.asEuint16(b, inputProof); - euint32 result = TFHE.min(aProc, bProc); + euint16 result = TFHE.min(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res16 = result; } - function max_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + function max_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint16 bProc = TFHE.asEuint16(b, inputProof); - euint32 result = TFHE.max(aProc, bProc); + euint16 result = TFHE.max(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res16 = result; } - function add_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); + 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_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); + 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); - res32 = result; + res128 = 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); + 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); - 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; + res128 = 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); + 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); - res32 = result; + res128 = 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); + 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); - res32 = result; + res128 = 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); + 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); - res32 = result; + res128 = 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); + 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); - res32 = result; + res128 = result; } - function eq_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint32 bProc = b; + 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 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); + 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_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint32 bProc = b; + 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 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; + 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 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); + 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_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); + 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_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); + 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); - res32 = result; + res128 = 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); + 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); - res32 = result; + res128 = 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); + 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); - res64 = result; + res256 = 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); + 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); - res64 = result; + res256 = 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); + 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); - res64 = result; + res256 = 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); + 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); - res64 = result; + res256 = 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); + 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); - res64 = result; + res256 = 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); + 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); - res64 = result; + res256 = 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); + 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_euint64_euint4(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); + 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_euint64_euint4(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); + 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_euint64_euint4(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); + 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_euint64_euint4(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); + 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_euint64_euint4(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); + 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_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); + 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); - res64 = result; + res256 = 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); + 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); - res64 = result; + res256 = 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); + 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); - 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; + res16 = 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); + 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); - res64 = result; + res16 = 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); + 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); - resb = result; + res16 = 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); + 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); - resb = result; + res16 = 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); + 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); - resb = result; + res16 = 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); + 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); - resb = result; + res16 = result; } } diff --git a/examples/tests/TFHETestSuite5.sol b/examples/tests/TFHETestSuite5.sol index e1782ede..0947c208 100644 --- a/examples/tests/TFHETestSuite5.sol +++ b/examples/tests/TFHETestSuite5.sol @@ -10,709 +10,641 @@ contract TFHETestSuite5 { euint16 public res16; euint32 public res32; euint64 public res64; + euint128 public res128; + euint256 public res256; constructor() { TFHE.setFHEVM(FHEVMConfig.defaultConfig()); } - 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); + 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); - resb = result; + res16 = 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); + 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); - res64 = result; + res16 = 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); + 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); - res64 = result; + res16 = result; } - function add_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); + function and_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { + uint16 aProc = a; euint16 bProc = TFHE.asEuint16(b, inputProof); - euint64 result = TFHE.add(aProc, bProc); + euint16 result = TFHE.and(aProc, bProc); TFHE.allowThis(result); - res64 = result; + res16 = 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); + 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); - res64 = result; + res16 = result; } - function mul_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); + function or_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { + uint16 aProc = a; euint16 bProc = TFHE.asEuint16(b, inputProof); - euint64 result = TFHE.mul(aProc, bProc); + euint16 result = TFHE.or(aProc, bProc); TFHE.allowThis(result); - res64 = result; + res16 = 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); + 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); - res64 = result; + res16 = result; } - function or_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); + function xor_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { + uint16 aProc = a; euint16 bProc = TFHE.asEuint16(b, inputProof); - euint64 result = TFHE.or(aProc, bProc); + euint16 result = TFHE.xor(aProc, bProc); TFHE.allowThis(result); - res64 = result; + res16 = 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); + 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); - res64 = result; + resb = result; } - function eq_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); + 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_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); + 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_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); + 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_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); + 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_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); + 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_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); + 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_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); + 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); - euint64 result = TFHE.min(aProc, bProc); + euint16 result = TFHE.min(aProc, bProc); TFHE.allowThis(result); - res64 = result; + res16 = result; } - function max_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); + 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); - euint64 result = TFHE.max(aProc, bProc); + euint16 result = TFHE.max(aProc, bProc); TFHE.allowThis(result); - res64 = result; + res16 = 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); + 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); - res64 = result; + res32 = 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); + 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); - res64 = result; + res32 = 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); + 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); - res64 = result; + res32 = 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); + 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); - res64 = result; + res32 = 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); + 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); - res64 = result; + res32 = 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); + 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); - res64 = result; + res32 = 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); + 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_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); + 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_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); + 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_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); + 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_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); + 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_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); + 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_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); + 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); - res64 = result; + res32 = 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); + 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); - res64 = result; + res32 = 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); + 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); - res64 = result; + res32 = 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); + 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); - res64 = result; + res32 = 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); + 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); - res64 = result; + res32 = 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); + 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); - res64 = result; + res32 = 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); + 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); - res64 = result; + res32 = 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); + 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); - res64 = result; + res32 = 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); + 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_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); + 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_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); + 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_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); + 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_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); + 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_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); + 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_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_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); + 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); - res64 = result; + res32 = 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); + 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); - res64 = result; + res32 = 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); + 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); - res64 = result; + res32 = 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); + 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); - res64 = result; + res32 = 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); + 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); - res64 = result; + res32 = 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); + 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); - res64 = result; + res32 = 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); + 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); - res64 = result; + res32 = 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); + 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); - resb = result; + res32 = result; } - function eq_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { - uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b, inputProof); + 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_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); + 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_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); + 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_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); + 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_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); + 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_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); + 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_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 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; - } - 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); + 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); - res8 = result; + res32 = 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); + 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); - res8 = result; + res32 = 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); + 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); - res8 = result; + res32 = 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); + 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); - res8 = result; + res32 = 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); + 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); - res8 = result; + res32 = 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); + 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); - res8 = result; + res32 = 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); + 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); - res8 = result; + res32 = 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); + 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); - res8 = result; + res32 = 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); + 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); - res16 = result; + resb = 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); + 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); - res16 = result; + resb = 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); + 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); - res16 = result; + resb = 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); + 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); - res16 = result; + resb = 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); + 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); - res16 = result; + resb = 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); + 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); - res16 = result; + resb = 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); + 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); - res16 = result; + res32 = 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); + 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); - res16 = result; + res32 = result; } - function shl_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + function add_euint32_euint64(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); + euint64 bProc = TFHE.asEuint64(b, inputProof); + euint64 result = TFHE.add(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res64 = result; } - function shl_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public { + function sub_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { euint32 aProc = TFHE.asEuint32(a, inputProof); - uint8 bProc = b; - euint32 result = TFHE.shl(aProc, bProc); + euint64 bProc = TFHE.asEuint64(b, inputProof); + euint64 result = TFHE.sub(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res64 = result; } - function shr_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + function mul_euint32_euint64(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); + euint64 bProc = TFHE.asEuint64(b, inputProof); + euint64 result = TFHE.mul(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res64 = result; } - function shr_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public { + function and_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { euint32 aProc = TFHE.asEuint32(a, inputProof); - uint8 bProc = b; - euint32 result = TFHE.shr(aProc, bProc); + euint64 bProc = TFHE.asEuint64(b, inputProof); + euint64 result = TFHE.and(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res64 = result; } - function rotl_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + function or_euint32_euint64(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); + euint64 bProc = TFHE.asEuint64(b, inputProof); + euint64 result = TFHE.or(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res64 = result; } - function rotl_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public { + function xor_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { euint32 aProc = TFHE.asEuint32(a, inputProof); - uint8 bProc = b; - euint32 result = TFHE.rotl(aProc, bProc); + euint64 bProc = TFHE.asEuint64(b, inputProof); + euint64 result = TFHE.xor(aProc, bProc); TFHE.allowThis(result); - res32 = result; + res64 = result; } - function rotr_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + function eq_euint32_euint64(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); + euint64 bProc = TFHE.asEuint64(b, inputProof); + ebool result = TFHE.eq(aProc, bProc); TFHE.allowThis(result); - res32 = result; + resb = result; } - function rotr_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public { + function ne_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { euint32 aProc = TFHE.asEuint32(a, inputProof); - uint8 bProc = b; - euint32 result = TFHE.rotr(aProc, bProc); + euint64 bProc = TFHE.asEuint64(b, inputProof); + ebool result = TFHE.ne(aProc, bProc); TFHE.allowThis(result); - res32 = result; + resb = 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); + 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); - res64 = result; + resb = 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); + 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); - res64 = result; + resb = result; } } diff --git a/examples/tests/TFHETestSuite6.sol b/examples/tests/TFHETestSuite6.sol index cca9b1eb..4180b5f5 100644 --- a/examples/tests/TFHETestSuite6.sol +++ b/examples/tests/TFHETestSuite6.sol @@ -10,110 +10,640 @@ contract TFHETestSuite6 { euint16 public res16; euint32 public res32; euint64 public res64; + euint128 public res128; + euint256 public res256; constructor() { TFHE.setFHEVM(FHEVMConfig.defaultConfig()); } - function shr_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + 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); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint64 result = TFHE.shr(aProc, bProc); + 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 shr_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public { + function or_euint64_euint4(einput a, einput b, bytes calldata inputProof) public { euint64 aProc = TFHE.asEuint64(a, inputProof); - uint8 bProc = b; - euint64 result = TFHE.shr(aProc, bProc); + euint4 bProc = TFHE.asEuint4(b, inputProof); + euint64 result = TFHE.or(aProc, bProc); TFHE.allowThis(result); res64 = result; } - function rotl_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + 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.rotl(aProc, bProc); + euint64 result = TFHE.add(aProc, bProc); TFHE.allowThis(result); res64 = result; } - function rotl_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public { + function sub_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { euint64 aProc = TFHE.asEuint64(a, inputProof); - uint8 bProc = b; - euint64 result = TFHE.rotl(aProc, bProc); + euint8 bProc = TFHE.asEuint8(b, inputProof); + euint64 result = TFHE.sub(aProc, bProc); TFHE.allowThis(result); res64 = result; } - function rotr_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + 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.rotr(aProc, bProc); + euint64 result = TFHE.mul(aProc, bProc); TFHE.allowThis(result); res64 = result; } - function rotr_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public { + function and_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { euint64 aProc = TFHE.asEuint64(a, inputProof); - uint8 bProc = b; - euint64 result = TFHE.rotr(aProc, bProc); + euint8 bProc = TFHE.asEuint8(b, inputProof); + euint64 result = TFHE.and(aProc, bProc); TFHE.allowThis(result); res64 = result; } - function neg_euint4(einput a, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint4 result = TFHE.neg(aProc); + 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); - res4 = result; + res64 = result; } - function not_euint4(einput a, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint4 result = TFHE.not(aProc); + 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); - res4 = result; + res64 = result; } - function neg_euint8(einput a, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 result = TFHE.neg(aProc); + 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); - res8 = result; + resb = result; } - function not_euint8(einput a, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 result = TFHE.not(aProc); + 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); - res8 = result; + resb = result; } - function neg_euint16(einput a, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 result = TFHE.neg(aProc); + 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); - res16 = result; + resb = result; } - function not_euint16(einput a, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 result = TFHE.not(aProc); + 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); - res16 = result; + resb = result; } - function neg_euint32(einput a, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint32 result = TFHE.neg(aProc); + 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); - res32 = result; + resb = result; } - function not_euint32(einput a, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint32 result = TFHE.not(aProc); + 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); - res32 = result; + resb = result; } - function neg_euint64(einput a, bytes calldata inputProof) public { + function min_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 result = TFHE.neg(aProc); + euint8 bProc = TFHE.asEuint8(b, inputProof); + euint64 result = TFHE.min(aProc, bProc); TFHE.allowThis(result); res64 = result; } - function not_euint64(einput a, bytes calldata inputProof) public { + function max_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 result = TFHE.not(aProc); + euint8 bProc = TFHE.asEuint8(b, inputProof); + euint64 result = TFHE.max(aProc, bProc); TFHE.allowThis(result); res64 = result; } diff --git a/examples/tests/TFHETestSuite7.sol b/examples/tests/TFHETestSuite7.sol new file mode 100644 index 00000000..824a52f8 --- /dev/null +++ b/examples/tests/TFHETestSuite7.sol @@ -0,0 +1,650 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +pragma solidity ^0.8.24; + +import "../../lib/TFHE.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/examples/tests/TFHETestSuite8.sol b/examples/tests/TFHETestSuite8.sol new file mode 100644 index 00000000..078c49bf --- /dev/null +++ b/examples/tests/TFHETestSuite8.sol @@ -0,0 +1,650 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +pragma solidity ^0.8.24; + +import "../../lib/TFHE.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/examples/tests/TFHETestSuite9.sol b/examples/tests/TFHETestSuite9.sol new file mode 100644 index 00000000..4a1f7137 --- /dev/null +++ b/examples/tests/TFHETestSuite9.sol @@ -0,0 +1,650 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +pragma solidity ^0.8.24; + +import "../../lib/TFHE.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/gateway/GatewayContract.sol b/gateway/GatewayContract.sol index 485fc8e7..d78995c8 100644 --- a/gateway/GatewayContract.sol +++ b/gateway/GatewayContract.sol @@ -43,9 +43,9 @@ contract GatewayContract is UUPSUpgradeable, Ownable2StepUpgradeable { bool passSignaturesToCaller ); - event AddedRelayer(address indexed realyer); + event AddedRelayer(address indexed relayer); - event RemovedRelayer(address indexed realyer); + event RemovedRelayer(address indexed relayer); event ResultCallback(uint256 indexed requestID, bool success, bytes result); diff --git a/gateway/lib/Gateway.sol b/gateway/lib/Gateway.sol index 738db915..8d15e296 100644 --- a/gateway/lib/Gateway.sol +++ b/gateway/lib/Gateway.sol @@ -69,10 +69,26 @@ library Gateway { ct = euint64.unwrap(newCT); } + function toUint256(euint128 newCT) internal pure returns (uint256 ct) { + ct = euint128.unwrap(newCT); + } + function toUint256(eaddress newCT) internal pure returns (uint256 ct) { ct = eaddress.unwrap(newCT); } + function toUint256(euint256 newCT) internal pure returns (uint256 ct) { + ct = euint256.unwrap(newCT); + } + + function toUint256(ebytes64 newCT) internal pure returns (uint256 ct) { + ct = ebytes64.unwrap(newCT); + } + + function toUint256(ebytes128 newCT) internal pure returns (uint256 ct) { + ct = ebytes128.unwrap(newCT); + } + function toUint256(ebytes256 newCT) internal pure returns (uint256 ct) { ct = ebytes256.unwrap(newCT); } diff --git a/lib/FHEPayment.sol b/lib/FHEPayment.sol index 92c8caca..d71c5575 100644 --- a/lib/FHEPayment.sol +++ b/lib/FHEPayment.sol @@ -8,9 +8,9 @@ import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol"; error FHEGasBlockLimitExceeded(); +error UnsupportedOperation(); error CallerMustBeTFHEExecutorContract(); error OnlyScalarOperationsAreSupported(); -error OnlyNonScalarOperationsAreSupported(); error RecoveryFailed(); error WithdrawalFailed(); error AccountNotEnoughFunded(); @@ -185,7 +185,7 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { function checkIfNewBlock() internal virtual { FHEPaymentStorage storage $ = _getFHEPaymentStorage(); uint256 lastBlock_ = block.number; - if (block.number > $.lastBlock) { + if (lastBlock_ > $.lastBlock) { $.lastBlock = lastBlock_; $.currentBlockConsumption = 0; } @@ -210,6 +210,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 162000); } else if (resultType == 5) { updateFunding(payer, 188000); + } else if (resultType == 6) { + updateFunding(payer, 218000); + } else if (resultType == 8) { + updateFunding(payer, 253000); + } else { + revert UnsupportedOperation(); } } else { if (resultType == 1) { @@ -222,6 +228,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 162000); } else if (resultType == 5) { updateFunding(payer, 188000); + } else if (resultType == 6) { + updateFunding(payer, 218000); + } else if (resultType == 8) { + updateFunding(payer, 253000); + } else { + revert UnsupportedOperation(); } } checkFHEGasBlockLimit(); @@ -241,6 +253,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 162000); } else if (resultType == 5) { updateFunding(payer, 188000); + } else if (resultType == 6) { + updateFunding(payer, 218000); + } else if (resultType == 8) { + updateFunding(payer, 253000); + } else { + revert UnsupportedOperation(); } } else { if (resultType == 1) { @@ -253,6 +271,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 162000); } else if (resultType == 5) { updateFunding(payer, 188000); + } else if (resultType == 6) { + updateFunding(payer, 218000); + } else if (resultType == 8) { + updateFunding(payer, 253000); + } else { + revert UnsupportedOperation(); } } checkFHEGasBlockLimit(); @@ -272,6 +296,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 264000); } else if (resultType == 5) { updateFunding(payer, 356000); + } else if (resultType == 6) { + updateFunding(payer, 480000); + } else if (resultType == 8) { + updateFunding(payer, 647000); + } else { + revert UnsupportedOperation(); } } else { if (resultType == 1) { @@ -284,6 +314,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 359000); } else if (resultType == 5) { updateFunding(payer, 641000); + } else if (resultType == 6) { + updateFunding(payer, 1145000); + } else if (resultType == 8) { + updateFunding(payer, 2045000); + } else { + revert UnsupportedOperation(); } } checkFHEGasBlockLimit(); @@ -303,6 +339,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 398000); } else if (resultType == 5) { updateFunding(payer, 584000); + } else if (resultType == 6) { + updateFunding(payer, 857000); + } else if (resultType == 8) { + updateFunding(payer, 1258000); + } else { + revert UnsupportedOperation(); } checkFHEGasBlockLimit(); } @@ -321,6 +363,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 805000); } else if (resultType == 5) { updateFunding(payer, 1095000); + } else if (resultType == 6) { + updateFunding(payer, 1499000); + } else if (resultType == 8) { + updateFunding(payer, 2052000); + } else { + revert UnsupportedOperation(); } checkFHEGasBlockLimit(); } @@ -328,19 +376,46 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { function payForFheBitAnd(address payer, uint8 resultType, bytes1 scalarByte) external virtual { if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); checkIfNewBlock(); - if (scalarByte != 0x00) revert OnlyNonScalarOperationsAreSupported(); - if (resultType == 0) { - updateFunding(payer, 26000); - } else if (resultType == 1) { - updateFunding(payer, 32000); - } else if (resultType == 2) { - updateFunding(payer, 34000); - } else if (resultType == 3) { - updateFunding(payer, 34000); - } else if (resultType == 4) { - updateFunding(payer, 35000); - } else if (resultType == 5) { - updateFunding(payer, 38000); + if (scalarByte == 0x01) { + if (resultType == 0) { + updateFunding(payer, 26000); + } else if (resultType == 1) { + updateFunding(payer, 32000); + } else if (resultType == 2) { + updateFunding(payer, 34000); + } else if (resultType == 3) { + updateFunding(payer, 34000); + } else if (resultType == 4) { + updateFunding(payer, 35000); + } else if (resultType == 5) { + updateFunding(payer, 38000); + } else if (resultType == 6) { + updateFunding(payer, 41000); + } else if (resultType == 8) { + updateFunding(payer, 44000); + } else { + revert UnsupportedOperation(); + } + } else { + if (resultType == 0) { + updateFunding(payer, 26000); + } else if (resultType == 1) { + updateFunding(payer, 32000); + } else if (resultType == 2) { + updateFunding(payer, 34000); + } else if (resultType == 3) { + updateFunding(payer, 34000); + } else if (resultType == 4) { + updateFunding(payer, 35000); + } else if (resultType == 5) { + updateFunding(payer, 38000); + } else if (resultType == 6) { + updateFunding(payer, 41000); + } else if (resultType == 8) { + updateFunding(payer, 44000); + } else { + revert UnsupportedOperation(); + } } checkFHEGasBlockLimit(); } @@ -348,19 +423,46 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { function payForFheBitOr(address payer, uint8 resultType, bytes1 scalarByte) external virtual { if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); checkIfNewBlock(); - if (scalarByte != 0x00) revert OnlyNonScalarOperationsAreSupported(); - if (resultType == 0) { - updateFunding(payer, 26000); - } else if (resultType == 1) { - updateFunding(payer, 32000); - } else if (resultType == 2) { - updateFunding(payer, 34000); - } else if (resultType == 3) { - updateFunding(payer, 34000); - } else if (resultType == 4) { - updateFunding(payer, 35000); - } else if (resultType == 5) { - updateFunding(payer, 38000); + if (scalarByte == 0x01) { + if (resultType == 0) { + updateFunding(payer, 26000); + } else if (resultType == 1) { + updateFunding(payer, 32000); + } else if (resultType == 2) { + updateFunding(payer, 34000); + } else if (resultType == 3) { + updateFunding(payer, 34000); + } else if (resultType == 4) { + updateFunding(payer, 35000); + } else if (resultType == 5) { + updateFunding(payer, 38000); + } else if (resultType == 6) { + updateFunding(payer, 41000); + } else if (resultType == 8) { + updateFunding(payer, 44000); + } else { + revert UnsupportedOperation(); + } + } else { + if (resultType == 0) { + updateFunding(payer, 26000); + } else if (resultType == 1) { + updateFunding(payer, 32000); + } else if (resultType == 2) { + updateFunding(payer, 34000); + } else if (resultType == 3) { + updateFunding(payer, 34000); + } else if (resultType == 4) { + updateFunding(payer, 35000); + } else if (resultType == 5) { + updateFunding(payer, 38000); + } else if (resultType == 6) { + updateFunding(payer, 41000); + } else if (resultType == 8) { + updateFunding(payer, 44000); + } else { + revert UnsupportedOperation(); + } } checkFHEGasBlockLimit(); } @@ -368,19 +470,46 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { function payForFheBitXor(address payer, uint8 resultType, bytes1 scalarByte) external virtual { if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); checkIfNewBlock(); - if (scalarByte != 0x00) revert OnlyNonScalarOperationsAreSupported(); - if (resultType == 0) { - updateFunding(payer, 26000); - } else if (resultType == 1) { - updateFunding(payer, 32000); - } else if (resultType == 2) { - updateFunding(payer, 34000); - } else if (resultType == 3) { - updateFunding(payer, 34000); - } else if (resultType == 4) { - updateFunding(payer, 35000); - } else if (resultType == 5) { - updateFunding(payer, 38000); + if (scalarByte == 0x01) { + if (resultType == 0) { + updateFunding(payer, 26000); + } else if (resultType == 1) { + updateFunding(payer, 32000); + } else if (resultType == 2) { + updateFunding(payer, 34000); + } else if (resultType == 3) { + updateFunding(payer, 34000); + } else if (resultType == 4) { + updateFunding(payer, 35000); + } else if (resultType == 5) { + updateFunding(payer, 38000); + } else if (resultType == 6) { + updateFunding(payer, 41000); + } else if (resultType == 8) { + updateFunding(payer, 44000); + } else { + revert UnsupportedOperation(); + } + } else { + if (resultType == 0) { + updateFunding(payer, 26000); + } else if (resultType == 1) { + updateFunding(payer, 32000); + } else if (resultType == 2) { + updateFunding(payer, 34000); + } else if (resultType == 3) { + updateFunding(payer, 34000); + } else if (resultType == 4) { + updateFunding(payer, 35000); + } else if (resultType == 5) { + updateFunding(payer, 38000); + } else if (resultType == 6) { + updateFunding(payer, 41000); + } else if (resultType == 8) { + updateFunding(payer, 44000); + } else { + revert UnsupportedOperation(); + } } checkFHEGasBlockLimit(); } @@ -399,6 +528,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 35000); } else if (resultType == 5) { updateFunding(payer, 38000); + } else if (resultType == 6) { + updateFunding(payer, 41000); + } else if (resultType == 8) { + updateFunding(payer, 44000); + } else { + revert UnsupportedOperation(); } } else { if (resultType == 1) { @@ -411,6 +546,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 183000); } else if (resultType == 5) { updateFunding(payer, 227000); + } else if (resultType == 6) { + updateFunding(payer, 282000); + } else if (resultType == 8) { + updateFunding(payer, 350000); + } else { + revert UnsupportedOperation(); } } checkFHEGasBlockLimit(); @@ -430,6 +571,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 35000); } else if (resultType == 5) { updateFunding(payer, 38000); + } else if (resultType == 6) { + updateFunding(payer, 41000); + } else if (resultType == 8) { + updateFunding(payer, 44000); + } else { + revert UnsupportedOperation(); } } else { if (resultType == 1) { @@ -442,6 +589,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 183000); } else if (resultType == 5) { updateFunding(payer, 227000); + } else if (resultType == 6) { + updateFunding(payer, 282000); + } else if (resultType == 8) { + updateFunding(payer, 350000); + } else { + revert UnsupportedOperation(); } } checkFHEGasBlockLimit(); @@ -461,6 +614,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 35000); } else if (resultType == 5) { updateFunding(payer, 38000); + } else if (resultType == 6) { + updateFunding(payer, 41000); + } else if (resultType == 8) { + updateFunding(payer, 44000); + } else { + revert UnsupportedOperation(); } } else { if (resultType == 1) { @@ -473,6 +632,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 183000); } else if (resultType == 5) { updateFunding(payer, 227000); + } else if (resultType == 6) { + updateFunding(payer, 282000); + } else if (resultType == 8) { + updateFunding(payer, 350000); + } else { + revert UnsupportedOperation(); } } checkFHEGasBlockLimit(); @@ -492,6 +657,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 35000); } else if (resultType == 5) { updateFunding(payer, 38000); + } else if (resultType == 6) { + updateFunding(payer, 41000); + } else if (resultType == 8) { + updateFunding(payer, 44000); + } else { + revert UnsupportedOperation(); } } else { if (resultType == 1) { @@ -504,6 +675,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 183000); } else if (resultType == 5) { updateFunding(payer, 227000); + } else if (resultType == 6) { + updateFunding(payer, 282000); + } else if (resultType == 8) { + updateFunding(payer, 350000); + } else { + revert UnsupportedOperation(); } } checkFHEGasBlockLimit(); @@ -513,7 +690,9 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); checkIfNewBlock(); if (scalarByte == 0x01) { - if (resultType == 1) { + if (resultType == 0) { + updateFunding(payer, 49000); + } else if (resultType == 1) { updateFunding(payer, 51000); } else if (resultType == 2) { updateFunding(payer, 53000); @@ -523,13 +702,25 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 82000); } else if (resultType == 5) { updateFunding(payer, 86000); + } else if (resultType == 6) { + updateFunding(payer, 88000); } else if (resultType == 7) { updateFunding(payer, 90000); + } else if (resultType == 8) { + updateFunding(payer, 100000); + } else if (resultType == 9) { + updateFunding(payer, 150000); + } else if (resultType == 10) { + updateFunding(payer, 200000); } else if (resultType == 11) { updateFunding(payer, 300000); + } else { + revert UnsupportedOperation(); } } else { - if (resultType == 1) { + if (resultType == 0) { + updateFunding(payer, 49000); + } else if (resultType == 1) { updateFunding(payer, 51000); } else if (resultType == 2) { updateFunding(payer, 53000); @@ -539,10 +730,20 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 82000); } else if (resultType == 5) { updateFunding(payer, 86000); + } else if (resultType == 6) { + updateFunding(payer, 88000); } else if (resultType == 7) { updateFunding(payer, 90000); + } else if (resultType == 8) { + updateFunding(payer, 100000); + } else if (resultType == 9) { + updateFunding(payer, 150000); + } else if (resultType == 10) { + updateFunding(payer, 200000); } else if (resultType == 11) { updateFunding(payer, 300000); + } else { + revert UnsupportedOperation(); } } checkFHEGasBlockLimit(); @@ -552,7 +753,9 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); checkIfNewBlock(); if (scalarByte == 0x01) { - if (resultType == 1) { + if (resultType == 0) { + updateFunding(payer, 49000); + } else if (resultType == 1) { updateFunding(payer, 51000); } else if (resultType == 2) { updateFunding(payer, 53000); @@ -562,13 +765,25 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 82000); } else if (resultType == 5) { updateFunding(payer, 86000); + } else if (resultType == 6) { + updateFunding(payer, 88000); } else if (resultType == 7) { updateFunding(payer, 90000); + } else if (resultType == 8) { + updateFunding(payer, 100000); + } else if (resultType == 9) { + updateFunding(payer, 150000); + } else if (resultType == 10) { + updateFunding(payer, 200000); } else if (resultType == 11) { updateFunding(payer, 300000); + } else { + revert UnsupportedOperation(); } } else { - if (resultType == 1) { + if (resultType == 0) { + updateFunding(payer, 49000); + } else if (resultType == 1) { updateFunding(payer, 51000); } else if (resultType == 2) { updateFunding(payer, 53000); @@ -578,10 +793,20 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 82000); } else if (resultType == 5) { updateFunding(payer, 86000); + } else if (resultType == 6) { + updateFunding(payer, 88000); } else if (resultType == 7) { updateFunding(payer, 90000); + } else if (resultType == 8) { + updateFunding(payer, 100000); + } else if (resultType == 9) { + updateFunding(payer, 150000); + } else if (resultType == 10) { + updateFunding(payer, 200000); } else if (resultType == 11) { updateFunding(payer, 300000); + } else { + revert UnsupportedOperation(); } } checkFHEGasBlockLimit(); @@ -601,6 +826,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 128000); } else if (resultType == 5) { updateFunding(payer, 156000); + } else if (resultType == 6) { + updateFunding(payer, 190000); + } else if (resultType == 8) { + updateFunding(payer, 231000); + } else { + revert UnsupportedOperation(); } } else { if (resultType == 1) { @@ -613,6 +844,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 128000); } else if (resultType == 5) { updateFunding(payer, 156000); + } else if (resultType == 6) { + updateFunding(payer, 190000); + } else if (resultType == 8) { + updateFunding(payer, 231000); + } else { + revert UnsupportedOperation(); } } checkFHEGasBlockLimit(); @@ -632,6 +869,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 128000); } else if (resultType == 5) { updateFunding(payer, 156000); + } else if (resultType == 6) { + updateFunding(payer, 190000); + } else if (resultType == 8) { + updateFunding(payer, 231000); + } else { + revert UnsupportedOperation(); } } else { if (resultType == 1) { @@ -644,6 +887,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 128000); } else if (resultType == 5) { updateFunding(payer, 156000); + } else if (resultType == 6) { + updateFunding(payer, 190000); + } else if (resultType == 8) { + updateFunding(payer, 231000); + } else { + revert UnsupportedOperation(); } } checkFHEGasBlockLimit(); @@ -663,6 +912,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 128000); } else if (resultType == 5) { updateFunding(payer, 156000); + } else if (resultType == 6) { + updateFunding(payer, 190000); + } else if (resultType == 8) { + updateFunding(payer, 231000); + } else { + revert UnsupportedOperation(); } } else { if (resultType == 1) { @@ -675,6 +930,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 128000); } else if (resultType == 5) { updateFunding(payer, 156000); + } else if (resultType == 6) { + updateFunding(payer, 190000); + } else if (resultType == 8) { + updateFunding(payer, 231000); + } else { + revert UnsupportedOperation(); } } checkFHEGasBlockLimit(); @@ -694,6 +955,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 128000); } else if (resultType == 5) { updateFunding(payer, 156000); + } else if (resultType == 6) { + updateFunding(payer, 190000); + } else if (resultType == 8) { + updateFunding(payer, 231000); + } else { + revert UnsupportedOperation(); } } else { if (resultType == 1) { @@ -706,6 +973,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 128000); } else if (resultType == 5) { updateFunding(payer, 156000); + } else if (resultType == 6) { + updateFunding(payer, 190000); + } else if (resultType == 8) { + updateFunding(payer, 231000); + } else { + revert UnsupportedOperation(); } } checkFHEGasBlockLimit(); @@ -725,6 +998,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 164000); } else if (resultType == 5) { updateFunding(payer, 192000); + } else if (resultType == 6) { + updateFunding(payer, 225000); + } else if (resultType == 8) { + updateFunding(payer, 264000); + } else { + revert UnsupportedOperation(); } } else { if (resultType == 1) { @@ -737,6 +1016,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 183000); } else if (resultType == 5) { updateFunding(payer, 210000); + } else if (resultType == 6) { + updateFunding(payer, 241000); + } else if (resultType == 8) { + updateFunding(payer, 277000); + } else { + revert UnsupportedOperation(); } } checkFHEGasBlockLimit(); @@ -756,6 +1041,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 164000); } else if (resultType == 5) { updateFunding(payer, 192000); + } else if (resultType == 6) { + updateFunding(payer, 225000); + } else if (resultType == 8) { + updateFunding(payer, 264000); + } else { + revert UnsupportedOperation(); } } else { if (resultType == 1) { @@ -768,6 +1059,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 183000); } else if (resultType == 5) { updateFunding(payer, 210000); + } else if (resultType == 6) { + updateFunding(payer, 241000); + } else if (resultType == 8) { + updateFunding(payer, 277000); + } else { + revert UnsupportedOperation(); } } checkFHEGasBlockLimit(); @@ -775,6 +1072,7 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { function payForFheNeg(address payer, uint8 resultType) external virtual { if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + checkIfNewBlock(); if (resultType == 1) { updateFunding(payer, 60000); } else if (resultType == 2) { @@ -785,12 +1083,19 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 160000); } else if (resultType == 5) { updateFunding(payer, 199000); + } else if (resultType == 6) { + updateFunding(payer, 248000); + } else if (resultType == 8) { + updateFunding(payer, 309000); + } else { + revert UnsupportedOperation(); } checkFHEGasBlockLimit(); } function payForFheNot(address payer, uint8 resultType) external virtual { if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + checkIfNewBlock(); if (resultType == 0) { updateFunding(payer, 30000); } else if (resultType == 1) { @@ -803,13 +1108,22 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 36000); } else if (resultType == 5) { updateFunding(payer, 37000); + } else if (resultType == 6) { + updateFunding(payer, 38000); + } else if (resultType == 8) { + updateFunding(payer, 39000); + } else { + revert UnsupportedOperation(); } checkFHEGasBlockLimit(); } function payForCast(address payer, uint8 resultType) external virtual { if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); - if (resultType == 1) { + checkIfNewBlock(); + if (resultType == 0) { + updateFunding(payer, 200); + } else if (resultType == 1) { updateFunding(payer, 200); } else if (resultType == 2) { updateFunding(payer, 200); @@ -819,12 +1133,19 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 200); } else if (resultType == 5) { updateFunding(payer, 200); + } else if (resultType == 6) { + updateFunding(payer, 200); + } else if (resultType == 8) { + updateFunding(payer, 200); + } else { + revert UnsupportedOperation(); } checkFHEGasBlockLimit(); } function payForTrivialEncrypt(address payer, uint8 resultType) external virtual { if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + checkIfNewBlock(); if (resultType == 0) { updateFunding(payer, 100); } else if (resultType == 1) { @@ -837,15 +1158,30 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 300); } else if (resultType == 5) { updateFunding(payer, 600); + } else if (resultType == 6) { + updateFunding(payer, 650); } else if (resultType == 7) { updateFunding(payer, 700); + } else if (resultType == 8) { + updateFunding(payer, 800); + } else if (resultType == 9) { + updateFunding(payer, 1600); + } else if (resultType == 10) { + updateFunding(payer, 3200); + } else if (resultType == 11) { + updateFunding(payer, 6400); + } else { + revert UnsupportedOperation(); } checkFHEGasBlockLimit(); } function payForIfThenElse(address payer, uint8 resultType) external virtual { if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); - if (resultType == 1) { + checkIfNewBlock(); + if (resultType == 0) { + updateFunding(payer, 43000); + } else if (resultType == 1) { updateFunding(payer, 45000); } else if (resultType == 2) { updateFunding(payer, 47000); @@ -855,15 +1191,32 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 50000); } else if (resultType == 5) { updateFunding(payer, 53000); + } else if (resultType == 6) { + updateFunding(payer, 70000); } else if (resultType == 7) { updateFunding(payer, 80000); + } else if (resultType == 8) { + updateFunding(payer, 90000); + } else if (resultType == 9) { + updateFunding(payer, 150000); + } else if (resultType == 10) { + updateFunding(payer, 200000); + } else if (resultType == 11) { + updateFunding(payer, 300000); + } else { + revert UnsupportedOperation(); } checkFHEGasBlockLimit(); } function payForFheRand(address payer, uint8 resultType) external virtual { if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); - if (resultType == 2) { + checkIfNewBlock(); + if (resultType == 0) { + updateFunding(payer, 100000); + } else if (resultType == 1) { + updateFunding(payer, 100000); + } else if (resultType == 2) { updateFunding(payer, 100000); } else if (resultType == 3) { updateFunding(payer, 100000); @@ -871,13 +1224,28 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 100000); } else if (resultType == 5) { updateFunding(payer, 100000); + } else if (resultType == 6) { + updateFunding(payer, 100000); + } else if (resultType == 8) { + updateFunding(payer, 100000); + } else if (resultType == 9) { + updateFunding(payer, 200000); + } else if (resultType == 10) { + updateFunding(payer, 300000); + } else if (resultType == 11) { + updateFunding(payer, 400000); + } else { + revert UnsupportedOperation(); } checkFHEGasBlockLimit(); } function payForFheRandBounded(address payer, uint8 resultType) external virtual { if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); - if (resultType == 2) { + checkIfNewBlock(); + if (resultType == 1) { + updateFunding(payer, 100000); + } else if (resultType == 2) { updateFunding(payer, 100000); } else if (resultType == 3) { updateFunding(payer, 100000); @@ -885,6 +1253,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { updateFunding(payer, 100000); } else if (resultType == 5) { updateFunding(payer, 100000); + } else if (resultType == 6) { + updateFunding(payer, 100000); + } else if (resultType == 8) { + updateFunding(payer, 100000); + } else { + revert UnsupportedOperation(); } checkFHEGasBlockLimit(); } diff --git a/lib/Impl.sol b/lib/Impl.sol index f95499f1..cf1183db 100644 --- a/lib/Impl.sol +++ b/lib/Impl.sol @@ -36,6 +36,9 @@ interface ITFHEExecutor { ) external returns (uint256 result); function cast(uint256 ct, bytes1 toType) external returns (uint256 result); function trivialEncrypt(uint256 ct, bytes1 toType) external returns (uint256 result); + function trivialEncrypt(bytes memory ct, bytes1 toType) external returns (uint256 result); + function fheEq(uint256 lhs, bytes memory rhs, bytes1 scalarByte) external returns (uint256 result); + function fheNe(uint256 lhs, bytes memory rhs, bytes1 scalarByte) external returns (uint256 result); function fheIfThenElse(uint256 control, uint256 ifTrue, uint256 ifFalse) external returns (uint256 result); function fheRand(bytes1 randType) external returns (uint256 result); function fheRandBounded(uint256 upperBound, bytes1 randType) external returns (uint256 result); @@ -112,20 +115,35 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheRem(lhs, rhs, scalarByte); } - function and(uint256 lhs, uint256 rhs) internal returns (uint256 result) { - bytes1 scalarByte = 0x00; + function and(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { + bytes1 scalarByte; + if (scalar) { + scalarByte = 0x01; + } else { + scalarByte = 0x00; + } FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig(); result = ITFHEExecutor($.TFHEExecutorAddress).fheBitAnd(lhs, rhs, scalarByte); } - function or(uint256 lhs, uint256 rhs) internal returns (uint256 result) { - bytes1 scalarByte = 0x00; + function or(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { + bytes1 scalarByte; + if (scalar) { + scalarByte = 0x01; + } else { + scalarByte = 0x00; + } FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig(); result = ITFHEExecutor($.TFHEExecutorAddress).fheBitOr(lhs, rhs, scalarByte); } - function xor(uint256 lhs, uint256 rhs) internal returns (uint256 result) { - bytes1 scalarByte = 0x00; + function xor(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { + bytes1 scalarByte; + if (scalar) { + scalarByte = 0x01; + } else { + scalarByte = 0x00; + } FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig(); result = ITFHEExecutor($.TFHEExecutorAddress).fheBitXor(lhs, rhs, scalarByte); } @@ -300,6 +318,33 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).trivialEncrypt(value, bytes1(toType)); } + function trivialEncrypt(bytes memory value, uint8 toType) internal returns (uint256 result) { + FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig(); + result = ITFHEExecutor($.TFHEExecutorAddress).trivialEncrypt(value, bytes1(toType)); + } + + function eq(uint256 lhs, bytes memory rhs, bool scalar) internal returns (uint256 result) { + bytes1 scalarByte; + if (scalar) { + scalarByte = 0x01; + } else { + scalarByte = 0x00; + } + FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig(); + result = ITFHEExecutor($.TFHEExecutorAddress).fheEq(lhs, rhs, scalarByte); + } + + function ne(uint256 lhs, bytes memory rhs, bool scalar) internal returns (uint256 result) { + bytes1 scalarByte; + if (scalar) { + scalarByte = 0x01; + } else { + scalarByte = 0x00; + } + FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig(); + result = ITFHEExecutor($.TFHEExecutorAddress).fheNe(lhs, rhs, scalarByte); + } + function rand(uint8 randType) internal returns (uint256 result) { FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig(); result = ITFHEExecutor($.TFHEExecutorAddress).fheRand(bytes1(randType)); diff --git a/lib/TFHE.sol b/lib/TFHE.sol index e99eed48..cf10186c 100644 --- a/lib/TFHE.sol +++ b/lib/TFHE.sol @@ -11,7 +11,11 @@ type euint8 is uint256; type euint16 is uint256; type euint32 is uint256; type euint64 is uint256; +type euint128 is uint256; +type euint256 is uint256; type eaddress is uint256; +type ebytes64 is uint256; +type ebytes128 is uint256; type ebytes256 is uint256; type einput is bytes32; @@ -66,6 +70,16 @@ library TFHE { return euint64.unwrap(v) != 0; } + // Return true if the enrypted integer is initialized and false otherwise. + function isInitialized(euint128 v) internal pure returns (bool) { + return euint128.unwrap(v) != 0; + } + + // Return true if the enrypted integer is initialized and false otherwise. + function isInitialized(euint256 v) internal pure returns (bool) { + return euint256.unwrap(v) != 0; + } + // Evaluate add(a, b) and return the result. function add(euint4 a, euint4 b) internal returns (euint4) { if (!isInitialized(a)) { @@ -107,7 +121,7 @@ library TFHE { if (!isInitialized(b)) { b = asEuint4(0); } - return euint4.wrap(Impl.and(euint4.unwrap(a), euint4.unwrap(b))); + return euint4.wrap(Impl.and(euint4.unwrap(a), euint4.unwrap(b), false)); } // Evaluate or(a, b) and return the result. @@ -118,7 +132,7 @@ library TFHE { if (!isInitialized(b)) { b = asEuint4(0); } - return euint4.wrap(Impl.or(euint4.unwrap(a), euint4.unwrap(b))); + return euint4.wrap(Impl.or(euint4.unwrap(a), euint4.unwrap(b), false)); } // Evaluate xor(a, b) and return the result. @@ -129,7 +143,7 @@ library TFHE { if (!isInitialized(b)) { b = asEuint4(0); } - return euint4.wrap(Impl.xor(euint4.unwrap(a), euint4.unwrap(b))); + return euint4.wrap(Impl.xor(euint4.unwrap(a), euint4.unwrap(b), false)); } // Evaluate eq(a, b) and return the result. @@ -261,7 +275,7 @@ library TFHE { if (!isInitialized(b)) { b = asEuint8(0); } - return euint8.wrap(Impl.and(euint8.unwrap(asEuint8(a)), euint8.unwrap(b))); + return euint8.wrap(Impl.and(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); } // Evaluate or(a, b) and return the result. @@ -272,7 +286,7 @@ library TFHE { if (!isInitialized(b)) { b = asEuint8(0); } - return euint8.wrap(Impl.or(euint8.unwrap(asEuint8(a)), euint8.unwrap(b))); + return euint8.wrap(Impl.or(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); } // Evaluate xor(a, b) and return the result. @@ -283,7 +297,7 @@ library TFHE { if (!isInitialized(b)) { b = asEuint8(0); } - return euint8.wrap(Impl.xor(euint8.unwrap(asEuint8(a)), euint8.unwrap(b))); + return euint8.wrap(Impl.xor(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); } // Evaluate eq(a, b) and return the result. @@ -415,7 +429,7 @@ library TFHE { if (!isInitialized(b)) { b = asEuint16(0); } - return euint16.wrap(Impl.and(euint16.unwrap(asEuint16(a)), euint16.unwrap(b))); + return euint16.wrap(Impl.and(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } // Evaluate or(a, b) and return the result. @@ -426,7 +440,7 @@ library TFHE { if (!isInitialized(b)) { b = asEuint16(0); } - return euint16.wrap(Impl.or(euint16.unwrap(asEuint16(a)), euint16.unwrap(b))); + return euint16.wrap(Impl.or(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } // Evaluate xor(a, b) and return the result. @@ -437,7 +451,7 @@ library TFHE { if (!isInitialized(b)) { b = asEuint16(0); } - return euint16.wrap(Impl.xor(euint16.unwrap(asEuint16(a)), euint16.unwrap(b))); + return euint16.wrap(Impl.xor(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } // Evaluate eq(a, b) and return the result. @@ -569,7 +583,7 @@ library TFHE { if (!isInitialized(b)) { b = asEuint32(0); } - return euint32.wrap(Impl.and(euint32.unwrap(asEuint32(a)), euint32.unwrap(b))); + return euint32.wrap(Impl.and(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } // Evaluate or(a, b) and return the result. @@ -580,7 +594,7 @@ library TFHE { if (!isInitialized(b)) { b = asEuint32(0); } - return euint32.wrap(Impl.or(euint32.unwrap(asEuint32(a)), euint32.unwrap(b))); + return euint32.wrap(Impl.or(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } // Evaluate xor(a, b) and return the result. @@ -591,7 +605,7 @@ library TFHE { if (!isInitialized(b)) { b = asEuint32(0); } - return euint32.wrap(Impl.xor(euint32.unwrap(asEuint32(a)), euint32.unwrap(b))); + return euint32.wrap(Impl.xor(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } // Evaluate eq(a, b) and return the result. @@ -723,7 +737,7 @@ library TFHE { if (!isInitialized(b)) { b = asEuint64(0); } - return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b))); + return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } // Evaluate or(a, b) and return the result. @@ -734,7 +748,7 @@ library TFHE { if (!isInitialized(b)) { b = asEuint64(0); } - return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b))); + return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } // Evaluate xor(a, b) and return the result. @@ -745,7 +759,7 @@ library TFHE { if (!isInitialized(b)) { b = asEuint64(0); } - return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b))); + return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } // Evaluate eq(a, b) and return the result. @@ -837,4048 +851,8466 @@ library TFHE { } // Evaluate add(a, b) and return the result. - function add(euint4 a, uint8 b) internal returns (euint4) { + function add(euint4 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint4(0); } - return euint4.wrap(Impl.add(euint4.unwrap(a), uint256(b), true)); - } - - // Evaluate add(a, b) and return the result. - function add(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint128(0); } - return euint4.wrap(Impl.add(euint4.unwrap(b), uint256(a), true)); + return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint4 a, uint8 b) internal returns (euint4) { + function sub(euint4 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint4(0); } - return euint4.wrap(Impl.sub(euint4.unwrap(a), uint256(b), true)); - } - - // Evaluate sub(a, b) and return the result. - function sub(uint8 a, euint4 b) internal returns (euint4) { - euint4 aEnc = asEuint4(a); if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint128(0); } - return euint4.wrap(Impl.sub(euint4.unwrap(aEnc), euint4.unwrap(b), false)); + return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint4 a, uint8 b) internal returns (euint4) { + function mul(euint4 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint4(0); } - return euint4.wrap(Impl.mul(euint4.unwrap(a), uint256(b), true)); - } - - // Evaluate mul(a, b) and return the result. - function mul(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint128(0); } - return euint4.wrap(Impl.mul(euint4.unwrap(b), uint256(a), true)); + return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate div(a, b) and return the result. - function div(euint4 a, uint8 b) internal returns (euint4) { + // Evaluate and(a, b) and return the result. + function and(euint4 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint4(0); } - return euint4.wrap(Impl.div(euint4.unwrap(a), uint256(b))); + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate rem(a, b) and return the result. - function rem(euint4 a, uint8 b) internal returns (euint4) { + // Evaluate or(a, b) and return the result. + function or(euint4 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint4(0); } - return euint4.wrap(Impl.rem(euint4.unwrap(a), uint256(b))); + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. - function eq(euint4 a, uint8 b) internal returns (ebool) { + // Evaluate xor(a, b) and return the result. + function xor(euint4 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint4(0); } - return ebool.wrap(Impl.eq(euint4.unwrap(a), uint256(b), true)); + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate eq(a, b) and return the result. - function eq(uint8 a, euint4 b) internal returns (ebool) { + function eq(euint4 a, euint128 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint4(0); + } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint128(0); } - return ebool.wrap(Impl.eq(euint4.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint4 a, uint8 b) internal returns (ebool) { + function ne(euint4 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); } - return ebool.wrap(Impl.ne(euint4.unwrap(a), uint256(b), true)); - } - - // Evaluate ne(a, b) and return the result. - function ne(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint128(0); } - return ebool.wrap(Impl.ne(euint4.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint4 a, uint8 b) internal returns (ebool) { + function ge(euint4 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); } - return ebool.wrap(Impl.ge(euint4.unwrap(a), uint256(b), true)); - } - - // Evaluate ge(a, b) and return the result. - function ge(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint128(0); } - return ebool.wrap(Impl.le(euint4.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint4 a, uint8 b) internal returns (ebool) { + function gt(euint4 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); } - return ebool.wrap(Impl.gt(euint4.unwrap(a), uint256(b), true)); - } - - // Evaluate gt(a, b) and return the result. - function gt(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint128(0); } - return ebool.wrap(Impl.lt(euint4.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate le(a, b) and return the result. - function le(euint4 a, uint8 b) internal returns (ebool) { + function le(euint4 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); } - return ebool.wrap(Impl.le(euint4.unwrap(a), uint256(b), true)); - } - - // Evaluate le(a, b) and return the result. - function le(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint128(0); } - return ebool.wrap(Impl.ge(euint4.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint4 a, uint8 b) internal returns (ebool) { + function lt(euint4 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); } - return ebool.wrap(Impl.lt(euint4.unwrap(a), uint256(b), true)); - } - - // Evaluate lt(a, b) and return the result. - function lt(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint128(0); } - return ebool.wrap(Impl.gt(euint4.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate min(a, b) and return the result. - function min(euint4 a, uint8 b) internal returns (euint4) { + function min(euint4 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint4(0); } - return euint4.wrap(Impl.min(euint4.unwrap(a), uint256(b), true)); - } - - // Evaluate min(a, b) and return the result. - function min(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint128(0); } - return euint4.wrap(Impl.min(euint4.unwrap(b), uint256(a), true)); + return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate max(a, b) and return the result. - function max(euint4 a, uint8 b) internal returns (euint4) { + function max(euint4 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint4(0); } - return euint4.wrap(Impl.max(euint4.unwrap(a), uint256(b), true)); - } - - // Evaluate max(a, b) and return the result. - function max(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint128(0); } - return euint4.wrap(Impl.max(euint4.unwrap(b), uint256(a), true)); + return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate add(a, b) and return the result. - function add(euint8 a, euint4 b) internal returns (euint8) { + function add(euint4 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint256(0); } - return euint8.wrap(Impl.add(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint8 a, euint4 b) internal returns (euint8) { + function sub(euint4 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint256(0); } - return euint8.wrap(Impl.sub(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint8 a, euint4 b) internal returns (euint8) { + function mul(euint4 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint256(0); } - return euint8.wrap(Impl.mul(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate and(a, b) and return the result. - function and(euint8 a, euint4 b) internal returns (euint8) { + function and(euint4 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint256(0); } - return euint8.wrap(Impl.and(euint8.unwrap(a), euint8.unwrap(asEuint8(b)))); + return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate or(a, b) and return the result. - function or(euint8 a, euint4 b) internal returns (euint8) { + function or(euint4 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint256(0); } - return euint8.wrap(Impl.or(euint8.unwrap(a), euint8.unwrap(asEuint8(b)))); + return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate xor(a, b) and return the result. - function xor(euint8 a, euint4 b) internal returns (euint8) { + function xor(euint4 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint256(0); } - return euint8.wrap(Impl.xor(euint8.unwrap(a), euint8.unwrap(asEuint8(b)))); + return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate eq(a, b) and return the result. - function eq(euint8 a, euint4 b) internal returns (ebool) { + function eq(euint4 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint256(0); } - return ebool.wrap(Impl.eq(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint8 a, euint4 b) internal returns (ebool) { + function ne(euint4 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint256(0); } - return ebool.wrap(Impl.ne(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint8 a, euint4 b) internal returns (ebool) { + function ge(euint4 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint256(0); } - return ebool.wrap(Impl.ge(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint8 a, euint4 b) internal returns (ebool) { + function gt(euint4 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint256(0); } - return ebool.wrap(Impl.gt(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate le(a, b) and return the result. - function le(euint8 a, euint4 b) internal returns (ebool) { + function le(euint4 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint256(0); } - return ebool.wrap(Impl.le(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint8 a, euint4 b) internal returns (ebool) { + function lt(euint4 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint256(0); } - return ebool.wrap(Impl.lt(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate min(a, b) and return the result. - function min(euint8 a, euint4 b) internal returns (euint8) { + function min(euint4 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint256(0); } - return euint8.wrap(Impl.min(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate max(a, b) and return the result. - function max(euint8 a, euint4 b) internal returns (euint8) { + function max(euint4 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint256(0); } - return euint8.wrap(Impl.max(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate add(a, b) and return the result. - function add(euint8 a, euint8 b) internal returns (euint8) { + function add(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } + return euint4.wrap(Impl.add(euint4.unwrap(a), uint256(b), true)); + } + + // Evaluate add(a, b) and return the result. + function add(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint4(0); } - return euint8.wrap(Impl.add(euint8.unwrap(a), euint8.unwrap(b), false)); + return euint4.wrap(Impl.add(euint4.unwrap(b), uint256(a), true)); } // Evaluate sub(a, b) and return the result. - function sub(euint8 a, euint8 b) internal returns (euint8) { + function sub(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } + return euint4.wrap(Impl.sub(euint4.unwrap(a), uint256(b), true)); + } + + // Evaluate sub(a, b) and return the result. + function sub(uint8 a, euint4 b) internal returns (euint4) { + euint4 aEnc = asEuint4(a); if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint4(0); } - return euint8.wrap(Impl.sub(euint8.unwrap(a), euint8.unwrap(b), false)); + return euint4.wrap(Impl.sub(euint4.unwrap(aEnc), euint4.unwrap(b), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint8 a, euint8 b) internal returns (euint8) { + function mul(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } + return euint4.wrap(Impl.mul(euint4.unwrap(a), uint256(b), true)); + } + + // Evaluate mul(a, b) and return the result. + function mul(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint4(0); } - return euint8.wrap(Impl.mul(euint8.unwrap(a), euint8.unwrap(b), false)); + return euint4.wrap(Impl.mul(euint4.unwrap(b), uint256(a), true)); + } + + // Evaluate div(a, b) and return the result. + function div(euint4 a, uint8 b) internal returns (euint4) { + if (!isInitialized(a)) { + a = asEuint4(0); + } + return euint4.wrap(Impl.div(euint4.unwrap(a), uint256(b))); + } + + // Evaluate rem(a, b) and return the result. + function rem(euint4 a, uint8 b) internal returns (euint4) { + if (!isInitialized(a)) { + a = asEuint4(0); + } + return euint4.wrap(Impl.rem(euint4.unwrap(a), uint256(b))); } // Evaluate and(a, b) and return the result. - function and(euint8 a, euint8 b) internal returns (euint8) { + function and(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } + return euint4.wrap(Impl.and(euint4.unwrap(a), uint256(b), true)); + } + + // Evaluate and(a, b) and return the result. + function and(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint4(0); } - return euint8.wrap(Impl.and(euint8.unwrap(a), euint8.unwrap(b))); + return euint4.wrap(Impl.and(euint4.unwrap(b), uint256(a), true)); } // Evaluate or(a, b) and return the result. - function or(euint8 a, euint8 b) internal returns (euint8) { + function or(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } + return euint4.wrap(Impl.or(euint4.unwrap(a), uint256(b), true)); + } + + // Evaluate or(a, b) and return the result. + function or(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint4(0); } - return euint8.wrap(Impl.or(euint8.unwrap(a), euint8.unwrap(b))); + return euint4.wrap(Impl.or(euint4.unwrap(b), uint256(a), true)); } // Evaluate xor(a, b) and return the result. - function xor(euint8 a, euint8 b) internal returns (euint8) { + function xor(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { - a = asEuint8(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); + a = asEuint4(0); } - return euint8.wrap(Impl.xor(euint8.unwrap(a), euint8.unwrap(b))); + return euint4.wrap(Impl.xor(euint4.unwrap(a), uint256(b), true)); + } + + // Evaluate xor(a, b) and return the result. + function xor(uint8 a, euint4 b) internal returns (euint4) { + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint4.wrap(Impl.xor(euint4.unwrap(b), uint256(a), true)); } // Evaluate eq(a, b) and return the result. - function eq(euint8 a, euint8 b) internal returns (ebool) { + function eq(euint4 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } + return ebool.wrap(Impl.eq(euint4.unwrap(a), uint256(b), true)); + } + + // Evaluate eq(a, b) and return the result. + function eq(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint4(0); } - return ebool.wrap(Impl.eq(euint8.unwrap(a), euint8.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint4.unwrap(b), uint256(a), true)); } // Evaluate ne(a, b) and return the result. - function ne(euint8 a, euint8 b) internal returns (ebool) { + function ne(euint4 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } + return ebool.wrap(Impl.ne(euint4.unwrap(a), uint256(b), true)); + } + + // Evaluate ne(a, b) and return the result. + function ne(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint4(0); } - return ebool.wrap(Impl.ne(euint8.unwrap(a), euint8.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint4.unwrap(b), uint256(a), true)); } // Evaluate ge(a, b) and return the result. - function ge(euint8 a, euint8 b) internal returns (ebool) { + function ge(euint4 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } + return ebool.wrap(Impl.ge(euint4.unwrap(a), uint256(b), true)); + } + + // Evaluate ge(a, b) and return the result. + function ge(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint4(0); } - return ebool.wrap(Impl.ge(euint8.unwrap(a), euint8.unwrap(b), false)); + return ebool.wrap(Impl.le(euint4.unwrap(b), uint256(a), true)); } // Evaluate gt(a, b) and return the result. - function gt(euint8 a, euint8 b) internal returns (ebool) { + function gt(euint4 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } + return ebool.wrap(Impl.gt(euint4.unwrap(a), uint256(b), true)); + } + + // Evaluate gt(a, b) and return the result. + function gt(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint4(0); } - return ebool.wrap(Impl.gt(euint8.unwrap(a), euint8.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint4.unwrap(b), uint256(a), true)); } // Evaluate le(a, b) and return the result. - function le(euint8 a, euint8 b) internal returns (ebool) { + function le(euint4 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } + return ebool.wrap(Impl.le(euint4.unwrap(a), uint256(b), true)); + } + + // Evaluate le(a, b) and return the result. + function le(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint4(0); } - return ebool.wrap(Impl.le(euint8.unwrap(a), euint8.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint4.unwrap(b), uint256(a), true)); } // Evaluate lt(a, b) and return the result. - function lt(euint8 a, euint8 b) internal returns (ebool) { + function lt(euint4 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } + return ebool.wrap(Impl.lt(euint4.unwrap(a), uint256(b), true)); + } + + // Evaluate lt(a, b) and return the result. + function lt(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint4(0); } - return ebool.wrap(Impl.lt(euint8.unwrap(a), euint8.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint4.unwrap(b), uint256(a), true)); } // Evaluate min(a, b) and return the result. - function min(euint8 a, euint8 b) internal returns (euint8) { + function min(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } + return euint4.wrap(Impl.min(euint4.unwrap(a), uint256(b), true)); + } + + // Evaluate min(a, b) and return the result. + function min(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint4(0); } - return euint8.wrap(Impl.min(euint8.unwrap(a), euint8.unwrap(b), false)); + return euint4.wrap(Impl.min(euint4.unwrap(b), uint256(a), true)); } // Evaluate max(a, b) and return the result. - function max(euint8 a, euint8 b) internal returns (euint8) { + function max(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint4(0); } + return euint4.wrap(Impl.max(euint4.unwrap(a), uint256(b), true)); + } + + // Evaluate max(a, b) and return the result. + function max(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint4(0); } - return euint8.wrap(Impl.max(euint8.unwrap(a), euint8.unwrap(b), false)); + return euint4.wrap(Impl.max(euint4.unwrap(b), uint256(a), true)); } // Evaluate add(a, b) and return the result. - function add(euint8 a, euint16 b) internal returns (euint16) { + function add(euint8 a, euint4 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return euint16.wrap(Impl.add(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return euint8.wrap(Impl.add(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint8 a, euint16 b) internal returns (euint16) { + function sub(euint8 a, euint4 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return euint16.wrap(Impl.sub(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return euint8.wrap(Impl.sub(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint8 a, euint16 b) internal returns (euint16) { + function mul(euint8 a, euint4 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return euint16.wrap(Impl.mul(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return euint8.wrap(Impl.mul(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } // Evaluate and(a, b) and return the result. - function and(euint8 a, euint16 b) internal returns (euint16) { + function and(euint8 a, euint4 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return euint16.wrap(Impl.and(euint16.unwrap(asEuint16(a)), euint16.unwrap(b))); + return euint8.wrap(Impl.and(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } // Evaluate or(a, b) and return the result. - function or(euint8 a, euint16 b) internal returns (euint16) { + function or(euint8 a, euint4 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return euint16.wrap(Impl.or(euint16.unwrap(asEuint16(a)), euint16.unwrap(b))); + return euint8.wrap(Impl.or(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } // Evaluate xor(a, b) and return the result. - function xor(euint8 a, euint16 b) internal returns (euint16) { + function xor(euint8 a, euint4 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return euint16.wrap(Impl.xor(euint16.unwrap(asEuint16(a)), euint16.unwrap(b))); + return euint8.wrap(Impl.xor(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } // Evaluate eq(a, b) and return the result. - function eq(euint8 a, euint16 b) internal returns (ebool) { + function eq(euint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return ebool.wrap(Impl.eq(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint8 a, euint16 b) internal returns (ebool) { + function ne(euint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return ebool.wrap(Impl.ne(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint8 a, euint16 b) internal returns (ebool) { + function ge(euint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return ebool.wrap(Impl.ge(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint8 a, euint16 b) internal returns (ebool) { + function gt(euint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return ebool.wrap(Impl.gt(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } // Evaluate le(a, b) and return the result. - function le(euint8 a, euint16 b) internal returns (ebool) { + function le(euint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return ebool.wrap(Impl.le(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return ebool.wrap(Impl.le(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint8 a, euint16 b) internal returns (ebool) { + function lt(euint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return ebool.wrap(Impl.lt(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } // Evaluate min(a, b) and return the result. - function min(euint8 a, euint16 b) internal returns (euint16) { + function min(euint8 a, euint4 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return euint16.wrap(Impl.min(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return euint8.wrap(Impl.min(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } // Evaluate max(a, b) and return the result. - function max(euint8 a, euint16 b) internal returns (euint16) { + function max(euint8 a, euint4 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return euint16.wrap(Impl.max(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return euint8.wrap(Impl.max(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } // Evaluate add(a, b) and return the result. - function add(euint8 a, euint32 b) internal returns (euint32) { + function add(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.add(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint8.wrap(Impl.add(euint8.unwrap(a), euint8.unwrap(b), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint8 a, euint32 b) internal returns (euint32) { + function sub(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.sub(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint8.wrap(Impl.sub(euint8.unwrap(a), euint8.unwrap(b), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint8 a, euint32 b) internal returns (euint32) { + function mul(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.mul(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint8.wrap(Impl.mul(euint8.unwrap(a), euint8.unwrap(b), false)); } // Evaluate and(a, b) and return the result. - function and(euint8 a, euint32 b) internal returns (euint32) { + function and(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.and(euint32.unwrap(asEuint32(a)), euint32.unwrap(b))); + return euint8.wrap(Impl.and(euint8.unwrap(a), euint8.unwrap(b), false)); } // Evaluate or(a, b) and return the result. - function or(euint8 a, euint32 b) internal returns (euint32) { + function or(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.or(euint32.unwrap(asEuint32(a)), euint32.unwrap(b))); + return euint8.wrap(Impl.or(euint8.unwrap(a), euint8.unwrap(b), false)); } // Evaluate xor(a, b) and return the result. - function xor(euint8 a, euint32 b) internal returns (euint32) { + function xor(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.xor(euint32.unwrap(asEuint32(a)), euint32.unwrap(b))); + return euint8.wrap(Impl.xor(euint8.unwrap(a), euint8.unwrap(b), false)); } // Evaluate eq(a, b) and return the result. - function eq(euint8 a, euint32 b) internal returns (ebool) { + function eq(euint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.eq(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint8.unwrap(a), euint8.unwrap(b), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint8 a, euint32 b) internal returns (ebool) { + function ne(euint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.ne(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint8.unwrap(a), euint8.unwrap(b), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint8 a, euint32 b) internal returns (ebool) { + function ge(euint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.ge(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint8.unwrap(a), euint8.unwrap(b), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint8 a, euint32 b) internal returns (ebool) { + function gt(euint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.gt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint8.unwrap(a), euint8.unwrap(b), false)); } // Evaluate le(a, b) and return the result. - function le(euint8 a, euint32 b) internal returns (ebool) { + function le(euint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.le(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.le(euint8.unwrap(a), euint8.unwrap(b), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint8 a, euint32 b) internal returns (ebool) { + function lt(euint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.lt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint8.unwrap(a), euint8.unwrap(b), false)); } // Evaluate min(a, b) and return the result. - function min(euint8 a, euint32 b) internal returns (euint32) { + function min(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.min(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint8.wrap(Impl.min(euint8.unwrap(a), euint8.unwrap(b), false)); } // Evaluate max(a, b) and return the result. - function max(euint8 a, euint32 b) internal returns (euint32) { + function max(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.max(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint8.wrap(Impl.max(euint8.unwrap(a), euint8.unwrap(b), false)); } // Evaluate add(a, b) and return the result. - function add(euint8 a, euint64 b) internal returns (euint64) { + function add(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint16.wrap(Impl.add(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint8 a, euint64 b) internal returns (euint64) { + function sub(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint16.wrap(Impl.sub(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint8 a, euint64 b) internal returns (euint64) { + function mul(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint16.wrap(Impl.mul(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } // Evaluate and(a, b) and return the result. - function and(euint8 a, euint64 b) internal returns (euint64) { + function and(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b))); + return euint16.wrap(Impl.and(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } // Evaluate or(a, b) and return the result. - function or(euint8 a, euint64 b) internal returns (euint64) { + function or(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b))); + return euint16.wrap(Impl.or(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } // Evaluate xor(a, b) and return the result. - function xor(euint8 a, euint64 b) internal returns (euint64) { + function xor(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b))); + return euint16.wrap(Impl.xor(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } // Evaluate eq(a, b) and return the result. - function eq(euint8 a, euint64 b) internal returns (ebool) { + function eq(euint8 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint8 a, euint64 b) internal returns (ebool) { + function ne(euint8 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint8 a, euint64 b) internal returns (ebool) { + function ge(euint8 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint8 a, euint64 b) internal returns (ebool) { + function gt(euint8 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } // Evaluate le(a, b) and return the result. - function le(euint8 a, euint64 b) internal returns (ebool) { + function le(euint8 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.le(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint8 a, euint64 b) internal returns (ebool) { + function lt(euint8 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } // Evaluate min(a, b) and return the result. - function min(euint8 a, euint64 b) internal returns (euint64) { + function min(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint16.wrap(Impl.min(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } // Evaluate max(a, b) and return the result. - function max(euint8 a, euint64 b) internal returns (euint64) { + function max(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint16.wrap(Impl.max(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } // Evaluate add(a, b) and return the result. - function add(euint8 a, uint8 b) internal returns (euint8) { + function add(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint8(0); } - return euint8.wrap(Impl.add(euint8.unwrap(a), uint256(b), true)); - } - - // Evaluate add(a, b) and return the result. - function add(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return euint8.wrap(Impl.add(euint8.unwrap(b), uint256(a), true)); + return euint32.wrap(Impl.add(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint8 a, uint8 b) internal returns (euint8) { + function sub(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint8(0); } - return euint8.wrap(Impl.sub(euint8.unwrap(a), uint256(b), true)); - } - - // Evaluate sub(a, b) and return the result. - function sub(uint8 a, euint8 b) internal returns (euint8) { - euint8 aEnc = asEuint8(a); if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return euint8.wrap(Impl.sub(euint8.unwrap(aEnc), euint8.unwrap(b), false)); + return euint32.wrap(Impl.sub(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint8 a, uint8 b) internal returns (euint8) { + function mul(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint8(0); } - return euint8.wrap(Impl.mul(euint8.unwrap(a), uint256(b), true)); - } - - // Evaluate mul(a, b) and return the result. - function mul(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return euint8.wrap(Impl.mul(euint8.unwrap(b), uint256(a), true)); + return euint32.wrap(Impl.mul(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate div(a, b) and return the result. - function div(euint8 a, uint8 b) internal returns (euint8) { + // Evaluate and(a, b) and return the result. + function and(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint8(0); } - return euint8.wrap(Impl.div(euint8.unwrap(a), uint256(b))); + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.and(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate rem(a, b) and return the result. - function rem(euint8 a, uint8 b) internal returns (euint8) { + // Evaluate or(a, b) and return the result. + function or(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint8(0); } - return euint8.wrap(Impl.rem(euint8.unwrap(a), uint256(b))); + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.or(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. - function eq(euint8 a, uint8 b) internal returns (ebool) { + // Evaluate xor(a, b) and return the result. + function xor(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint8(0); } - return ebool.wrap(Impl.eq(euint8.unwrap(a), uint256(b), true)); + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.xor(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } // Evaluate eq(a, b) and return the result. - function eq(uint8 a, euint8 b) internal returns (ebool) { + function eq(euint8 a, euint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return ebool.wrap(Impl.eq(euint8.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.eq(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint8 a, uint8 b) internal returns (ebool) { + function ne(euint8 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } - return ebool.wrap(Impl.ne(euint8.unwrap(a), uint256(b), true)); - } - - // Evaluate ne(a, b) and return the result. - function ne(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return ebool.wrap(Impl.ne(euint8.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.ne(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint8 a, uint8 b) internal returns (ebool) { + function ge(euint8 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } - return ebool.wrap(Impl.ge(euint8.unwrap(a), uint256(b), true)); - } - - // Evaluate ge(a, b) and return the result. - function ge(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return ebool.wrap(Impl.le(euint8.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.ge(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint8 a, uint8 b) internal returns (ebool) { + function gt(euint8 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } - return ebool.wrap(Impl.gt(euint8.unwrap(a), uint256(b), true)); - } - - // Evaluate gt(a, b) and return the result. - function gt(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return ebool.wrap(Impl.lt(euint8.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.gt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } // Evaluate le(a, b) and return the result. - function le(euint8 a, uint8 b) internal returns (ebool) { + function le(euint8 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } - return ebool.wrap(Impl.le(euint8.unwrap(a), uint256(b), true)); - } - - // Evaluate le(a, b) and return the result. - function le(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return ebool.wrap(Impl.ge(euint8.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.le(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint8 a, uint8 b) internal returns (ebool) { + function lt(euint8 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); } - return ebool.wrap(Impl.lt(euint8.unwrap(a), uint256(b), true)); - } - - // Evaluate lt(a, b) and return the result. - function lt(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return ebool.wrap(Impl.gt(euint8.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.lt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } // Evaluate min(a, b) and return the result. - function min(euint8 a, uint8 b) internal returns (euint8) { + function min(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint8(0); } - return euint8.wrap(Impl.min(euint8.unwrap(a), uint256(b), true)); - } - - // Evaluate min(a, b) and return the result. - function min(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return euint8.wrap(Impl.min(euint8.unwrap(b), uint256(a), true)); + return euint32.wrap(Impl.min(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } // Evaluate max(a, b) and return the result. - function max(euint8 a, uint8 b) internal returns (euint8) { + function max(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint8(0); } - return euint8.wrap(Impl.max(euint8.unwrap(a), uint256(b), true)); - } - - // Evaluate max(a, b) and return the result. - function max(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return euint8.wrap(Impl.max(euint8.unwrap(b), uint256(a), true)); + return euint32.wrap(Impl.max(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } // Evaluate add(a, b) and return the result. - function add(euint16 a, euint4 b) internal returns (euint16) { + function add(euint8 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint64(0); } - return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint16 a, euint4 b) internal returns (euint16) { + function sub(euint8 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint64(0); } - return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint16 a, euint4 b) internal returns (euint16) { + function mul(euint8 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint64(0); } - return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate and(a, b) and return the result. + function and(euint8 a, euint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint8 a, euint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint8 a, euint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint8 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint8 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint8 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint8 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint8 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint8 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint8 a, euint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint8 a, euint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint8 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint8 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint8 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate and(a, b) and return the result. + function and(euint8 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint8 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint8 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint8 a, euint128 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint8 a, euint128 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint8 a, euint128 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint8 a, euint128 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint8 a, euint128 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint8 a, euint128 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint8 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint8 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint8 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint8 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint8 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate and(a, b) and return the result. + function and(euint8 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint8 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint8 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint8 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint8 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint8 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint8 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint8 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint8 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint8 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint8 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint8 a, uint8 b) internal returns (euint8) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + return euint8.wrap(Impl.add(euint8.unwrap(a), uint256(b), true)); + } + + // Evaluate add(a, b) and return the result. + function add(uint8 a, euint8 b) internal returns (euint8) { + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint8.wrap(Impl.add(euint8.unwrap(b), uint256(a), true)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint8 a, uint8 b) internal returns (euint8) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + return euint8.wrap(Impl.sub(euint8.unwrap(a), uint256(b), true)); + } + + // Evaluate sub(a, b) and return the result. + function sub(uint8 a, euint8 b) internal returns (euint8) { + euint8 aEnc = asEuint8(a); + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint8.wrap(Impl.sub(euint8.unwrap(aEnc), euint8.unwrap(b), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint8 a, uint8 b) internal returns (euint8) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + return euint8.wrap(Impl.mul(euint8.unwrap(a), uint256(b), true)); + } + + // Evaluate mul(a, b) and return the result. + function mul(uint8 a, euint8 b) internal returns (euint8) { + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint8.wrap(Impl.mul(euint8.unwrap(b), uint256(a), true)); + } + + // Evaluate div(a, b) and return the result. + function div(euint8 a, uint8 b) internal returns (euint8) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + return euint8.wrap(Impl.div(euint8.unwrap(a), uint256(b))); + } + + // Evaluate rem(a, b) and return the result. + function rem(euint8 a, uint8 b) internal returns (euint8) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + return euint8.wrap(Impl.rem(euint8.unwrap(a), uint256(b))); + } + + // Evaluate and(a, b) and return the result. + function and(euint8 a, uint8 b) internal returns (euint8) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + return euint8.wrap(Impl.and(euint8.unwrap(a), uint256(b), true)); + } + + // Evaluate and(a, b) and return the result. + function and(uint8 a, euint8 b) internal returns (euint8) { + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint8.wrap(Impl.and(euint8.unwrap(b), uint256(a), true)); + } + + // Evaluate or(a, b) and return the result. + function or(euint8 a, uint8 b) internal returns (euint8) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + return euint8.wrap(Impl.or(euint8.unwrap(a), uint256(b), true)); + } + + // Evaluate or(a, b) and return 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), uint256(a), true)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint8 a, uint8 b) internal returns (euint8) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + return euint8.wrap(Impl.xor(euint8.unwrap(a), uint256(b), true)); + } + + // Evaluate xor(a, b) and return the result. + function xor(uint8 a, euint8 b) internal returns (euint8) { + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint8.wrap(Impl.xor(euint8.unwrap(b), uint256(a), true)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint8 a, uint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + return ebool.wrap(Impl.eq(euint8.unwrap(a), uint256(b), true)); + } + + // Evaluate eq(a, b) and return the result. + function eq(uint8 a, euint8 b) internal returns (ebool) { + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.eq(euint8.unwrap(b), uint256(a), true)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint8 a, uint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + return ebool.wrap(Impl.ne(euint8.unwrap(a), uint256(b), true)); + } + + // Evaluate ne(a, b) and return the result. + function ne(uint8 a, euint8 b) internal returns (ebool) { + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.ne(euint8.unwrap(b), uint256(a), true)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint8 a, uint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + return ebool.wrap(Impl.ge(euint8.unwrap(a), uint256(b), true)); + } + + // Evaluate ge(a, b) and return the result. + function ge(uint8 a, euint8 b) internal returns (ebool) { + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.le(euint8.unwrap(b), uint256(a), true)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint8 a, uint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + return ebool.wrap(Impl.gt(euint8.unwrap(a), uint256(b), true)); + } + + // Evaluate gt(a, b) and return the result. + function gt(uint8 a, euint8 b) internal returns (ebool) { + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.lt(euint8.unwrap(b), uint256(a), true)); + } + + // Evaluate le(a, b) and return the result. + function le(euint8 a, uint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + return ebool.wrap(Impl.le(euint8.unwrap(a), uint256(b), true)); + } + + // Evaluate le(a, b) and return the result. + function le(uint8 a, euint8 b) internal returns (ebool) { + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.ge(euint8.unwrap(b), uint256(a), true)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint8 a, uint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + return ebool.wrap(Impl.lt(euint8.unwrap(a), uint256(b), true)); + } + + // Evaluate lt(a, b) and return the result. + function lt(uint8 a, euint8 b) internal returns (ebool) { + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.gt(euint8.unwrap(b), uint256(a), true)); + } + + // Evaluate min(a, b) and return the result. + function min(euint8 a, uint8 b) internal returns (euint8) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + return euint8.wrap(Impl.min(euint8.unwrap(a), uint256(b), true)); + } + + // Evaluate min(a, b) and return the result. + function min(uint8 a, euint8 b) internal returns (euint8) { + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint8.wrap(Impl.min(euint8.unwrap(b), uint256(a), true)); + } + + // Evaluate max(a, b) and return the result. + function max(euint8 a, uint8 b) internal returns (euint8) { + if (!isInitialized(a)) { + a = asEuint8(0); + } + return euint8.wrap(Impl.max(euint8.unwrap(a), uint256(b), true)); + } + + // Evaluate max(a, b) and return the result. + function max(uint8 a, euint8 b) internal returns (euint8) { + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint8.wrap(Impl.max(euint8.unwrap(b), uint256(a), true)); + } + + // Evaluate add(a, b) and return the result. + function add(euint16 a, euint4 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint16 a, euint4 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint16 a, euint4 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } // Evaluate and(a, b) and return the result. function and(euint16 a, euint4 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint16 a, euint4 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint16 a, euint4 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint16 a, euint4 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint16 a, euint4 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint16 a, euint4 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint16 a, euint4 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint16 a, euint4 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint16 a, euint4 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint16 a, euint4 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint16 a, euint4 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint16 a, euint8 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint16 a, euint8 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint16 a, euint8 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate and(a, b) and return the result. + function and(euint16 a, euint8 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint16 a, euint8 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint16 a, euint8 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint16 a, euint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint16 a, euint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint16 a, euint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint16 a, euint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint16 a, euint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint16 a, euint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint16 a, euint8 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint16 a, euint8 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint16 a, euint16 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(b), false)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint16 a, euint16 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(b), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint16 a, euint16 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(b), false)); + } + + // Evaluate and(a, b) and return the result. + function and(euint16 a, euint16 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(b), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint16 a, euint16 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(b), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint16 a, euint16 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(b), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint16 a, euint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(b), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint16 a, euint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(b), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint16 a, euint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(b), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint16 a, euint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(b), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint16 a, euint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(b), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint16 a, euint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(b), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint16 a, euint16 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(b), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint16 a, euint16 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(b), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint16 a, euint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.add(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint16 a, euint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.sub(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint16 a, euint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.mul(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + } + + // Evaluate and(a, b) and return the result. + function and(euint16 a, euint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.and(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint16 a, euint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.or(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint16 a, euint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.xor(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint16 a, euint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.eq(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint16 a, euint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.ne(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint16 a, euint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.ge(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint16 a, euint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.gt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint16 a, euint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.le(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint16 a, euint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.lt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint16 a, euint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.min(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint16 a, euint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.max(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint16 a, euint64 b) internal returns (euint64) { + 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)); + } + + // Evaluate sub(a, b) and return 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)); + } + + // Evaluate mul(a, b) and return 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)); + } + + // Evaluate and(a, b) and return 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)); + } + + // Evaluate or(a, b) and return 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)); + } + + // Evaluate xor(a, b) and return 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)); + } + + // Evaluate eq(a, b) and return 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)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint16 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint16 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint16 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint16 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint16 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint16 a, euint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint16 a, euint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint16 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint16 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint16 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate and(a, b) and return the result. + function and(euint16 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint16 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint16 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint16 a, euint128 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint16 a, euint128 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint16 a, euint128 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint16 a, euint128 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint16 a, euint128 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint16 a, euint128 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint16 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint16 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint16 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint16 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint16 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate and(a, b) and return the result. + function and(euint16 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint16 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint16 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint16 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint16 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint16 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint16 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint16 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint16 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint16 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint16 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint16 a, uint16 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + return euint16.wrap(Impl.add(euint16.unwrap(a), uint256(b), true)); + } + + // Evaluate add(a, b) and return the result. + function add(uint16 a, euint16 b) internal returns (euint16) { + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint16.wrap(Impl.add(euint16.unwrap(b), uint256(a), true)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint16 a, uint16 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + return euint16.wrap(Impl.sub(euint16.unwrap(a), uint256(b), true)); + } + + // Evaluate sub(a, b) and return the result. + function sub(uint16 a, euint16 b) internal returns (euint16) { + euint16 aEnc = asEuint16(a); + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint16.wrap(Impl.sub(euint16.unwrap(aEnc), euint16.unwrap(b), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint16 a, uint16 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + return euint16.wrap(Impl.mul(euint16.unwrap(a), uint256(b), true)); + } + + // Evaluate mul(a, b) and return the result. + function mul(uint16 a, euint16 b) internal returns (euint16) { + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint16.wrap(Impl.mul(euint16.unwrap(b), uint256(a), true)); + } + + // Evaluate div(a, b) and return the result. + function div(euint16 a, uint16 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + return euint16.wrap(Impl.div(euint16.unwrap(a), uint256(b))); + } + + // Evaluate rem(a, b) and return the result. + function rem(euint16 a, uint16 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + return euint16.wrap(Impl.rem(euint16.unwrap(a), uint256(b))); + } + + // Evaluate and(a, b) and return the result. + function and(euint16 a, uint16 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + return euint16.wrap(Impl.and(euint16.unwrap(a), uint256(b), true)); + } + + // Evaluate and(a, b) and return 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), uint256(a), true)); + } + + // Evaluate or(a, b) and return the result. + function or(euint16 a, uint16 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + return euint16.wrap(Impl.or(euint16.unwrap(a), uint256(b), true)); + } + + // Evaluate or(a, b) and return 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), uint256(a), true)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint16 a, uint16 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + return euint16.wrap(Impl.xor(euint16.unwrap(a), uint256(b), true)); + } + + // Evaluate xor(a, b) and return 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), uint256(a), true)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint16 a, uint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + return ebool.wrap(Impl.eq(euint16.unwrap(a), uint256(b), true)); + } + + // Evaluate eq(a, b) and return 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), uint256(a), true)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint16 a, uint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + return ebool.wrap(Impl.ne(euint16.unwrap(a), uint256(b), true)); + } + + // Evaluate ne(a, b) and return 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), uint256(a), true)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint16 a, uint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + return ebool.wrap(Impl.ge(euint16.unwrap(a), uint256(b), true)); + } + + // Evaluate ge(a, b) and return 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), uint256(a), true)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint16 a, uint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + return ebool.wrap(Impl.gt(euint16.unwrap(a), uint256(b), true)); + } + + // Evaluate gt(a, b) and return 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), uint256(a), true)); + } + + // Evaluate le(a, b) and return the result. + function le(euint16 a, uint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + return ebool.wrap(Impl.le(euint16.unwrap(a), uint256(b), true)); + } + + // Evaluate le(a, b) and return 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), uint256(a), true)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint16 a, uint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + return ebool.wrap(Impl.lt(euint16.unwrap(a), uint256(b), true)); + } + + // Evaluate lt(a, b) and return 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), uint256(a), true)); + } + + // Evaluate min(a, b) and return the result. + function min(euint16 a, uint16 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + return euint16.wrap(Impl.min(euint16.unwrap(a), uint256(b), true)); + } + + // Evaluate min(a, b) and return 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), uint256(a), true)); + } + + // Evaluate max(a, b) and return the result. + function max(euint16 a, uint16 b) internal returns (euint16) { + if (!isInitialized(a)) { + a = asEuint16(0); + } + return euint16.wrap(Impl.max(euint16.unwrap(a), uint256(b), true)); + } + + // Evaluate max(a, b) and return 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), uint256(a), true)); + } + + // Evaluate add(a, b) and return the result. + function add(euint32 a, euint4 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint32 a, euint4 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint32 a, euint4 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate and(a, b) and return the result. + function and(euint32 a, euint4 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint32 a, euint4 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint32 a, euint4 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint32 a, euint4 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint32 a, euint4 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint32 a, euint4 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint32 a, euint4 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint32 a, euint4 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint32 a, euint4 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint32 a, euint4 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint32 a, euint4 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint32 a, euint8 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint32 a, euint8 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint32 a, euint8 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate and(a, b) and return the result. + function and(euint32 a, euint8 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint32 a, euint8 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint32 a, euint8 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint32 a, euint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint32 a, euint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint32 a, euint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint32 a, euint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint32 a, euint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint32 a, euint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint32 a, euint8 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint32 a, euint8 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint32 a, euint16 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint32 a, euint16 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint32 a, euint16 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate and(a, b) and return the result. + function and(euint32 a, euint16 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint32 a, euint16 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint32 a, euint16 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint32 a, euint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint32 a, euint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint32 a, euint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint32 a, euint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint32 a, euint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint32 a, euint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint32 a, euint16 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint32 a, euint16 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint32 a, euint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(b), false)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint32 a, euint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(b), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint32 a, euint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(b), false)); + } + + // Evaluate and(a, b) and return the result. + function and(euint32 a, euint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(b), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint32 a, euint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(b), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint32 a, euint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(b), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint32 a, euint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(b), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint32 a, euint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(b), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint32 a, euint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(b), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint32 a, euint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(b), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint32 a, euint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(b), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint32 a, euint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(b), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint32 a, euint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(b), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint32 a, euint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(b), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint32 a, euint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint32 a, euint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint32 a, euint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate and(a, b) and return the result. + function and(euint32 a, euint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint32 a, euint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint32 a, euint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint32 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint32 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint32 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint32 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint32 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint32 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint32 a, euint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint32 a, euint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint32 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint32 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint32 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate and(a, b) and return the result. + function and(euint32 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint32 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint32 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint32 a, euint128 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint32 a, euint128 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint32 a, euint128 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint32 a, euint128 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint32 a, euint128 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint32 a, euint128 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint32 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint32 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint32 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint32 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint32 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate and(a, b) and return the result. + function and(euint32 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint32 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint32 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint32 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint32 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint32 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint32 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint32 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint32 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint32 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint32 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint32 a, uint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + return euint32.wrap(Impl.add(euint32.unwrap(a), uint256(b), true)); + } + + // Evaluate add(a, b) and return the result. + function add(uint32 a, euint32 b) internal returns (euint32) { + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.add(euint32.unwrap(b), uint256(a), true)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint32 a, uint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + return euint32.wrap(Impl.sub(euint32.unwrap(a), uint256(b), true)); + } + + // Evaluate sub(a, b) and return the result. + function sub(uint32 a, euint32 b) internal returns (euint32) { + euint32 aEnc = asEuint32(a); + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.sub(euint32.unwrap(aEnc), euint32.unwrap(b), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint32 a, uint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + return euint32.wrap(Impl.mul(euint32.unwrap(a), uint256(b), true)); + } + + // Evaluate mul(a, b) and return the result. + function mul(uint32 a, euint32 b) internal returns (euint32) { + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.mul(euint32.unwrap(b), uint256(a), true)); + } + + // Evaluate div(a, b) and return the result. + function div(euint32 a, uint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + return euint32.wrap(Impl.div(euint32.unwrap(a), uint256(b))); + } + + // Evaluate rem(a, b) and return the result. + function rem(euint32 a, uint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + return euint32.wrap(Impl.rem(euint32.unwrap(a), uint256(b))); + } + + // Evaluate and(a, b) and return the result. + function and(euint32 a, uint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + return euint32.wrap(Impl.and(euint32.unwrap(a), uint256(b), true)); + } + + // Evaluate and(a, b) and return the result. + function and(uint32 a, euint32 b) internal returns (euint32) { + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.and(euint32.unwrap(b), uint256(a), true)); + } + + // Evaluate or(a, b) and return the result. + function or(euint32 a, uint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + return euint32.wrap(Impl.or(euint32.unwrap(a), uint256(b), true)); + } + + // Evaluate or(a, b) and return the result. + function or(uint32 a, euint32 b) internal returns (euint32) { + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.or(euint32.unwrap(b), uint256(a), true)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint32 a, uint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + return euint32.wrap(Impl.xor(euint32.unwrap(a), uint256(b), true)); + } + + // Evaluate xor(a, b) and return the result. + function xor(uint32 a, euint32 b) internal returns (euint32) { + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.xor(euint32.unwrap(b), uint256(a), true)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint32 a, uint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + return ebool.wrap(Impl.eq(euint32.unwrap(a), uint256(b), true)); + } + + // Evaluate eq(a, b) and return the result. + function eq(uint32 a, euint32 b) internal returns (ebool) { + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.eq(euint32.unwrap(b), uint256(a), true)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint32 a, uint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + return ebool.wrap(Impl.ne(euint32.unwrap(a), uint256(b), true)); + } + + // Evaluate ne(a, b) and return the result. + function ne(uint32 a, euint32 b) internal returns (ebool) { + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.ne(euint32.unwrap(b), uint256(a), true)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint32 a, uint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + return ebool.wrap(Impl.ge(euint32.unwrap(a), uint256(b), true)); + } + + // Evaluate ge(a, b) and return the result. + function ge(uint32 a, euint32 b) internal returns (ebool) { + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.le(euint32.unwrap(b), uint256(a), true)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint32 a, uint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + return ebool.wrap(Impl.gt(euint32.unwrap(a), uint256(b), true)); + } + + // Evaluate gt(a, b) and return the result. + function gt(uint32 a, euint32 b) internal returns (ebool) { + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.lt(euint32.unwrap(b), uint256(a), true)); + } + + // Evaluate le(a, b) and return the result. + function le(euint32 a, uint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + return ebool.wrap(Impl.le(euint32.unwrap(a), uint256(b), true)); + } + + // Evaluate le(a, b) and return the result. + function le(uint32 a, euint32 b) internal returns (ebool) { + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.ge(euint32.unwrap(b), uint256(a), true)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint32 a, uint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + return ebool.wrap(Impl.lt(euint32.unwrap(a), uint256(b), true)); + } + + // Evaluate lt(a, b) and return the result. + function lt(uint32 a, euint32 b) internal returns (ebool) { + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.gt(euint32.unwrap(b), uint256(a), true)); + } + + // Evaluate min(a, b) and return the result. + function min(euint32 a, uint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + return euint32.wrap(Impl.min(euint32.unwrap(a), uint256(b), true)); + } + + // Evaluate min(a, b) and return the result. + function min(uint32 a, euint32 b) internal returns (euint32) { + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.min(euint32.unwrap(b), uint256(a), true)); + } + + // Evaluate max(a, b) and return the result. + function max(euint32 a, uint32 b) internal returns (euint32) { + if (!isInitialized(a)) { + a = asEuint32(0); + } + return euint32.wrap(Impl.max(euint32.unwrap(a), uint256(b), true)); + } + + // Evaluate max(a, b) and return the result. + function max(uint32 a, euint32 b) internal returns (euint32) { + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint32.wrap(Impl.max(euint32.unwrap(b), uint256(a), true)); + } + + // Evaluate add(a, b) and return the result. + function add(euint64 a, euint4 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint64 a, euint4 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint64 a, euint4 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate and(a, b) and return the result. + function and(euint64 a, euint4 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint64 a, euint4 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint64 a, euint4 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint64 a, euint4 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint64 a, euint4 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint64 a, euint4 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint64 a, euint4 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint64 a, euint4 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint64 a, euint4 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint64 a, euint4 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint64 a, euint4 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint4(0); + } + return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint64 a, euint8 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint64 a, euint8 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint64 a, euint8 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate and(a, b) and return the result. + function and(euint64 a, euint8 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint64 a, euint8 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint64 a, euint8 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint64 a, euint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint64 a, euint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint64 a, euint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint64 a, euint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint64 a, euint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint64 a, euint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint64 a, euint8 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint64 a, euint8 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint64 a, euint16 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint64 a, euint16 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint64 a, euint16 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate and(a, b) and return the result. + function and(euint64 a, euint16 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint64 a, euint16 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint64 a, euint16 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint64 a, euint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint64 a, euint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint64 a, euint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint64 a, euint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint64 a, euint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint64 a, euint16 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint64 a, euint16 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint64 a, euint16 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint16(0); + } + return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint64 a, euint32 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint64 a, euint32 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint64 a, euint32 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate and(a, b) and return the result. + function and(euint64 a, euint32 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint64 a, euint32 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint64 a, euint32 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint64 a, euint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint64 a, euint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint64 a, euint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint64 a, euint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint64 a, euint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint64 a, euint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint64 a, euint32 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint64 a, euint32 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint64 a, euint64 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)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint64 a, euint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(b), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint64 a, euint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(b), false)); + } + + // Evaluate and(a, b) and return the result. + function and(euint64 a, euint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(b), false)); + } + + // Evaluate or(a, b) and return the result. + function or(euint64 a, euint64 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)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint64 a, euint64 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)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint64 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(b), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint64 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(b), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint64 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(b), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint64 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(b), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint64 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(b), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint64 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(b), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint64 a, euint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(b), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint64 a, euint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(b), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint64 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint128(0); + } + return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint64 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint64 a, euint128 b) internal returns (euint128) { + 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)); + } + + // Evaluate and(a, b) and return the result. + function and(euint64 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint128(0); } - return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(asEuint16(b)))); + return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate or(a, b) and return the result. - function or(euint16 a, euint4 b) internal returns (euint16) { + function or(euint64 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint128(0); } - return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(asEuint16(b)))); + return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate xor(a, b) and return the result. - function xor(euint16 a, euint4 b) internal returns (euint16) { + function xor(euint64 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint128(0); } - return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(asEuint16(b)))); + return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate eq(a, b) and return the result. - function eq(euint16 a, euint4 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 = asEuint4(0); + b = asEuint128(0); } - return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint16 a, euint4 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 = asEuint4(0); + b = asEuint128(0); } - return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint16 a, euint4 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 = asEuint4(0); + b = asEuint128(0); } - return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint16 a, euint4 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 = asEuint4(0); + b = asEuint128(0); } - return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate le(a, b) and return the result. - function le(euint16 a, euint4 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 = asEuint4(0); + b = asEuint128(0); } - return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint16 a, euint4 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 = asEuint4(0); + b = asEuint128(0); } - return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate min(a, b) and return the result. - function min(euint16 a, euint4 b) internal returns (euint16) { + function min(euint64 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint128(0); } - return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate max(a, b) and return the result. - function max(euint16 a, euint4 b) internal returns (euint16) { + function max(euint64 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint128(0); } - return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } // Evaluate add(a, b) and return the result. - function add(euint16 a, euint8 b) internal returns (euint16) { + function add(euint64 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint256(0); } - return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint16 a, euint8 b) internal returns (euint16) { + function sub(euint64 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint256(0); } - return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint16 a, euint8 b) internal returns (euint16) { + function mul(euint64 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint256(0); } - return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate and(a, b) and return the result. - function and(euint16 a, euint8 b) internal returns (euint16) { + function and(euint64 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint256(0); } - return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(asEuint16(b)))); + return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate or(a, b) and return the result. - function or(euint16 a, euint8 b) internal returns (euint16) { + 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.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint64 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate eq(a, b) and return the result. + function eq(euint64 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate ne(a, b) and return the result. + function ne(euint64 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate ge(a, b) and return the result. + function ge(euint64 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate gt(a, b) and return the result. + function gt(euint64 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate le(a, b) and return the result. + function le(euint64 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate lt(a, b) and return the result. + function lt(euint64 a, euint256 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate min(a, b) and return the result. + function min(euint64 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate max(a, b) and return the result. + function max(euint64 a, euint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + if (!isInitialized(b)) { + b = asEuint256(0); + } + return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + } + + // Evaluate add(a, b) and return the result. + function add(euint64 a, uint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + return euint64.wrap(Impl.add(euint64.unwrap(a), uint256(b), true)); + } + + // Evaluate add(a, b) and return the result. + function add(uint64 a, euint64 b) internal returns (euint64) { + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.add(euint64.unwrap(b), uint256(a), true)); + } + + // Evaluate sub(a, b) and return the result. + function sub(euint64 a, uint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + return euint64.wrap(Impl.sub(euint64.unwrap(a), uint256(b), true)); + } + + // Evaluate sub(a, b) and return 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.sub(euint64.unwrap(aEnc), euint64.unwrap(b), false)); + } + + // Evaluate mul(a, b) and return the result. + function mul(euint64 a, uint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + return euint64.wrap(Impl.mul(euint64.unwrap(a), uint256(b), true)); + } + + // Evaluate mul(a, b) and return the result. + function mul(uint64 a, euint64 b) internal returns (euint64) { + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.mul(euint64.unwrap(b), uint256(a), true)); + } + + // Evaluate div(a, b) and return the result. + function div(euint64 a, uint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + return euint64.wrap(Impl.div(euint64.unwrap(a), uint256(b))); + } + + // Evaluate rem(a, b) and return the result. + function rem(euint64 a, uint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + return euint64.wrap(Impl.rem(euint64.unwrap(a), uint256(b))); + } + + // Evaluate and(a, b) and return the result. + function and(euint64 a, uint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + return euint64.wrap(Impl.and(euint64.unwrap(a), uint256(b), true)); + } + + // Evaluate and(a, b) and return the result. + function and(uint64 a, euint64 b) internal returns (euint64) { + if (!isInitialized(b)) { + b = asEuint64(0); } + return euint64.wrap(Impl.and(euint64.unwrap(b), uint256(a), true)); + } + + // Evaluate or(a, b) and return the result. + function or(euint64 a, uint64 b) internal returns (euint64) { + if (!isInitialized(a)) { + a = asEuint64(0); + } + return euint64.wrap(Impl.or(euint64.unwrap(a), uint256(b), true)); + } + + // Evaluate or(a, b) and return the result. + function or(uint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(asEuint16(b)))); + return euint64.wrap(Impl.or(euint64.unwrap(b), uint256(a), true)); } // Evaluate xor(a, b) and return the result. - function xor(euint16 a, euint8 b) internal returns (euint16) { + function xor(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } + return euint64.wrap(Impl.xor(euint64.unwrap(a), uint256(b), true)); + } + + // Evaluate xor(a, b) and return the result. + function xor(uint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(asEuint16(b)))); + return euint64.wrap(Impl.xor(euint64.unwrap(b), uint256(a), true)); } // Evaluate eq(a, b) and return the result. - function eq(euint16 a, euint8 b) internal returns (ebool) { + function eq(euint64 a, uint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } + return ebool.wrap(Impl.eq(euint64.unwrap(a), uint256(b), true)); + } + + // Evaluate eq(a, b) and return the result. + function eq(uint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.eq(euint64.unwrap(b), uint256(a), true)); } // Evaluate ne(a, b) and return the result. - function ne(euint16 a, euint8 b) internal returns (ebool) { + function ne(euint64 a, uint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } + return ebool.wrap(Impl.ne(euint64.unwrap(a), uint256(b), true)); + } + + // Evaluate ne(a, b) and return the result. + function ne(uint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.ne(euint64.unwrap(b), uint256(a), true)); } // Evaluate ge(a, b) and return the result. - function ge(euint16 a, euint8 b) internal returns (ebool) { + function ge(euint64 a, uint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } + return ebool.wrap(Impl.ge(euint64.unwrap(a), uint256(b), true)); + } + + // Evaluate ge(a, b) and return the result. + function ge(uint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.le(euint64.unwrap(b), uint256(a), true)); } // Evaluate gt(a, b) and return the result. - function gt(euint16 a, euint8 b) internal returns (ebool) { + function gt(euint64 a, uint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } + return ebool.wrap(Impl.gt(euint64.unwrap(a), uint256(b), true)); + } + + // Evaluate gt(a, b) and return the result. + function gt(uint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.lt(euint64.unwrap(b), uint256(a), true)); } // Evaluate le(a, b) and return the result. - function le(euint16 a, euint8 b) internal returns (ebool) { + function le(euint64 a, uint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } + return ebool.wrap(Impl.le(euint64.unwrap(a), uint256(b), true)); + } + + // Evaluate le(a, b) and return the result. + function le(uint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.ge(euint64.unwrap(b), uint256(a), true)); } // Evaluate lt(a, b) and return the result. - function lt(euint16 a, euint8 b) internal returns (ebool) { + function lt(euint64 a, uint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } + return ebool.wrap(Impl.lt(euint64.unwrap(a), uint256(b), true)); + } + + // Evaluate lt(a, b) and return the result. + function lt(uint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.gt(euint64.unwrap(b), uint256(a), true)); } // Evaluate min(a, b) and return the result. - function min(euint16 a, euint8 b) internal returns (euint16) { + function min(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } + return euint64.wrap(Impl.min(euint64.unwrap(a), uint256(b), true)); + } + + // Evaluate min(a, b) and return the result. + function min(uint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint64.wrap(Impl.min(euint64.unwrap(b), uint256(a), true)); } // Evaluate max(a, b) and return the result. - function max(euint16 a, euint8 b) internal returns (euint16) { + function max(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } + return euint64.wrap(Impl.max(euint64.unwrap(a), uint256(b), true)); + } + + // Evaluate max(a, b) and return the result. + function max(uint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint64.wrap(Impl.max(euint64.unwrap(b), uint256(a), true)); } // Evaluate add(a, b) and return the result. - function add(euint16 a, euint16 b) internal returns (euint16) { + function add(euint128 a, euint4 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(b), false)); + return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint16 a, euint16 b) internal returns (euint16) { + function sub(euint128 a, euint4 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(b), false)); + return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint16 a, euint16 b) internal returns (euint16) { + function mul(euint128 a, euint4 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(b), false)); + return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate and(a, b) and return the result. - function and(euint16 a, euint16 b) internal returns (euint16) { + function and(euint128 a, euint4 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(b))); + return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate or(a, b) and return the result. - function or(euint16 a, euint16 b) internal returns (euint16) { + function or(euint128 a, euint4 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(b))); + return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate xor(a, b) and return the result. - function xor(euint16 a, euint16 b) internal returns (euint16) { + function xor(euint128 a, euint4 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(b))); + return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate eq(a, b) and return the result. - function eq(euint16 a, euint16 b) internal returns (ebool) { + function eq(euint128 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint16 a, euint16 b) internal returns (ebool) { + function ne(euint128 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint16 a, euint16 b) internal returns (ebool) { + function ge(euint128 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint16 a, euint16 b) internal returns (ebool) { + function gt(euint128 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate le(a, b) and return the result. - function le(euint16 a, euint16 b) internal returns (ebool) { + function le(euint128 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(b), false)); + return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint16 a, euint16 b) internal returns (ebool) { + function lt(euint128 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate min(a, b) and return the result. - function min(euint16 a, euint16 b) internal returns (euint16) { + function min(euint128 a, euint4 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(b), false)); + return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate max(a, b) and return the result. - function max(euint16 a, euint16 b) internal returns (euint16) { + function max(euint128 a, euint4 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint4(0); } - return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(b), false)); + return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate add(a, b) and return the result. - function add(euint16 a, euint32 b) internal returns (euint32) { + function add(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.add(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint16 a, euint32 b) internal returns (euint32) { + function sub(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.sub(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint16 a, euint32 b) internal returns (euint32) { + function mul(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.mul(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate and(a, b) and return the result. - function and(euint16 a, euint32 b) internal returns (euint32) { + function and(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.and(euint32.unwrap(asEuint32(a)), euint32.unwrap(b))); + return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate or(a, b) and return the result. - function or(euint16 a, euint32 b) internal returns (euint32) { + function or(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.or(euint32.unwrap(asEuint32(a)), euint32.unwrap(b))); + return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate xor(a, b) and return the result. - function xor(euint16 a, euint32 b) internal returns (euint32) { + function xor(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.xor(euint32.unwrap(asEuint32(a)), euint32.unwrap(b))); + return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate eq(a, b) and return the result. - function eq(euint16 a, euint32 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 = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.eq(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint16 a, euint32 b) internal returns (ebool) { + function ne(euint128 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.ne(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint16 a, euint32 b) internal returns (ebool) { + function ge(euint128 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.ge(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint16 a, euint32 b) internal returns (ebool) { + function gt(euint128 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.gt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate le(a, b) and return the result. - function le(euint16 a, euint32 b) internal returns (ebool) { + function le(euint128 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.le(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint16 a, euint32 b) internal returns (ebool) { + function lt(euint128 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.lt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate min(a, b) and return the result. - function min(euint16 a, euint32 b) internal returns (euint32) { + function min(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.min(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate max(a, b) and return the result. - function max(euint16 a, euint32 b) internal returns (euint32) { + function max(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.max(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate add(a, b) and return the result. - function add(euint16 a, euint64 b) internal returns (euint64) { + function add(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint16 a, euint64 b) internal returns (euint64) { + function sub(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint16 a, euint64 b) internal returns (euint64) { + function mul(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate and(a, b) and return the result. - function and(euint16 a, euint64 b) internal returns (euint64) { + function and(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b))); + return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate or(a, b) and return the result. - function or(euint16 a, euint64 b) internal returns (euint64) { + function or(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b))); + return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate xor(a, b) and return the result. - function xor(euint16 a, euint64 b) internal returns (euint64) { + function xor(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b))); + return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate eq(a, b) and return the result. - function eq(euint16 a, euint64 b) internal returns (ebool) { + function eq(euint128 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint16 a, euint64 b) internal returns (ebool) { + function ne(euint128 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint16 a, euint64 b) internal returns (ebool) { + function ge(euint128 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint16 a, euint64 b) internal returns (ebool) { + function gt(euint128 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate le(a, b) and return the result. - function le(euint16 a, euint64 b) internal returns (ebool) { + function le(euint128 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint16 a, euint64 b) internal returns (ebool) { + function lt(euint128 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate min(a, b) and return the result. - function min(euint16 a, euint64 b) internal returns (euint64) { + function min(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate max(a, b) and return the result. - function max(euint16 a, euint64 b) internal returns (euint64) { + function max(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate add(a, b) and return the result. - function add(euint16 a, uint16 b) internal returns (euint16) { + function add(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return euint16.wrap(Impl.add(euint16.unwrap(a), uint256(b), true)); - } - - // Evaluate add(a, b) and return the result. - function add(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return euint16.wrap(Impl.add(euint16.unwrap(b), uint256(a), true)); + return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint16 a, uint16 b) internal returns (euint16) { + function sub(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return euint16.wrap(Impl.sub(euint16.unwrap(a), uint256(b), true)); - } - - // Evaluate sub(a, b) and return the result. - function sub(uint16 a, euint16 b) internal returns (euint16) { - euint16 aEnc = asEuint16(a); if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return euint16.wrap(Impl.sub(euint16.unwrap(aEnc), euint16.unwrap(b), false)); + return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint16 a, uint16 b) internal returns (euint16) { + function mul(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return euint16.wrap(Impl.mul(euint16.unwrap(a), uint256(b), true)); - } - - // Evaluate mul(a, b) and return the result. - function mul(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return euint16.wrap(Impl.mul(euint16.unwrap(b), uint256(a), true)); + return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate div(a, b) and return the result. - function div(euint16 a, uint16 b) internal returns (euint16) { + // Evaluate and(a, b) and return the result. + function and(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return euint16.wrap(Impl.div(euint16.unwrap(a), uint256(b))); + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate rem(a, b) and return the result. - function rem(euint16 a, uint16 b) internal returns (euint16) { + // Evaluate or(a, b) and return the result. + function or(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return euint16.wrap(Impl.rem(euint16.unwrap(a), uint256(b))); + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate eq(a, b) and return the result. - function eq(euint16 a, uint16 b) internal returns (ebool) { + // Evaluate xor(a, b) and return the result. + function xor(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return ebool.wrap(Impl.eq(euint16.unwrap(a), uint256(b), true)); + if (!isInitialized(b)) { + b = asEuint32(0); + } + return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate eq(a, b) and return the result. - function eq(uint16 a, euint16 b) internal returns (ebool) { + function eq(euint128 a, euint32 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint128(0); + } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return ebool.wrap(Impl.eq(euint16.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint16 a, uint16 b) internal returns (ebool) { + function ne(euint128 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return ebool.wrap(Impl.ne(euint16.unwrap(a), uint256(b), true)); - } - - // Evaluate ne(a, b) and return the result. - function ne(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return ebool.wrap(Impl.ne(euint16.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint16 a, uint16 b) internal returns (ebool) { + function ge(euint128 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return ebool.wrap(Impl.ge(euint16.unwrap(a), uint256(b), true)); - } - - // Evaluate ge(a, b) and return the result. - function ge(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return ebool.wrap(Impl.le(euint16.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint16 a, uint16 b) internal returns (ebool) { + function gt(euint128 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return ebool.wrap(Impl.gt(euint16.unwrap(a), uint256(b), true)); - } - - // Evaluate gt(a, b) and return the result. - function gt(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return ebool.wrap(Impl.lt(euint16.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate le(a, b) and return the result. - function le(euint16 a, uint16 b) internal returns (ebool) { + function le(euint128 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return ebool.wrap(Impl.le(euint16.unwrap(a), uint256(b), true)); - } - - // Evaluate le(a, b) and return the result. - function le(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return ebool.wrap(Impl.ge(euint16.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint16 a, uint16 b) internal returns (ebool) { + function lt(euint128 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return ebool.wrap(Impl.lt(euint16.unwrap(a), uint256(b), true)); - } - - // Evaluate lt(a, b) and return the result. - function lt(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return ebool.wrap(Impl.gt(euint16.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate min(a, b) and return the result. - function min(euint16 a, uint16 b) internal returns (euint16) { + function min(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return euint16.wrap(Impl.min(euint16.unwrap(a), uint256(b), true)); - } - - // Evaluate min(a, b) and return the result. - function min(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return euint16.wrap(Impl.min(euint16.unwrap(b), uint256(a), true)); + return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate max(a, b) and return the result. - function max(euint16 a, uint16 b) internal returns (euint16) { + function max(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return euint16.wrap(Impl.max(euint16.unwrap(a), uint256(b), true)); - } - - // Evaluate max(a, b) and return the result. - function max(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return euint16.wrap(Impl.max(euint16.unwrap(b), uint256(a), true)); + return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate add(a, b) and return the result. - function add(euint32 a, euint4 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 = asEuint4(0); + b = asEuint64(0); } - return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint32 a, euint4 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 = asEuint4(0); + b = asEuint64(0); } - return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint32 a, euint4 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 = asEuint4(0); + b = asEuint64(0); } - return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate and(a, b) and return the result. - function and(euint32 a, euint4 b) internal returns (euint32) { + function and(euint128 a, euint64 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint64(0); } - return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b)))); + return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate or(a, b) and return the result. - function or(euint32 a, euint4 b) internal returns (euint32) { + function or(euint128 a, euint64 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint64(0); } - return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b)))); + return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate xor(a, b) and return the result. - function xor(euint32 a, euint4 b) internal returns (euint32) { + function xor(euint128 a, euint64 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint64(0); } - return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b)))); + return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate eq(a, b) and return the result. - function eq(euint32 a, euint4 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 = asEuint4(0); + b = asEuint64(0); } - return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint32 a, euint4 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 = asEuint4(0); + b = asEuint64(0); } - return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint32 a, euint4 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 = asEuint4(0); + b = asEuint64(0); } - return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint32 a, euint4 b) internal returns (ebool) { + function gt(euint128 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint64(0); } - return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate le(a, b) and return the result. - function le(euint32 a, euint4 b) internal returns (ebool) { + function le(euint128 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint64(0); } - return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint32 a, euint4 b) internal returns (ebool) { + function lt(euint128 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint64(0); } - return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate min(a, b) and return the result. - function min(euint32 a, euint4 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 = asEuint4(0); + b = asEuint64(0); } - return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate max(a, b) and return the result. - function max(euint32 a, euint4 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 = asEuint4(0); + b = asEuint64(0); } - return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } // Evaluate add(a, b) and return the result. - function add(euint32 a, euint8 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 = asEuint8(0); + b = asEuint128(0); } - return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(b), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint32 a, euint8 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 = asEuint8(0); + b = asEuint128(0); } - return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(b), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint32 a, euint8 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 = asEuint8(0); + b = asEuint128(0); } - return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(b), false)); } // Evaluate and(a, b) and return the result. - function and(euint32 a, euint8 b) internal returns (euint32) { + function and(euint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint128(0); } - return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b)))); + return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(b), false)); } // Evaluate or(a, b) and return the result. - function or(euint32 a, euint8 b) internal returns (euint32) { + function or(euint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint128(0); } - return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b)))); + return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(b), false)); } // Evaluate xor(a, b) and return the result. - function xor(euint32 a, euint8 b) internal returns (euint32) { + function xor(euint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint128(0); } - return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b)))); + return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(b), false)); } // Evaluate eq(a, b) and return the result. - function eq(euint32 a, euint8 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 = asEuint8(0); + b = asEuint128(0); } - return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(b), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint32 a, euint8 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 = asEuint8(0); + b = asEuint128(0); } - return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(b), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint32 a, euint8 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 = asEuint8(0); + b = asEuint128(0); } - return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(b), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint32 a, euint8 b) internal returns (ebool) { + function gt(euint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint128(0); } - return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(b), false)); } // Evaluate le(a, b) and return the result. - function le(euint32 a, euint8 b) internal returns (ebool) { + function le(euint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint128(0); } - return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(b), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint32 a, euint8 b) internal returns (ebool) { + function lt(euint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint128(0); } - return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(b), false)); } // Evaluate min(a, b) and return the result. - function min(euint32 a, euint8 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 = asEuint8(0); + b = asEuint128(0); } - return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(b), false)); } // Evaluate max(a, b) and return the result. - function max(euint32 a, euint8 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 = asEuint8(0); + b = asEuint128(0); } - return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(b), false)); } // Evaluate add(a, b) and return the result. - function add(euint32 a, euint16 b) internal returns (euint32) { + function add(euint128 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint256(0); } - return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint32 a, euint16 b) internal returns (euint32) { + function sub(euint128 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint256(0); } - return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint32 a, euint16 b) internal returns (euint32) { + function mul(euint128 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint256(0); } - return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate and(a, b) and return the result. - function and(euint32 a, euint16 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 = asEuint16(0); + b = asEuint256(0); } - return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b)))); + return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate or(a, b) and return the result. - function or(euint32 a, euint16 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 = asEuint16(0); + b = asEuint256(0); } - return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b)))); + return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate xor(a, b) and return the result. - function xor(euint32 a, euint16 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 = asEuint16(0); + b = asEuint256(0); } - return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b)))); + return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate eq(a, b) and return the result. - function eq(euint32 a, euint16 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 = asEuint16(0); + b = asEuint256(0); } - return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint32 a, euint16 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 = asEuint16(0); + b = asEuint256(0); } - return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint32 a, euint16 b) internal returns (ebool) { + function ge(euint128 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint256(0); } - return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint32 a, euint16 b) internal returns (ebool) { + function gt(euint128 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint256(0); } - return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate le(a, b) and return the result. - function le(euint32 a, euint16 b) internal returns (ebool) { + function le(euint128 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint256(0); } - return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint32 a, euint16 b) internal returns (ebool) { + function lt(euint128 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint256(0); } - return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate min(a, b) and return the result. - function min(euint32 a, euint16 b) internal returns (euint32) { + function min(euint128 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint256(0); } - return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate max(a, b) and return the result. - function max(euint32 a, euint16 b) internal returns (euint32) { + function max(euint128 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint256(0); } - return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } // Evaluate add(a, b) and return the result. - function add(euint32 a, euint32 b) internal returns (euint32) { + function add(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } + return euint128.wrap(Impl.add(euint128.unwrap(a), uint256(b), true)); + } + + // Evaluate add(a, b) and return the result. + function add(uint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(b), false)); + return euint128.wrap(Impl.add(euint128.unwrap(b), uint256(a), true)); } // Evaluate sub(a, b) and return the result. - function sub(euint32 a, euint32 b) internal returns (euint32) { + function sub(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } + return euint128.wrap(Impl.sub(euint128.unwrap(a), uint256(b), true)); + } + + // Evaluate sub(a, b) and return the result. + function sub(uint128 a, euint128 b) internal returns (euint128) { + euint128 aEnc = asEuint128(a); 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.sub(euint128.unwrap(aEnc), euint128.unwrap(b), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint32 a, euint32 b) internal returns (euint32) { + function mul(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } + return euint128.wrap(Impl.mul(euint128.unwrap(a), uint256(b), true)); + } + + // Evaluate mul(a, b) and return the result. + function mul(uint128 a, euint128 b) internal returns (euint128) { 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.mul(euint128.unwrap(b), uint256(a), true)); + } + + // Evaluate div(a, b) and return 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), uint256(b))); + } + + // Evaluate rem(a, b) and return 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), uint256(b))); } // Evaluate and(a, b) and return the result. - function and(euint32 a, euint32 b) internal returns (euint32) { + function and(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } + return euint128.wrap(Impl.and(euint128.unwrap(a), uint256(b), true)); + } + + // Evaluate and(a, b) and return the result. + function and(uint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(b))); + return euint128.wrap(Impl.and(euint128.unwrap(b), uint256(a), true)); } // Evaluate or(a, b) and return the result. - function or(euint32 a, euint32 b) internal returns (euint32) { + function or(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } + return euint128.wrap(Impl.or(euint128.unwrap(a), uint256(b), true)); + } + + // Evaluate or(a, b) and return the result. + function or(uint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(b))); + return euint128.wrap(Impl.or(euint128.unwrap(b), uint256(a), true)); } // Evaluate xor(a, b) and return the result. - function xor(euint32 a, euint32 b) internal returns (euint32) { + function xor(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } + return euint128.wrap(Impl.xor(euint128.unwrap(a), uint256(b), true)); + } + + // Evaluate xor(a, b) and return the result. + function xor(uint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(b))); + return euint128.wrap(Impl.xor(euint128.unwrap(b), uint256(a), true)); } // Evaluate eq(a, b) and return the result. - function eq(euint32 a, euint32 b) internal returns (ebool) { + function eq(euint128 a, uint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } + return ebool.wrap(Impl.eq(euint128.unwrap(a), uint256(b), true)); + } + + // Evaluate eq(a, b) and return the result. + function eq(uint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint128.unwrap(b), uint256(a), true)); } // Evaluate ne(a, b) and return the result. - function ne(euint32 a, euint32 b) internal returns (ebool) { + function ne(euint128 a, uint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } + return ebool.wrap(Impl.ne(euint128.unwrap(a), uint256(b), true)); + } + + // Evaluate ne(a, b) and return the result. + function ne(uint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint128.unwrap(b), uint256(a), true)); } // Evaluate ge(a, b) and return the result. - function ge(euint32 a, euint32 b) internal returns (ebool) { + function ge(euint128 a, uint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } + return ebool.wrap(Impl.ge(euint128.unwrap(a), uint256(b), true)); + } + + // Evaluate ge(a, b) and return the result. + function ge(uint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(b), false)); + return ebool.wrap(Impl.le(euint128.unwrap(b), uint256(a), true)); } // Evaluate gt(a, b) and return the result. - function gt(euint32 a, euint32 b) internal returns (ebool) { + function gt(euint128 a, uint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } + return ebool.wrap(Impl.gt(euint128.unwrap(a), uint256(b), true)); + } + + // Evaluate gt(a, b) and return the result. + function gt(uint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint128.unwrap(b), uint256(a), true)); } // Evaluate le(a, b) and return the result. - function le(euint32 a, euint32 b) internal returns (ebool) { + function le(euint128 a, uint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } + return ebool.wrap(Impl.le(euint128.unwrap(a), uint256(b), true)); + } + + // Evaluate le(a, b) and return the result. + function le(uint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint128.unwrap(b), uint256(a), true)); } // Evaluate lt(a, b) and return the result. - function lt(euint32 a, euint32 b) internal returns (ebool) { + function lt(euint128 a, uint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } + return ebool.wrap(Impl.lt(euint128.unwrap(a), uint256(b), true)); + } + + // Evaluate lt(a, b) and return the result. + function lt(uint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint128.unwrap(b), uint256(a), true)); } // Evaluate min(a, b) and return the result. - function min(euint32 a, euint32 b) internal returns (euint32) { + function min(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } + return euint128.wrap(Impl.min(euint128.unwrap(a), uint256(b), true)); + } + + // Evaluate min(a, b) and return the result. + function min(uint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(b), false)); + return euint128.wrap(Impl.min(euint128.unwrap(b), uint256(a), true)); } // Evaluate max(a, b) and return the result. - function max(euint32 a, euint32 b) internal returns (euint32) { + function max(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } + return euint128.wrap(Impl.max(euint128.unwrap(a), uint256(b), true)); + } + + // Evaluate max(a, b) and return the result. + function max(uint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(b), false)); + return euint128.wrap(Impl.max(euint128.unwrap(b), uint256(a), true)); } // Evaluate add(a, b) and return the result. - function add(euint32 a, euint64 b) internal returns (euint64) { + function add(euint256 a, euint4 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint4(0); } - return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint32 a, euint64 b) internal returns (euint64) { + function sub(euint256 a, euint4 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint4(0); } - return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint32 a, euint64 b) internal returns (euint64) { + function mul(euint256 a, euint4 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint4(0); } - return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate and(a, b) and return the result. - function and(euint32 a, euint64 b) internal returns (euint64) { + function and(euint256 a, euint4 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint4(0); } - return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b))); + return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate or(a, b) and return the result. - function or(euint32 a, euint64 b) internal returns (euint64) { + function or(euint256 a, euint4 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint4(0); } - return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b))); + return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate xor(a, b) and return the result. - function xor(euint32 a, euint64 b) internal returns (euint64) { + function xor(euint256 a, euint4 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint4(0); } - return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b))); + return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate eq(a, b) and return the result. - function eq(euint32 a, euint64 b) internal returns (ebool) { + function eq(euint256 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint4(0); } - return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint32 a, euint64 b) internal returns (ebool) { + function ne(euint256 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint4(0); } - return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint32 a, euint64 b) internal returns (ebool) { + function ge(euint256 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint4(0); } - return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint32 a, euint64 b) internal returns (ebool) { + function gt(euint256 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint4(0); } - return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate le(a, b) and return the result. - function le(euint32 a, euint64 b) internal returns (ebool) { + function le(euint256 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint4(0); } - return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint32 a, euint64 b) internal returns (ebool) { + function lt(euint256 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint4(0); } - return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate min(a, b) and return the result. - function min(euint32 a, euint64 b) internal returns (euint64) { + function min(euint256 a, euint4 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint4(0); } - return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate max(a, b) and return the result. - function max(euint32 a, euint64 b) internal returns (euint64) { + function max(euint256 a, euint4 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint4(0); } - return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate add(a, b) and return the result. - function add(euint32 a, uint32 b) internal returns (euint32) { + function add(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } - return euint32.wrap(Impl.add(euint32.unwrap(a), uint256(b), true)); - } - - // Evaluate add(a, b) and return the result. - function add(uint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.add(euint32.unwrap(b), uint256(a), true)); + return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint32 a, uint32 b) internal returns (euint32) { + function sub(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } - return euint32.wrap(Impl.sub(euint32.unwrap(a), uint256(b), true)); - } - - // Evaluate sub(a, b) and return the result. - function sub(uint32 a, euint32 b) internal returns (euint32) { - euint32 aEnc = asEuint32(a); if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.sub(euint32.unwrap(aEnc), euint32.unwrap(b), false)); + return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint32 a, uint32 b) internal returns (euint32) { + function mul(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } - return euint32.wrap(Impl.mul(euint32.unwrap(a), uint256(b), true)); - } - - // Evaluate mul(a, b) and return the result. - function mul(uint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.mul(euint32.unwrap(b), uint256(a), true)); + return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate div(a, b) and return the result. - function div(euint32 a, uint32 b) internal returns (euint32) { + // Evaluate and(a, b) and return the result. + function and(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } - return euint32.wrap(Impl.div(euint32.unwrap(a), uint256(b))); + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate rem(a, b) and return the result. - function rem(euint32 a, uint32 b) internal returns (euint32) { + // Evaluate or(a, b) and return the result. + function or(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } - return euint32.wrap(Impl.rem(euint32.unwrap(a), uint256(b))); + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate eq(a, b) and return the result. - function eq(euint32 a, uint32 b) internal returns (ebool) { + // Evaluate xor(a, b) and return the result. + function xor(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } - return ebool.wrap(Impl.eq(euint32.unwrap(a), uint256(b), true)); + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate eq(a, b) and return the result. - function eq(uint32 a, euint32 b) internal returns (ebool) { + function eq(euint256 a, euint8 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint256(0); + } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.eq(euint32.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint32 a, uint32 b) internal returns (ebool) { + function ne(euint256 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } - return ebool.wrap(Impl.ne(euint32.unwrap(a), uint256(b), true)); - } - - // Evaluate ne(a, b) and return the result. - function ne(uint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.ne(euint32.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint32 a, uint32 b) internal returns (ebool) { + function ge(euint256 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } - return ebool.wrap(Impl.ge(euint32.unwrap(a), uint256(b), true)); - } - - // Evaluate ge(a, b) and return the result. - function ge(uint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.le(euint32.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint32 a, uint32 b) internal returns (ebool) { + function gt(euint256 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } - return ebool.wrap(Impl.gt(euint32.unwrap(a), uint256(b), true)); - } - - // Evaluate gt(a, b) and return the result. - function gt(uint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.lt(euint32.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate le(a, b) and return the result. - function le(euint32 a, uint32 b) internal returns (ebool) { + function le(euint256 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } - return ebool.wrap(Impl.le(euint32.unwrap(a), uint256(b), true)); - } - - // Evaluate le(a, b) and return the result. - function le(uint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.ge(euint32.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint32 a, uint32 b) internal returns (ebool) { + function lt(euint256 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } - return ebool.wrap(Impl.lt(euint32.unwrap(a), uint256(b), true)); - } - - // Evaluate lt(a, b) and return the result. - function lt(uint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.gt(euint32.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate min(a, b) and return the result. - function min(euint32 a, uint32 b) internal returns (euint32) { + function min(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } - return euint32.wrap(Impl.min(euint32.unwrap(a), uint256(b), true)); - } - - // Evaluate min(a, b) and return the result. - function min(uint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.min(euint32.unwrap(b), uint256(a), true)); + return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate max(a, b) and return the result. - function max(euint32 a, uint32 b) internal returns (euint32) { + function max(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } - return euint32.wrap(Impl.max(euint32.unwrap(a), uint256(b), true)); - } - - // Evaluate max(a, b) and return the result. - function max(uint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.max(euint32.unwrap(b), uint256(a), true)); + return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate add(a, b) and return the result. - function add(euint64 a, euint4 b) internal returns (euint64) { + function add(euint256 a, euint16 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint64 a, euint4 b) internal returns (euint64) { + function sub(euint256 a, euint16 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint64 a, euint4 b) internal returns (euint64) { + function mul(euint256 a, euint16 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate and(a, b) and return the result. - function and(euint64 a, euint4 b) internal returns (euint64) { + function and(euint256 a, euint16 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)))); + return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate or(a, b) and return the result. - function or(euint64 a, euint4 b) internal returns (euint64) { + function or(euint256 a, euint16 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)))); + return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate xor(a, b) and return the result. - function xor(euint64 a, euint4 b) internal returns (euint64) { + function xor(euint256 a, euint16 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)))); + return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate eq(a, b) and return the result. - function eq(euint64 a, euint4 b) internal returns (ebool) { + function eq(euint256 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint64 a, euint4 b) internal returns (ebool) { + function ne(euint256 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint64 a, euint4 b) internal returns (ebool) { + function ge(euint256 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint64 a, euint4 b) internal returns (ebool) { + function gt(euint256 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate le(a, b) and return the result. - function le(euint64 a, euint4 b) internal returns (ebool) { + function le(euint256 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint64 a, euint4 b) internal returns (ebool) { + function lt(euint256 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate min(a, b) and return the result. - function min(euint64 a, euint4 b) internal returns (euint64) { + function min(euint256 a, euint16 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate max(a, b) and return the result. - function max(euint64 a, euint4 b) internal returns (euint64) { + function max(euint256 a, euint16 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate add(a, b) and return the result. - function add(euint64 a, euint8 b) internal returns (euint64) { + function add(euint256 a, euint32 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint64 a, euint8 b) internal returns (euint64) { + function sub(euint256 a, euint32 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint64 a, euint8 b) internal returns (euint64) { + function mul(euint256 a, euint32 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate and(a, b) and return the result. - function and(euint64 a, euint8 b) internal returns (euint64) { + function and(euint256 a, euint32 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)))); + return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate or(a, b) and return the result. - function or(euint64 a, euint8 b) internal returns (euint64) { + function or(euint256 a, euint32 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)))); + return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate xor(a, b) and return the result. - function xor(euint64 a, euint8 b) internal returns (euint64) { + function xor(euint256 a, euint32 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)))); + return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate eq(a, b) and return the result. - function eq(euint64 a, euint8 b) internal returns (ebool) { + function eq(euint256 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint64 a, euint8 b) internal returns (ebool) { + function ne(euint256 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint64 a, euint8 b) internal returns (ebool) { + function ge(euint256 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint64 a, euint8 b) internal returns (ebool) { + function gt(euint256 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate le(a, b) and return the result. - function le(euint64 a, euint8 b) internal returns (ebool) { + function le(euint256 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint64 a, euint8 b) internal returns (ebool) { + function lt(euint256 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate min(a, b) and return the result. - function min(euint64 a, euint8 b) internal returns (euint64) { + function min(euint256 a, euint32 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate max(a, b) and return the result. - function max(euint64 a, euint8 b) internal returns (euint64) { + function max(euint256 a, euint32 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate add(a, b) and return the result. - function add(euint64 a, euint16 b) internal returns (euint64) { + function add(euint256 a, euint64 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint64(0); } - return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint64 a, euint16 b) internal returns (euint64) { + function sub(euint256 a, euint64 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint64(0); } - return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint64 a, euint16 b) internal returns (euint64) { + function mul(euint256 a, euint64 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint64(0); } - return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate and(a, b) and return the result. - function and(euint64 a, euint16 b) internal returns (euint64) { + function and(euint256 a, euint64 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint64(0); } - return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)))); + return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate or(a, b) and return the result. - function or(euint64 a, euint16 b) internal returns (euint64) { + function or(euint256 a, euint64 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint64(0); } - return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)))); + return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate xor(a, b) and return the result. - function xor(euint64 a, euint16 b) internal returns (euint64) { + function xor(euint256 a, euint64 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint64(0); } - return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)))); + return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate eq(a, b) and return the result. - function eq(euint64 a, euint16 b) internal returns (ebool) { + function eq(euint256 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint64(0); } - return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint64 a, euint16 b) internal returns (ebool) { + function ne(euint256 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint64(0); } - return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint64 a, euint16 b) internal returns (ebool) { + function ge(euint256 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint64(0); } - return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint64 a, euint16 b) internal returns (ebool) { + function gt(euint256 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint64(0); } - return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate le(a, b) and return the result. - function le(euint64 a, euint16 b) internal returns (ebool) { + function le(euint256 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint64(0); } - return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint64 a, euint16 b) internal returns (ebool) { + function lt(euint256 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint64(0); } - return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate min(a, b) and return the result. - function min(euint64 a, euint16 b) internal returns (euint64) { + function min(euint256 a, euint64 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint64(0); } - return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate max(a, b) and return the result. - function max(euint64 a, euint16 b) internal returns (euint64) { + function max(euint256 a, euint64 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint64(0); } - return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate add(a, b) and return the result. - function add(euint64 a, euint32 b) internal returns (euint64) { + function add(euint256 a, euint128 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint64 a, euint32 b) internal returns (euint64) { + function sub(euint256 a, euint128 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint64 a, euint32 b) internal returns (euint64) { + function mul(euint256 a, euint128 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate and(a, b) and return the result. - function and(euint64 a, euint32 b) internal returns (euint64) { + function and(euint256 a, euint128 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)))); + return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate or(a, b) and return the result. - function or(euint64 a, euint32 b) internal returns (euint64) { + function or(euint256 a, euint128 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)))); + return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate xor(a, b) and return the result. - function xor(euint64 a, euint32 b) internal returns (euint64) { + function xor(euint256 a, euint128 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)))); + return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate eq(a, b) and return the result. - function eq(euint64 a, euint32 b) internal returns (ebool) { + function eq(euint256 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint64 a, euint32 b) internal returns (ebool) { + function ne(euint256 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint64 a, euint32 b) internal returns (ebool) { + function ge(euint256 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint64 a, euint32 b) internal returns (ebool) { + function gt(euint256 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate le(a, b) and return the result. - function le(euint64 a, euint32 b) internal returns (ebool) { + function le(euint256 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint64 a, euint32 b) internal returns (ebool) { + function lt(euint256 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate min(a, b) and return the result. - function min(euint64 a, euint32 b) internal returns (euint64) { + function min(euint256 a, euint128 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate max(a, b) and return the result. - function max(euint64 a, euint32 b) internal returns (euint64) { + function max(euint256 a, euint128 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } // Evaluate add(a, b) and return the result. - function add(euint64 a, euint64 b) internal returns (euint64) { + function add(euint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(b), false)); + return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(b), false)); } // Evaluate sub(a, b) and return the result. - function sub(euint64 a, euint64 b) internal returns (euint64) { + function sub(euint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(b), false)); + return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(b), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint64 a, euint64 b) internal returns (euint64) { + function mul(euint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(b), false)); + return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(b), false)); } // Evaluate and(a, b) and return the result. - function and(euint64 a, euint64 b) internal returns (euint64) { + function and(euint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(b))); + return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(b), false)); } // Evaluate or(a, b) and return the result. - function or(euint64 a, euint64 b) internal returns (euint64) { + function or(euint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(b))); + return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(b), false)); } // Evaluate xor(a, b) and return the result. - function xor(euint64 a, euint64 b) internal returns (euint64) { + function xor(euint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(b))); + return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(b), false)); } // Evaluate eq(a, b) and return the result. - function eq(euint64 a, euint64 b) internal returns (ebool) { + function eq(euint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(b), false)); } // Evaluate ne(a, b) and return the result. - function ne(euint64 a, euint64 b) internal returns (ebool) { + function ne(euint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(b), false)); } // Evaluate ge(a, b) and return the result. - function ge(euint64 a, euint64 b) internal returns (ebool) { + function ge(euint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(b), false)); } // Evaluate gt(a, b) and return the result. - function gt(euint64 a, euint64 b) internal returns (ebool) { + function gt(euint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(b), false)); } // Evaluate le(a, b) and return the result. - function le(euint64 a, euint64 b) internal returns (ebool) { + function le(euint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(b), false)); + return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(b), false)); } // Evaluate lt(a, b) and return the result. - function lt(euint64 a, euint64 b) internal returns (ebool) { + function lt(euint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(b), false)); } // Evaluate min(a, b) and return the result. - function min(euint64 a, euint64 b) internal returns (euint64) { + function min(euint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(b), false)); + return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(b), false)); } // Evaluate max(a, b) and return the result. - function max(euint64 a, euint64 b) internal returns (euint64) { + function max(euint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(b), false)); + return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(b), false)); } // Evaluate add(a, b) and return the result. - function add(euint64 a, uint64 b) internal returns (euint64) { + function add(euint256 a, uint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } - return euint64.wrap(Impl.add(euint64.unwrap(a), uint256(b), true)); + return euint256.wrap(Impl.add(euint256.unwrap(a), uint256(b), true)); } // Evaluate add(a, b) and return the result. - function add(uint64 a, euint64 b) internal returns (euint64) { + function add(uint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return euint64.wrap(Impl.add(euint64.unwrap(b), uint256(a), true)); + return euint256.wrap(Impl.add(euint256.unwrap(b), uint256(a), true)); } // Evaluate sub(a, b) and return the result. - function sub(euint64 a, uint64 b) internal returns (euint64) { + function sub(euint256 a, uint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } - return euint64.wrap(Impl.sub(euint64.unwrap(a), uint256(b), true)); + return euint256.wrap(Impl.sub(euint256.unwrap(a), uint256(b), true)); } // Evaluate sub(a, b) and return the result. - function sub(uint64 a, euint64 b) internal returns (euint64) { - euint64 aEnc = asEuint64(a); + function sub(uint256 a, euint256 b) internal returns (euint256) { + euint256 aEnc = asEuint256(a); if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return euint64.wrap(Impl.sub(euint64.unwrap(aEnc), euint64.unwrap(b), false)); + return euint256.wrap(Impl.sub(euint256.unwrap(aEnc), euint256.unwrap(b), false)); } // Evaluate mul(a, b) and return the result. - function mul(euint64 a, uint64 b) internal returns (euint64) { + function mul(euint256 a, uint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } - return euint64.wrap(Impl.mul(euint64.unwrap(a), uint256(b), true)); + return euint256.wrap(Impl.mul(euint256.unwrap(a), uint256(b), true)); } // Evaluate mul(a, b) and return the result. - function mul(uint64 a, euint64 b) internal returns (euint64) { + function mul(uint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return euint64.wrap(Impl.mul(euint64.unwrap(b), uint256(a), true)); + return euint256.wrap(Impl.mul(euint256.unwrap(b), uint256(a), true)); } // Evaluate div(a, b) and return the result. - function div(euint64 a, uint64 b) internal returns (euint64) { + function div(euint256 a, uint256 b) internal returns (euint256) { + if (!isInitialized(a)) { + a = asEuint256(0); + } + return euint256.wrap(Impl.div(euint256.unwrap(a), uint256(b))); + } + + // Evaluate rem(a, b) and return 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), uint256(b))); + } + + // Evaluate and(a, b) and return 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), uint256(b), true)); + } + + // Evaluate and(a, b) and return 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), uint256(a), true)); + } + + // Evaluate or(a, b) and return 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), uint256(b), true)); + } + + // Evaluate or(a, b) and return 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), uint256(a), true)); + } + + // Evaluate xor(a, b) and return the result. + function xor(euint256 a, uint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } - return euint64.wrap(Impl.div(euint64.unwrap(a), uint256(b))); + return euint256.wrap(Impl.xor(euint256.unwrap(a), uint256(b), true)); } - // Evaluate rem(a, b) and return the result. - function rem(euint64 a, uint64 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); + // Evaluate xor(a, b) and return the result. + function xor(uint256 a, euint256 b) internal returns (euint256) { + if (!isInitialized(b)) { + b = asEuint256(0); } - return euint64.wrap(Impl.rem(euint64.unwrap(a), uint256(b))); + return euint256.wrap(Impl.xor(euint256.unwrap(b), uint256(a), true)); } // Evaluate eq(a, b) and return the result. - function eq(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.eq(euint64.unwrap(a), uint256(b), true)); + return ebool.wrap(Impl.eq(euint256.unwrap(a), uint256(b), true)); } // Evaluate eq(a, b) and return the result. - function eq(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.eq(euint64.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.eq(euint256.unwrap(b), uint256(a), true)); } // Evaluate ne(a, b) and return the result. - function ne(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.ne(euint64.unwrap(a), uint256(b), true)); + return ebool.wrap(Impl.ne(euint256.unwrap(a), uint256(b), true)); } // Evaluate ne(a, b) and return the result. - function ne(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.ne(euint64.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.ne(euint256.unwrap(b), uint256(a), true)); } // Evaluate ge(a, b) and return the result. - function ge(euint64 a, uint64 b) internal returns (ebool) { + function ge(euint256 a, uint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } - return ebool.wrap(Impl.ge(euint64.unwrap(a), uint256(b), true)); + return ebool.wrap(Impl.ge(euint256.unwrap(a), uint256(b), true)); } // Evaluate ge(a, b) and return the result. - function ge(uint64 a, euint64 b) internal returns (ebool) { + function ge(uint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return ebool.wrap(Impl.le(euint64.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.le(euint256.unwrap(b), uint256(a), true)); } // Evaluate gt(a, b) and return the result. - function gt(euint64 a, uint64 b) internal returns (ebool) { + function gt(euint256 a, uint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } - return ebool.wrap(Impl.gt(euint64.unwrap(a), uint256(b), true)); + return ebool.wrap(Impl.gt(euint256.unwrap(a), uint256(b), true)); } // Evaluate gt(a, b) and return the result. - function gt(uint64 a, euint64 b) internal returns (ebool) { + function gt(uint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return ebool.wrap(Impl.lt(euint64.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.lt(euint256.unwrap(b), uint256(a), true)); } // Evaluate le(a, b) and return the result. - function le(euint64 a, uint64 b) internal returns (ebool) { + function le(euint256 a, uint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } - return ebool.wrap(Impl.le(euint64.unwrap(a), uint256(b), true)); + return ebool.wrap(Impl.le(euint256.unwrap(a), uint256(b), true)); } // Evaluate le(a, b) and return the result. - function le(uint64 a, euint64 b) internal returns (ebool) { + function le(uint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return ebool.wrap(Impl.ge(euint64.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.ge(euint256.unwrap(b), uint256(a), true)); } // Evaluate lt(a, b) and return the result. - function lt(euint64 a, uint64 b) internal returns (ebool) { + function lt(euint256 a, uint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } - return ebool.wrap(Impl.lt(euint64.unwrap(a), uint256(b), true)); + return ebool.wrap(Impl.lt(euint256.unwrap(a), uint256(b), true)); } // Evaluate lt(a, b) and return the result. - function lt(uint64 a, euint64 b) internal returns (ebool) { + function lt(uint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return ebool.wrap(Impl.gt(euint64.unwrap(b), uint256(a), true)); + return ebool.wrap(Impl.gt(euint256.unwrap(b), uint256(a), true)); } // Evaluate min(a, b) and return the result. - function min(euint64 a, uint64 b) internal returns (euint64) { + function min(euint256 a, uint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } - return euint64.wrap(Impl.min(euint64.unwrap(a), uint256(b), true)); + return euint256.wrap(Impl.min(euint256.unwrap(a), uint256(b), true)); } // Evaluate min(a, b) and return the result. - function min(uint64 a, euint64 b) internal returns (euint64) { + function min(uint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return euint64.wrap(Impl.min(euint64.unwrap(b), uint256(a), true)); + return euint256.wrap(Impl.min(euint256.unwrap(b), uint256(a), true)); } // Evaluate max(a, b) and return the result. - function max(euint64 a, uint64 b) internal returns (euint64) { + function max(euint256 a, uint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } - return euint64.wrap(Impl.max(euint64.unwrap(a), uint256(b), true)); + return euint256.wrap(Impl.max(euint256.unwrap(a), uint256(b), true)); } // Evaluate max(a, b) and return the result. - function max(uint64 a, euint64 b) internal returns (euint64) { + function max(uint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return euint64.wrap(Impl.max(euint64.unwrap(b), uint256(a), true)); + return euint256.wrap(Impl.max(euint256.unwrap(b), uint256(a), true)); } // Evaluate shl(a, b) and return the result. @@ -5217,6 +9649,158 @@ library TFHE { return euint64.wrap(Impl.rotr(euint64.unwrap(a), uint256(b), true)); } + // Evaluate shl(a, b) and return 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)); + } + + // Evaluate shl(a, b) and return 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), uint256(b), true)); + } + + // Evaluate shr(a, b) and return 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)); + } + + // Evaluate shr(a, b) and return 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), uint256(b), true)); + } + + // Evaluate rotl(a, b) and return 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)); + } + + // Evaluate rotl(a, b) and return 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), uint256(b), true)); + } + + // Evaluate rotr(a, b) and return 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)); + } + + // Evaluate rotr(a, b) and return 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), uint256(b), true)); + } + + // Evaluate shl(a, b) and return 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)); + } + + // Evaluate shl(a, b) and return 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), uint256(b), true)); + } + + // Evaluate shr(a, b) and return 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)); + } + + // Evaluate shr(a, b) and return 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), uint256(b), true)); + } + + // Evaluate rotl(a, b) and return 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)); + } + + // Evaluate rotl(a, b) and return 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), uint256(b), true)); + } + + // Evaluate rotr(a, b) and return 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)); + } + + // Evaluate rotr(a, b) and return 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), uint256(b), true)); + } + // 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, euint4 a, euint4 b) internal returns (euint4) { @@ -5242,6 +9826,16 @@ library TFHE { 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))); } + // 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, euint128 a, euint128 b) internal returns (euint128) { + return euint128.wrap(Impl.select(ebool.unwrap(control), euint128.unwrap(a), euint128.unwrap(b))); + } + // 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, euint256 a, euint256 b) internal returns (euint256) { + return euint256.wrap(Impl.select(ebool.unwrap(control), euint256.unwrap(a), euint256.unwrap(b))); + } // Cast 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)); @@ -5262,6 +9856,16 @@ library TFHE { return euint4.wrap(Impl.cast(euint64.unwrap(value), Common.euint4_t)); } + // Cast 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)); + } + + // Cast 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)); + } + // Cast an encrypted integer from euint4 to ebool. function asEbool(euint4 value) internal returns (ebool) { return ne(value, 0); @@ -5292,6 +9896,16 @@ library TFHE { return euint8.wrap(Impl.cast(euint64.unwrap(value), Common.euint8_t)); } + // Cast 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)); + } + + // Cast 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)); + } + // Cast an encrypted integer from euint8 to ebool. function asEbool(euint8 value) internal returns (ebool) { return ne(value, 0); @@ -5323,17 +9937,47 @@ library TFHE { // Evaluate and(a, b) and return the result. function and(ebool a, ebool b) internal returns (ebool) { - return ebool.wrap(Impl.and(ebool.unwrap(a), ebool.unwrap(b))); + return ebool.wrap(Impl.and(ebool.unwrap(a), ebool.unwrap(b), false)); + } + + // Evaluate and(a, b) and return the result. + function and(ebool a, bool b) internal returns (ebool) { + return ebool.wrap(Impl.and(ebool.unwrap(a), b ? 1 : 0, true)); + } + + // Evaluate and(a, b) and return the result. + function and(bool a, ebool b) internal returns (ebool) { + return ebool.wrap(Impl.and(ebool.unwrap(b), a ? 1 : 0, true)); } // Evaluate or(a, b) and return the result. function or(ebool a, ebool b) internal returns (ebool) { - return ebool.wrap(Impl.or(ebool.unwrap(a), ebool.unwrap(b))); + return ebool.wrap(Impl.or(ebool.unwrap(a), ebool.unwrap(b), false)); + } + + // Evaluate or(a, b) and return the result. + function or(ebool a, bool b) internal returns (ebool) { + return ebool.wrap(Impl.or(ebool.unwrap(a), b ? 1 : 0, true)); + } + + // Evaluate or(a, b) and return the result. + function or(bool a, ebool b) internal returns (ebool) { + return ebool.wrap(Impl.or(ebool.unwrap(b), a ? 1 : 0, true)); } // Evaluate xor(a, b) and return the result. function xor(ebool a, ebool b) internal returns (ebool) { - return ebool.wrap(Impl.xor(ebool.unwrap(a), ebool.unwrap(b))); + return ebool.wrap(Impl.xor(ebool.unwrap(a), ebool.unwrap(b), false)); + } + + // Evaluate xor(a, b) and return the result. + function xor(ebool a, bool b) internal returns (ebool) { + return ebool.wrap(Impl.xor(ebool.unwrap(a), b ? 1 : 0, true)); + } + + // Evaluate xor(a, b) and return the result. + function xor(bool a, ebool b) internal returns (ebool) { + return ebool.wrap(Impl.xor(ebool.unwrap(b), a ? 1 : 0, true)); } function not(ebool a) internal returns (ebool) { @@ -5360,6 +10004,16 @@ library TFHE { return euint16.wrap(Impl.cast(euint64.unwrap(value), Common.euint16_t)); } + // Cast 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)); + } + + // Cast 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)); + } + // Cast an encrypted integer from euint16 to ebool. function asEbool(euint16 value) internal returns (ebool) { return ne(value, 0); @@ -5390,6 +10044,16 @@ library TFHE { return euint32.wrap(Impl.cast(euint64.unwrap(value), Common.euint32_t)); } + // Cast 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)); + } + + // Cast 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)); + } + // Cast an encrypted integer from euint32 to ebool. function asEbool(euint32 value) internal returns (ebool) { return ne(value, 0); @@ -5400,34 +10064,124 @@ library TFHE { return euint32.wrap(Impl.cast(ebool.unwrap(b), Common.euint32_t)); } - // Cast 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)); + // Cast 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)); + } + + // Cast 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)); + } + + // Cast 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)); + } + + // Cast 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)); + } + + // Cast 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)); + } + + // Cast 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)); + } + + // Cast an encrypted integer from euint64 to ebool. + function asEbool(euint64 value) internal returns (ebool) { + return ne(value, 0); + } + + // Converts an 'ebool' to an 'euint64'. + function asEuint64(ebool b) internal returns (euint64) { + return euint64.wrap(Impl.cast(ebool.unwrap(b), Common.euint64_t)); + } + + // Cast 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)); + } + + // Cast 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)); + } + + // Cast 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)); + } + + // Cast an encrypted integer from euint32 to euint128. + function asEuint128(euint32 value) internal returns (euint128) { + return euint128.wrap(Impl.cast(euint32.unwrap(value), Common.euint128_t)); + } + + // Cast an encrypted integer from euint64 to euint128. + function asEuint128(euint64 value) internal returns (euint128) { + return euint128.wrap(Impl.cast(euint64.unwrap(value), Common.euint128_t)); + } + + // Cast an encrypted integer from euint256 to euint128. + function asEuint128(euint256 value) internal returns (euint128) { + return euint128.wrap(Impl.cast(euint256.unwrap(value), Common.euint128_t)); + } + + // Cast an encrypted integer from euint128 to ebool. + function asEbool(euint128 value) internal returns (ebool) { + return ne(value, 0); + } + + // Converts an 'ebool' to an 'euint128'. + function asEuint128(ebool b) internal returns (euint128) { + return euint128.wrap(Impl.cast(ebool.unwrap(b), Common.euint128_t)); + } + + // Cast an encrypted integer from euint4 to euint256. + function asEuint256(euint4 value) internal returns (euint256) { + return euint256.wrap(Impl.cast(euint4.unwrap(value), Common.euint256_t)); + } + + // Cast an encrypted integer from euint8 to euint256. + function asEuint256(euint8 value) internal returns (euint256) { + return euint256.wrap(Impl.cast(euint8.unwrap(value), Common.euint256_t)); + } + + // Cast an encrypted integer from euint16 to euint256. + function asEuint256(euint16 value) internal returns (euint256) { + return euint256.wrap(Impl.cast(euint16.unwrap(value), Common.euint256_t)); } - // Cast 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)); + // Cast an encrypted integer from euint32 to euint256. + function asEuint256(euint32 value) internal returns (euint256) { + return euint256.wrap(Impl.cast(euint32.unwrap(value), Common.euint256_t)); } - // Cast 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)); + // Cast an encrypted integer from euint64 to euint256. + function asEuint256(euint64 value) internal returns (euint256) { + return euint256.wrap(Impl.cast(euint64.unwrap(value), Common.euint256_t)); } - // Cast 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)); + // Cast an encrypted integer from euint128 to euint256. + function asEuint256(euint128 value) internal returns (euint256) { + return euint256.wrap(Impl.cast(euint128.unwrap(value), Common.euint256_t)); } - // Cast an encrypted integer from euint64 to ebool. - function asEbool(euint64 value) internal returns (ebool) { + // Cast an encrypted integer from euint256 to ebool. + function asEbool(euint256 value) internal returns (ebool) { return ne(value, 0); } - // Converts an 'ebool' to an 'euint64'. - function asEuint64(ebool b) internal returns (euint64) { - return euint64.wrap(Impl.cast(ebool.unwrap(b), Common.euint64_t)); + // Converts an 'ebool' to an 'euint256'. + 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) { @@ -5470,6 +10224,22 @@ library TFHE { return euint64.wrap(Impl.not(euint64.unwrap(value))); } + function neg(euint128 value) internal returns (euint128) { + return euint128.wrap(Impl.neg(euint128.unwrap(value))); + } + + function not(euint128 value) internal returns (euint128) { + return euint128.wrap(Impl.not(euint128.unwrap(value))); + } + + function neg(euint256 value) internal returns (euint256) { + return euint256.wrap(Impl.neg(euint256.unwrap(value))); + } + + function not(euint256 value) internal returns (euint256) { + return euint256.wrap(Impl.not(euint256.unwrap(value))); + } + // Convert an inputHandle with corresponding inputProof to an encrypted euint4 integer. function asEuint4(einput inputHandle, bytes memory inputProof) internal returns (euint4) { return euint4.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint4_t)); @@ -5520,83 +10290,283 @@ library TFHE { return euint64.wrap(Impl.trivialEncrypt(value, Common.euint64_t)); } + // Convert an inputHandle with corresponding inputProof to an encrypted euint128 integer. + function asEuint128(einput inputHandle, bytes memory inputProof) internal returns (euint128) { + return euint128.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint128_t)); + } + + // Convert a plaintext value to an encrypted euint128 integer. + function asEuint128(uint256 value) internal returns (euint128) { + return euint128.wrap(Impl.trivialEncrypt(value, Common.euint128_t)); + } + + // Convert an inputHandle with corresponding inputProof to an encrypted euint256 integer. + function asEuint256(einput inputHandle, bytes memory inputProof) internal returns (euint256) { + return euint256.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint256_t)); + } + + // Convert a plaintext value to an encrypted euint256 integer. + function asEuint256(uint256 value) internal returns (euint256) { + return euint256.wrap(Impl.trivialEncrypt(value, Common.euint256_t)); + } + + // Generates a random encrypted boolean. + function randEbool() internal returns (ebool) { + return ebool.wrap(Impl.rand(Common.ebool_t)); + } + + // Generates a random encrypted 4-bit unsigned integer. + function randEuint4() internal returns (euint4) { + return euint4.wrap(Impl.rand(Common.euint4_t)); + } + + // 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)); + } + // Generates a random encrypted 8-bit unsigned integer. - // Important: The random integer is generated in the plain! An FHE-based version is coming soon. function randEuint8() internal returns (euint8) { return euint8.wrap(Impl.rand(Common.euint8_t)); } // Generates a random encrypted 8-bit unsigned integer in the [0, upperBound) range. // The upperBound must be a power of 2. - // Important: The random integer is generated in the plain! An FHE-based version is coming soon. function randEuint8(uint8 upperBound) internal returns (euint8) { return euint8.wrap(Impl.randBounded(upperBound, Common.euint8_t)); } // Generates a random encrypted 16-bit unsigned integer. - // Important: The random integer is generated in the plain! An FHE-based version is coming soon. function randEuint16() internal returns (euint16) { return euint16.wrap(Impl.rand(Common.euint16_t)); } // Generates a random encrypted 16-bit unsigned integer in the [0, upperBound) range. // The upperBound must be a power of 2. - // Important: The random integer is generated in the plain! An FHE-based version is coming soon. function randEuint16(uint16 upperBound) internal returns (euint16) { return euint16.wrap(Impl.randBounded(upperBound, Common.euint16_t)); } // Generates a random encrypted 32-bit unsigned integer. - // Important: The random integer is generated in the plain! An FHE-based version is coming soon. function randEuint32() internal returns (euint32) { return euint32.wrap(Impl.rand(Common.euint32_t)); } // Generates a random encrypted 32-bit unsigned integer in the [0, upperBound) range. // The upperBound must be a power of 2. - // Important: The random integer is generated in the plain! An FHE-based version is coming soon. function randEuint32(uint32 upperBound) internal returns (euint32) { return euint32.wrap(Impl.randBounded(upperBound, Common.euint32_t)); } // Generates a random encrypted 64-bit unsigned integer. - // Important: The random integer is generated in the plain! An FHE-based version is coming soon. function randEuint64() internal returns (euint64) { return euint64.wrap(Impl.rand(Common.euint64_t)); } // Generates a random encrypted 64-bit unsigned integer in the [0, upperBound) range. // The upperBound must be a power of 2. - // Important: The random integer is generated in the plain! An FHE-based version is coming soon. function randEuint64(uint64 upperBound) internal returns (euint64) { return euint64.wrap(Impl.randBounded(upperBound, Common.euint64_t)); } + // Generates a random encrypted 128-bit unsigned integer. + function randEuint128() internal returns (euint128) { + return euint128.wrap(Impl.rand(Common.euint128_t)); + } + + // 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)); + } + + // Generates a random encrypted 256-bit unsigned integer. + function randEuint256() internal returns (euint256) { + return euint256.wrap(Impl.rand(Common.euint256_t)); + } + + // 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)); + } + + // Generates a random encrypted 512-bit unsigned integer. + function randEbytes64() internal returns (ebytes64) { + return ebytes64.wrap(Impl.rand(Common.ebytes64_t)); + } + + // Generates a random encrypted 1024-bit unsigned integer. + function randEbytes128() internal returns (ebytes128) { + return ebytes128.wrap(Impl.rand(Common.ebytes128_t)); + } + + // Generates a random encrypted 2048-bit unsigned integer. + function randEbytes256() internal returns (ebytes256) { + return ebytes256.wrap(Impl.rand(Common.ebytes256_t)); + } + // 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)); } - // Convert a plaintext value to an encrypted asEaddress. + // 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)); } + // 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)); + } + + // Left-pad a bytes array with zeros such that it becomes of length 64. + function padToBytes64(bytes memory input) internal pure returns (bytes memory) { + require(input.length <= 64, "Input exceeds 64 bytes"); + bytes memory result = new bytes(64); + uint256 paddingLength = 64 - input.length; + for (uint256 i = 0; i < paddingLength; i++) { + result[i] = 0; + } + for (uint256 i = 0; i < input.length; i++) { + result[paddingLength + i] = input[i]; + } + return result; + } + + // 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)); + } + + // 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)); + } + + // Left-pad a bytes array with zeros such that it becomes of length 128. + function padToBytes128(bytes memory input) internal pure returns (bytes memory) { + require(input.length <= 128, "Input exceeds 128 bytes"); + bytes memory result = new bytes(128); + uint256 paddingLength = 128 - input.length; + for (uint256 i = 0; i < paddingLength; i++) { + result[i] = 0; + } + for (uint256 i = 0; i < input.length; i++) { + result[paddingLength + i] = input[i]; + } + return result; + } + + // 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)); + } + // 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)); } + // Left-pad a bytes array with zeros such that it becomes of length 256. + function padToBytes256(bytes memory input) internal pure returns (bytes memory) { + require(input.length <= 256, "Input exceeds 256 bytes"); + bytes memory result = new bytes(256); + uint256 paddingLength = 256 - input.length; + for (uint256 i = 0; i < paddingLength; i++) { + result[i] = 0; + } + for (uint256 i = 0; i < input.length; i++) { + result[paddingLength + i] = input[i]; + } + return result; + } + + // 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)); + } + // Return true if the enrypted address is initialized and false otherwise. function isInitialized(eaddress v) internal pure returns (bool) { return eaddress.unwrap(v) != 0; } + // Return true if the enrypted value is initialized and false otherwise. + function isInitialized(ebytes64 v) internal pure returns (bool) { + return ebytes64.unwrap(v) != 0; + } + + // Return true if the enrypted value is initialized and false otherwise. + function isInitialized(ebytes128 v) internal pure returns (bool) { + return ebytes128.unwrap(v) != 0; + } + // Return true if the enrypted value is initialized and false otherwise. function isInitialized(ebytes256 v) internal pure returns (bool) { return ebytes256.unwrap(v) != 0; } + // Evaluate eq(a, b) and return 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)); + } + + // Evaluate ne(a, b) and return 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)); + } + + // Evaluate eq(a, b) and return 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), bProc, true)); + } + + // Evaluate eq(a, b) and return 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), bProc, true)); + } + + // Evaluate ne(a, b) and return 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), bProc, true)); + } + + // Evaluate ne(a, b) and return 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), bProc, true)); + } + // Evaluate eq(a, b) and return the result. function eq(eaddress a, eaddress b) internal returns (ebool) { if (!isInitialized(a)) { @@ -5655,26 +10625,198 @@ library TFHE { return ebool.wrap(Impl.ne(eaddress.unwrap(a), bProc, true)); } + // 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))); + } + // 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))); } + // 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, ebytes64 a, ebytes64 b) internal returns (ebytes64) { + return ebytes64.wrap(Impl.select(ebool.unwrap(control), ebytes64.unwrap(a), ebytes64.unwrap(b))); + } + + // 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))); + } + + // 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))); + } + + // Evaluate eq(a, b) and return 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)); + } + + // Evaluate eq(a, b) and return 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)); + } + + // Evaluate eq(a, b) and return 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)); + } + + // Evaluate ne(a, b) and return 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)); + } + + // Evaluate ne(a, b) and return 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)); + } + + // Evaluate ne(a, b) and return 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)); + } + + // Evaluate eq(a, b) and return 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)); + } + + // Evaluate eq(a, b) and return 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)); + } + + // Evaluate eq(a, b) and return 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)); + } + + // Evaluate ne(a, b) and return 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)); + } + + // Evaluate ne(a, b) and return the result. + 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)); + } + + // Evaluate ne(a, b) and return the result. + 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)); + } + // Evaluate eq(a, b) and return the result. function eq(ebytes256 a, ebytes256 b) internal returns (ebool) { - require(isInitialized(a), "a is uninitialized"); - require(isInitialized(b), "b is uninitialized"); + 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)); } + // Evaluate eq(a, b) and return 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)); + } + + // Evaluate eq(a, b) and return 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)); + } + // Evaluate ne(a, b) and return the result. function ne(ebytes256 a, ebytes256 b) internal returns (ebool) { - require(isInitialized(a), "a is uninitialized"); - require(isInitialized(b), "b is uninitialized"); + 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)); } + // Evaluate ne(a, b) and return 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)); + } + + // Evaluate ne(a, b) and return the result. + function ne(bytes memory a, ebytes256 b) internal returns (ebool) { + if (!isInitialized(b)) { + b = asEbytes256(padToBytes256(hex"")); + } + return ebool.wrap(Impl.ne(ebytes256.unwrap(b), a, true)); + } + // cleans the transient storage of ACL containing all the allowedTransient accounts // to be used for integration with Account Abstraction or when bundling UserOps calling the FHEVMCoprocessor function cleanTransientStorage() internal { @@ -5699,6 +10841,12 @@ library TFHE { function isAllowed(euint64 value, address account) internal view returns (bool) { return Impl.isAllowed(euint64.unwrap(value), account); } + function isAllowed(euint128 value, address account) internal view returns (bool) { + return Impl.isAllowed(euint128.unwrap(value), account); + } + function isAllowed(euint256 value, address account) internal view returns (bool) { + return Impl.isAllowed(euint256.unwrap(value), account); + } function isAllowed(eaddress value, address account) internal view returns (bool) { return Impl.isAllowed(eaddress.unwrap(value), account); } @@ -5731,6 +10879,14 @@ library TFHE { return Impl.isAllowed(euint64.unwrap(value), msg.sender); } + function isSenderAllowed(euint128 value) internal view returns (bool) { + return Impl.isAllowed(euint128.unwrap(value), msg.sender); + } + + function isSenderAllowed(euint256 value) internal view returns (bool) { + return Impl.isAllowed(euint256.unwrap(value), msg.sender); + } + function isSenderAllowed(eaddress value) internal view returns (bool) { return Impl.isAllowed(eaddress.unwrap(value), msg.sender); } @@ -5787,6 +10943,22 @@ library TFHE { Impl.allow(euint64.unwrap(value), address(this)); } + function allow(euint128 value, address account) internal { + Impl.allow(euint128.unwrap(value), account); + } + + function allowThis(euint128 value) internal { + Impl.allow(euint128.unwrap(value), address(this)); + } + + function allow(euint256 value, address account) internal { + Impl.allow(euint256.unwrap(value), account); + } + + function allowThis(euint256 value) internal { + Impl.allow(euint256.unwrap(value), address(this)); + } + function allow(eaddress value, address account) internal { Impl.allow(eaddress.unwrap(value), account); } @@ -5795,6 +10967,22 @@ library TFHE { Impl.allow(eaddress.unwrap(value), address(this)); } + function allow(ebytes64 value, address account) internal { + Impl.allow(ebytes64.unwrap(value), account); + } + + function allowThis(ebytes64 value) internal { + Impl.allow(ebytes64.unwrap(value), address(this)); + } + + function allow(ebytes128 value, address account) internal { + Impl.allow(ebytes128.unwrap(value), account); + } + + function allowThis(ebytes128 value) internal { + Impl.allow(ebytes128.unwrap(value), address(this)); + } + function allow(ebytes256 value, address account) internal { Impl.allow(ebytes256.unwrap(value), account); } @@ -5827,6 +11015,14 @@ library TFHE { Impl.allowTransient(euint64.unwrap(value), account); } + function allowTransient(euint128 value, address account) internal { + Impl.allowTransient(euint128.unwrap(value), account); + } + + function allowTransient(euint256 value, address account) internal { + Impl.allowTransient(euint256.unwrap(value), account); + } + function allowTransient(eaddress value, address account) internal { Impl.allowTransient(eaddress.unwrap(value), account); } diff --git a/lib/TFHEExecutor.sol b/lib/TFHEExecutor.sol index 732d4457..5ff0fe92 100644 --- a/lib/TFHEExecutor.sol +++ b/lib/TFHEExecutor.sol @@ -184,7 +184,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { } function fheAdd(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); requireType(lhs, supportedTypes); uint8 lhsType = typeOf(lhs); bytes1 scalar = scalarByte & 0x01; @@ -193,7 +193,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { } function fheSub(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); requireType(lhs, supportedTypes); uint8 lhsType = typeOf(lhs); bytes1 scalar = scalarByte & 0x01; @@ -202,7 +202,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { } function fheMul(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); requireType(lhs, supportedTypes); uint8 lhsType = typeOf(lhs); bytes1 scalar = scalarByte & 0x01; @@ -212,7 +212,8 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { function fheDiv(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) { require(scalarByte & 0x01 == 0x01, "Only fheDiv by a scalar is supported"); - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + require(rhs != 0, "Could not divide by 0"); + uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); requireType(lhs, supportedTypes); uint8 lhsType = typeOf(lhs); bytes1 scalar = scalarByte & 0x01; @@ -222,7 +223,8 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { function fheRem(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) { require(scalarByte & 0x01 == 0x01, "Only fheRem by a scalar is supported"); - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + require(rhs != 0, "Could not divide by 0"); + uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); requireType(lhs, supportedTypes); uint8 lhsType = typeOf(lhs); bytes1 scalar = scalarByte & 0x01; @@ -231,8 +233,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { } function fheBitAnd(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) { - require(scalarByte & 0x01 == 0x00, "Only fheBitAnd by a ciphertext is supported"); - uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); requireType(lhs, supportedTypes); uint8 lhsType = typeOf(lhs); bytes1 scalar = scalarByte & 0x01; @@ -241,8 +242,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { } function fheBitOr(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) { - require(scalarByte & 0x01 == 0x00, "Only fheBitOr by a ciphertext is supported"); - uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); requireType(lhs, supportedTypes); uint8 lhsType = typeOf(lhs); bytes1 scalar = scalarByte & 0x01; @@ -251,8 +251,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { } function fheBitXor(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) { - require(scalarByte & 0x01 == 0x00, "Only fheBitXor by a ciphertext is supported"); - uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); requireType(lhs, supportedTypes); uint8 lhsType = typeOf(lhs); bytes1 scalar = scalarByte & 0x01; @@ -261,7 +260,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { } function fheShl(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); requireType(lhs, supportedTypes); uint8 lhsType = typeOf(lhs); bytes1 scalar = scalarByte & 0x01; @@ -270,7 +269,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { } function fheShr(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); requireType(lhs, supportedTypes); uint8 lhsType = typeOf(lhs); bytes1 scalar = scalarByte & 0x01; @@ -279,7 +278,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { } function fheRotl(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); requireType(lhs, supportedTypes); uint8 lhsType = typeOf(lhs); bytes1 scalar = scalarByte & 0x01; @@ -288,7 +287,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { } function fheRotr(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); requireType(lhs, supportedTypes); uint8 lhsType = typeOf(lhs); bytes1 scalar = scalarByte & 0x01; @@ -297,25 +296,97 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { } function fheEq(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 7) + (1 << 11); + 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); requireType(lhs, supportedTypes); uint8 lhsType = typeOf(lhs); bytes1 scalar = scalarByte & 0x01; + if (scalar == 0x01) { + require(lhsType <= 8, "Scalar fheEq for ebytesXXX types must use the overloaded fheEq"); + } fhePayment.payForFheEq(msg.sender, lhsType, scalar); result = binaryOp(Operators.fheEq, lhs, rhs, scalar, 0); } + function fheEq(uint256 lhs, bytes memory rhs, bytes1 scalarByte) external virtual returns (uint256 result) { + uint256 supportedTypes = (1 << 9) + (1 << 10) + (1 << 11); + requireType(lhs, supportedTypes); + uint8 lhsType = typeOf(lhs); + bytes1 scalar = scalarByte & 0x01; + require(scalar == 0x01, "Overloaded fheEq is only for scalar ebytesXXX second operand"); + fhePayment.payForFheEq(msg.sender, lhsType, scalar); + require(acl.isAllowed(lhs, msg.sender), "Sender doesn't own lhs on op"); + uint256 lenBytesPT = rhs.length; + if (lhsType == 9) { + require(lenBytesPT == 64, "Bytes array length of Bytes64 should be 64"); + } else if (lhsType == 10) { + require(lenBytesPT == 128, "Bytes array length of Bytes128 should be 128"); + } else { + // @note: i.e lhsType == 11 thanks to the first pre-condition + require(lenBytesPT == 256, "Bytes array length of Bytes256 should be 256"); + } + result = uint256(keccak256(abi.encodePacked(Operators.fheEq, lhs, rhs, scalar, acl, block.chainid))); + result = appendType(result, 0); + acl.allowTransient(result, msg.sender); + } + function fheNe(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 7) + (1 << 11); + 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); requireType(lhs, supportedTypes); uint8 lhsType = typeOf(lhs); bytes1 scalar = scalarByte & 0x01; + if (scalar == 0x01) { + require(lhsType <= 8, "Scalar fheNe for ebytesXXX types must use the overloaded fheNe"); + } fhePayment.payForFheNe(msg.sender, lhsType, scalar); result = binaryOp(Operators.fheNe, lhs, rhs, scalar, 0); } + function fheNe(uint256 lhs, bytes memory rhs, bytes1 scalarByte) external virtual returns (uint256 result) { + uint256 supportedTypes = (1 << 9) + (1 << 10) + (1 << 11); + requireType(lhs, supportedTypes); + uint8 lhsType = typeOf(lhs); + bytes1 scalar = scalarByte & 0x01; + require(scalar == 0x01, "Overloaded fheNe is only for scalar ebytesXXX second operand"); + fhePayment.payForFheNe(msg.sender, lhsType, scalar); + require(acl.isAllowed(lhs, msg.sender), "Sender doesn't own lhs on op"); + uint256 lenBytesPT = rhs.length; + if (lhsType == 9) { + require(lenBytesPT == 64, "Bytes array length of Bytes64 should be 64"); + } else if (lhsType == 10) { + require(lenBytesPT == 128, "Bytes array length of Bytes128 should be 128"); + } else { + // @note: i.e lhsType == 11 thanks to the first pre-condition + require(lenBytesPT == 256, "Bytes array length of Bytes256 should be 256"); + } + result = uint256(keccak256(abi.encodePacked(Operators.fheNe, lhs, rhs, scalar, acl, block.chainid))); + result = appendType(result, 0); + acl.allowTransient(result, msg.sender); + } + function fheGe(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); requireType(lhs, supportedTypes); uint8 lhsType = typeOf(lhs); bytes1 scalar = scalarByte & 0x01; @@ -324,7 +395,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { } function fheGt(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); requireType(lhs, supportedTypes); uint8 lhsType = typeOf(lhs); bytes1 scalar = scalarByte & 0x01; @@ -333,7 +404,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { } function fheLe(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); requireType(lhs, supportedTypes); uint8 lhsType = typeOf(lhs); bytes1 scalar = scalarByte & 0x01; @@ -342,7 +413,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { } function fheLt(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); requireType(lhs, supportedTypes); uint8 lhsType = typeOf(lhs); bytes1 scalar = scalarByte & 0x01; @@ -351,7 +422,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { } function fheMin(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); requireType(lhs, supportedTypes); uint8 lhsType = typeOf(lhs); bytes1 scalar = scalarByte & 0x01; @@ -360,7 +431,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { } function fheMax(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); requireType(lhs, supportedTypes); uint8 lhsType = typeOf(lhs); bytes1 scalar = scalarByte & 0x01; @@ -369,7 +440,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { } function fheNeg(uint256 ct) external virtual returns (uint256 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); requireType(ct, supportedTypes); uint8 typeCt = typeOf(ct); fhePayment.payForFheNeg(msg.sender, typeCt); @@ -377,7 +448,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { } function fheNot(uint256 ct) external virtual returns (uint256 result) { - uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); requireType(ct, supportedTypes); uint8 typeCt = typeOf(ct); fhePayment.payForFheNot(msg.sender, typeCt); @@ -403,9 +474,16 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { function cast(uint256 ct, bytes1 toType) external virtual returns (uint256 result) { require(acl.isAllowed(ct, msg.sender), "Sender doesn't own ct on cast"); - uint256 supportedTypesInput = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + uint256 supportedTypesInput = (1 << 0) + + (1 << 1) + + (1 << 2) + + (1 << 3) + + (1 << 4) + + (1 << 5) + + (1 << 6) + + (1 << 8); requireType(ct, supportedTypesInput); - uint256 supportedTypesOutput = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); // @note: unsupported casting to ebool (use fheNe instead) + uint256 supportedTypesOutput = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); // @note: unsupported casting to ebool (use fheNe instead) require((1 << uint8(toType)) & supportedTypesOutput > 0, "Unsupported output type"); uint8 typeCt = typeOf(ct); require(bytes1(typeCt) != toType, "Cannot cast to same type"); @@ -416,17 +494,56 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { } function trivialEncrypt(uint256 pt, bytes1 toType) external virtual returns (uint256 result) { - uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 7); + uint256 supportedTypes = (1 << 0) + + (1 << 1) + + (1 << 2) + + (1 << 3) + + (1 << 4) + + (1 << 5) + + (1 << 6) + + (1 << 7) + + (1 << 8); + uint8 toT = uint8(toType); + require((1 << toT) & supportedTypes > 0, "Unsupported type"); + fhePayment.payForTrivialEncrypt(msg.sender, toT); + result = uint256(keccak256(abi.encodePacked(Operators.trivialEncrypt, pt, toType, acl, block.chainid))); + result = appendType(result, toT); + acl.allowTransient(result, msg.sender); + } + + function trivialEncrypt(bytes memory pt, bytes1 toType) external virtual returns (uint256 result) { + // @note: overloaded function for ebytesXX types + uint256 supportedTypes = (1 << 9) + (1 << 10) + (1 << 11); uint8 toT = uint8(toType); require((1 << toT) & supportedTypes > 0, "Unsupported type"); fhePayment.payForTrivialEncrypt(msg.sender, toT); + uint256 lenBytesPT = pt.length; + if (toT == 9) { + require(lenBytesPT == 64, "Bytes array length of Bytes64 should be 64"); + } else if (toT == 10) { + require(lenBytesPT == 128, "Bytes array length of Bytes128 should be 128"); + } else { + // @note: i.e toT == 11 thanks to the pre-condition above + require(lenBytesPT == 256, "Bytes array length of Bytes256 should be 256"); + } result = uint256(keccak256(abi.encodePacked(Operators.trivialEncrypt, pt, toType, acl, block.chainid))); result = appendType(result, toT); acl.allowTransient(result, msg.sender); } function fheIfThenElse(uint256 control, uint256 ifTrue, uint256 ifFalse) external virtual returns (uint256 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 7); + 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); requireType(ifTrue, supportedTypes); uint8 typeCt = typeOf(ifTrue); fhePayment.payForIfThenElse(msg.sender, typeCt); @@ -435,7 +552,17 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { function fheRand(bytes1 randType) external virtual returns (uint256 result) { TFHEExecutorStorage storage $ = _getTFHEExecutorStorage(); - uint256 supportedTypes = (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + 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); require((1 << randT) & supportedTypes > 0, "Unsupported erandom type"); fhePayment.payForFheRand(msg.sender, randT); @@ -450,7 +577,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable { function fheRandBounded(uint256 upperBound, bytes1 randType) external virtual returns (uint256 result) { TFHEExecutorStorage storage $ = _getTFHEExecutorStorage(); - uint256 supportedTypes = (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); + uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); uint8 randT = uint8(randType); require((1 << randT) & supportedTypes > 0, "Unsupported erandom type"); require(isPowerOfTwo(upperBound), "UpperBound must be a power of 2"); diff --git a/test/asyncDecrypt.ts b/test/asyncDecrypt.ts index a024bf23..e9a16374 100644 --- a/test/asyncDecrypt.ts +++ b/test/asyncDecrypt.ts @@ -21,6 +21,9 @@ const CiphertextType = { 5: 'uint64', 6: 'uint128', 7: 'address', + 8: 'uint256', + 9: 'bytes', + 10: 'bytes', 11: 'bytes', }; @@ -44,7 +47,7 @@ let gateway: GatewayContract; let firstBlockListening: number; let lastBlockSnapshotForDecrypt: number; -export const asyncDecrypt = async (): Promise => { +export const initGateway = async (): Promise => { firstBlockListening = await ethers.provider.getBlockNumber(); if (networkName === 'hardhat' && hre.__SOLIDITY_COVERAGE_RUNNING !== true) { // evm_snapshot is not supported in coverage mode @@ -130,24 +133,29 @@ const fulfillAllPastRequestsIds = async (mocked: boolean) => { if (!allTrue(isAllowedForDec)) { throw new Error('Some handle is not authorized for decryption'); } - const types = typesList.map((num) => CiphertextType[num]); const values = await Promise.all(handles.map(async (handle) => BigInt(await getClearText(handle)))); const valuesFormatted = values.map((value, index) => types[index] === 'address' ? '0x' + value.toString(16).padStart(40, '0') : value, ); const valuesFormatted2 = valuesFormatted.map((value, index) => - types[index] === 'bytes' ? '0x' + value.toString(16).padStart(512, '0') : value, + typesList[index] === 9 ? '0x' + value.toString(16).padStart(128, '0') : value, + ); + const valuesFormatted3 = valuesFormatted2.map((value, index) => + typesList[index] === 10 ? '0x' + value.toString(16).padStart(256, '0') : value, + ); + const valuesFormatted4 = valuesFormatted3.map((value, index) => + typesList[index] === 11 ? '0x' + value.toString(16).padStart(512, '0') : value, ); const abiCoder = new ethers.AbiCoder(); let encodedData; let calldata; if (!passSignaturesToCaller) { - encodedData = abiCoder.encode(['uint256', ...types], [31, ...valuesFormatted2]); // 31 is just a dummy uint256 requestID to get correct abi encoding for the remaining arguments (i.e everything except the requestID) + encodedData = abiCoder.encode(['uint256', ...types], [31, ...valuesFormatted4]); // 31 is just a dummy uint256 requestID to get correct abi encoding for the remaining arguments (i.e everything except the requestID) calldata = '0x' + encodedData.slice(66); // we just pop the dummy requestID to get the correct value to pass for `decryptedCts` } else { - encodedData = abiCoder.encode(['uint256', ...types, 'bytes[]'], [31, ...valuesFormatted2, []]); // adding also a dummy empty array of bytes for correct abi-encoding when used with signatures + encodedData = abiCoder.encode(['uint256', ...types, 'bytes[]'], [31, ...valuesFormatted4, []]); // adding also a dummy empty array of bytes for correct abi-encoding when used with signatures calldata = '0x' + encodedData.slice(66).slice(0, -64); // we also pop the last 32 bytes (empty bytes[]) } diff --git a/test/coprocessorUtils.ts b/test/coprocessorUtils.ts index c3c62a2a..42222fea 100644 --- a/test/coprocessorUtils.ts +++ b/test/coprocessorUtils.ts @@ -223,6 +223,19 @@ async function insertHandle( insertSQL(handle, clearText); break; + case 'trivialEncrypt(bytes,bytes1)': + resultType = Number(decodedData[1]); + clearText = decodedData[0]; + handle = ethers.keccak256( + ethers.solidityPacked( + ['uint8', 'bytes', 'bytes1', 'address', 'uint256'], + [Operators.trivialEncrypt, decodedData[0], decodedData[1], aclAddress, chainId], + ), + ); + handle = appendType(handle, resultType); + insertSQL(handle, clearText); + break; + case 'fheAdd(uint256,uint256,bytes1)': handle = ethers.keccak256( ethers.solidityPacked( @@ -507,6 +520,24 @@ async function insertHandle( insertSQL(handle, clearText); break; + case 'fheEq(uint256,bytes,bytes1)': + handle = ethers.keccak256( + ethers.solidityPacked( + ['uint8', 'uint256', 'bytes', 'bytes1', 'address', 'uint256'], + [Operators.fheEq, decodedData[0], decodedData[1], decodedData[2], aclAddress, chainId], + ), + ); + handle = appendType(handle, 0); + clearLHS = await getClearText(decodedData[0]); + if (decodedData[2] === '0x01') { + clearText = BigInt(clearLHS) === BigInt(decodedData[1]) ? 1n : 0n; + } else { + clearRHS = await getClearText(decodedData[1]); + clearText = BigInt(clearLHS) === BigInt(clearRHS) ? 1n : 0n; + } + insertSQL(handle, clearText); + break; + case 'fheNe(uint256,uint256,bytes1)': handle = ethers.keccak256( ethers.solidityPacked( @@ -525,6 +556,24 @@ async function insertHandle( insertSQL(handle, clearText); break; + case 'fheNe(uint256,bytes,bytes1)': + handle = ethers.keccak256( + ethers.solidityPacked( + ['uint8', 'uint256', 'bytes', 'bytes1', 'address', 'uint256'], + [Operators.fheNe, decodedData[0], decodedData[1], decodedData[2], aclAddress, chainId], + ), + ); + handle = appendType(handle, 0); + clearLHS = await getClearText(decodedData[0]); + if (decodedData[2] === '0x01') { + clearText = BigInt(clearLHS) !== BigInt(decodedData[1]) ? 1n : 0n; + } else { + clearRHS = await getClearText(decodedData[1]); + clearText = BigInt(clearLHS) !== BigInt(clearRHS) ? 1n : 0n; + } + insertSQL(handle, clearText); + break; + case 'fheGe(uint256,uint256,bytes1)': handle = ethers.keccak256( ethers.solidityPacked( diff --git a/test/gatewayDecrypt/testAsyncDecrypt.ts b/test/gatewayDecrypt/testAsyncDecrypt.ts index a490bd83..803e957c 100644 --- a/test/gatewayDecrypt/testAsyncDecrypt.ts +++ b/test/gatewayDecrypt/testAsyncDecrypt.ts @@ -1,10 +1,10 @@ import { expect } from 'chai'; import { ethers, network } from 'hardhat'; -import { asyncDecrypt, awaitAllDecryptionResults } from '../asyncDecrypt'; +import { awaitAllDecryptionResults, initGateway } from '../asyncDecrypt'; import { createInstances } from '../instance'; import { getSigners, initSigners } from '../signers'; -import { bigIntToBytes256, waitNBlocks } from '../utils'; +import { bigIntToBytes64, bigIntToBytes128, bigIntToBytes256, waitNBlocks } from '../utils'; describe('TestAsyncDecrypt', function () { before(async function () { @@ -23,7 +23,7 @@ describe('TestAsyncDecrypt', function () { await tx.wait(); // this first request is here just to silence the current gateway bug at the moment await waitNBlocks(1); - await asyncDecrypt(); + await initGateway(); }); beforeEach(async function () { @@ -233,6 +233,48 @@ describe('TestAsyncDecrypt', function () { expect(y).to.equal(18446744073709551600n); }); + it('test async decrypt uint128', async function () { + const tx2 = await this.contract.connect(this.signers.carol).requestUint128({ gasLimit: 5_000_000 }); + await tx2.wait(); + await awaitAllDecryptionResults(); + const y = await this.contract.yUint128(); + expect(y).to.equal(1267650600228229401496703205443n); + }); + + it('test async decrypt uint128 non-trivial', async function () { + const inputAlice = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address); + inputAlice.add128(184467440737095500429401496n); + const encryptedAmount = await inputAlice.encrypt(); + const tx = await this.contract.requestUint128NonTrivial(encryptedAmount.handles[0], encryptedAmount.inputProof, { + gasLimit: 5_000_000, + }); + await tx.wait(); + await awaitAllDecryptionResults(); + const y = await this.contract.yUint128(); + expect(y).to.equal(184467440737095500429401496n); + }); + + it('test async decrypt uint256', async function () { + const tx2 = await this.contract.connect(this.signers.carol).requestUint256({ gasLimit: 5_000_000 }); + await tx2.wait(); + await awaitAllDecryptionResults(); + const y = await this.contract.yUint256(); + expect(y).to.equal(27606985387162255149739023449108101809804435888681546220650096895197251n); + }); + + it('test async decrypt uint256 non-trivial', async function () { + const inputAlice = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address); + inputAlice.add256(6985387162255149739023449108101809804435888681546n); + const encryptedAmount = await inputAlice.encrypt(); + const tx = await this.contract.requestUint256NonTrivial(encryptedAmount.handles[0], encryptedAmount.inputProof, { + gasLimit: 5_000_000, + }); + await tx.wait(); + await awaitAllDecryptionResults(); + const y = await this.contract.yUint256(); + expect(y).to.equal(6985387162255149739023449108101809804435888681546n); + }); + it.skip('test async decrypt FAKE uint64', async function () { if (network.name !== 'hardhat') { // only in fhevm mode @@ -322,6 +364,78 @@ describe('TestAsyncDecrypt', function () { expect(y).to.equal(18446744073709550042n); }); + it('test async decrypt ebytes64 trivial', async function () { + const tx = await this.contract.requestEbytes64Trivial('0x78685689'); + await tx.wait(); + await awaitAllDecryptionResults(); + const y = await this.contract.yBytes64(); + expect(y).to.equal(ethers.toBeHex(BigInt('0x78685689'), 64)); + }); + + it('test async decrypt ebytes64 non-trivial', async function () { + const inputAlice = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address); + inputAlice.addBytes64( + bigIntToBytes64(98870780878070870878787887072921111299111111000000292928818818818818221112111n), + ); + const encryptedAmount = await inputAlice.encrypt(); + const tx = await this.contract.requestEbytes64NonTrivial(encryptedAmount.handles[0], encryptedAmount.inputProof, { + gasLimit: 5_000_000, + }); + await tx.wait(); + await awaitAllDecryptionResults(); + const y = await this.contract.yBytes64(); + expect(y).to.equal( + ethers.toBeHex(98870780878070870878787887072921111299111111000000292928818818818818221112111n, 64), + ); + }); + + it('test async decrypt ebytes128 trivial', async function () { + const tx = await this.contract.requestEbytes128Trivial( + '0x8701d11594415047dfac2d9cb87e6631df5a735a2f364fba1511fa7b812dfad2972b809b80ff25ec19591a598081af357cba384cf5aa8e085678ff70bc55faee', + ); + await tx.wait(); + await awaitAllDecryptionResults(); + const y = await this.contract.yBytes128(); + expect(y).to.equal( + ethers.toBeHex( + BigInt( + '0x8701d11594415047dfac2d9cb87e6631df5a735a2f364fba1511fa7b812dfad2972b809b80ff25ec19591a598081af357cba384cf5aa8e085678ff70bc55faee', + ), + 128, + ), + ); + }); + + it('test async decrypt ebytes128 non-trivial', async function () { + const inputAlice = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address); + inputAlice.addBytes128( + bigIntToBytes128( + 9887078087807087087878788707292111129911111100000029292881881881881822111211198870780878070870878787887072921111299111111000000292928818818818818221112111n, + ), + ); + const encryptedAmount = await inputAlice.encrypt(); + const tx = await this.contract.requestEbytes128NonTrivial(encryptedAmount.handles[0], encryptedAmount.inputProof, { + gasLimit: 5_000_000, + }); + await tx.wait(); + await awaitAllDecryptionResults(); + const y = await this.contract.yBytes128(); + expect(y).to.equal( + ethers.toBeHex( + 9887078087807087087878788707292111129911111100000029292881881881881822111211198870780878070870878787887072921111299111111000000292928818818818818221112111n, + 128, + ), + ); + }); + + it('test async decrypt ebytes256 trivial', async function () { + const tx = await this.contract.requestEbytes256Trivial('0x78685689'); + await tx.wait(); + await awaitAllDecryptionResults(); + const y = await this.contract.yBytes256(); + expect(y).to.equal(ethers.toBeHex(BigInt('0x78685689'), 256)); + }); + it('test async decrypt ebytes256 non-trivial', async function () { const inputAlice = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address); inputAlice.addBytes256(bigIntToBytes256(18446744073709550022n)); @@ -378,6 +492,8 @@ describe('TestAsyncDecrypt', function () { await awaitAllDecryptionResults(); const y = await this.contract.yBytes256(); expect(y).to.equal(ethers.toBeHex(18446744073709550032n, 256)); + const y2 = await this.contract.yBytes64(); + expect(y2).to.equal(ethers.toBeHex(BigInt('0xaaff42'), 64)); const yb = await this.contract.yBool(); expect(yb).to.equal(true); const yAdd = await this.contract.yAddress(); diff --git a/test/instance.ts b/test/instance.ts index ee307d9d..453bf64c 100644 --- a/test/instance.ts +++ b/test/instance.ts @@ -190,6 +190,42 @@ export const decrypt64 = async (handle: bigint): 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 Gateway. + * + * @param {bigint} a handle to decrypt + * @returns {bigint} + */ +export const decrypt128 = async (handle: bigint): Promise => { + if (network.name === 'hardhat') { + await awaitCoprocessor(); + return BigInt(await getClearText(handle)); + } else { + return getDecryptor().decrypt128(await getCiphertext(handle, ethers)); + } +}; + +/** + * @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 Gateway. + * + * @param {bigint} a handle to decrypt + * @returns {bigint} + */ +export const decrypt256 = async (handle: bigint): Promise => { + if (network.name === 'hardhat') { + await awaitCoprocessor(); + return BigInt(await getClearText(handle)); + } else { + return getDecryptor().decrypt256(await getCiphertext(handle, ethers)); + } +}; + /** * @debug * This function is intended for debugging purposes only. @@ -209,3 +245,57 @@ export const decryptAddress = async (handle: bigint): Promise => { return getDecryptor().decryptAddress(await getCiphertext(handle, ethers)); } }; + +/** + * @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 Gateway. + * + * @param {bigint} a handle to decrypt + * @returns {bigint} + */ +export const decryptEbytes64 = async (handle: bigint): Promise => { + if (network.name === 'hardhat') { + await awaitCoprocessor(); + return BigInt(await getClearText(handle)); + } else { + return getDecryptor().decryptEbytes64(await getCiphertext(handle, ethers)); + } +}; + +/** + * @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 Gateway. + * + * @param {bigint} a handle to decrypt + * @returns {bigint} + */ +export const decryptEbytes128 = async (handle: bigint): Promise => { + if (network.name === 'hardhat') { + await awaitCoprocessor(); + return BigInt(await getClearText(handle)); + } else { + return getDecryptor().decryptEbytes128(await getCiphertext(handle, ethers)); + } +}; + +/** + * @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 Gateway. + * + * @param {bigint} a handle to decrypt + * @returns {bigint} + */ +export const decryptEbytes256 = async (handle: bigint): Promise => { + if (network.name === 'hardhat') { + await awaitCoprocessor(); + return BigInt(await getClearText(handle)); + } else { + return getDecryptor().decryptEbytes256(await getCiphertext(handle, ethers)); + } +}; diff --git a/test/kmsVerifier/kmsVerifier.ts b/test/kmsVerifier/kmsVerifier.ts index b4bba0be..11e3c533 100644 --- a/test/kmsVerifier/kmsVerifier.ts +++ b/test/kmsVerifier/kmsVerifier.ts @@ -3,7 +3,7 @@ import dotenv from 'dotenv'; import fs from 'fs'; import { ethers } from 'hardhat'; -import { asyncDecrypt, awaitAllDecryptionResults } from '../asyncDecrypt'; +import { awaitAllDecryptionResults, initGateway } from '../asyncDecrypt'; import { createInstances } from '../instance'; import { getSigners, initSigners } from '../signers'; import { bigIntToBytes256 } from '../utils'; @@ -14,7 +14,7 @@ describe('KMSVerifier', function () { this.signers = await getSigners(); this.instances = await createInstances(this.signers); this.kmsFactory = await ethers.getContractFactory('KMSVerifier'); - await asyncDecrypt(); + await initGateway(); }); it('original owner adds one signer, then adds two more signers, then removes one signer', async function () { diff --git a/test/rand/Rand.ts b/test/rand/Rand.ts index b2ea35ce..e45886f6 100644 --- a/test/rand/Rand.ts +++ b/test/rand/Rand.ts @@ -1,7 +1,20 @@ import { expect } from 'chai'; import { ethers, network } from 'hardhat'; -import { createInstances, decrypt8, decrypt16, decrypt32, decrypt64 } from '../instance'; +import { + createInstances, + decrypt4, + decrypt8, + decrypt16, + decrypt32, + decrypt64, + decrypt128, + decrypt256, + decryptBool, + decryptEbytes64, + decryptEbytes128, + decryptEbytes256, +} from '../instance'; import { getSigners, initSigners } from '../signers'; import { deployRandFixture } from './Rand.fixture'; @@ -18,6 +31,50 @@ describe('Rand', function () { this.instances = await createInstances(this.signers); }); + it('ebool generate and decrypt', async function () { + const values: boolean[] = []; + for (let i = 0; i < 15; i++) { + const txn = await this.rand.generateBool(); + await txn.wait(); + const valueHandle = await this.rand.valueb(); + const value = await decryptBool(valueHandle); + 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 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++) { @@ -132,10 +189,11 @@ describe('Rand', function () { if (value > BigInt('0xffffffff')) { has64bit = true; } + // Make sure we actually generate 64 bit integers. + expect(has64bit).to.be.true; values.push(value); } - // Make sure we actually generate 64 bit integers. - expect(has64bit).to.be.true; + // Expect at least two different generated values. const unique = new Set(values); expect(unique.size).to.be.greaterThanOrEqual(2); @@ -156,6 +214,138 @@ describe('Rand', function () { expect(unique.size).to.be.greaterThanOrEqual(2); }); + it('128 bits generate and decrypt', async function () { + const values: bigint[] = []; + let has128bit: boolean = false; + for (let i = 0; i < 5; i++) { + const txn = await this.rand.generate128(); + await txn.wait(); + const valueHandle = await this.rand.value128(); + const value = await decrypt128(valueHandle); + expect(value).to.be.lessThanOrEqual(BigInt('0xffffffffffffffffffffffffffffffff')); + if (value > BigInt('0xffffffffffffffff')) { + has128bit = true; + } + values.push(value); + // Make sure we actually generate 128 bit integers. + expect(has128bit).to.be.true; + } + // Expect at least 4 different generated values. + const unique = new Set(values); + expect(unique.size).to.be.greaterThanOrEqual(4); + }); + + it('128 bits generate with upper bound and decrypt', async function () { + const values: bigint[] = []; + for (let i = 0; i < 5; i++) { + const txn = await this.rand.generate128UpperBound(2n ** 100n); + await txn.wait(); + const valueHandle = await this.rand.value128(); + const value = await decrypt128(valueHandle); + expect(value).to.be.lessThanOrEqual(2n ** 100n); + values.push(value); + } + // Expect at least 4 different generated values. + const unique = new Set(values); + expect(unique.size).to.be.greaterThanOrEqual(4); + }); + + it('256 bits generate and decrypt', async function () { + const values: bigint[] = []; + let has256bit: boolean = false; + for (let i = 0; i < 5; i++) { + const txn = await this.rand.generate256(); + await txn.wait(); + const valueHandle = await this.rand.value256(); + const value = await decrypt256(valueHandle); + expect(value).to.be.lessThanOrEqual(BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')); + if (value > BigInt('0xffffffffffffffffffffffffffffffff')) { + has256bit = true; + } + values.push(value); + // Make sure we actually generate 256 bit integers. + expect(has256bit).to.be.true; + } + // Expect at least 5 different generated values. + const unique = new Set(values); + expect(unique.size).to.be.greaterThanOrEqual(5); + }); + + it('256 bits generate with upper bound and decrypt', async function () { + const values: bigint[] = []; + for (let i = 0; i < 5; i++) { + const txn = await this.rand.generate256UpperBound(2n ** 200n); + await txn.wait(); + const valueHandle = await this.rand.value256(); + const value = await decrypt256(valueHandle); + expect(value).to.be.lessThanOrEqual(2n ** 200n); + values.push(value); + } + // Expect at least 5 different generated values. + const unique = new Set(values); + expect(unique.size).to.be.greaterThanOrEqual(5); + }); + + it('512 bits generate and decrypt', async function () { + const values: bigint[] = []; + let has512bit: boolean = false; + for (let i = 0; i < 5; i++) { + const txn = await this.rand.generate512(); + await txn.wait(); + const valueHandle = await this.rand.value512(); + const value = await decryptEbytes64(valueHandle); + expect(value).to.be.lessThan(2n ** 512n); + if (value > 2n ** 256n) { + has512bit = true; + } + values.push(value); + expect(has512bit).to.be.true; + } + // Expect at least 5 different generated values. + const unique = new Set(values); + expect(unique.size).to.be.greaterThanOrEqual(5); + }); + + it('1024 bits generate and decrypt', async function () { + const values: bigint[] = []; + let has1024bit: boolean = false; + for (let i = 0; i < 5; i++) { + const txn = await this.rand.generate1024(); + await txn.wait(); + const valueHandle = await this.rand.value1024(); + const value = await decryptEbytes128(valueHandle); + expect(value).to.be.lessThan(2n ** 1024n); + if (value > 2n ** 512n) { + has1024bit = true; + } + values.push(value); + expect(has1024bit).to.be.true; + } + // Expect at least 5 different generated values. + const unique = new Set(values); + expect(unique.size).to.be.greaterThanOrEqual(5); + }); + + it('2048 bits generate and decrypt', async function () { + const values: bigint[] = []; + let has2048bit: boolean = false; + for (let i = 0; i < 5; i++) { + const txn = await this.rand.generate2048(); + await txn.wait(); + const valueHandle = await this.rand.value2048(); + const value = await decryptEbytes256(valueHandle); + expect(value).to.be.lessThan(2n ** 2048n); + if (value > 2n ** 1024n) { + has2048bit = true; + } + values.push(value); + expect(has2048bit).to.be.true; + } + // Expect at least 5 different generated values. + const unique = new Set(values); + expect(unique.size).to.be.greaterThanOrEqual(5); + }); + it('8 and 16 bits generate and decrypt with hardhat snapshots [skip-on-coverage]', async function () { if (network.name === 'hardhat') { // snapshots are only possible in hardhat node, i.e in mocked mode diff --git a/test/reencryption/reencryption.ts b/test/reencryption/reencryption.ts index 476d7fcb..a604f8f7 100644 --- a/test/reencryption/reencryption.ts +++ b/test/reencryption/reencryption.ts @@ -15,16 +15,6 @@ describe('Reencryption', function () { this.contract = await contractFactory.connect(this.signers.alice).deploy(); this.contractAddress = await this.contract.getAddress(); this.instances = await createInstances(this.signers); - - const inputAlice = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address); - inputAlice.addBytes256( - bigIntToBytes256(184467440737095500228978978978978970980978908978978907890778907089780970897890n), - ); - const encryptedAmount = await inputAlice.encrypt(); - const tx = await this.contract.setEBytes256(encryptedAmount.handles[0], encryptedAmount.inputProof, { - gasLimit: 5_000_000, - }); - await tx.wait(); }); it('test reencrypt ebool', async function () { @@ -147,6 +137,26 @@ describe('Reencryption', function () { expect(decryptedValue).to.equal(18446744073709551600n); }); + it('test reencrypt euint128', async function () { + const handle = await this.contract.xUint128(); + 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(145275933516363203950142179850024740765n); + }); + it('test reencrypt eaddress', async function () { const handle = await this.contract.xAddress(); const { publicKey, privateKey } = this.instances.alice.generateKeypair(); @@ -167,6 +177,74 @@ describe('Reencryption', function () { expect(decryptedValue).to.equal(BigInt('0x8ba1f109551bD432803012645Ac136ddd64DBA72')); }); + it('test reencrypt euint256', async function () { + const handle = await this.contract.xUint256(); + 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(74285495974541385002137713624115238327312291047062397922780925695323480915729n); + }); + + it('test reencrypt ebytes64', async function () { + const handle = await this.contract.yBytes64(); + 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( + BigInt( + '0x19d179e0cc7e816dc944582ed4f5652f5951900098fc2e0a15a7ea4dc8cfa4e3b6c54beea5ee95e56b728762f659347ce1d4aa1b05fcc5', + ), + ); + }); + + it('test reencrypt ebytes128', async function () { + const handle = await this.contract.yBytes128(); + 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( + BigInt( + '0x13e7819123de6e2870c7e83bb764508e22d7c3ab8a5aee6bdfb26355ef0d3f1977d651b83bf5f78634fa360aa14debdc3daa6a587b5c2fb1710ab4d6677e62a8577f2d9fecc190ad8b11c9f0a5ec3138b27da1f055437af8c90a9495dad230', + ), + ); + }); + it('test reencrypt ebytes256', async function () { const handle = await this.contract.yBytes256(); const { publicKey, privateKey } = this.instances.alice.generateKeypair(); @@ -184,6 +262,10 @@ describe('Reencryption', function () { this.contractAddress, this.signers.alice.address, ); - expect(decryptedValue).to.equal(184467440737095500228978978978978970980978908978978907890778907089780970897890n); + expect(decryptedValue).to.equal( + BigInt( + '0xd179e0cc7e816dc944582ed4f5652f5951900098fc2e0a15a7ea4dc8cfa4e3b6c54beea5ee95e56b728762f659347ce1d4aa1b05fcc513e7819123de6e2870c7e83bb764508e22d7c3ab8a5aee6bdfb26355ef0d3f1977d651b83bf5f78634fa360aa14debdc3daa6a587b5c2fb1710ab4d6677e62a8577f2d9fecc190ad8b11c9f0a5ec3138b27da1f055437af8c90a9495dad230', + ), + ); }); }); diff --git a/test/tfheOperations/manual.ts b/test/tfheOperations/manual.ts index ae0fe362..d4a56b8e 100644 --- a/test/tfheOperations/manual.ts +++ b/test/tfheOperations/manual.ts @@ -9,8 +9,13 @@ import { decrypt16, decrypt32, decrypt64, + decrypt128, + decrypt256, decryptAddress, decryptBool, + decryptEbytes64, + decryptEbytes128, + decryptEbytes256, } from '../instance'; import { getSigners, initSigners } from '../signers'; import { bigIntToBytes256 } from '../utils'; @@ -72,6 +77,68 @@ describe('TFHE manual operations', function () { 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()); + 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()); + expect(res2).to.equal(true); + }); + + it('Select ebytes64', async function () { + const tx = await this.contract.test_select_ebytes64( + true, + '0x6798aa6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb', + '0x11', + ); + await tx.wait(); + const res = await decryptEbytes64(await this.contract.resB64()); + 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()); + expect(res2).to.equal(ethers.toBeHex(BigInt('0xaaaaaaaa'), 64)); + }); + + it('Select ebytes128', async function () { + const tx = await this.contract.test_select_ebytes128( + true, + '0x6798aa6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb', + '0x11', + ); + await tx.wait(); + const res = await decryptEbytes128(await this.contract.resB128()); + 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()); + expect(res2).to.equal(ethers.toBeHex(BigInt('0xaaaaaaaa'), 128)); + }); + + it('Select ebytes256', async function () { + const tx = await this.contract.test_select_ebytes256( + true, + '0x6798aa6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb', + '0x11', + ); + await tx.wait(); + const res = await decryptEbytes256(await this.contract.resB256()); + 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()); + expect(res2).to.equal(ethers.toBeHex(BigInt('0xaaaaaabb'), 256)); + }); + it('Select works for eaddress returning if false', async function () { const input = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address); input.addBool(false); @@ -106,6 +173,120 @@ describe('TFHE manual operations', function () { expect(res).to.equal('0x8ba1f109551bd432803012645ac136ddd64dba72'); }); + 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()); + expect(res).to.equal(true); + const tx2 = await this.contract.eqEbool(false, false); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(true); + const tx3 = await this.contract.eqEbool(false, true); + await tx3.wait(); + const res3 = await decryptBool(await this.contract.resb()); + expect(res3).to.equal(false); + const tx4 = await this.contract.eqEbool(true, false); + await tx4.wait(); + const res4 = await decryptBool(await this.contract.resb()); + 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()); + expect(res).to.equal(true); + const tx2 = await this.contract.eqEboolScalarL(false, true); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(false); + const tx3 = await this.contract.eqEboolScalarL(false, false); + await tx3.wait(); + const res3 = await decryptBool(await this.contract.resb()); + expect(res3).to.equal(true); + const tx4 = await this.contract.eqEboolScalarL(true, false); + await tx4.wait(); + const res4 = await decryptBool(await this.contract.resb()); + 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()); + expect(res).to.equal(true); + const tx2 = await this.contract.eqEboolScalarL(false, true); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(false); + const tx3 = await this.contract.eqEboolScalarL(true, true); + await tx3.wait(); + const res3 = await decryptBool(await this.contract.resb()); + expect(res3).to.equal(true); + const tx4 = await this.contract.eqEboolScalarL(true, false); + await tx4.wait(); + const res4 = await decryptBool(await this.contract.resb()); + 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()); + expect(res).to.equal(false); + const tx2 = await this.contract.neEbool(false, false); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(false); + const tx3 = await this.contract.neEbool(false, true); + await tx3.wait(); + const res3 = await decryptBool(await this.contract.resb()); + expect(res3).to.equal(true); + const tx4 = await this.contract.neEbool(true, false); + await tx4.wait(); + const res4 = await decryptBool(await this.contract.resb()); + 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()); + expect(res).to.equal(false); + const tx2 = await this.contract.neEboolScalarL(false, true); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(true); + const tx3 = await this.contract.neEboolScalarL(false, false); + await tx3.wait(); + const res3 = await decryptBool(await this.contract.resb()); + expect(res3).to.equal(false); + const tx4 = await this.contract.neEboolScalarL(true, false); + await tx4.wait(); + const res4 = await decryptBool(await this.contract.resb()); + 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()); + expect(res).to.equal(false); + const tx2 = await this.contract.neEboolScalarL(false, true); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(true); + const tx3 = await this.contract.neEboolScalarL(true, true); + await tx3.wait(); + const res3 = await decryptBool(await this.contract.resb()); + expect(res3).to.equal(false); + const tx4 = await this.contract.neEboolScalarL(true, false); + await tx4.wait(); + const res4 = await decryptBool(await this.contract.resb()); + expect(res4).to.equal(true); + }); + it('eaddress eq eaddress,eaddress true', async function () { const input = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address); input.addAddress('0x8ba1f109551bd432803012645ac136ddd64dba72'); @@ -324,6 +505,48 @@ describe('TFHE manual operations', function () { 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()); + 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()); + 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()); + 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()); + 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()); + 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(); @@ -404,6 +627,138 @@ describe('TFHE manual operations', function () { 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()); + 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()); + 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()); + 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()); + 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()); + 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()); + 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()); + 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()); + 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()); + 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()); + 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()); + 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()); + 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()); + 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()); + 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()); + 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()); + 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()); + 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()); + 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()); + 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()); + 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()); + 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()); + 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()); + 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()); + expect(res4).to.equal(true); + }); + it('eq ebytes256,ebytes256 true', async function () { const inputAliceA = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address); inputAliceA.addBytes256(bigIntToBytes256(18446744073709550022n)); @@ -491,4 +846,291 @@ describe('TFHE manual operations', function () { const decRes = await decryptBool(res); expect(decRes).to.equal(false); }); + + it('ebytes64 eq ebytes64', async function () { + const tx = await this.contract.eqEbytes64( + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb', + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb', + ); + await tx.wait(); + const res = await decryptBool(await this.contract.resb()); + expect(res).to.equal(true); + const tx2 = await this.contract.eqEbytes64('0x1100', '0x0011'); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(false); + }); + + it('ebytes64 eq ebytes64 - scalarL', async function () { + const tx = await this.contract.eqEbytes64ScalarL( + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb', + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa', + ); + await tx.wait(); + const res = await decryptBool(await this.contract.resb()); + expect(res).to.equal(false); + const tx2 = await this.contract.eqEbytes64ScalarL('0x1100', '0x1100'); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(true); + }); + + it('ebytes64 eq ebytes64 - scalarR', async function () { + const tx = await this.contract.eqEbytes64ScalarR( + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb', + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa', + ); + await tx.wait(); + const res = await decryptBool(await this.contract.resb()); + expect(res).to.equal(false); + const tx2 = await this.contract.eqEbytes64ScalarR('0x1100', '0x1100'); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(true); + }); + + it('ebytes64 ne ebytes64', async function () { + const tx = await this.contract.neEbytes64( + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb', + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb', + ); + await tx.wait(); + const res = await decryptBool(await this.contract.resb()); + expect(res).to.equal(false); + const tx2 = await this.contract.neEbytes64('0x1100', '0x0011'); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(true); + }); + + it('ebytes64 ne ebytes64 - scalarL', async function () { + const tx = await this.contract.neEbytes64ScalarL( + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb', + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa', + ); + await tx.wait(); + const res = await decryptBool(await this.contract.resb()); + expect(res).to.equal(true); + const tx2 = await this.contract.neEbytes64ScalarL('0x1100', '0x1100'); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(false); + }); + + it('ebytes64 ne ebytes64 - scalarR', async function () { + const tx = await this.contract.neEbytes64ScalarR( + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb', + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa', + ); + await tx.wait(); + const res = await decryptBool(await this.contract.resb()); + expect(res).to.equal(true); + const tx2 = await this.contract.neEbytes64ScalarR('0x1100', '0x1100'); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(false); + }); + + it('ebytes128 eq ebytes128', async function () { + const tx = await this.contract.eqEbytes128( + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb73', + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb73', + ); + await tx.wait(); + const res = await decryptBool(await this.contract.resb()); + expect(res).to.equal(true); + const tx2 = await this.contract.eqEbytes128( + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb73', + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb71', + ); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(false); + }); + + it('ebytes128 eq ebytes128 - scalarL', async function () { + const tx = await this.contract.eqEbytes128ScalarL( + '0x6d4b2086ba8e3d2104fbf4a8dfe9679d6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb', + '0x6d4b2086ba8e3d2104fbf4a8dfe9679d6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa', + ); + await tx.wait(); + const res = await decryptBool(await this.contract.resb()); + expect(res).to.equal(false); + const tx2 = await this.contract.eqEbytes128ScalarL('0x1100', '0x1100'); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(true); + }); + + it('ebytes128 eq ebytes128 - scalarR', async function () { + const tx = await this.contract.eqEbytes128ScalarR( + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb', + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa', + ); + await tx.wait(); + const res = await decryptBool(await this.contract.resb()); + expect(res).to.equal(false); + const tx2 = await this.contract.eqEbytes128ScalarR('0x1100', '0x1100'); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(true); + }); + + it('ebytes128 ne ebytes128', async function () { + const tx = await this.contract.neEbytes128( + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb73', + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb73', + ); + await tx.wait(); + const res = await decryptBool(await this.contract.resb()); + expect(res).to.equal(false); + const tx2 = await this.contract.neEbytes128( + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb73', + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb71', + ); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(true); + }); + + it('ebytes128 ne ebytes128 - scalarL', async function () { + const tx = await this.contract.neEbytes128ScalarL( + '0x6d4b2086ba8e3d2104fbf4a8dfe9679d6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb', + '0x6d4b2086ba8e3d2104fbf4a8dfe9679d6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa', + ); + await tx.wait(); + const res = await decryptBool(await this.contract.resb()); + expect(res).to.equal(true); + const tx2 = await this.contract.neEbytes128ScalarL('0x1100', '0x1100'); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(false); + }); + + it('ebytes128 ne ebytes128 - scalarR', async function () { + const tx = await this.contract.neEbytes128ScalarR( + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb', + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa', + ); + await tx.wait(); + const res = await decryptBool(await this.contract.resb()); + expect(res).to.equal(true); + const tx2 = await this.contract.neEbytes128ScalarR('0x1100', '0x1100'); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(false); + }); + + it('ebytes256 eq ebytes256 - scalarL', async function () { + const tx = await this.contract.eqEbytes256ScalarL( + '0x6d4b2086ba8e3d2104fbf4a8dfe9679d6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb', + '0x6d4b2086ba8e3d2104fbf4a8dfe9679d6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa', + ); + await tx.wait(); + const res = await decryptBool(await this.contract.resb()); + expect(res).to.equal(false); + const tx2 = await this.contract.eqEbytes256ScalarL('0x1100', '0x1100'); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(true); + }); + + it('ebytes256 eq ebytes256 - scalarR', async function () { + const tx = await this.contract.eqEbytes256ScalarR( + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbaa', + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaaaa', + ); + await tx.wait(); + const res = await decryptBool(await this.contract.resb()); + expect(res).to.equal(false); + const tx2 = await this.contract.eqEbytes256ScalarR('0x1100', '0x1100'); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(true); + }); + + it('ebytes256 ne ebytes256 - scalarL', async function () { + const tx = await this.contract.neEbytes256ScalarL( + '0x6d4b2086ba8e3d2104fbf4a8dfe9679d6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb', + '0x6d4b2086ba8e3d2104fbf4a8dfe9679d6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa', + ); + await tx.wait(); + const res = await decryptBool(await this.contract.resb()); + expect(res).to.equal(true); + const tx2 = await this.contract.neEbytes256ScalarL('0x1100', '0x1100'); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(false); + }); + + it('ebytes256 ne ebytes256 - scalarR', async function () { + const tx = await this.contract.neEbytes256ScalarR( + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbaa', + '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaaaa', + ); + await tx.wait(); + const res = await decryptBool(await this.contract.resb()); + expect(res).to.equal(true); + const tx2 = await this.contract.neEbytes256ScalarR('0x1100', '0x1100'); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + 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()); + expect(res).to.equal(false); + const tx2 = await this.contract.neEbool(false, false); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(false); + const tx3 = await this.contract.neEbool(false, true); + await tx3.wait(); + const res3 = await decryptBool(await this.contract.resb()); + expect(res3).to.equal(true); + const tx4 = await this.contract.neEbool(true, false); + await tx4.wait(); + const res4 = await decryptBool(await this.contract.resb()); + 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()); + expect(res).to.equal(false); + const tx2 = await this.contract.neEboolScalarL(false, true); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(true); + const tx3 = await this.contract.neEboolScalarL(false, false); + await tx3.wait(); + const res3 = await decryptBool(await this.contract.resb()); + expect(res3).to.equal(false); + const tx4 = await this.contract.neEboolScalarL(true, false); + await tx4.wait(); + const res4 = await decryptBool(await this.contract.resb()); + 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()); + expect(res).to.equal(false); + const tx2 = await this.contract.neEboolScalarL(false, true); + await tx2.wait(); + const res2 = await decryptBool(await this.contract.resb()); + expect(res2).to.equal(true); + const tx3 = await this.contract.neEboolScalarL(true, true); + await tx3.wait(); + const res3 = await decryptBool(await this.contract.resb()); + expect(res3).to.equal(false); + const tx4 = await this.contract.neEboolScalarL(true, false); + await tx4.wait(); + const res4 = await decryptBool(await this.contract.resb()); + expect(res4).to.equal(true); + }); }); diff --git a/test/tfheOperations/tfheOperations1.ts b/test/tfheOperations/tfheOperations1.ts index ecd18ae7..82012291 100644 --- a/test/tfheOperations/tfheOperations1.ts +++ b/test/tfheOperations/tfheOperations1.ts @@ -7,7 +7,22 @@ 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 { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance'; +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 { @@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise { 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); @@ -105,14 +175,34 @@ describe('TFHE operations 1', function () { 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 (3, 2)', async function () { + 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(3n); input.add4(2n); + input.add4(7n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.add_euint4_euint4( encryptedAmount.handles[0], @@ -121,7 +211,7 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(5n); + expect(res).to.equal(9n); }); it('test operator "add" overload (euint4, euint4) => euint4 test 2 (4, 8)', async function () { @@ -199,10 +289,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(4n); }); - it('test operator "mul" overload (euint4, euint4) => euint4 test 1 (3, 3)', async function () { + 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(3n); - input.add4(3n); + input.add4(1n); + input.add4(7n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.mul_euint4_euint4( encryptedAmount.handles[0], @@ -211,7 +301,7 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(9n); + expect(res).to.equal(7n); }); it('test operator "mul" overload (euint4, euint4) => euint4 test 2 (3, 5)', async function () { @@ -259,10 +349,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(15n); }); - it('test operator "and" overload (euint4, euint4) => euint4 test 1 (8, 8)', async function () { + 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(8n); - input.add4(8n); + input.add4(14n); + input.add4(7n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.and_euint4_euint4( encryptedAmount.handles[0], @@ -271,7 +361,7 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(8n); + expect(res).to.equal(6n); }); it('test operator "and" overload (euint4, euint4) => euint4 test 2 (4, 8)', async function () { @@ -319,10 +409,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(0n); }); - it('test operator "or" overload (euint4, euint4) => euint4 test 1 (7, 10)', async function () { + 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(7n); input.add4(10n); + input.add4(6n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.or_euint4_euint4( encryptedAmount.handles[0], @@ -331,7 +421,7 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(15n); + expect(res).to.equal(14n); }); it('test operator "or" overload (euint4, euint4) => euint4 test 2 (4, 8)', async function () { @@ -379,10 +469,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(12n); }); - it('test operator "xor" overload (euint4, euint4) => euint4 test 1 (13, 14)', async function () { + 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(13n); - input.add4(14n); + input.add4(9n); + input.add4(4n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.xor_euint4_euint4( encryptedAmount.handles[0], @@ -391,13 +481,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(3n); + expect(res).to.equal(13n); }); - it('test operator "xor" overload (euint4, euint4) => euint4 test 2 (9, 13)', async function () { + 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(9n); - input.add4(13n); + input.add4(4n); + input.add4(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.xor_euint4_euint4( encryptedAmount.handles[0], @@ -406,13 +496,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(4n); + expect(res).to.equal(12n); }); - it('test operator "xor" overload (euint4, euint4) => euint4 test 3 (13, 13)', async function () { + 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(13n); - input.add4(13n); + input.add4(8n); + input.add4(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.xor_euint4_euint4( encryptedAmount.handles[0], @@ -424,10 +514,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(0n); }); - it('test operator "xor" overload (euint4, euint4) => euint4 test 4 (13, 9)', async function () { + 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(13n); - input.add4(9n); + input.add4(8n); + input.add4(4n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.xor_euint4_euint4( encryptedAmount.handles[0], @@ -436,13 +526,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(4n); + expect(res).to.equal(12n); }); - it('test operator "eq" overload (euint4, euint4) => ebool test 1 (6, 11)', async function () { + 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(6n); - input.add4(11n); + input.add4(2n); + input.add4(2n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.eq_euint4_euint4( encryptedAmount.handles[0], @@ -451,7 +541,7 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + expect(res).to.equal(true); }); it('test operator "eq" overload (euint4, euint4) => ebool test 2 (4, 8)', async function () { @@ -499,10 +589,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "ne" overload (euint4, euint4) => ebool test 1 (11, 4)', async function () { + 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(11n); - input.add4(4n); + input.add4(1n); + input.add4(9n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.ne_euint4_euint4( encryptedAmount.handles[0], @@ -559,10 +649,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "ge" overload (euint4, euint4) => ebool test 1 (9, 9)', async function () { + 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(9n); - input.add4(9n); + input.add4(6n); + input.add4(11n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.ge_euint4_euint4( encryptedAmount.handles[0], @@ -571,13 +661,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + expect(res).to.equal(false); }); - it('test operator "ge" overload (euint4, euint4) => ebool test 2 (5, 9)', async function () { + 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(5n); - input.add4(9n); + input.add4(4n); + input.add4(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.ge_euint4_euint4( encryptedAmount.handles[0], @@ -589,10 +679,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "ge" overload (euint4, euint4) => ebool test 3 (9, 9)', async function () { + 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(9n); - input.add4(9n); + input.add4(8n); + input.add4(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.ge_euint4_euint4( encryptedAmount.handles[0], @@ -604,10 +694,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "ge" overload (euint4, euint4) => ebool test 4 (9, 5)', async function () { + 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(9n); - input.add4(5n); + input.add4(8n); + input.add4(4n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.ge_euint4_euint4( encryptedAmount.handles[0], @@ -619,9 +709,9 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "gt" overload (euint4, euint4) => ebool test 1 (4, 14)', async function () { + 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(4n); + input.add4(12n); input.add4(14n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.gt_euint4_euint4( @@ -634,10 +724,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "gt" overload (euint4, euint4) => ebool test 2 (4, 8)', async function () { + 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(4n); input.add4(8n); + input.add4(12n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.gt_euint4_euint4( encryptedAmount.handles[0], @@ -649,10 +739,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "gt" overload (euint4, euint4) => ebool test 3 (8, 8)', async function () { + 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(8n); - input.add4(8n); + input.add4(12n); + input.add4(12n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.gt_euint4_euint4( encryptedAmount.handles[0], @@ -664,10 +754,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "gt" overload (euint4, euint4) => ebool test 4 (8, 4)', async function () { + 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); - input.add4(4n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.gt_euint4_euint4( encryptedAmount.handles[0], @@ -679,10 +769,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "le" overload (euint4, euint4) => ebool test 1 (10, 9)', async function () { + 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(10n); - input.add4(9n); + input.add4(6n); + input.add4(6n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.le_euint4_euint4( encryptedAmount.handles[0], @@ -691,13 +781,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + expect(res).to.equal(true); }); - it('test operator "le" overload (euint4, euint4) => ebool test 2 (5, 9)', async function () { + 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(5n); - input.add4(9n); + input.add4(4n); + input.add4(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.le_euint4_euint4( encryptedAmount.handles[0], @@ -709,10 +799,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "le" overload (euint4, euint4) => ebool test 3 (9, 9)', async function () { + 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(9n); - input.add4(9n); + input.add4(8n); + input.add4(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.le_euint4_euint4( encryptedAmount.handles[0], @@ -724,10 +814,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "le" overload (euint4, euint4) => ebool test 4 (9, 5)', async function () { + 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(9n); - input.add4(5n); + input.add4(8n); + input.add4(4n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.le_euint4_euint4( encryptedAmount.handles[0], @@ -739,10 +829,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "lt" overload (euint4, euint4) => ebool test 1 (4, 10)', async function () { + 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(4n); - input.add4(10n); + input.add4(2n); + input.add4(6n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.lt_euint4_euint4( encryptedAmount.handles[0], @@ -799,10 +889,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "min" overload (euint4, euint4) => euint4 test 1 (7, 10)', async function () { + 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(7n); - input.add4(10n); + input.add4(14n); + input.add4(13n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.min_euint4_euint4( encryptedAmount.handles[0], @@ -811,13 +901,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(7n); + expect(res).to.equal(13n); }); - it('test operator "min" overload (euint4, euint4) => euint4 test 2 (4, 8)', async function () { + 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(4n); - input.add4(8n); + input.add4(9n); + input.add4(13n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.min_euint4_euint4( encryptedAmount.handles[0], @@ -826,13 +916,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(4n); + expect(res).to.equal(9n); }); - it('test operator "min" overload (euint4, euint4) => euint4 test 3 (8, 8)', async function () { + 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(8n); - input.add4(8n); + input.add4(13n); + input.add4(13n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.min_euint4_euint4( encryptedAmount.handles[0], @@ -841,13 +931,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(8n); + expect(res).to.equal(13n); }); - it('test operator "min" overload (euint4, euint4) => euint4 test 4 (8, 4)', async function () { + 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(8n); - input.add4(4n); + input.add4(13n); + input.add4(9n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.min_euint4_euint4( encryptedAmount.handles[0], @@ -856,13 +946,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(4n); + expect(res).to.equal(9n); }); - it('test operator "max" overload (euint4, euint4) => euint4 test 1 (3, 1)', async function () { + 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(3n); - input.add4(1n); + input.add4(9n); + input.add4(13n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.max_euint4_euint4( encryptedAmount.handles[0], @@ -871,13 +961,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(3n); + expect(res).to.equal(13n); }); - it('test operator "max" overload (euint4, euint4) => euint4 test 2 (4, 8)', async function () { + 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(4n); - input.add4(8n); + input.add4(5n); + input.add4(9n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.max_euint4_euint4( encryptedAmount.handles[0], @@ -886,13 +976,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(8n); + expect(res).to.equal(9n); }); - it('test operator "max" overload (euint4, euint4) => euint4 test 3 (8, 8)', async function () { + 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(8n); - input.add4(8n); + input.add4(9n); + input.add4(9n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.max_euint4_euint4( encryptedAmount.handles[0], @@ -901,13 +991,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(8n); + expect(res).to.equal(9n); }); - it('test operator "max" overload (euint4, euint4) => euint4 test 4 (8, 4)', async function () { + 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(8n); - input.add4(4n); + input.add4(9n); + input.add4(5n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.max_euint4_euint4( encryptedAmount.handles[0], @@ -916,13 +1006,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(8n); + expect(res).to.equal(9n); }); - it('test operator "add" overload (euint4, euint8) => euint8 test 1 (1, 9)', async function () { + 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(1n); - input.add8(9n); + input.add4(2n); + input.add8(10n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.add_euint4_euint8( encryptedAmount.handles[0], @@ -931,13 +1021,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(10n); + expect(res).to.equal(12n); }); - it('test operator "add" overload (euint4, euint8) => euint8 test 2 (4, 8)', async function () { + 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(4n); - input.add8(8n); + input.add4(5n); + input.add8(9n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.add_euint4_euint8( encryptedAmount.handles[0], @@ -946,7 +1036,7 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(12n); + expect(res).to.equal(14n); }); it('test operator "add" overload (euint4, euint8) => euint8 test 3 (5, 5)', async function () { @@ -964,10 +1054,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(10n); }); - it('test operator "add" overload (euint4, euint8) => euint8 test 4 (8, 4)', async function () { + 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(8n); - input.add8(4n); + input.add4(9n); + input.add8(5n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.add_euint4_euint8( encryptedAmount.handles[0], @@ -976,13 +1066,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(12n); + expect(res).to.equal(14n); }); - it('test operator "sub" overload (euint4, euint8) => euint8 test 1 (10, 10)', async function () { + 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(10n); - input.add8(10n); + input.add4(8n); + input.add8(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.sub_euint4_euint8( encryptedAmount.handles[0], @@ -994,10 +1084,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(0n); }); - it('test operator "sub" overload (euint4, euint8) => euint8 test 2 (10, 6)', async function () { + 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(10n); - input.add8(6n); + input.add4(8n); + input.add8(4n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.sub_euint4_euint8( encryptedAmount.handles[0], @@ -1024,10 +1114,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(10n); }); - it('test operator "mul" overload (euint4, euint8) => euint8 test 2 (3, 3)', async function () { + 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(3n); + input.add8(5n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.mul_euint4_euint8( encryptedAmount.handles[0], @@ -1036,7 +1126,7 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(9n); + expect(res).to.equal(15n); }); it('test operator "mul" overload (euint4, euint8) => euint8 test 3 (3, 3)', async function () { @@ -1054,9 +1144,9 @@ describe('TFHE operations 1', function () { expect(res).to.equal(9n); }); - it('test operator "mul" overload (euint4, euint8) => euint8 test 4 (3, 3)', async function () { + 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(3n); + input.add4(5n); input.add8(3n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.mul_euint4_euint8( @@ -1066,13 +1156,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(9n); + expect(res).to.equal(15n); }); - it('test operator "and" overload (euint4, euint8) => euint8 test 1 (10, 6)', async function () { + 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(6n); + input.add8(116n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.and_euint4_euint8( encryptedAmount.handles[0], @@ -1081,13 +1171,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(2n); + expect(res).to.equal(0n); }); - it('test operator "and" overload (euint4, euint8) => euint8 test 2 (4, 8)', async function () { + 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(4n); - input.add8(8n); + input.add4(6n); + input.add8(10n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.and_euint4_euint8( encryptedAmount.handles[0], @@ -1096,13 +1186,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(0n); + expect(res).to.equal(2n); }); - it('test operator "and" overload (euint4, euint8) => euint8 test 3 (8, 8)', async function () { + 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(8n); - input.add8(8n); + input.add4(10n); + input.add8(10n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.and_euint4_euint8( encryptedAmount.handles[0], @@ -1111,13 +1201,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(8n); + expect(res).to.equal(10n); }); - it('test operator "and" overload (euint4, euint8) => euint8 test 4 (8, 4)', async function () { + 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(8n); - input.add8(4n); + input.add4(10n); + input.add8(6n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.and_euint4_euint8( encryptedAmount.handles[0], @@ -1126,13 +1216,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(0n); + expect(res).to.equal(2n); }); - it('test operator "or" overload (euint4, euint8) => euint8 test 1 (12, 18)', async function () { + 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(12n); - input.add8(18n); + input.add4(8n); + input.add8(185n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.or_euint4_euint8( encryptedAmount.handles[0], @@ -1141,13 +1231,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(30n); + expect(res).to.equal(185n); }); - it('test operator "or" overload (euint4, euint8) => euint8 test 2 (8, 12)', async function () { + 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(8n); - input.add8(12n); + input.add4(4n); + input.add8(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.or_euint4_euint8( encryptedAmount.handles[0], @@ -1159,10 +1249,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(12n); }); - it('test operator "or" overload (euint4, euint8) => euint8 test 3 (12, 12)', async function () { + 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(12n); - input.add8(12n); + input.add4(8n); + input.add8(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.or_euint4_euint8( encryptedAmount.handles[0], @@ -1171,13 +1261,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(12n); + expect(res).to.equal(8n); }); - it('test operator "or" overload (euint4, euint8) => euint8 test 4 (12, 8)', async function () { + 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(12n); - input.add8(8n); + input.add4(8n); + input.add8(4n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.or_euint4_euint8( encryptedAmount.handles[0], @@ -1189,10 +1279,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(12n); }); - it('test operator "xor" overload (euint4, euint8) => euint8 test 1 (5, 19)', async function () { + 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(5n); - input.add8(19n); + input.add4(10n); + input.add8(103n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.xor_euint4_euint8( encryptedAmount.handles[0], @@ -1201,13 +1291,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(22n); + expect(res).to.equal(109n); }); - it('test operator "xor" overload (euint4, euint8) => euint8 test 2 (4, 8)', async function () { + 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(4n); - input.add8(8n); + input.add4(6n); + input.add8(10n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.xor_euint4_euint8( encryptedAmount.handles[0], @@ -1219,10 +1309,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(12n); }); - it('test operator "xor" overload (euint4, euint8) => euint8 test 3 (8, 8)', async function () { + 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(8n); - input.add8(8n); + input.add4(10n); + input.add8(10n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.xor_euint4_euint8( encryptedAmount.handles[0], @@ -1234,10 +1324,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(0n); }); - it('test operator "xor" overload (euint4, euint8) => euint8 test 4 (8, 4)', async function () { + 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(8n); - input.add8(4n); + input.add4(10n); + input.add8(6n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.xor_euint4_euint8( encryptedAmount.handles[0], @@ -1249,10 +1339,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(12n); }); - it('test operator "eq" overload (euint4, euint8) => ebool test 1 (4, 5)', async function () { + 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(4n); - input.add8(5n); + input.add4(14n); + input.add8(3n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.eq_euint4_euint8( encryptedAmount.handles[0], @@ -1309,10 +1399,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "ne" overload (euint4, euint8) => ebool test 1 (4, 62)', async function () { + 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(4n); - input.add8(62n); + input.add4(8n); + input.add8(128n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.ne_euint4_euint8( encryptedAmount.handles[0], @@ -1369,10 +1459,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "ge" overload (euint4, euint8) => ebool test 1 (13, 91)', async function () { + 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(13n); - input.add8(91n); + input.add4(3n); + input.add8(79n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.ge_euint4_euint8( encryptedAmount.handles[0], @@ -1384,10 +1474,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "ge" overload (euint4, euint8) => ebool test 2 (9, 13)', async function () { + 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(9n); - input.add8(13n); + input.add4(4n); + input.add8(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.ge_euint4_euint8( encryptedAmount.handles[0], @@ -1399,10 +1489,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "ge" overload (euint4, euint8) => ebool test 3 (13, 13)', async function () { + 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(13n); - input.add8(13n); + input.add4(8n); + input.add8(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.ge_euint4_euint8( encryptedAmount.handles[0], @@ -1414,10 +1504,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "ge" overload (euint4, euint8) => ebool test 4 (13, 9)', async function () { + 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(13n); - input.add8(9n); + input.add4(8n); + input.add8(4n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.ge_euint4_euint8( encryptedAmount.handles[0], @@ -1429,10 +1519,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "gt" overload (euint4, euint8) => ebool test 1 (14, 199)', async function () { + 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(14n); - input.add8(199n); + input.add4(1n); + input.add8(59n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.gt_euint4_euint8( encryptedAmount.handles[0], @@ -1444,10 +1534,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "gt" overload (euint4, euint8) => ebool test 2 (10, 14)', async function () { + 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(10n); - input.add8(14n); + input.add4(4n); + input.add8(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.gt_euint4_euint8( encryptedAmount.handles[0], @@ -1459,10 +1549,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "gt" overload (euint4, euint8) => ebool test 3 (14, 14)', async function () { + 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(14n); - input.add8(14n); + input.add4(8n); + input.add8(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.gt_euint4_euint8( encryptedAmount.handles[0], @@ -1474,10 +1564,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "gt" overload (euint4, euint8) => ebool test 4 (14, 10)', async function () { + 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(14n); - input.add8(10n); + input.add4(8n); + input.add8(4n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.gt_euint4_euint8( encryptedAmount.handles[0], @@ -1489,10 +1579,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "le" overload (euint4, euint8) => ebool test 1 (13, 94)', async function () { + 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(13n); - input.add8(94n); + input.add4(1n); + input.add8(98n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.le_euint4_euint8( encryptedAmount.handles[0], @@ -1504,10 +1594,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "le" overload (euint4, euint8) => ebool test 2 (9, 13)', async function () { + 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(9n); - input.add8(13n); + input.add4(4n); + input.add8(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.le_euint4_euint8( encryptedAmount.handles[0], @@ -1519,10 +1609,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "le" overload (euint4, euint8) => ebool test 3 (13, 13)', async function () { + 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(13n); - input.add8(13n); + input.add4(8n); + input.add8(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.le_euint4_euint8( encryptedAmount.handles[0], @@ -1534,10 +1624,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "le" overload (euint4, euint8) => ebool test 4 (13, 9)', async function () { + 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(13n); - input.add8(9n); + input.add4(8n); + input.add8(4n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.le_euint4_euint8( encryptedAmount.handles[0], @@ -1549,10 +1639,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "lt" overload (euint4, euint8) => ebool test 1 (13, 128)', async function () { + 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(13n); - input.add8(128n); + input.add4(12n); + input.add8(31n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.lt_euint4_euint8( encryptedAmount.handles[0], @@ -1564,10 +1654,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "lt" overload (euint4, euint8) => ebool test 2 (9, 13)', async function () { + 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(9n); - input.add8(13n); + input.add4(8n); + input.add8(12n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.lt_euint4_euint8( encryptedAmount.handles[0], @@ -1579,10 +1669,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "lt" overload (euint4, euint8) => ebool test 3 (13, 13)', async function () { + 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(13n); - input.add8(13n); + input.add4(12n); + input.add8(12n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.lt_euint4_euint8( encryptedAmount.handles[0], @@ -1594,10 +1684,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "lt" overload (euint4, euint8) => ebool test 4 (13, 9)', async function () { + 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(13n); - input.add8(9n); + input.add4(12n); + input.add8(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.lt_euint4_euint8( encryptedAmount.handles[0], @@ -1609,10 +1699,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "min" overload (euint4, euint8) => euint8 test 1 (8, 124)', async function () { + 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(8n); - input.add8(124n); + input.add4(5n); + input.add8(254n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.min_euint4_euint8( encryptedAmount.handles[0], @@ -1621,7 +1711,7 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(8n); + expect(res).to.equal(5n); }); it('test operator "min" overload (euint4, euint8) => euint8 test 2 (4, 8)', async function () { @@ -1669,10 +1759,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(4n); }); - it('test operator "max" overload (euint4, euint8) => euint8 test 1 (1, 157)', async function () { + 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(1n); - input.add8(157n); + input.add4(14n); + input.add8(226n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.max_euint4_euint8( encryptedAmount.handles[0], @@ -1681,13 +1771,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(157n); + expect(res).to.equal(226n); }); - it('test operator "max" overload (euint4, euint8) => euint8 test 2 (4, 8)', async function () { + 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(4n); - input.add8(8n); + input.add4(10n); + input.add8(14n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.max_euint4_euint8( encryptedAmount.handles[0], @@ -1696,13 +1786,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(8n); + expect(res).to.equal(14n); }); - it('test operator "max" overload (euint4, euint8) => euint8 test 3 (8, 8)', async function () { + 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(8n); - input.add8(8n); + input.add4(14n); + input.add8(14n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.max_euint4_euint8( encryptedAmount.handles[0], @@ -1711,13 +1801,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(8n); + expect(res).to.equal(14n); }); - it('test operator "max" overload (euint4, euint8) => euint8 test 4 (8, 4)', async function () { + 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(8n); - input.add8(4n); + input.add4(14n); + input.add8(10n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.max_euint4_euint8( encryptedAmount.handles[0], @@ -1726,13 +1816,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(8n); + expect(res).to.equal(14n); }); - it('test operator "add" overload (euint4, euint16) => euint16 test 1 (2, 13)', async function () { + 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(13n); + input.add16(9n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.add_euint4_euint16( encryptedAmount.handles[0], @@ -1741,12 +1831,12 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(15n); + expect(res).to.equal(11n); }); - it('test operator "add" overload (euint4, euint16) => euint16 test 2 (4, 8)', async function () { + 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(4n); + input.add4(6n); input.add16(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.add_euint4_euint16( @@ -1756,7 +1846,7 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(12n); + expect(res).to.equal(14n); }); it('test operator "add" overload (euint4, euint16) => euint16 test 3 (5, 5)', async function () { @@ -1774,10 +1864,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(10n); }); - it('test operator "add" overload (euint4, euint16) => euint16 test 4 (8, 4)', async function () { + 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(4n); + input.add16(6n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.add_euint4_euint16( encryptedAmount.handles[0], @@ -1786,13 +1876,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(12n); + expect(res).to.equal(14n); }); - it('test operator "sub" overload (euint4, euint16) => euint16 test 1 (11, 11)', async function () { + 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(11n); - input.add16(11n); + input.add4(13n); + input.add16(13n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.sub_euint4_euint16( encryptedAmount.handles[0], @@ -1804,10 +1894,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(0n); }); - it('test operator "sub" overload (euint4, euint16) => euint16 test 2 (11, 7)', async function () { + 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(11n); - input.add16(7n); + input.add4(13n); + input.add16(9n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.sub_euint4_euint16( encryptedAmount.handles[0], @@ -1819,10 +1909,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(4n); }); - it('test operator "mul" overload (euint4, euint16) => euint16 test 1 (2, 5)', async function () { + 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(5n); + input.add16(6n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.mul_euint4_euint16( encryptedAmount.handles[0], @@ -1831,7 +1921,7 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(10n); + expect(res).to.equal(12n); }); it('test operator "mul" overload (euint4, euint16) => euint16 test 2 (3, 5)', async function () { @@ -1879,10 +1969,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(15n); }); - it('test operator "and" overload (euint4, euint16) => euint16 test 1 (10, 28165)', async function () { + 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(10n); - input.add16(28165n); + input.add4(3n); + input.add16(65312n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.and_euint4_euint16( encryptedAmount.handles[0], @@ -1894,10 +1984,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(0n); }); - it('test operator "and" overload (euint4, euint16) => euint16 test 2 (6, 10)', async function () { + 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(6n); - input.add16(10n); + input.add4(4n); + input.add16(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.and_euint4_euint16( encryptedAmount.handles[0], @@ -1906,13 +1996,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(2n); + expect(res).to.equal(0n); }); - it('test operator "and" overload (euint4, euint16) => euint16 test 3 (10, 10)', async function () { + 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(10n); - input.add16(10n); + input.add4(8n); + input.add16(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.and_euint4_euint16( encryptedAmount.handles[0], @@ -1921,13 +2011,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(10n); + expect(res).to.equal(8n); }); - it('test operator "and" overload (euint4, euint16) => euint16 test 4 (10, 6)', async function () { + 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(10n); - input.add16(6n); + input.add4(8n); + input.add16(4n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.and_euint4_euint16( encryptedAmount.handles[0], @@ -1936,13 +2026,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(2n); + expect(res).to.equal(0n); }); - it('test operator "or" overload (euint4, euint16) => euint16 test 1 (12, 197)', async function () { + 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(12n); - input.add16(197n); + input.add4(9n); + input.add16(28733n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.or_euint4_euint16( encryptedAmount.handles[0], @@ -1951,13 +2041,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(205n); + expect(res).to.equal(28733n); }); - it('test operator "or" overload (euint4, euint16) => euint16 test 2 (8, 12)', async function () { + 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(8n); - input.add16(12n); + input.add4(5n); + input.add16(9n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.or_euint4_euint16( encryptedAmount.handles[0], @@ -1966,13 +2056,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(12n); + expect(res).to.equal(13n); }); - it('test operator "or" overload (euint4, euint16) => euint16 test 3 (12, 12)', async function () { + 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(12n); - input.add16(12n); + input.add4(9n); + input.add16(9n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.or_euint4_euint16( encryptedAmount.handles[0], @@ -1981,13 +2071,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(12n); + expect(res).to.equal(9n); }); - it('test operator "or" overload (euint4, euint16) => euint16 test 4 (12, 8)', async function () { + 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(12n); - input.add16(8n); + input.add4(9n); + input.add16(5n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.or_euint4_euint16( encryptedAmount.handles[0], @@ -1996,13 +2086,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(12n); + expect(res).to.equal(13n); }); - it('test operator "xor" overload (euint4, euint16) => euint16 test 1 (10, 13907)', async function () { + 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(10n); - input.add16(13907n); + input.add4(14n); + input.add16(11463n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.xor_euint4_euint16( encryptedAmount.handles[0], @@ -2011,13 +2101,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(13913n); + expect(res).to.equal(11465n); }); - it('test operator "xor" overload (euint4, euint16) => euint16 test 2 (6, 10)', async function () { + 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(6n); - input.add16(10n); + input.add4(10n); + input.add16(14n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.xor_euint4_euint16( encryptedAmount.handles[0], @@ -2026,13 +2116,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(12n); + expect(res).to.equal(4n); }); - it('test operator "xor" overload (euint4, euint16) => euint16 test 3 (10, 10)', async function () { + 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(10n); - input.add16(10n); + input.add4(14n); + input.add16(14n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.xor_euint4_euint16( encryptedAmount.handles[0], @@ -2044,10 +2134,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(0n); }); - it('test operator "xor" overload (euint4, euint16) => euint16 test 4 (10, 6)', async function () { + 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(10n); - input.add16(6n); + input.add4(14n); + input.add16(10n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.xor_euint4_euint16( encryptedAmount.handles[0], @@ -2056,13 +2146,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(12n); + expect(res).to.equal(4n); }); - it('test operator "eq" overload (euint4, euint16) => ebool test 1 (10, 41899)', async function () { + 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(10n); - input.add16(41899n); + input.add4(11n); + input.add16(40901n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.eq_euint4_euint16( encryptedAmount.handles[0], @@ -2074,10 +2164,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "eq" overload (euint4, euint16) => ebool test 2 (6, 10)', async function () { + 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(6n); - input.add16(10n); + input.add4(7n); + input.add16(11n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.eq_euint4_euint16( encryptedAmount.handles[0], @@ -2089,10 +2179,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "eq" overload (euint4, euint16) => ebool test 3 (10, 10)', async function () { + 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(10n); - input.add16(10n); + input.add4(11n); + input.add16(11n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.eq_euint4_euint16( encryptedAmount.handles[0], @@ -2104,10 +2194,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "eq" overload (euint4, euint16) => ebool test 4 (10, 6)', async function () { + 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(10n); - input.add16(6n); + input.add4(11n); + input.add16(7n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.eq_euint4_euint16( encryptedAmount.handles[0], @@ -2119,10 +2209,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "ne" overload (euint4, euint16) => ebool test 1 (3, 41708)', async function () { + 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(3n); - input.add16(41708n); + input.add4(14n); + input.add16(35568n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.ne_euint4_euint16( encryptedAmount.handles[0], @@ -2134,10 +2224,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "ne" overload (euint4, euint16) => ebool test 2 (4, 8)', async function () { + 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(4n); - input.add16(8n); + input.add4(10n); + input.add16(14n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.ne_euint4_euint16( encryptedAmount.handles[0], @@ -2149,10 +2239,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "ne" overload (euint4, euint16) => ebool test 3 (8, 8)', async function () { + 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(8n); - input.add16(8n); + input.add4(14n); + input.add16(14n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.ne_euint4_euint16( encryptedAmount.handles[0], @@ -2164,10 +2254,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "ne" overload (euint4, euint16) => ebool test 4 (8, 4)', async function () { + 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(8n); - input.add16(4n); + input.add4(14n); + input.add16(10n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.ne_euint4_euint16( encryptedAmount.handles[0], @@ -2179,10 +2269,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "ge" overload (euint4, euint16) => ebool test 1 (5, 34397)', async function () { + 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(5n); - input.add16(34397n); + input.add4(1n); + input.add16(53247n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.ge_euint4_euint16( encryptedAmount.handles[0], @@ -2239,10 +2329,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "gt" overload (euint4, euint16) => ebool test 1 (10, 34348)', async function () { + 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(10n); - input.add16(34348n); + input.add4(13n); + input.add16(43765n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.gt_euint4_euint16( encryptedAmount.handles[0], @@ -2254,10 +2344,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "gt" overload (euint4, euint16) => ebool test 2 (6, 10)', async function () { + 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(6n); - input.add16(10n); + input.add4(9n); + input.add16(13n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.gt_euint4_euint16( encryptedAmount.handles[0], @@ -2269,10 +2359,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "gt" overload (euint4, euint16) => ebool test 3 (10, 10)', async function () { + 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(10n); - input.add16(10n); + input.add4(13n); + input.add16(13n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.gt_euint4_euint16( encryptedAmount.handles[0], @@ -2284,10 +2374,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "gt" overload (euint4, euint16) => ebool test 4 (10, 6)', async function () { + 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(10n); - input.add16(6n); + input.add4(13n); + input.add16(9n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.gt_euint4_euint16( encryptedAmount.handles[0], @@ -2299,10 +2389,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "le" overload (euint4, euint16) => ebool test 1 (3, 38645)', async function () { + 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(3n); - input.add16(38645n); + input.add4(14n); + input.add16(62468n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.le_euint4_euint16( encryptedAmount.handles[0], @@ -2314,10 +2404,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "le" overload (euint4, euint16) => ebool test 2 (4, 8)', async function () { + 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(4n); - input.add16(8n); + input.add4(10n); + input.add16(14n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.le_euint4_euint16( encryptedAmount.handles[0], @@ -2329,10 +2419,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "le" overload (euint4, euint16) => ebool test 3 (8, 8)', async function () { + 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(8n); - input.add16(8n); + input.add4(14n); + input.add16(14n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.le_euint4_euint16( encryptedAmount.handles[0], @@ -2344,10 +2434,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(true); }); - it('test operator "le" overload (euint4, euint16) => ebool test 4 (8, 4)', async function () { + 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(8n); - input.add16(4n); + input.add4(14n); + input.add16(10n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.le_euint4_euint16( encryptedAmount.handles[0], @@ -2359,10 +2449,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "lt" overload (euint4, euint16) => ebool test 1 (10, 15096)', async function () { + 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(15096n); + input.add16(24653n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.lt_euint4_euint16( encryptedAmount.handles[0], @@ -2419,10 +2509,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(false); }); - it('test operator "min" overload (euint4, euint16) => euint16 test 1 (12, 47994)', async function () { + 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(12n); - input.add16(47994n); + input.add4(1n); + input.add16(50108n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.min_euint4_euint16( encryptedAmount.handles[0], @@ -2431,13 +2521,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(12n); + expect(res).to.equal(1n); }); - it('test operator "min" overload (euint4, euint16) => euint16 test 2 (8, 12)', async function () { + 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(8n); - input.add16(12n); + input.add4(4n); + input.add16(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.min_euint4_euint16( encryptedAmount.handles[0], @@ -2446,13 +2536,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(8n); + expect(res).to.equal(4n); }); - it('test operator "min" overload (euint4, euint16) => euint16 test 3 (12, 12)', async function () { + 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(12n); - input.add16(12n); + input.add4(8n); + input.add16(8n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.min_euint4_euint16( encryptedAmount.handles[0], @@ -2461,13 +2551,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(12n); + expect(res).to.equal(8n); }); - it('test operator "min" overload (euint4, euint16) => euint16 test 4 (12, 8)', async function () { + 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(12n); - input.add16(8n); + input.add4(8n); + input.add16(4n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.min_euint4_euint16( encryptedAmount.handles[0], @@ -2476,13 +2566,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(8n); + expect(res).to.equal(4n); }); - it('test operator "max" overload (euint4, euint16) => euint16 test 1 (6, 62382)', async function () { + 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(6n); - input.add16(62382n); + input.add4(14n); + input.add16(33411n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.max_euint4_euint16( encryptedAmount.handles[0], @@ -2491,13 +2581,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(62382n); + expect(res).to.equal(33411n); }); - it('test operator "max" overload (euint4, euint16) => euint16 test 2 (4, 8)', async function () { + 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(4n); - input.add16(8n); + input.add4(10n); + input.add16(14n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.max_euint4_euint16( encryptedAmount.handles[0], @@ -2506,13 +2596,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(8n); + expect(res).to.equal(14n); }); - it('test operator "max" overload (euint4, euint16) => euint16 test 3 (8, 8)', async function () { + 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(8n); - input.add16(8n); + input.add4(14n); + input.add16(14n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.max_euint4_euint16( encryptedAmount.handles[0], @@ -2521,13 +2611,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(8n); + expect(res).to.equal(14n); }); - it('test operator "max" overload (euint4, euint16) => euint16 test 4 (8, 4)', async function () { + 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(8n); - input.add16(4n); + input.add4(14n); + input.add16(10n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.max_euint4_euint16( encryptedAmount.handles[0], @@ -2536,13 +2626,13 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(8n); + expect(res).to.equal(14n); }); - it('test operator "add" overload (euint4, euint32) => euint32 test 1 (2, 8)', async function () { + 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(8n); + input.add32(9n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.add_euint4_euint32( encryptedAmount.handles[0], @@ -2551,13 +2641,28 @@ describe('TFHE operations 1', function () { ); await tx.wait(); const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(10n); + expect(res).to.equal(11n); }); - it('test operator "add" overload (euint4, euint32) => euint32 test 2 (4, 8)', async function () { + 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(8n); + 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], @@ -2569,10 +2674,10 @@ describe('TFHE operations 1', function () { expect(res).to.equal(12n); }); - it('test operator "add" overload (euint4, euint32) => euint32 test 3 (5, 5)', async function () { + 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(5n); - input.add32(5n); + input.add4(6n); + input.add32(4n); const encryptedAmount = await input.encrypt(); const tx = await this.contract1.add_euint4_euint32( encryptedAmount.handles[0], @@ -2584,12 +2689,267 @@ describe('TFHE operations 1', function () { expect(res).to.equal(10n); }); - it('test operator "add" overload (euint4, euint32) => euint32 test 4 (8, 4)', async function () { + 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.add_euint4_euint32( + 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, @@ -2598,4 +2958,1864 @@ describe('TFHE operations 1', function () { 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/test/tfheOperations/tfheOperations10.ts b/test/tfheOperations/tfheOperations10.ts index 963f198c..fa223d0d 100644 --- a/test/tfheOperations/tfheOperations10.ts +++ b/test/tfheOperations/tfheOperations10.ts @@ -7,7 +7,22 @@ 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 { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance'; +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 { @@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise { 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); @@ -105,2497 +175,4647 @@ describe('TFHE operations 10', function () { 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 "lt" overload (euint64, euint4) => ebool test 1 (18443056909764585511, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(18443056909764585511n); - input.add4(1n); + 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.contract4.lt_euint64_euint4( + 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.contract4.resb()); + const res = await decryptBool(await this.contract9.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint64, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(4n); - input.add4(8n); + 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.contract4.lt_euint64_euint4( + 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.contract4.resb()); + const res = await decryptBool(await this.contract9.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (euint64, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(8n); - input.add4(8n); + 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.contract4.lt_euint64_euint4( + 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.contract4.resb()); + const res = await decryptBool(await this.contract9.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint64, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(8n); - input.add4(4n); + 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.contract4.lt_euint64_euint4( + 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.contract4.resb()); + const res = await decryptBool(await this.contract9.resb()); expect(res).to.equal(false); }); - it('test operator "min" overload (euint64, euint4) => euint64 test 1 (18446705827641256747, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(18446705827641256747n); - input.add4(10n); + 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.contract4.min_euint64_euint4( + const tx = await this.contract9.lt_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(10n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "min" overload (euint64, euint4) => euint64 test 2 (6, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(6n); - input.add4(10n); + 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.contract4.min_euint64_euint4( + const tx = await this.contract9.min_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(6n); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463369507025632955721n); }); - it('test operator "min" overload (euint64, euint4) => euint64 test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(10n); - input.add4(10n); + 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.contract4.min_euint64_euint4( + const tx = await this.contract9.min_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(10n); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463369507025632955717n); }); - it('test operator "min" overload (euint64, euint4) => euint64 test 4 (10, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(10n); - input.add4(6n); + 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.contract4.min_euint64_euint4( + const tx = await this.contract9.min_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(6n); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463369507025632955721n); }); - it('test operator "max" overload (euint64, euint4) => euint64 test 1 (18445668950732298129, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(18445668950732298129n); - input.add4(5n); + 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.contract4.max_euint64_euint4( + const tx = await this.contract9.min_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(18445668950732298129n); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463369507025632955717n); }); - it('test operator "max" overload (euint64, euint4) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(4n); - input.add4(8n); + 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.contract4.max_euint64_euint4( + const tx = await this.contract9.max_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(8n); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463374311959896511759n); }); - it('test operator "max" overload (euint64, euint4) => euint64 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(8n); - input.add4(8n); + 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.contract4.max_euint64_euint4( + const tx = await this.contract9.max_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(8n); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463367499312160836031n); }); - it('test operator "max" overload (euint64, euint4) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(8n); - input.add4(4n); + 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.contract4.max_euint64_euint4( + const tx = await this.contract9.max_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(8n); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463367499312160836031n); }); - it('test operator "add" overload (euint64, euint8) => euint64 test 1 (129, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(129n); - input.add8(2n); + 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.contract4.add_euint64_euint8( + const tx = await this.contract9.max_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(131n); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463367499312160836031n); }); - it('test operator "add" overload (euint64, euint8) => euint64 test 2 (89, 91)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(89n); - input.add8(91n); + 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.contract4.add_euint64_euint8( + const tx = await this.contract9.add_euint128_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(180n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(170141183460469231731687303715884105731n); }); - it('test operator "add" overload (euint64, euint8) => euint64 test 3 (91, 91)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(91n); - input.add8(91n); + 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.contract4.add_euint64_euint8( + const tx = await this.contract9.add_euint128_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(182n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(340282366920938463463372015146696703094n); }); - it('test operator "add" overload (euint64, euint8) => euint64 test 4 (91, 89)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(91n); - input.add8(89n); + 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.contract4.add_euint64_euint8( + const tx = await this.contract9.add_euint128_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(180n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(340282366920938463463372015146696703096n); }); - it('test operator "sub" overload (euint64, euint8) => euint64 test 1 (25, 25)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(25n); - input.add8(25n); + 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.contract4.sub_euint64_euint8( + const tx = await this.contract9.sub_euint128_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); + const res = await decrypt256(await this.contract9.res256()); expect(res).to.equal(0n); }); - it('test operator "sub" overload (euint64, euint8) => euint64 test 2 (25, 21)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(25n); - input.add8(21n); + 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.contract4.sub_euint64_euint8( + const tx = await this.contract9.sub_euint128_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); + const res = await decrypt256(await this.contract9.res256()); 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.contract4Address, this.signers.alice.address); - input.add64(65n); - input.add8(2n); + 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.contract4.mul_euint64_euint8( + const tx = await this.contract9.mul_euint128_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(130n); + 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 "mul" overload (euint64, euint8) => euint64 test 2 (9, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(9n); - input.add8(10n); + 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.contract4.mul_euint64_euint8( + const tx = await this.contract9.or_euint128_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(90n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(340282366920938463463366429103695675815n); }); - it('test operator "mul" overload (euint64, euint8) => euint64 test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(10n); - input.add8(10n); + 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.contract4.mul_euint64_euint8( + const tx = await this.contract9.xor_euint128_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(100n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(115792089237316195423570985008687907852929702298719625575994215220393361046008n); }); - it('test operator "mul" overload (euint64, euint8) => euint64 test 4 (10, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(10n); - input.add8(9n); + 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.contract4.mul_euint64_euint8( + const tx = await this.contract9.xor_euint128_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(90n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(28n); }); - it('test operator "and" overload (euint64, euint8) => euint64 test 1 (18441413446268134663, 40)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(18441413446268134663n); - input.add8(40n); + 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.contract4.and_euint64_euint8( + const tx = await this.contract9.xor_euint128_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); + const res = await decrypt256(await this.contract9.res256()); expect(res).to.equal(0n); }); - it('test operator "and" overload (euint64, euint8) => euint64 test 2 (36, 40)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(36n); - input.add8(40n); + 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.contract4.and_euint64_euint8( + const tx = await this.contract9.lt_euint128_uint128( encryptedAmount.handles[0], - encryptedAmount.handles[1], + 340282366920938463463368309276517872425n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(32n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "and" overload (euint64, euint8) => euint64 test 3 (40, 40)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(40n); - input.add8(40n); + 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.contract4.and_euint64_euint8( + const tx = await this.contract9.lt_uint128_euint128( + 340282366920938463463371881592186712743n, encryptedAmount.handles[0], - encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(40n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "and" overload (euint64, euint8) => euint64 test 4 (40, 36)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(40n); - input.add8(36n); + 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.contract4.and_euint64_euint8( + const tx = await this.contract9.lt_uint128_euint128( + 340282366920938463463368309276517872425n, encryptedAmount.handles[0], - encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(32n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "or" overload (euint64, euint8) => euint64 test 1 (18442062213086556497, 168)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(18442062213086556497n); - input.add8(168n); + 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.contract4.or_euint64_euint8( + const tx = await this.contract9.lt_uint128_euint128( + 340282366920938463463368309276517872429n, encryptedAmount.handles[0], - encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(18442062213086556665n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "or" overload (euint64, euint8) => euint64 test 2 (164, 168)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(164n); - input.add8(168n); + 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.contract4.or_euint64_euint8( + const tx = await this.contract9.lt_uint128_euint128( + 340282366920938463463368309276517872429n, encryptedAmount.handles[0], - encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(172n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "or" overload (euint64, euint8) => euint64 test 3 (168, 168)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(168n); - input.add8(168n); + 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.contract4.or_euint64_euint8( + const tx = await this.contract9.min_euint128_uint128( encryptedAmount.handles[0], - encryptedAmount.handles[1], + 340282366920938463463369479362880511843n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(168n); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463369479362880511843n); }); - it('test operator "or" overload (euint64, euint8) => euint64 test 4 (168, 164)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(168n); - input.add8(164n); + 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.contract4.or_euint64_euint8( + const tx = await this.contract9.min_euint128_uint128( encryptedAmount.handles[0], - encryptedAmount.handles[1], + 340282366920938463463369507025632955721n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(172n); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463369507025632955717n); }); - it('test operator "xor" overload (euint64, euint8) => euint64 test 1 (18443626965217997733, 213)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(18443626965217997733n); - input.add8(213n); + 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.contract4.xor_euint64_euint8( + const tx = await this.contract9.min_euint128_uint128( encryptedAmount.handles[0], - encryptedAmount.handles[1], + 340282366920938463463369507025632955721n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(18443626965217997680n); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463369507025632955721n); }); - it('test operator "xor" overload (euint64, euint8) => euint64 test 2 (209, 213)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(209n); - input.add8(213n); + 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.contract4.xor_euint64_euint8( + const tx = await this.contract9.min_euint128_uint128( encryptedAmount.handles[0], - encryptedAmount.handles[1], + 340282366920938463463369507025632955717n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(4n); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463369507025632955717n); }); - it('test operator "xor" overload (euint64, euint8) => euint64 test 3 (213, 213)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(213n); - input.add8(213n); + 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.contract4.xor_euint64_euint8( + const tx = await this.contract9.min_uint128_euint128( + 340282366920938463463367460119738968177n, encryptedAmount.handles[0], - encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(0n); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463367460119738968177n); }); - it('test operator "xor" overload (euint64, euint8) => euint64 test 4 (213, 209)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(213n); - input.add8(209n); + 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.contract4.xor_euint64_euint8( + const tx = await this.contract9.min_uint128_euint128( + 340282366920938463463369507025632955717n, encryptedAmount.handles[0], - encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(4n); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463369507025632955717n); }); - it('test operator "eq" overload (euint64, euint8) => ebool test 1 (18446185668440461367, 98)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(18446185668440461367n); - input.add8(98n); + 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.contract4.eq_euint64_euint8( + const tx = await this.contract9.min_uint128_euint128( + 340282366920938463463369507025632955721n, encryptedAmount.handles[0], - encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463369507025632955721n); }); - it('test operator "eq" overload (euint64, euint8) => ebool test 2 (94, 98)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(94n); - input.add8(98n); + 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.contract4.eq_euint64_euint8( + const tx = await this.contract9.min_uint128_euint128( + 340282366920938463463369507025632955721n, encryptedAmount.handles[0], - encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463369507025632955717n); }); - it('test operator "eq" overload (euint64, euint8) => ebool test 3 (98, 98)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(98n); - input.add8(98n); + 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.contract4.eq_euint64_euint8( + const tx = await this.contract9.max_euint128_uint128( encryptedAmount.handles[0], - encryptedAmount.handles[1], + 340282366920938463463371397781663603615n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463374311959896511759n); }); - it('test operator "eq" overload (euint64, euint8) => ebool test 4 (98, 94)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(98n); - input.add8(94n); + 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.contract4.eq_euint64_euint8( + const tx = await this.contract9.max_euint128_uint128( encryptedAmount.handles[0], - encryptedAmount.handles[1], + 340282366920938463463367499312160836031n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463367499312160836031n); }); - it('test operator "ne" overload (euint64, euint8) => ebool test 1 (18445474251392791649, 41)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(18445474251392791649n); - input.add8(41n); + 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.contract4.ne_euint64_euint8( + const tx = await this.contract9.max_euint128_uint128( encryptedAmount.handles[0], - encryptedAmount.handles[1], + 340282366920938463463367499312160836031n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463367499312160836031n); }); - it('test operator "ne" overload (euint64, euint8) => ebool test 2 (37, 41)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(37n); - input.add8(41n); + 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.contract4.ne_euint64_euint8( + const tx = await this.contract9.max_euint128_uint128( encryptedAmount.handles[0], - encryptedAmount.handles[1], + 340282366920938463463367499312160836027n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463367499312160836031n); }); - it('test operator "ne" overload (euint64, euint8) => ebool test 3 (41, 41)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(41n); - input.add8(41n); + 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.contract4.ne_euint64_euint8( + const tx = await this.contract9.max_uint128_euint128( + 340282366920938463463370589299931927619n, encryptedAmount.handles[0], - encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463371397781663603615n); }); - it('test operator "ne" overload (euint64, euint8) => ebool test 4 (41, 37)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(41n); - input.add8(37n); + 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.contract4.ne_euint64_euint8( + const tx = await this.contract9.max_uint128_euint128( + 340282366920938463463367499312160836027n, encryptedAmount.handles[0], - encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463367499312160836031n); }); - it('test operator "ge" overload (euint64, euint8) => ebool test 1 (18444294270645254277, 229)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(18444294270645254277n); - input.add8(229n); + 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.contract4.ge_euint64_euint8( + const tx = await this.contract9.max_uint128_euint128( + 340282366920938463463367499312160836031n, encryptedAmount.handles[0], - encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463367499312160836031n); }); - it('test operator "ge" overload (euint64, euint8) => ebool test 2 (225, 229)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(225n); - input.add8(229n); + 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.contract4.ge_euint64_euint8( + const tx = await this.contract9.max_uint128_euint128( + 340282366920938463463367499312160836031n, encryptedAmount.handles[0], - encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); + const res = await decrypt128(await this.contract9.res128()); + expect(res).to.equal(340282366920938463463367499312160836031n); }); - it('test operator "ge" overload (euint64, euint8) => ebool test 3 (229, 229)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(229n); - input.add8(229n); + 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.contract4.ge_euint64_euint8( + const tx = await this.contract9.add_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(11n); }); - it('test operator "ge" overload (euint64, euint8) => ebool test 4 (229, 225)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(229n); - input.add8(225n); + 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.contract4.ge_euint64_euint8( + const tx = await this.contract9.add_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(14n); }); - it('test operator "gt" overload (euint64, euint8) => ebool test 1 (18446048537684194985, 113)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(18446048537684194985n); - input.add8(113n); + 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.contract4.gt_euint64_euint8( + const tx = await this.contract9.add_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(10n); }); - it('test operator "gt" overload (euint64, euint8) => ebool test 2 (109, 113)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(109n); - input.add8(113n); + 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.contract4.gt_euint64_euint8( + const tx = await this.contract9.add_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(14n); }); - it('test operator "gt" overload (euint64, euint8) => ebool test 3 (113, 113)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(113n); - input.add8(113n); + 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.contract4.gt_euint64_euint8( + const tx = await this.contract9.sub_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(0n); }); - it('test operator "gt" overload (euint64, euint8) => ebool test 4 (113, 109)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(113n); - input.add8(109n); + 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.contract4.gt_euint64_euint8( + const tx = await this.contract9.sub_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(4n); }); - it('test operator "le" overload (euint64, euint8) => ebool test 1 (18443934013808426023, 129)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18443934013808426023n); - input.add8(129n); + 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.contract5.le_euint64_euint8( + const tx = await this.contract9.mul_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(10n); }); - it('test operator "le" overload (euint64, euint8) => ebool test 2 (125, 129)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(125n); - input.add8(129n); + 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.contract5.le_euint64_euint8( + const tx = await this.contract9.mul_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(15n); }); - it('test operator "le" overload (euint64, euint8) => ebool test 3 (129, 129)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(129n); - input.add8(129n); + 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.contract5.le_euint64_euint8( + const tx = await this.contract9.mul_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(9n); }); - it('test operator "le" overload (euint64, euint8) => ebool test 4 (129, 125)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(129n); - input.add8(125n); + 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.contract5.le_euint64_euint8( + const tx = await this.contract9.mul_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(15n); }); - it('test operator "lt" overload (euint64, euint8) => ebool test 1 (18444118039600142421, 79)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18444118039600142421n); - input.add8(79n); + 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.contract5.lt_euint64_euint8( + const tx = await this.contract9.and_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(1n); }); - it('test operator "lt" overload (euint64, euint8) => ebool test 2 (75, 79)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(75n); - input.add8(79n); + 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.contract5.lt_euint64_euint8( + const tx = await this.contract9.and_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(0n); }); - it('test operator "lt" overload (euint64, euint8) => ebool test 3 (79, 79)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(79n); - input.add8(79n); + 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.contract5.lt_euint64_euint8( + const tx = await this.contract9.and_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(8n); }); - it('test operator "lt" overload (euint64, euint8) => ebool test 4 (79, 75)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(79n); - input.add8(75n); + 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.contract5.lt_euint64_euint8( + const tx = await this.contract9.and_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(0n); }); - it('test operator "min" overload (euint64, euint8) => euint64 test 1 (18440761228336909285, 170)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18440761228336909285n); - input.add8(170n); + 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.contract5.min_euint64_euint8( + const tx = await this.contract9.or_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(170n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579810763114124559n); }); - it('test operator "min" overload (euint64, euint8) => euint64 test 2 (166, 170)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(166n); - input.add8(170n); + 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.contract5.min_euint64_euint8( + const tx = await this.contract9.or_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(166n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(14n); }); - it('test operator "min" overload (euint64, euint8) => euint64 test 3 (170, 170)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(170n); - input.add8(170n); + 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.contract5.min_euint64_euint8( + const tx = await this.contract9.or_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(170n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(14n); }); - it('test operator "min" overload (euint64, euint8) => euint64 test 4 (170, 166)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(170n); - input.add8(166n); + 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.contract5.min_euint64_euint8( + const tx = await this.contract9.or_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(166n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(14n); }); - it('test operator "max" overload (euint64, euint8) => euint64 test 1 (18446007384031513667, 44)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18446007384031513667n); - input.add8(44n); + 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.contract5.max_euint64_euint8( + const tx = await this.contract9.xor_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18446007384031513667n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457582453903191902883n); }); - it('test operator "max" overload (euint64, euint8) => euint64 test 2 (40, 44)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(40n); - input.add8(44n); + 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.contract5.max_euint64_euint8( + const tx = await this.contract9.xor_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(44n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(4n); }); - it('test operator "max" overload (euint64, euint8) => euint64 test 3 (44, 44)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(44n); - input.add8(44n); + 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.contract5.max_euint64_euint8( + const tx = await this.contract9.xor_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(44n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(0n); }); - it('test operator "max" overload (euint64, euint8) => euint64 test 4 (44, 40)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(44n); - input.add8(40n); + 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.contract5.max_euint64_euint8( + const tx = await this.contract9.xor_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(44n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(4n); }); - it('test operator "add" overload (euint64, euint16) => euint64 test 1 (65527, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(65527n); - input.add16(2n); + 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.contract5.add_euint64_euint16( + const tx = await this.contract9.eq_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(65529n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "add" overload (euint64, euint16) => euint64 test 2 (22102, 22104)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(22102n); - input.add16(22104n); + 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.contract5.add_euint64_euint16( + const tx = await this.contract9.eq_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(44206n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "add" overload (euint64, euint16) => euint64 test 3 (22104, 22104)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(22104n); - input.add16(22104n); + 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.contract5.add_euint64_euint16( + const tx = await this.contract9.eq_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(44208n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "add" overload (euint64, euint16) => euint64 test 4 (22104, 22102)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(22104n); - input.add16(22102n); + 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.contract5.add_euint64_euint16( + const tx = await this.contract9.eq_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(44206n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "sub" overload (euint64, euint16) => euint64 test 1 (45502, 45502)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(45502n); - input.add16(45502n); + 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.contract5.sub_euint64_euint16( + const tx = await this.contract9.ne_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(0n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "sub" overload (euint64, euint16) => euint64 test 2 (45502, 45498)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(45502n); - input.add16(45498n); + 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.contract5.sub_euint64_euint16( + const tx = await this.contract9.ne_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "mul" overload (euint64, euint16) => euint64 test 1 (32761, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(32761n); - input.add16(2n); + 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.contract5.mul_euint64_euint16( + const tx = await this.contract9.ne_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(65522n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "mul" overload (euint64, euint16) => euint64 test 2 (252, 252)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(252n); - input.add16(252n); + 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.contract5.mul_euint64_euint16( + const tx = await this.contract9.ne_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(63504n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "mul" overload (euint64, euint16) => euint64 test 3 (252, 252)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(252n); - input.add16(252n); + 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.contract5.mul_euint64_euint16( + const tx = await this.contract9.ge_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(63504n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "mul" overload (euint64, euint16) => euint64 test 4 (252, 252)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(252n); - input.add16(252n); + 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.contract5.mul_euint64_euint16( + const tx = await this.contract9.ge_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(63504n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "and" overload (euint64, euint16) => euint64 test 1 (18446210605213941359, 52123)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18446210605213941359n); - input.add16(52123n); + 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.contract5.and_euint64_euint16( + const tx = await this.contract9.ge_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(51723n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "and" overload (euint64, euint16) => euint64 test 2 (52119, 52123)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(52119n); - input.add16(52123n); + 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.contract5.and_euint64_euint16( + const tx = await this.contract9.ge_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(52115n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "and" overload (euint64, euint16) => euint64 test 3 (52123, 52123)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(52123n); - input.add16(52123n); + 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.contract5.and_euint64_euint16( + const tx = await this.contract9.gt_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(52123n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "and" overload (euint64, euint16) => euint64 test 4 (52123, 52119)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(52123n); - input.add16(52119n); + 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.contract5.and_euint64_euint16( + const tx = await this.contract9.gt_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(52115n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "or" overload (euint64, euint16) => euint64 test 1 (18437769114436402597, 8954)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18437769114436402597n); - input.add16(8954n); + 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.contract5.or_euint64_euint16( + const tx = await this.contract9.gt_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18437769114436403199n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "or" overload (euint64, euint16) => euint64 test 2 (8950, 8954)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(8950n); - input.add16(8954n); + 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.contract5.or_euint64_euint16( + const tx = await this.contract9.gt_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(8958n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "or" overload (euint64, euint16) => euint64 test 3 (8954, 8954)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(8954n); - input.add16(8954n); + 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.contract5.or_euint64_euint16( + const tx = await this.contract9.le_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(8954n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "or" overload (euint64, euint16) => euint64 test 4 (8954, 8950)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(8954n); - input.add16(8950n); + 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.contract5.or_euint64_euint16( + const tx = await this.contract9.le_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(8958n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "xor" overload (euint64, euint16) => euint64 test 1 (18442272025927693303, 37790)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442272025927693303n); - input.add16(37790n); + 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.contract5.xor_euint64_euint16( + const tx = await this.contract9.le_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18442272025927721065n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "xor" overload (euint64, euint16) => euint64 test 2 (37786, 37790)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(37786n); - input.add16(37790n); + 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.contract5.xor_euint64_euint16( + const tx = await this.contract9.le_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "xor" overload (euint64, euint16) => euint64 test 3 (37790, 37790)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(37790n); - input.add16(37790n); + 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.contract5.xor_euint64_euint16( + const tx = await this.contract9.lt_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(0n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "xor" overload (euint64, euint16) => euint64 test 4 (37790, 37786)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(37790n); - input.add16(37786n); + 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.contract5.xor_euint64_euint16( + const tx = await this.contract9.lt_euint256_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "eq" overload (euint64, euint16) => ebool test 1 (18439660654359160363, 41883)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18439660654359160363n); - input.add16(41883n); + 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.contract5.eq_euint64_euint16( + 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.contract5.resb()); + const res = await decryptBool(await this.contract9.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint64, euint16) => ebool test 2 (41879, 41883)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(41879n); - input.add16(41883n); + 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.contract5.eq_euint64_euint16( + 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.contract5.resb()); + const res = await decryptBool(await this.contract9.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint64, euint16) => ebool test 3 (41883, 41883)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(41883n); - input.add16(41883n); + 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.contract5.eq_euint64_euint16( + const tx = await this.contract9.min_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(2n); }); - it('test operator "eq" overload (euint64, euint16) => ebool test 4 (41883, 41879)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(41883n); - input.add16(41879n); + 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.contract5.eq_euint64_euint16( + const tx = await this.contract9.min_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(4n); }); - it('test operator "ne" overload (euint64, euint16) => ebool test 1 (18440863971063577997, 29590)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18440863971063577997n); - input.add16(29590n); + 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.contract5.ne_euint64_euint16( + const tx = await this.contract9.min_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(8n); }); - it('test operator "ne" overload (euint64, euint16) => ebool test 2 (29586, 29590)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(29586n); - input.add16(29590n); + 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.contract5.ne_euint64_euint16( + const tx = await this.contract9.min_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(4n); }); - it('test operator "ne" overload (euint64, euint16) => ebool test 3 (29590, 29590)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(29590n); - input.add16(29590n); + 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.contract5.ne_euint64_euint16( + const tx = await this.contract9.max_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577303760309863037n); }); - it('test operator "ne" overload (euint64, euint16) => ebool test 4 (29590, 29586)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(29590n); - input.add16(29586n); + 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.contract5.ne_euint64_euint16( + const tx = await this.contract9.max_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(8n); }); - it('test operator "ge" overload (euint64, euint16) => ebool test 1 (18437766862316060605, 31992)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18437766862316060605n); - input.add16(31992n); + 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.contract5.ge_euint64_euint16( + const tx = await this.contract9.max_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(8n); }); - it('test operator "ge" overload (euint64, euint16) => ebool test 2 (31988, 31992)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(31988n); - input.add16(31992n); + 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.contract5.ge_euint64_euint16( + const tx = await this.contract9.max_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(8n); }); - it('test operator "ge" overload (euint64, euint16) => ebool test 3 (31992, 31992)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(31992n); - input.add16(31992n); + 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.contract5.ge_euint64_euint16( + const tx = await this.contract9.add_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(131n); }); - it('test operator "ge" overload (euint64, euint16) => ebool test 4 (31992, 31988)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(31992n); - input.add16(31988n); + 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.contract5.ge_euint64_euint16( + const tx = await this.contract9.add_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(204n); }); - it('test operator "gt" overload (euint64, euint16) => ebool test 1 (18446546126614473389, 55175)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18446546126614473389n); - input.add16(55175n); + 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.contract5.gt_euint64_euint16( + const tx = await this.contract9.add_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(206n); }); - it('test operator "gt" overload (euint64, euint16) => ebool test 2 (55171, 55175)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(55171n); - input.add16(55175n); + 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.contract5.gt_euint64_euint16( + const tx = await this.contract9.add_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(204n); }); - it('test operator "gt" overload (euint64, euint16) => ebool test 3 (55175, 55175)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(55175n); - input.add16(55175n); + 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.contract5.gt_euint64_euint16( + const tx = await this.contract9.sub_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(0n); }); - it('test operator "gt" overload (euint64, euint16) => ebool test 4 (55175, 55171)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(55175n); - input.add16(55171n); + 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.contract5.gt_euint64_euint16( + const tx = await this.contract9.sub_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(4n); }); - it('test operator "le" overload (euint64, euint16) => ebool test 1 (18445404390633548443, 34855)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18445404390633548443n); - input.add16(34855n); + 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.contract5.le_euint64_euint16( + const tx = await this.contract9.mul_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(130n); }); - it('test operator "le" overload (euint64, euint16) => ebool test 2 (34851, 34855)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(34851n); - input.add16(34855n); + 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.contract5.le_euint64_euint16( + const tx = await this.contract9.mul_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(182n); }); - it('test operator "le" overload (euint64, euint16) => ebool test 3 (34855, 34855)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(34855n); - input.add16(34855n); + 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.contract5.le_euint64_euint16( + const tx = await this.contract9.mul_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(196n); }); - it('test operator "le" overload (euint64, euint16) => ebool test 4 (34855, 34851)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(34855n); - input.add16(34851n); + 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.contract5.le_euint64_euint16( + const tx = await this.contract9.mul_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(182n); }); - it('test operator "lt" overload (euint64, euint16) => ebool test 1 (18438335232029320935, 10564)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438335232029320935n); - input.add16(10564n); + 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.contract5.lt_euint64_euint16( + const tx = await this.contract9.and_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(128n); }); - it('test operator "lt" overload (euint64, euint16) => ebool test 2 (10560, 10564)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(10560n); - input.add16(10564n); + 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.contract5.lt_euint64_euint16( + const tx = await this.contract9.and_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(128n); }); - it('test operator "lt" overload (euint64, euint16) => ebool test 3 (10564, 10564)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(10564n); - input.add16(10564n); + 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.contract5.lt_euint64_euint16( + const tx = await this.contract9.and_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(160n); }); - it('test operator "lt" overload (euint64, euint16) => ebool test 4 (10564, 10560)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(10564n); - input.add16(10560n); + 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.contract5.lt_euint64_euint16( + const tx = await this.contract9.and_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(128n); }); - it('test operator "min" overload (euint64, euint16) => euint64 test 1 (18438622448280376415, 51692)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438622448280376415n); - input.add16(51692n); + 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.contract5.min_euint64_euint16( + const tx = await this.contract9.or_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(51692n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579600697842114429n); }); - it('test operator "min" overload (euint64, euint16) => euint64 test 2 (51688, 51692)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(51688n); - input.add16(51692n); + 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.contract5.min_euint64_euint16( + const tx = await this.contract9.or_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(51688n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(29n); }); - it('test operator "min" overload (euint64, euint16) => euint64 test 3 (51692, 51692)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(51692n); - input.add16(51692n); + 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.contract5.min_euint64_euint16( + const tx = await this.contract9.or_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(51692n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(25n); }); - it('test operator "min" overload (euint64, euint16) => euint64 test 4 (51692, 51688)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(51692n); - input.add16(51688n); + 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.contract5.min_euint64_euint16( + const tx = await this.contract9.or_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(51688n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(29n); }); - it('test operator "max" overload (euint64, euint16) => euint64 test 1 (18444284510736997839, 51628)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18444284510736997839n); - input.add16(51628n); + 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.contract5.max_euint64_euint16( + const tx = await this.contract9.xor_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18444284510736997839n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576224347045805774n); }); - it('test operator "max" overload (euint64, euint16) => euint64 test 2 (51624, 51628)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(51624n); - input.add16(51628n); + 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.contract5.max_euint64_euint16( + const tx = await this.contract9.xor_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(51628n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(4n); }); - it('test operator "max" overload (euint64, euint16) => euint64 test 3 (51628, 51628)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(51628n); - input.add16(51628n); + 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.contract5.max_euint64_euint16( + const tx = await this.contract9.xor_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(51628n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(0n); }); - it('test operator "max" overload (euint64, euint16) => euint64 test 4 (51628, 51624)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(51628n); - input.add16(51624n); + 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.contract5.max_euint64_euint16( + const tx = await this.contract9.xor_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(51628n); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(4n); }); - it('test operator "add" overload (euint64, euint32) => euint64 test 1 (4293751578, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(4293751578n); - input.add32(2n); + 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.contract5.add_euint64_euint32( + const tx = await this.contract9.eq_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4293751580n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "add" overload (euint64, euint32) => euint64 test 2 (1806019599, 1806019601)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(1806019599n); - input.add32(1806019601n); + 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.contract5.add_euint64_euint32( + const tx = await this.contract9.eq_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(3612039200n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "add" overload (euint64, euint32) => euint64 test 3 (1806019601, 1806019601)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(1806019601n); - input.add32(1806019601n); + 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.contract5.add_euint64_euint32( + const tx = await this.contract9.eq_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(3612039202n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "add" overload (euint64, euint32) => euint64 test 4 (1806019601, 1806019599)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(1806019601n); - input.add32(1806019599n); + 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.contract5.add_euint64_euint32( + const tx = await this.contract9.eq_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(3612039200n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "sub" overload (euint64, euint32) => euint64 test 1 (3425308729, 3425308729)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(3425308729n); - input.add32(3425308729n); + 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.contract5.sub_euint64_euint32( + const tx = await this.contract9.ne_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(0n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "sub" overload (euint64, euint32) => euint64 test 2 (3425308729, 3425308725)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(3425308729n); - input.add32(3425308725n); + 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.contract5.sub_euint64_euint32( + const tx = await this.contract9.ne_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "mul" overload (euint64, euint32) => euint64 test 1 (2147367784, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(2147367784n); - input.add32(2n); + 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.contract5.mul_euint64_euint32( + const tx = await this.contract9.ne_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4294735568n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "mul" overload (euint64, euint32) => euint64 test 2 (50787, 50787)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(50787n); - input.add32(50787n); + 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.contract5.mul_euint64_euint32( + const tx = await this.contract9.ne_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(2579319369n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "mul" overload (euint64, euint32) => euint64 test 3 (50787, 50787)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(50787n); - input.add32(50787n); + 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.contract5.mul_euint64_euint32( + const tx = await this.contract9.ge_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(2579319369n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "mul" overload (euint64, euint32) => euint64 test 4 (50787, 50787)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(50787n); - input.add32(50787n); + 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.contract5.mul_euint64_euint32( + const tx = await this.contract9.ge_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(2579319369n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "and" overload (euint64, euint32) => euint64 test 1 (18442857416785747441, 1547691532)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442857416785747441n); - input.add32(1547691532n); + 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.contract5.and_euint64_euint32( + const tx = await this.contract9.ge_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(137446400n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "and" overload (euint64, euint32) => euint64 test 2 (1547691528, 1547691532)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(1547691528n); - input.add32(1547691532n); + 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.contract5.and_euint64_euint32( + const tx = await this.contract9.ge_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(1547691528n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "and" overload (euint64, euint32) => euint64 test 3 (1547691532, 1547691532)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(1547691532n); - input.add32(1547691532n); + 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.contract5.and_euint64_euint32( + const tx = await this.contract9.gt_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(1547691532n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "and" overload (euint64, euint32) => euint64 test 4 (1547691532, 1547691528)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(1547691532n); - input.add32(1547691528n); + 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.contract5.and_euint64_euint32( + const tx = await this.contract9.gt_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(1547691528n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "or" overload (euint64, euint32) => euint64 test 1 (18438806940040470143, 729835566)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438806940040470143n); - input.add32(729835566n); + 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.contract5.or_euint64_euint32( + const tx = await this.contract9.gt_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18438806940585754239n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "or" overload (euint64, euint32) => euint64 test 2 (729835562, 729835566)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(729835562n); - input.add32(729835566n); + 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.contract5.or_euint64_euint32( + const tx = await this.contract9.gt_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(729835566n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "or" overload (euint64, euint32) => euint64 test 3 (729835566, 729835566)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(729835566n); - input.add32(729835566n); + 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.contract5.or_euint64_euint32( + const tx = await this.contract9.le_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(729835566n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "or" overload (euint64, euint32) => euint64 test 4 (729835566, 729835562)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(729835566n); - input.add32(729835562n); + 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.contract5.or_euint64_euint32( + const tx = await this.contract9.le_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(729835566n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "xor" overload (euint64, euint32) => euint64 test 1 (18444516407156523745, 3421158537)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18444516407156523745n); - input.add32(3421158537n); + 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.contract5.xor_euint64_euint32( + const tx = await this.contract9.le_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18444516404054425192n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "xor" overload (euint64, euint32) => euint64 test 2 (3421158533, 3421158537)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(3421158533n); - input.add32(3421158537n); + 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.contract5.xor_euint64_euint32( + const tx = await this.contract9.le_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(12n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "xor" overload (euint64, euint32) => euint64 test 3 (3421158537, 3421158537)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(3421158537n); - input.add32(3421158537n); + 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.contract5.xor_euint64_euint32( + const tx = await this.contract9.lt_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(0n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(false); }); - it('test operator "xor" overload (euint64, euint32) => euint64 test 4 (3421158537, 3421158533)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(3421158537n); - input.add32(3421158533n); + 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.contract5.xor_euint64_euint32( + const tx = await this.contract9.lt_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(12n); + const res = await decryptBool(await this.contract9.resb()); + expect(res).to.equal(true); }); - it('test operator "eq" overload (euint64, euint32) => ebool test 1 (18445744067307966387, 926561519)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18445744067307966387n); - input.add32(926561519n); + 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.contract5.eq_euint64_euint32( + 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.contract5.resb()); + const res = await decryptBool(await this.contract9.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint64, euint32) => ebool test 2 (926561515, 926561519)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(926561515n); - input.add32(926561519n); + 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.contract5.eq_euint64_euint32( + 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.contract5.resb()); + const res = await decryptBool(await this.contract9.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint64, euint32) => ebool test 3 (926561519, 926561519)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(926561519n); - input.add32(926561519n); + 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.contract5.eq_euint64_euint32( + const tx = await this.contract9.min_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(103n); }); - it('test operator "eq" overload (euint64, euint32) => ebool test 4 (926561519, 926561515)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(926561519n); - input.add32(926561515n); + 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.contract5.eq_euint64_euint32( + const tx = await this.contract9.min_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(99n); }); - it('test operator "ne" overload (euint64, euint32) => ebool test 1 (18446476368209552349, 3024704127)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18446476368209552349n); - input.add32(3024704127n); + 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.contract5.ne_euint64_euint32( + const tx = await this.contract9.min_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(103n); }); - it('test operator "ne" overload (euint64, euint32) => ebool test 2 (3024704123, 3024704127)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(3024704123n); - input.add32(3024704127n); + 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.contract5.ne_euint64_euint32( + const tx = await this.contract9.min_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(99n); }); - it('test operator "ne" overload (euint64, euint32) => ebool test 3 (3024704127, 3024704127)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(3024704127n); - input.add32(3024704127n); + 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.contract5.ne_euint64_euint32( + const tx = await this.contract9.max_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457581923844171729579n); }); - it('test operator "ne" overload (euint64, euint32) => ebool test 4 (3024704127, 3024704123)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(3024704127n); - input.add32(3024704123n); + 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.contract5.ne_euint64_euint32( + const tx = await this.contract9.max_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(237n); }); - it('test operator "ge" overload (euint64, euint32) => ebool test 1 (18440264286866387829, 85256317)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18440264286866387829n); - input.add32(85256317n); + 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.contract5.ge_euint64_euint32( + const tx = await this.contract9.max_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(237n); }); - it('test operator "ge" overload (euint64, euint32) => ebool test 2 (85256313, 85256317)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(85256313n); - input.add32(85256317n); + 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.contract5.ge_euint64_euint32( + const tx = await this.contract9.max_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(237n); }); - it('test operator "ge" overload (euint64, euint32) => ebool test 3 (85256317, 85256317)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(85256317n); - input.add32(85256317n); + 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.contract5.ge_euint64_euint32( + const tx = await this.contract9.add_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(32771n); }); - it('test operator "ge" overload (euint64, euint32) => ebool test 4 (85256317, 85256313)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(85256317n); - input.add32(85256313n); + 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.contract5.ge_euint64_euint32( + const tx = await this.contract9.add_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(37182n); }); - it('test operator "gt" overload (euint64, euint32) => ebool test 1 (18443613995542007651, 1679838761)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18443613995542007651n); - input.add32(1679838761n); + 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.contract5.gt_euint64_euint32( + const tx = await this.contract9.add_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(37184n); }); - it('test operator "gt" overload (euint64, euint32) => ebool test 2 (1679838757, 1679838761)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(1679838757n); - input.add32(1679838761n); + 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.contract5.gt_euint64_euint32( + const tx = await this.contract9.add_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(37182n); }); - it('test operator "gt" overload (euint64, euint32) => ebool test 3 (1679838761, 1679838761)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(1679838761n); - input.add32(1679838761n); + 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.contract5.gt_euint64_euint32( + const tx = await this.contract9.sub_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(0n); }); - it('test operator "gt" overload (euint64, euint32) => ebool test 4 (1679838761, 1679838757)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(1679838761n); - input.add32(1679838757n); + 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.contract5.gt_euint64_euint32( + const tx = await this.contract9.sub_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(4n); }); - it('test operator "le" overload (euint64, euint32) => ebool test 1 (18443133688534935497, 622548585)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18443133688534935497n); - input.add32(622548585n); + 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.contract5.le_euint64_euint32( + const tx = await this.contract9.mul_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(32770n); }); - it('test operator "le" overload (euint64, euint32) => ebool test 2 (622548581, 622548585)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(622548581n); - input.add32(622548585n); + 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.contract5.le_euint64_euint32( + const tx = await this.contract9.mul_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(54289n); }); - it('test operator "le" overload (euint64, euint32) => ebool test 3 (622548585, 622548585)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(622548585n); - input.add32(622548585n); + 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.contract5.le_euint64_euint32( + const tx = await this.contract9.mul_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(54289n); }); - it('test operator "le" overload (euint64, euint32) => ebool test 4 (622548585, 622548581)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(622548585n); - input.add32(622548581n); + 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.contract5.le_euint64_euint32( + const tx = await this.contract9.mul_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(54289n); }); - it('test operator "lt" overload (euint64, euint32) => ebool test 1 (18446696862115863979, 853267915)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18446696862115863979n); - input.add32(853267915n); + 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.contract5.lt_euint64_euint32( + const tx = await this.contract9.and_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(5442n); }); - it('test operator "lt" overload (euint64, euint32) => ebool test 2 (853267911, 853267915)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(853267911n); - input.add32(853267915n); + 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.contract5.lt_euint64_euint32( + const tx = await this.contract9.and_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(21826n); }); - it('test operator "lt" overload (euint64, euint32) => ebool test 3 (853267915, 853267915)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(853267915n); - input.add32(853267915n); + 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.contract5.lt_euint64_euint32( + const tx = await this.contract9.and_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(21842n); }); - it('test operator "lt" overload (euint64, euint32) => ebool test 4 (853267915, 853267911)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(853267915n); - input.add32(853267911n); + 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.contract5.lt_euint64_euint32( + const tx = await this.contract9.and_euint256_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); + const res = await decrypt256(await this.contract9.res256()); + expect(res).to.equal(21826n); }); }); diff --git a/test/tfheOperations/tfheOperations11.ts b/test/tfheOperations/tfheOperations11.ts index e1c19134..74694fec 100644 --- a/test/tfheOperations/tfheOperations11.ts +++ b/test/tfheOperations/tfheOperations11.ts @@ -7,7 +7,22 @@ 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 { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance'; +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 { @@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise { 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); @@ -101,2453 +171,4651 @@ describe('TFHE operations 11', function () { this.contract5Address = await contract5.getAddress(); this.contract5 = contract5; - const contract6 = await deployTfheTestFixture6(); - this.contract6Address = await contract6.getAddress(); - this.contract6 = contract6; + 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); + }); - const instances = await createInstances(this.signers); - this.instances = instances; + 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 (euint64, euint32) => euint64 test 1 (18440186743754430625, 4137891061)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18440186743754430625n); - input.add32(4137891061n); + 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.contract5.min_euint64_euint32( + const tx = await this.contract10.min_euint256_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4137891061n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(18443636668516069273n); }); - it('test operator "min" overload (euint64, euint32) => euint64 test 2 (4137891057, 4137891061)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(4137891057n); - input.add32(4137891061n); + 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.contract5.min_euint64_euint32( + const tx = await this.contract10.min_euint256_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4137891057n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(18443636668516069269n); }); - it('test operator "min" overload (euint64, euint32) => euint64 test 3 (4137891061, 4137891061)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(4137891061n); - input.add32(4137891061n); + 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.contract5.min_euint64_euint32( + const tx = await this.contract10.min_euint256_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4137891061n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(18443636668516069273n); }); - it('test operator "min" overload (euint64, euint32) => euint64 test 4 (4137891061, 4137891057)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(4137891061n); - input.add32(4137891057n); + 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.contract5.min_euint64_euint32( + const tx = await this.contract10.min_euint256_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4137891057n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(18443636668516069269n); }); - it('test operator "max" overload (euint64, euint32) => euint64 test 1 (18445662984886583599, 303914102)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18445662984886583599n); - input.add32(303914102n); + 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.contract5.max_euint64_euint32( + const tx = await this.contract10.max_euint256_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18445662984886583599n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457583257576614099953n); }); - it('test operator "max" overload (euint64, euint32) => euint64 test 2 (303914098, 303914102)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(303914098n); - input.add32(303914102n); + 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.contract5.max_euint64_euint32( + const tx = await this.contract10.max_euint256_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(303914102n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(18438250957457099341n); }); - it('test operator "max" overload (euint64, euint32) => euint64 test 3 (303914102, 303914102)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(303914102n); - input.add32(303914102n); + 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.contract5.max_euint64_euint32( + const tx = await this.contract10.max_euint256_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(303914102n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(18438250957457099341n); }); - it('test operator "max" overload (euint64, euint32) => euint64 test 4 (303914102, 303914098)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(303914102n); - input.add32(303914098n); + 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.contract5.max_euint64_euint32( + const tx = await this.contract10.max_euint256_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(303914102n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(18438250957457099341n); }); - it('test operator "add" overload (euint64, euint64) => euint64 test 1 (9219336648067240893, 9223239842705786428)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(9219336648067240893n); - input.add64(9223239842705786428n); + 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.contract5.add_euint64_euint64( + const tx = await this.contract10.add_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18442576490773027321n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(170141183460469231731687303715884105731n); }); - it('test operator "add" overload (euint64, euint64) => euint64 test 2 (9219336648067240891, 9219336648067240893)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(9219336648067240891n); - input.add64(9219336648067240893n); + 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.contract5.add_euint64_euint64( + const tx = await this.contract10.add_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18438673296134481784n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(340282366920938463463368556108058666554n); }); - it('test operator "add" overload (euint64, euint64) => euint64 test 3 (9219336648067240893, 9219336648067240893)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(9219336648067240893n); - input.add64(9219336648067240893n); + 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.contract5.add_euint64_euint64( + const tx = await this.contract10.add_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18438673296134481786n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(340282366920938463463368556108058666556n); }); - it('test operator "add" overload (euint64, euint64) => euint64 test 4 (9219336648067240893, 9219336648067240891)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(9219336648067240893n); - input.add64(9219336648067240891n); + 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.contract5.add_euint64_euint64( + const tx = await this.contract10.add_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18438673296134481784n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(340282366920938463463368556108058666554n); }); - it('test operator "sub" overload (euint64, euint64) => euint64 test 1 (18442295292010752223, 18442295292010752223)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442295292010752223n); - input.add64(18442295292010752223n); + 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.contract5.sub_euint64_euint64( + const tx = await this.contract10.sub_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); + const res = await decrypt256(await this.contract10.res256()); expect(res).to.equal(0n); }); - it('test operator "sub" overload (euint64, euint64) => euint64 test 2 (18442295292010752223, 18442295292010752219)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442295292010752223n); - input.add64(18442295292010752219n); + 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.contract5.sub_euint64_euint64( + const tx = await this.contract10.sub_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); + const res = await decrypt256(await this.contract10.res256()); expect(res).to.equal(4n); }); - it('test operator "mul" overload (euint64, euint64) => euint64 test 1 (4294744203, 4293841776)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(4294744203n); - input.add64(4293841776n); + 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.contract5.mul_euint64_euint64( + const tx = await this.contract10.mul_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18440952076075224528n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(170141183460469231731687303715884105730n); }); - it('test operator "mul" overload (euint64, euint64) => euint64 test 2 (4293841776, 4293841776)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(4293841776n); - input.add64(4293841776n); + 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.contract5.mul_euint64_euint64( + const tx = await this.contract10.mul_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18437077197322834176n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(85070591730234615884290395931651604481n); }); - it('test operator "mul" overload (euint64, euint64) => euint64 test 3 (4293841776, 4293841776)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(4293841776n); - input.add64(4293841776n); + 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.contract5.mul_euint64_euint64( + const tx = await this.contract10.mul_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18437077197322834176n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(85070591730234615884290395931651604481n); }); - it('test operator "mul" overload (euint64, euint64) => euint64 test 4 (4293841776, 4293841776)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(4293841776n); - input.add64(4293841776n); + 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.contract5.mul_euint64_euint64( + const tx = await this.contract10.mul_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18437077197322834176n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(85070591730234615884290395931651604481n); }); - it('test operator "and" overload (euint64, euint64) => euint64 test 1 (18444924635377016941, 18446173308524975411)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18444924635377016941n); - input.add64(18446173308524975411n); + 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.contract5.and_euint64_euint64( + const tx = await this.contract10.and_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18444923419899985953n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(340282366920938463463365636070292242947n); }); - it('test operator "and" overload (euint64, euint64) => euint64 test 2 (18444924635377016937, 18444924635377016941)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18444924635377016937n); - input.add64(18444924635377016941n); + 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.contract5.and_euint64_euint64( + const tx = await this.contract10.and_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18444924635377016937n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(340282366920938463463365847322826293779n); }); - it('test operator "and" overload (euint64, euint64) => euint64 test 3 (18444924635377016941, 18444924635377016941)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18444924635377016941n); - input.add64(18444924635377016941n); + 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.contract5.and_euint64_euint64( + const tx = await this.contract10.and_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18444924635377016941n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(340282366920938463463365847322826293787n); }); - it('test operator "and" overload (euint64, euint64) => euint64 test 4 (18444924635377016941, 18444924635377016937)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18444924635377016941n); - input.add64(18444924635377016937n); + 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.contract5.and_euint64_euint64( + const tx = await this.contract10.and_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18444924635377016937n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(340282366920938463463365847322826293779n); }); - it('test operator "or" overload (euint64, euint64) => euint64 test 1 (18442105052999173891, 18440193626964063709)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442105052999173891n); - input.add64(18440193626964063709n); + 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.contract5.or_euint64_euint64( + const tx = await this.contract10.or_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18442168970778769375n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457582951827808547903n); }); - it('test operator "or" overload (euint64, euint64) => euint64 test 2 (18440193626964063705, 18440193626964063709)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18440193626964063705n); - input.add64(18440193626964063709n); + 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.contract5.or_euint64_euint64( + const tx = await this.contract10.or_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18440193626964063709n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(340282366920938463463373551062299472959n); }); - it('test operator "or" overload (euint64, euint64) => euint64 test 3 (18440193626964063709, 18440193626964063709)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18440193626964063709n); - input.add64(18440193626964063709n); + 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.contract5.or_euint64_euint64( + const tx = await this.contract10.or_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18440193626964063709n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(340282366920938463463373551062299472959n); }); - it('test operator "or" overload (euint64, euint64) => euint64 test 4 (18440193626964063709, 18440193626964063705)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18440193626964063709n); - input.add64(18440193626964063705n); + 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.contract5.or_euint64_euint64( + const tx = await this.contract10.or_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18440193626964063709n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(340282366920938463463373551062299472959n); }); - it('test operator "xor" overload (euint64, euint64) => euint64 test 1 (18440379911699358599, 18444259094994538125)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18440379911699358599n); - input.add64(18444259094994538125n); + 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.contract5.xor_euint64_euint64( + const tx = await this.contract10.xor_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(8523658389368074n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907852929702298719625575994209836984672105980n); }); - it('test operator "xor" overload (euint64, euint64) => euint64 test 2 (18440379911699358595, 18440379911699358599)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18440379911699358595n); - input.add64(18440379911699358599n); + 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.contract5.xor_euint64_euint64( + const tx = await this.contract10.xor_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(124n); }); - it('test operator "xor" overload (euint64, euint64) => euint64 test 3 (18440379911699358599, 18440379911699358599)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18440379911699358599n); - input.add64(18440379911699358599n); + 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.contract5.xor_euint64_euint64( + const tx = await this.contract10.xor_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); + const res = await decrypt256(await this.contract10.res256()); expect(res).to.equal(0n); }); - it('test operator "xor" overload (euint64, euint64) => euint64 test 4 (18440379911699358599, 18440379911699358595)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18440379911699358599n); - input.add64(18440379911699358595n); + 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.contract5.xor_euint64_euint64( + const tx = await this.contract10.xor_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(124n); }); - it('test operator "eq" overload (euint64, euint64) => ebool test 1 (18442470885463520691, 18445888562756211467)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442470885463520691n); - input.add64(18445888562756211467n); + 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.contract5.eq_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint64, euint64) => ebool test 2 (18442470885463520687, 18442470885463520691)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442470885463520687n); - input.add64(18442470885463520691n); + 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.contract5.eq_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint64, euint64) => ebool test 3 (18442470885463520691, 18442470885463520691)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442470885463520691n); - input.add64(18442470885463520691n); + 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.contract5.eq_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(true); }); - it('test operator "eq" overload (euint64, euint64) => ebool test 4 (18442470885463520691, 18442470885463520687)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442470885463520691n); - input.add64(18442470885463520687n); + 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.contract5.eq_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint64, euint64) => ebool test 1 (18442343533763371027, 18438477816592523453)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442343533763371027n); - input.add64(18438477816592523453n); + 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.contract5.ne_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint64, euint64) => ebool test 2 (18438477816592523449, 18438477816592523453)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438477816592523449n); - input.add64(18438477816592523453n); + 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.contract5.ne_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint64, euint64) => ebool test 3 (18438477816592523453, 18438477816592523453)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438477816592523453n); - input.add64(18438477816592523453n); + 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.contract5.ne_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint64, euint64) => ebool test 4 (18438477816592523453, 18438477816592523449)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438477816592523453n); - input.add64(18438477816592523449n); + 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.contract5.ne_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint64, euint64) => ebool test 1 (18441951286640352465, 18443086804815428517)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18441951286640352465n); - input.add64(18443086804815428517n); + 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.contract5.ge_euint64_euint64( + 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.contract5.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract10.resb()); + expect(res).to.equal(true); }); - it('test operator "ge" overload (euint64, euint64) => ebool test 2 (18441951286640352461, 18441951286640352465)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18441951286640352461n); - input.add64(18441951286640352465n); + 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.contract5.ge_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(false); }); - it('test operator "ge" overload (euint64, euint64) => ebool test 3 (18441951286640352465, 18441951286640352465)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18441951286640352465n); - input.add64(18441951286640352465n); + 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.contract5.ge_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint64, euint64) => ebool test 4 (18441951286640352465, 18441951286640352461)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18441951286640352465n); - input.add64(18441951286640352461n); + 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.contract5.ge_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(true); }); - it('test operator "gt" overload (euint64, euint64) => ebool test 1 (18443021258691337483, 18443593997946075985)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18443021258691337483n); - input.add64(18443593997946075985n); + 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.contract5.gt_euint64_euint64( + 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.contract5.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract10.resb()); + expect(res).to.equal(true); }); - it('test operator "gt" overload (euint64, euint64) => ebool test 2 (18443021258691337479, 18443021258691337483)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18443021258691337479n); - input.add64(18443021258691337483n); + 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.contract5.gt_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint64, euint64) => ebool test 3 (18443021258691337483, 18443021258691337483)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18443021258691337483n); - input.add64(18443021258691337483n); + 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.contract5.gt_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint64, euint64) => ebool test 4 (18443021258691337483, 18443021258691337479)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18443021258691337483n); - input.add64(18443021258691337479n); + 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.contract5.gt_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint64, euint64) => ebool test 1 (18443782238591650169, 18441978790273961913)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18443782238591650169n); - input.add64(18441978790273961913n); + 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.contract5.le_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(false); }); - it('test operator "le" overload (euint64, euint64) => ebool test 2 (18441978790273961909, 18441978790273961913)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18441978790273961909n); - input.add64(18441978790273961913n); + 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.contract5.le_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint64, euint64) => ebool test 3 (18441978790273961913, 18441978790273961913)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18441978790273961913n); - input.add64(18441978790273961913n); + 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.contract5.le_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint64, euint64) => ebool test 4 (18441978790273961913, 18441978790273961909)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18441978790273961913n); - input.add64(18441978790273961909n); + 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.contract5.le_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint64, euint64) => ebool test 1 (18445972196307174659, 18438760003066140571)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18445972196307174659n); - input.add64(18438760003066140571n); + 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.contract5.lt_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint64, euint64) => ebool test 2 (18438760003066140567, 18438760003066140571)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438760003066140567n); - input.add64(18438760003066140571n); + 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.contract5.lt_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (euint64, euint64) => ebool test 3 (18438760003066140571, 18438760003066140571)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438760003066140571n); - input.add64(18438760003066140571n); + 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.contract5.lt_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint64, euint64) => ebool test 4 (18438760003066140571, 18438760003066140567)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438760003066140571n); - input.add64(18438760003066140567n); + 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.contract5.lt_euint64_euint64( + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(false); }); - it('test operator "min" overload (euint64, euint64) => euint64 test 1 (18446277918636147641, 18439099819121701507)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18446277918636147641n); - input.add64(18439099819121701507n); + 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.contract5.min_euint64_euint64( + const tx = await this.contract10.min_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18439099819121701507n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(340282366920938463463370032475222092647n); }); - it('test operator "min" overload (euint64, euint64) => euint64 test 2 (18439099819121701503, 18439099819121701507)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18439099819121701503n); - input.add64(18439099819121701507n); + 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.contract5.min_euint64_euint64( + const tx = await this.contract10.min_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18439099819121701503n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(340282366920938463463370032475222092643n); }); - it('test operator "min" overload (euint64, euint64) => euint64 test 3 (18439099819121701507, 18439099819121701507)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18439099819121701507n); - input.add64(18439099819121701507n); + 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.contract5.min_euint64_euint64( + const tx = await this.contract10.min_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18439099819121701507n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(340282366920938463463370032475222092647n); }); - it('test operator "min" overload (euint64, euint64) => euint64 test 4 (18439099819121701507, 18439099819121701503)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18439099819121701507n); - input.add64(18439099819121701503n); + 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.contract5.min_euint64_euint64( + const tx = await this.contract10.min_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18439099819121701503n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(340282366920938463463370032475222092643n); }); - it('test operator "max" overload (euint64, euint64) => euint64 test 1 (18438631683554897479, 18438807769877774597)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438631683554897479n); - input.add64(18438807769877774597n); + 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.contract5.max_euint64_euint64( + const tx = await this.contract10.max_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18438807769877774597n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457580295384680552043n); }); - it('test operator "max" overload (euint64, euint64) => euint64 test 2 (18438631683554897475, 18438631683554897479)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438631683554897475n); - input.add64(18438631683554897479n); + 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.contract5.max_euint64_euint64( + const tx = await this.contract10.max_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18438631683554897479n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(340282366920938463463368511201134180813n); }); - it('test operator "max" overload (euint64, euint64) => euint64 test 3 (18438631683554897479, 18438631683554897479)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438631683554897479n); - input.add64(18438631683554897479n); + 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.contract5.max_euint64_euint64( + const tx = await this.contract10.max_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18438631683554897479n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(340282366920938463463368511201134180813n); }); - it('test operator "max" overload (euint64, euint64) => euint64 test 4 (18438631683554897479, 18438631683554897475)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438631683554897479n); - input.add64(18438631683554897475n); + 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.contract5.max_euint64_euint64( + const tx = await this.contract10.max_euint256_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18438631683554897479n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(340282366920938463463368511201134180813n); }); - it('test operator "add" overload (euint64, uint64) => euint64 test 1 (9219336648067240893, 9219865027937887870)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(9219336648067240893n); - + 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.contract5.add_euint64_uint64( + const tx = await this.contract10.add_euint256_euint256( encryptedAmount.handles[0], - 9219865027937887870n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18439201676005128763n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577123288734822326n); }); - it('test operator "add" overload (euint64, uint64) => euint64 test 2 (9219336648067240891, 9219336648067240893)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(9219336648067240891n); - + 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.contract5.add_euint64_uint64( + const tx = await this.contract10.add_euint256_euint256( encryptedAmount.handles[0], - 9219336648067240893n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18438673296134481784n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484358n); }); - it('test operator "add" overload (euint64, uint64) => euint64 test 3 (9219336648067240893, 9219336648067240893)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(9219336648067240893n); - + 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.contract5.add_euint64_uint64( + const tx = await this.contract10.add_euint256_euint256( encryptedAmount.handles[0], - 9219336648067240893n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18438673296134481786n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484360n); }); - it('test operator "add" overload (euint64, uint64) => euint64 test 4 (9219336648067240893, 9219336648067240891)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(9219336648067240893n); - + 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.contract5.add_euint64_uint64( + const tx = await this.contract10.add_euint256_euint256( encryptedAmount.handles[0], - 9219336648067240891n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18438673296134481784n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484358n); }); - it('test operator "add" overload (uint64, euint64) => euint64 test 1 (9221821645145019755, 9219865027937887870)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add64(9219865027937887870n); + 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.contract5.add_uint64_euint64( - 9221821645145019755n, + const tx = await this.contract10.sub_euint256_euint256( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18441686673082907625n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(0n); }); - it('test operator "add" overload (uint64, euint64) => euint64 test 2 (9219336648067240891, 9219336648067240893)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add64(9219336648067240893n); + 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.contract5.add_uint64_euint64( - 9219336648067240891n, + const tx = await this.contract10.sub_euint256_euint256( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18438673296134481784n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(4n); }); - it('test operator "add" overload (uint64, euint64) => euint64 test 3 (9219336648067240893, 9219336648067240893)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add64(9219336648067240893n); + 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.contract5.add_uint64_euint64( - 9219336648067240893n, + const tx = await this.contract10.mul_euint256_euint256( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18438673296134481786n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); }); - it('test operator "add" overload (uint64, euint64) => euint64 test 4 (9219336648067240893, 9219336648067240891)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add64(9219336648067240891n); + 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.contract5.add_uint64_euint64( - 9219336648067240893n, + const tx = await this.contract10.mul_euint256_euint256( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18438673296134481784n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); }); - it('test operator "sub" overload (euint64, uint64) => euint64 test 1 (18442295292010752223, 18442295292010752223)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442295292010752223n); - + 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.contract5.sub_euint64_uint64( + const tx = await this.contract10.mul_euint256_euint256( encryptedAmount.handles[0], - 18442295292010752223n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(0n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); }); - it('test operator "sub" overload (euint64, uint64) => euint64 test 2 (18442295292010752223, 18442295292010752219)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442295292010752223n); - + 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.contract5.sub_euint64_uint64( + const tx = await this.contract10.mul_euint256_euint256( encryptedAmount.handles[0], - 18442295292010752219n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); }); - it('test operator "sub" overload (uint64, euint64) => euint64 test 1 (18442295292010752223, 18442295292010752223)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add64(18442295292010752223n); + 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.contract5.sub_uint64_euint64( - 18442295292010752223n, + const tx = await this.contract10.and_euint256_euint256( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(0n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457575671150140541961n); }); - it('test operator "sub" overload (uint64, euint64) => euint64 test 2 (18442295292010752223, 18442295292010752219)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add64(18442295292010752219n); + 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.contract5.sub_uint64_euint64( - 18442295292010752223n, + const tx = await this.contract10.and_euint256_euint256( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491321n); }); - it('test operator "mul" overload (euint64, uint64) => euint64 test 1 (4294744203, 4294589707)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(4294744203n); - + 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.contract5.mul_euint64_uint64( + const tx = await this.contract10.and_euint256_euint256( encryptedAmount.handles[0], - 4294589707n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18444164248401718521n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491325n); }); - it('test operator "mul" overload (euint64, uint64) => euint64 test 2 (4293841776, 4293841776)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(4293841776n); - + 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.contract5.mul_euint64_uint64( + const tx = await this.contract10.and_euint256_euint256( encryptedAmount.handles[0], - 4293841776n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18437077197322834176n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491321n); }); - it('test operator "mul" overload (euint64, uint64) => euint64 test 3 (4293841776, 4293841776)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(4293841776n); - + 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.contract5.mul_euint64_uint64( + const tx = await this.contract10.or_euint256_euint256( encryptedAmount.handles[0], - 4293841776n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18437077197322834176n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457583914753535699069n); }); - it('test operator "mul" overload (euint64, uint64) => euint64 test 4 (4293841776, 4293841776)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(4293841776n); - + 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.contract5.mul_euint64_uint64( + const tx = await this.contract10.or_euint256_euint256( encryptedAmount.handles[0], - 4293841776n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18437077197322834176n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184701n); }); - it('test operator "mul" overload (uint64, euint64) => euint64 test 1 (4293263967, 4294589707)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add64(4294589707n); + 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.contract5.mul_uint64_euint64( - 4293263967n, + const tx = await this.contract10.or_euint256_euint256( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18437807242112187669n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184697n); }); - it('test operator "mul" overload (uint64, euint64) => euint64 test 2 (4293841776, 4293841776)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add64(4293841776n); + 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.contract5.mul_uint64_euint64( - 4293841776n, + const tx = await this.contract10.or_euint256_euint256( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18437077197322834176n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184701n); }); - it('test operator "mul" overload (uint64, euint64) => euint64 test 3 (4293841776, 4293841776)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add64(4293841776n); + 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.contract5.mul_uint64_euint64( - 4293841776n, + const tx = await this.contract10.xor_euint256_euint256( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18437077197322834176n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(714633272808854n); }); - it('test operator "mul" overload (uint64, euint64) => euint64 test 4 (4293841776, 4293841776)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add64(4293841776n); + 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.contract5.mul_uint64_euint64( - 4293841776n, + const tx = await this.contract10.xor_euint256_euint256( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18437077197322834176n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(124n); }); - it('test operator "div" overload (euint64, uint64) => euint64 test 1 (18442885434890559161, 18443612733078410209)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442885434890559161n); - + 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.contract5.div_euint64_uint64( + const tx = await this.contract10.xor_euint256_euint256( encryptedAmount.handles[0], - 18443612733078410209n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); + const res = await decrypt256(await this.contract10.res256()); expect(res).to.equal(0n); }); - it('test operator "div" overload (euint64, uint64) => euint64 test 2 (18442885434890559157, 18442885434890559161)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442885434890559157n); - + 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.contract5.div_euint64_uint64( + const tx = await this.contract10.xor_euint256_euint256( encryptedAmount.handles[0], - 18442885434890559161n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(0n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(124n); }); - it('test operator "div" overload (euint64, uint64) => euint64 test 3 (18442885434890559161, 18442885434890559161)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442885434890559161n); - + 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.contract5.div_euint64_uint64( + const tx = await this.contract10.eq_euint256_euint256( encryptedAmount.handles[0], - 18442885434890559161n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(1n); + const res = await decryptBool(await this.contract10.resb()); + expect(res).to.equal(false); }); - it('test operator "div" overload (euint64, uint64) => euint64 test 4 (18442885434890559161, 18442885434890559157)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442885434890559161n); - + 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.contract5.div_euint64_uint64( + const tx = await this.contract10.eq_euint256_euint256( encryptedAmount.handles[0], - 18442885434890559157n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(1n); + const res = await decryptBool(await this.contract10.resb()); + expect(res).to.equal(false); }); - it('test operator "rem" overload (euint64, uint64) => euint64 test 1 (18445299104872939013, 18441298343819074757)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18445299104872939013n); - + 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.contract5.rem_euint64_uint64( + const tx = await this.contract10.eq_euint256_euint256( encryptedAmount.handles[0], - 18441298343819074757n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4000761053864256n); + const res = await decryptBool(await this.contract10.resb()); + expect(res).to.equal(true); }); - it('test operator "rem" overload (euint64, uint64) => euint64 test 2 (18441202573467232859, 18441202573467232863)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18441202573467232859n); - + 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.contract5.rem_euint64_uint64( + const tx = await this.contract10.eq_euint256_euint256( encryptedAmount.handles[0], - 18441202573467232863n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18441202573467232859n); + const res = await decryptBool(await this.contract10.resb()); + expect(res).to.equal(false); }); - it('test operator "rem" overload (euint64, uint64) => euint64 test 3 (18441202573467232863, 18441202573467232863)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18441202573467232863n); - + 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.contract5.rem_euint64_uint64( + const tx = await this.contract10.ne_euint256_euint256( encryptedAmount.handles[0], - 18441202573467232863n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(0n); + const res = await decryptBool(await this.contract10.resb()); + expect(res).to.equal(true); }); - it('test operator "rem" overload (euint64, uint64) => euint64 test 4 (18441202573467232863, 18441202573467232859)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18441202573467232863n); - + 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.contract5.rem_euint64_uint64( + const tx = await this.contract10.ne_euint256_euint256( encryptedAmount.handles[0], - 18441202573467232859n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4n); + const res = await decryptBool(await this.contract10.resb()); + expect(res).to.equal(true); }); - it('test operator "eq" overload (euint64, uint64) => ebool test 1 (18442470885463520691, 18444839379902899701)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442470885463520691n); - + 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.contract5.eq_euint64_uint64( + const tx = await this.contract10.ne_euint256_euint256( encryptedAmount.handles[0], - 18444839379902899701n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint64, uint64) => ebool test 2 (18442470885463520687, 18442470885463520691)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442470885463520687n); - + 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.contract5.eq_euint64_uint64( + const tx = await this.contract10.ne_euint256_euint256( encryptedAmount.handles[0], - 18442470885463520691n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract10.resb()); + expect(res).to.equal(true); }); - it('test operator "eq" overload (euint64, uint64) => ebool test 3 (18442470885463520691, 18442470885463520691)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442470885463520691n); - + 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.contract5.eq_euint64_uint64( + const tx = await this.contract10.ge_euint256_euint256( encryptedAmount.handles[0], - 18442470885463520691n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract10.resb()); + expect(res).to.equal(false); }); - it('test operator "eq" overload (euint64, uint64) => ebool test 4 (18442470885463520691, 18442470885463520687)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442470885463520691n); - + 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.contract5.eq_euint64_uint64( + const tx = await this.contract10.ge_euint256_euint256( encryptedAmount.handles[0], - 18442470885463520687n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (uint64, euint64) => ebool test 1 (18446106064654681685, 18444839379902899701)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add64(18444839379902899701n); + 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.contract5.eq_uint64_euint64( - 18446106064654681685n, + 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.contract5.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract10.resb()); + expect(res).to.equal(true); }); - it('test operator "eq" overload (uint64, euint64) => ebool test 2 (18442470885463520687, 18442470885463520691)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add64(18442470885463520691n); + 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.contract5.eq_uint64_euint64( - 18442470885463520687n, + 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.contract5.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract10.resb()); + expect(res).to.equal(true); }); - it('test operator "eq" overload (uint64, euint64) => ebool test 3 (18442470885463520691, 18442470885463520691)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add64(18442470885463520691n); + 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.contract5.eq_uint64_euint64( - 18442470885463520691n, + 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.contract5.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract10.resb()); + expect(res).to.equal(false); }); - it('test operator "eq" overload (uint64, euint64) => ebool test 4 (18442470885463520691, 18442470885463520687)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add64(18442470885463520687n); + 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.contract5.eq_uint64_euint64( - 18442470885463520691n, + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint64, uint64) => ebool test 1 (18442343533763371027, 18445982647402256701)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18442343533763371027n); - + 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.contract5.ne_euint64_uint64( + const tx = await this.contract10.gt_euint256_euint256( encryptedAmount.handles[0], - 18445982647402256701n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract10.resb()); + expect(res).to.equal(false); }); - it('test operator "ne" overload (euint64, uint64) => ebool test 2 (18438477816592523449, 18438477816592523453)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438477816592523449n); - + 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.contract5.ne_euint64_uint64( + const tx = await this.contract10.gt_euint256_euint256( encryptedAmount.handles[0], - 18438477816592523453n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint64, uint64) => ebool test 3 (18438477816592523453, 18438477816592523453)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438477816592523453n); - + 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.contract5.ne_euint64_uint64( + const tx = await this.contract10.le_euint256_euint256( encryptedAmount.handles[0], - 18438477816592523453n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint64, uint64) => ebool test 4 (18438477816592523453, 18438477816592523449)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438477816592523453n); - + 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.contract5.ne_euint64_uint64( + const tx = await this.contract10.le_euint256_euint256( encryptedAmount.handles[0], - 18438477816592523449n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (uint64, euint64) => ebool test 1 (18440875682349733785, 18445982647402256701)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add64(18445982647402256701n); + 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.contract5.ne_uint64_euint64( - 18440875682349733785n, + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (uint64, euint64) => ebool test 2 (18438477816592523449, 18438477816592523453)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add64(18438477816592523453n); + 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.contract5.ne_uint64_euint64( - 18438477816592523449n, + 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.contract5.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract10.resb()); + expect(res).to.equal(false); }); - it('test operator "ne" overload (uint64, euint64) => ebool test 3 (18438477816592523453, 18438477816592523453)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add64(18438477816592523453n); + 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.contract5.ne_uint64_euint64( - 18438477816592523453n, + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (uint64, euint64) => ebool test 4 (18438477816592523453, 18438477816592523449)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add64(18438477816592523449n); + 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.contract5.ne_uint64_euint64( - 18438477816592523453n, + 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.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint64, uint64) => ebool test 1 (18441951286640352465, 18443569233121144247)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18441951286640352465n); - + 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.contract5.ge_euint64_uint64( + const tx = await this.contract10.lt_euint256_euint256( encryptedAmount.handles[0], - 18443569233121144247n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(false); }); - it('test operator "ge" overload (euint64, uint64) => ebool test 2 (18441951286640352461, 18441951286640352465)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18441951286640352461n); - + 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.contract5.ge_euint64_uint64( + const tx = await this.contract10.lt_euint256_euint256( encryptedAmount.handles[0], - 18441951286640352465n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); + const res = await decryptBool(await this.contract10.resb()); expect(res).to.equal(false); }); - it('test operator "ge" overload (euint64, uint64) => ebool test 3 (18441951286640352465, 18441951286640352465)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18441951286640352465n); - + 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.contract5.ge_euint64_uint64( + const tx = await this.contract10.min_euint256_euint256( encryptedAmount.handles[0], - 18441951286640352465n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778291n); }); - it('test operator "ge" overload (euint64, uint64) => ebool test 4 (18441951286640352465, 18441951286640352461)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18441951286640352465n); - + 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.contract5.ge_euint64_uint64( + const tx = await this.contract10.min_euint256_euint256( encryptedAmount.handles[0], - 18441951286640352461n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778287n); }); - it('test operator "ge" overload (uint64, euint64) => ebool test 1 (18439035083186430691, 18443569233121144247)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add64(18443569233121144247n); + 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.contract5.ge_uint64_euint64( - 18439035083186430691n, + const tx = await this.contract10.min_euint256_euint256( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778291n); }); - it('test operator "ge" overload (uint64, euint64) => ebool test 2 (18441951286640352461, 18441951286640352465)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add64(18441951286640352465n); + 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.contract5.ge_uint64_euint64( - 18441951286640352461n, + const tx = await this.contract10.min_euint256_euint256( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778287n); }); - it('test operator "ge" overload (uint64, euint64) => ebool test 3 (18441951286640352465, 18441951286640352465)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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); + }); - input.add64(18441951286640352465n); + 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.contract5.ge_uint64_euint64( - 18441951286640352465n, + const tx = await this.contract10.max_euint256_euint256( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577809030115355409n); }); - it('test operator "ge" overload (uint64, euint64) => ebool test 4 (18441951286640352465, 18441951286640352461)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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); + }); - input.add64(18441951286640352461n); + 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.contract5.ge_uint64_euint64( - 18441951286640352465n, + const tx = await this.contract10.max_euint256_euint256( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577809030115355409n); }); - it('test operator "gt" overload (euint64, uint64) => ebool test 1 (18443021258691337483, 18440565481263531071)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18443021258691337483n); + 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.contract5.gt_euint64_uint64( + const tx = await this.contract10.add_euint256_uint256( encryptedAmount.handles[0], - 18440565481263531071n, + 57896044618658097711785492504343953926634992332820282019728788733583887971237n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577747386712051383n); }); - it('test operator "gt" overload (euint64, uint64) => ebool test 2 (18443021258691337479, 18443021258691337483)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18443021258691337479n); + 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.contract5.gt_euint64_uint64( + const tx = await this.contract10.add_euint256_uint256( encryptedAmount.handles[0], - 18443021258691337483n, + 57896044618658097711785492504343953926634992332820282019728788109485910742180n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484358n); }); - it('test operator "gt" overload (euint64, uint64) => ebool test 3 (18443021258691337483, 18443021258691337483)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18443021258691337483n); + 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.contract5.gt_euint64_uint64( + const tx = await this.contract10.add_euint256_uint256( encryptedAmount.handles[0], - 18443021258691337483n, + 57896044618658097711785492504343953926634992332820282019728788109485910742180n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484360n); }); - it('test operator "gt" overload (euint64, uint64) => ebool test 4 (18443021258691337483, 18443021258691337479)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18443021258691337483n); + 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.contract5.gt_euint64_uint64( + const tx = await this.contract10.add_euint256_uint256( encryptedAmount.handles[0], - 18443021258691337479n, + 57896044618658097711785492504343953926634992332820282019728788109485910742178n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484358n); }); - it('test operator "gt" overload (uint64, euint64) => ebool test 1 (18439903764692512057, 18440565481263531071)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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.add64(18440565481263531071n); + input.add256(57896044618658097711785492504343953926634992332820282019728788733583887971237n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_uint64_euint64( - 18439903764692512057n, + const tx = await this.contract10.add_uint256_euint256( + 57896044618658097711785492504343953926634992332820282019728789372175656948236n, encryptedAmount.handles[0], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457578105759544919473n); }); - it('test operator "gt" overload (uint64, euint64) => ebool test 2 (18443021258691337479, 18443021258691337483)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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.add64(18443021258691337483n); + input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742180n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_uint64_euint64( - 18443021258691337479n, + const tx = await this.contract10.add_uint256_euint256( + 57896044618658097711785492504343953926634992332820282019728788109485910742178n, encryptedAmount.handles[0], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484358n); }); - it('test operator "gt" overload (uint64, euint64) => ebool test 3 (18443021258691337483, 18443021258691337483)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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.add64(18443021258691337483n); + input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742180n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_uint64_euint64( - 18443021258691337483n, + const tx = await this.contract10.add_uint256_euint256( + 57896044618658097711785492504343953926634992332820282019728788109485910742180n, encryptedAmount.handles[0], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484360n); }); - it('test operator "gt" overload (uint64, euint64) => ebool test 4 (18443021258691337483, 18443021258691337479)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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.add64(18443021258691337479n); + input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742178n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_uint64_euint64( - 18443021258691337483n, + const tx = await this.contract10.add_uint256_euint256( + 57896044618658097711785492504343953926634992332820282019728788109485910742180n, encryptedAmount.handles[0], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484358n); }); - it('test operator "le" overload (euint64, uint64) => ebool test 1 (18443782238591650169, 18439298139086159343)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18443782238591650169n); + 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.contract5.le_euint64_uint64( + const tx = await this.contract10.sub_euint256_uint256( encryptedAmount.handles[0], - 18439298139086159343n, + 115792089237316195423570985008687907853269984665640564039457579667871013646565n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(0n); }); - it('test operator "le" overload (euint64, uint64) => ebool test 2 (18441978790273961909, 18441978790273961913)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18441978790273961909n); + 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.contract5.le_euint64_uint64( + const tx = await this.contract10.sub_euint256_uint256( encryptedAmount.handles[0], - 18441978790273961913n, + 115792089237316195423570985008687907853269984665640564039457579667871013646561n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(4n); }); - it('test operator "le" overload (euint64, uint64) => ebool test 3 (18441978790273961913, 18441978790273961913)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18441978790273961913n); + 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.contract5.le_euint64_uint64( + const tx = await this.contract10.sub_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457579667871013646565n, encryptedAmount.handles[0], - 18441978790273961913n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(0n); }); - it('test operator "le" overload (euint64, uint64) => ebool test 4 (18441978790273961913, 18441978790273961909)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18441978790273961913n); + 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.contract5.le_euint64_uint64( + const tx = await this.contract10.sub_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457579667871013646565n, encryptedAmount.handles[0], - 18441978790273961909n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(4n); }); - it('test operator "le" overload (uint64, euint64) => ebool test 1 (18438386930936343347, 18439298139086159343)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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); - input.add64(18439298139086159343n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_uint64_euint64( - 18438386930936343347n, + const tx = await this.contract10.mul_euint256_uint256( encryptedAmount.handles[0], + 170141183460469231731687303715884105729n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); }); - it('test operator "le" overload (uint64, euint64) => ebool test 2 (18441978790273961909, 18441978790273961913)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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); - input.add64(18441978790273961913n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_uint64_euint64( - 18441978790273961909n, + const tx = await this.contract10.mul_euint256_uint256( encryptedAmount.handles[0], + 170141183460469231731687303715884105729n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); }); - it('test operator "le" overload (uint64, euint64) => ebool test 3 (18441978790273961913, 18441978790273961913)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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); - input.add64(18441978790273961913n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_uint64_euint64( - 18441978790273961913n, + const tx = await this.contract10.mul_euint256_uint256( encryptedAmount.handles[0], + 170141183460469231731687303715884105729n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); }); - it('test operator "le" overload (uint64, euint64) => ebool test 4 (18441978790273961913, 18441978790273961909)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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); - input.add64(18441978790273961909n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_uint64_euint64( - 18441978790273961913n, + const tx = await this.contract10.mul_euint256_uint256( encryptedAmount.handles[0], + 170141183460469231731687303715884105729n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); }); - it('test operator "lt" overload (euint64, uint64) => ebool test 1 (18445972196307174659, 18441359463085216855)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18445972196307174659n); + 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.contract5.lt_euint64_uint64( + const tx = await this.contract10.mul_uint256_euint256( + 170141183460469231731687303715884105729n, encryptedAmount.handles[0], - 18441359463085216855n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); }); - it('test operator "lt" overload (euint64, uint64) => ebool test 2 (18438760003066140567, 18438760003066140571)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438760003066140567n); + 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.contract5.lt_euint64_uint64( + const tx = await this.contract10.mul_uint256_euint256( + 170141183460469231731687303715884105729n, encryptedAmount.handles[0], - 18438760003066140571n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); }); - it('test operator "lt" overload (euint64, uint64) => ebool test 3 (18438760003066140571, 18438760003066140571)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438760003066140571n); + 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.contract5.lt_euint64_uint64( + const tx = await this.contract10.mul_uint256_euint256( + 170141183460469231731687303715884105729n, encryptedAmount.handles[0], - 18438760003066140571n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); }); - it('test operator "lt" overload (euint64, uint64) => ebool test 4 (18438760003066140571, 18438760003066140567)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438760003066140571n); + 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.contract5.lt_euint64_uint64( + const tx = await this.contract10.mul_uint256_euint256( + 170141183460469231731687303715884105729n, encryptedAmount.handles[0], - 18438760003066140567n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); }); - it('test operator "lt" overload (uint64, euint64) => ebool test 1 (18440565799944043085, 18441359463085216855)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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); - input.add64(18441359463085216855n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_uint64_euint64( - 18440565799944043085n, + const tx = await this.contract10.div_euint256_uint256( encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457577919950085050983n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(1n); }); - it('test operator "lt" overload (uint64, euint64) => ebool test 2 (18438760003066140567, 18438760003066140571)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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); - input.add64(18438760003066140571n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_uint64_euint64( - 18438760003066140567n, + const tx = await this.contract10.div_euint256_uint256( encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457576535097376895419n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(0n); }); - it('test operator "lt" overload (uint64, euint64) => ebool test 3 (18438760003066140571, 18438760003066140571)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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); - input.add64(18438760003066140571n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_uint64_euint64( - 18438760003066140571n, + const tx = await this.contract10.div_euint256_uint256( encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457576535097376895419n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(1n); }); - it('test operator "lt" overload (uint64, euint64) => ebool test 4 (18438760003066140571, 18438760003066140567)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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); - input.add64(18438760003066140567n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_uint64_euint64( - 18438760003066140571n, + const tx = await this.contract10.div_euint256_uint256( encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457576535097376895415n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(1n); }); - it('test operator "min" overload (euint64, uint64) => euint64 test 1 (18446277918636147641, 18444361908116912137)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18446277918636147641n); + 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.contract5.min_euint64_uint64( + const tx = await this.contract10.rem_euint256_uint256( encryptedAmount.handles[0], - 18444361908116912137n, + 115792089237316195423570985008687907853269984665640564039457581127377285906497n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18444361908116912137n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457578502975350831453n); }); - it('test operator "min" overload (euint64, uint64) => euint64 test 2 (18439099819121701503, 18439099819121701507)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18439099819121701503n); + 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.contract5.min_euint64_uint64( + const tx = await this.contract10.rem_euint256_uint256( encryptedAmount.handles[0], - 18439099819121701507n, + 115792089237316195423570985008687907853269984665640564039457577137781640958327n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18439099819121701503n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577137781640958323n); }); - it('test operator "min" overload (euint64, uint64) => euint64 test 3 (18439099819121701507, 18439099819121701507)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18439099819121701507n); + 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.contract5.min_euint64_uint64( + const tx = await this.contract10.rem_euint256_uint256( encryptedAmount.handles[0], - 18439099819121701507n, + 115792089237316195423570985008687907853269984665640564039457577137781640958327n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18439099819121701507n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(0n); }); - it('test operator "min" overload (euint64, uint64) => euint64 test 4 (18439099819121701507, 18439099819121701503)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18439099819121701507n); + 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.contract5.min_euint64_uint64( + const tx = await this.contract10.rem_euint256_uint256( encryptedAmount.handles[0], - 18439099819121701503n, + 115792089237316195423570985008687907853269984665640564039457577137781640958323n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18439099819121701503n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(4n); }); - it('test operator "min" overload (uint64, euint64) => euint64 test 1 (18445356693251014369, 18444361908116912137)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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); - input.add64(18444361908116912137n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_uint64_euint64( - 18445356693251014369n, + const tx = await this.contract10.and_euint256_uint256( encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457581816489991853517n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18444361908116912137n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579557951374476745n); }); - it('test operator "min" overload (uint64, euint64) => euint64 test 2 (18439099819121701503, 18439099819121701507)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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); - input.add64(18439099819121701507n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_uint64_euint64( - 18439099819121701503n, + const tx = await this.contract10.and_euint256_uint256( encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457579064265044491325n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18439099819121701503n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491321n); }); - it('test operator "min" overload (uint64, euint64) => euint64 test 3 (18439099819121701507, 18439099819121701507)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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); - input.add64(18439099819121701507n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_uint64_euint64( - 18439099819121701507n, + const tx = await this.contract10.and_euint256_uint256( encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457579064265044491325n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18439099819121701507n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491325n); }); - it('test operator "min" overload (uint64, euint64) => euint64 test 4 (18439099819121701507, 18439099819121701503)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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); - input.add64(18439099819121701503n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_uint64_euint64( - 18439099819121701507n, + const tx = await this.contract10.and_euint256_uint256( encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457579064265044491321n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18439099819121701503n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491321n); }); - it('test operator "max" overload (euint64, uint64) => euint64 test 1 (18438631683554897479, 18445384533883180417)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438631683554897479n); + 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.contract5.max_euint64_uint64( + const tx = await this.contract10.and_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457576516611416206839n, encryptedAmount.handles[0], - 18445384533883180417n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18445384533883180417n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457575038788798842309n); }); - it('test operator "max" overload (euint64, uint64) => euint64 test 2 (18438631683554897475, 18438631683554897479)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438631683554897475n); + 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.contract5.max_euint64_uint64( + const tx = await this.contract10.and_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457579064265044491321n, encryptedAmount.handles[0], - 18438631683554897479n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18438631683554897479n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491321n); }); - it('test operator "max" overload (euint64, uint64) => euint64 test 3 (18438631683554897479, 18438631683554897479)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438631683554897479n); + 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.contract5.max_euint64_uint64( + const tx = await this.contract10.and_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457579064265044491325n, encryptedAmount.handles[0], - 18438631683554897479n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18438631683554897479n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491325n); }); - it('test operator "max" overload (euint64, uint64) => euint64 test 4 (18438631683554897479, 18438631683554897475)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18438631683554897479n); + 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.contract5.max_euint64_uint64( + const tx = await this.contract10.and_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457579064265044491325n, encryptedAmount.handles[0], - 18438631683554897475n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18438631683554897479n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491321n); }); - it('test operator "max" overload (uint64, euint64) => euint64 test 1 (18440833161069655121, 18445384533883180417)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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); - input.add64(18445384533883180417n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_uint64_euint64( - 18440833161069655121n, + const tx = await this.contract10.or_euint256_uint256( encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457575617602160724601n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18445384533883180417n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579147311516134009n); }); - it('test operator "max" overload (uint64, euint64) => euint64 test 2 (18438631683554897475, 18438631683554897479)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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); - input.add64(18438631683554897479n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_uint64_euint64( - 18438631683554897475n, + const tx = await this.contract10.or_euint256_uint256( encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457579093390716184697n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18438631683554897479n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184701n); }); - it('test operator "max" overload (uint64, euint64) => euint64 test 3 (18438631683554897479, 18438631683554897479)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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); - input.add64(18438631683554897479n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_uint64_euint64( - 18438631683554897479n, + const tx = await this.contract10.or_euint256_uint256( encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457579093390716184697n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18438631683554897479n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184697n); }); - it('test operator "max" overload (uint64, euint64) => euint64 test 4 (18438631683554897479, 18438631683554897475)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + 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); - input.add64(18438631683554897475n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_uint64_euint64( - 18438631683554897479n, + const tx = await this.contract10.or_euint256_uint256( encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457579093390716184693n, encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18438631683554897479n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184701n); }); - it('test operator "shl" overload (euint4, uint8) => euint4 test 1 (4, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add4(4n); + 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.contract5.shl_euint4_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof); + const tx = await this.contract10.or_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457580060042571469423n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract5.res4()); - expect(res).to.equal(8n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457580622993567439487n); }); - it('test operator "shl" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add4(4n); + 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.contract5.shl_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract10.or_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457579093390716184693n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract5.res4()); - expect(res).to.equal(4n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184701n); }); - it('test operator "shl" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add4(8n); + 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.contract5.shl_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract10.or_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457579093390716184697n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract5.res4()); - expect(res).to.equal(8n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184697n); }); - it('test operator "shl" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add4(8n); + 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.contract5.shl_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract10.or_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457579093390716184697n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract5.res4()); - expect(res).to.equal(8n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184701n); }); - it('test operator "shr" overload (euint4, uint8) => euint4 test 1 (7, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add4(7n); + 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.contract5.shr_euint4_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + const tx = await this.contract10.xor_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457579143464719512889n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract5.res4()); - expect(res).to.equal(0n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(5655612635835244n); }); - it('test operator "shr" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add4(4n); + 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.contract5.shr_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract10.xor_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457581801761034193859n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract5.res4()); - expect(res).to.equal(4n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(124n); }); - it('test operator "shr" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add4(8n); + 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.contract5.shr_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract10.xor_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457581801761034193859n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract5.res4()); - expect(res).to.equal(8n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(0n); }); - it('test operator "shr" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add4(8n); + 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.contract5.shr_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract10.xor_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457581801761034193855n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract5.res4()); - expect(res).to.equal(8n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(124n); }); - it('test operator "rotl" overload (euint4, uint8) => euint4 test 1 (14, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add4(14n); + 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.contract5.rotl_euint4_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + const tx = await this.contract10.xor_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457579014577469369511n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract5.res4()); - expect(res).to.equal(7n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(269763301726622n); }); - it('test operator "rotl" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add4(4n); + 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.contract5.rotl_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract10.xor_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457581801761034193855n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract5.res4()); - expect(res).to.equal(4n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(124n); }); - it('test operator "rotl" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add4(8n); + 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.contract5.rotl_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract10.xor_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457581801761034193859n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract5.res4()); - expect(res).to.equal(8n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(0n); }); - it('test operator "rotl" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add4(8n); + 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.contract5.rotl_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract10.xor_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457581801761034193859n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract5.res4()); - expect(res).to.equal(8n); + const res = await decrypt256(await this.contract10.res256()); + expect(res).to.equal(124n); }); }); diff --git a/test/tfheOperations/tfheOperations12.ts b/test/tfheOperations/tfheOperations12.ts index 9a753ae6..3c4e4b0f 100644 --- a/test/tfheOperations/tfheOperations12.ts +++ b/test/tfheOperations/tfheOperations12.ts @@ -7,7 +7,22 @@ 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 { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance'; +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 { @@ -76,1844 +91,3863 @@ async function deployTfheTestFixture6(): Promise { 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 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); + }); - const contract2 = await deployTfheTestFixture2(); - this.contract2Address = await contract2.getAddress(); - this.contract2 = contract2; + 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 contract3 = await deployTfheTestFixture3(); - this.contract3Address = await contract3.getAddress(); - this.contract3 = contract3; + 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); + }); - const contract4 = await deployTfheTestFixture4(); - this.contract4Address = await contract4.getAddress(); - this.contract4 = contract4; + 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 contract5 = await deployTfheTestFixture5(); - this.contract5Address = await contract5.getAddress(); - this.contract5 = contract5; + 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); + }); - const contract6 = await deployTfheTestFixture6(); - this.contract6Address = await contract6.getAddress(); - this.contract6 = contract6; + 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 instances = await createInstances(this.signers); - this.instances = instances; + 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 "rotr" overload (euint4, uint8) => euint4 test 1 (14, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add4(14n); + 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.contract5.rotr_euint4_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + const tx = await this.contract11.rotl_euint16_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract5.res4()); - expect(res).to.equal(13n); + const res = await decrypt16(await this.contract11.res16()); + expect(res).to.equal(128n); }); - it('test operator "rotr" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add4(4n); + 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.contract5.rotr_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.rotr_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract5.res4()); - expect(res).to.equal(4n); + const res = await decrypt16(await this.contract11.res16()); + expect(res).to.equal(1024n); }); - it('test operator "rotr" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add4(8n); + 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.contract5.rotr_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.rotr_euint16_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract5.res4()); - expect(res).to.equal(8n); + const res = await decrypt16(await this.contract11.res16()); + expect(res).to.equal(12217n); }); - it('test operator "rotr" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add4(8n); + 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.contract5.rotr_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract11.rotr_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract5.res4()); - expect(res).to.equal(8n); + const res = await decrypt16(await this.contract11.res16()); + expect(res).to.equal(1024n); }); - it('test operator "shl" overload (euint8, euint8) => euint8 test 1 (201, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(201n); - input.add8(7n); + 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.contract5.shl_euint8_euint8( + const tx = await this.contract11.shl_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(128n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(3793627264n); }); - it('test operator "shl" overload (euint8, euint8) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(4n); + 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.contract5.shl_euint8_euint8( + const tx = await this.contract11.shl_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(4n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(1024n); }); - it('test operator "shl" overload (euint8, euint8) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(8n); + 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.contract5.shl_euint8_euint8( + const tx = await this.contract11.shl_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(8n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(2048n); }); - it('test operator "shl" overload (euint8, euint8) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(8n); + 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.contract5.shl_euint8_euint8( + const tx = await this.contract11.shl_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); + const res = await decrypt32(await this.contract11.res32()); expect(res).to.equal(128n); }); - it('test operator "shl" overload (euint8, uint8) => euint8 test 1 (201, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(201n); + 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.contract5.shl_euint8_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + const tx = await this.contract11.shl_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(128n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(3793627264n); }); - it('test operator "shl" overload (euint8, uint8) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(4n); + 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.contract5.shl_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.shl_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(4n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(1024n); }); - it('test operator "shl" overload (euint8, uint8) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(8n); + 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.contract5.shl_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.shl_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(8n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(2048n); }); - it('test operator "shl" overload (euint8, uint8) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(8n); + 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.contract5.shl_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract11.shl_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); + const res = await decrypt32(await this.contract11.res32()); expect(res).to.equal(128n); }); - it('test operator "shr" overload (euint8, euint8) => euint8 test 1 (15, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(15n); + 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.contract5.shr_euint8_euint8( + const tx = await this.contract11.shr_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(0n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(107559321n); }); - it('test operator "shr" overload (euint8, euint8) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(4n); + 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.contract5.shr_euint8_euint8( + const tx = await this.contract11.shr_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(4n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(0n); }); - it('test operator "shr" overload (euint8, euint8) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(8n); + 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.contract5.shr_euint8_euint8( + const tx = await this.contract11.shr_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(8n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(0n); }); - it('test operator "shr" overload (euint8, euint8) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(8n); + 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.contract5.shr_euint8_euint8( + const tx = await this.contract11.shr_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); + const res = await decrypt32(await this.contract11.res32()); expect(res).to.equal(0n); }); - it('test operator "shr" overload (euint8, uint8) => euint8 test 1 (15, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(15n); + 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.contract5.shr_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract11.shr_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(0n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(107559321n); }); - it('test operator "shr" overload (euint8, uint8) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(4n); + 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.contract5.shr_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.shr_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(4n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(0n); }); - it('test operator "shr" overload (euint8, uint8) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(8n); + 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.contract5.shr_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.shr_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(8n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(0n); }); - it('test operator "shr" overload (euint8, uint8) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(8n); + 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.contract5.shr_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract11.shr_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); + const res = await decrypt32(await this.contract11.res32()); expect(res).to.equal(0n); }); - it('test operator "rotl" overload (euint8, euint8) => euint8 test 1 (52, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(52n); - input.add8(1n); + 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.contract5.rotl_euint8_euint8( + const tx = await this.contract11.rotl_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(104n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(83443704n); }); - it('test operator "rotl" overload (euint8, euint8) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(4n); + 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.contract5.rotl_euint8_euint8( + const tx = await this.contract11.rotl_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(4n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(1024n); }); - it('test operator "rotl" overload (euint8, euint8) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(8n); + 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.contract5.rotl_euint8_euint8( + const tx = await this.contract11.rotl_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(8n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(2048n); }); - it('test operator "rotl" overload (euint8, euint8) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(8n); + 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.contract5.rotl_euint8_euint8( + const tx = await this.contract11.rotl_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); + const res = await decrypt32(await this.contract11.res32()); expect(res).to.equal(128n); }); - it('test operator "rotl" overload (euint8, uint8) => euint8 test 1 (52, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(52n); + 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.contract5.rotl_euint8_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof); + const tx = await this.contract11.rotl_euint32_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(104n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(83443704n); }); - it('test operator "rotl" overload (euint8, uint8) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(4n); + 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.contract5.rotl_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.rotl_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(4n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(1024n); }); - it('test operator "rotl" overload (euint8, uint8) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(8n); + 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.contract5.rotl_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.rotl_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(8n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(2048n); }); - it('test operator "rotl" overload (euint8, uint8) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(8n); + 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.contract5.rotl_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract11.rotl_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); + const res = await decrypt32(await this.contract11.res32()); expect(res).to.equal(128n); }); - it('test operator "rotr" overload (euint8, euint8) => euint8 test 1 (50, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(50n); - input.add8(4n); + 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.contract5.rotr_euint8_euint8( + const tx = await this.contract11.rotr_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(35n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(1839199560n); }); - it('test operator "rotr" overload (euint8, euint8) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(4n); + 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.contract5.rotr_euint8_euint8( + const tx = await this.contract11.rotr_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(4n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(67108864n); }); - it('test operator "rotr" overload (euint8, euint8) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(8n); + 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.contract5.rotr_euint8_euint8( + const tx = await this.contract11.rotr_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(8n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(134217728n); }); - it('test operator "rotr" overload (euint8, euint8) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(8n); + 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.contract5.rotr_euint8_euint8( + const tx = await this.contract11.rotr_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(128n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(2147483648n); }); - it('test operator "rotr" overload (euint8, uint8) => euint8 test 1 (50, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(50n); + 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.contract5.rotr_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract11.rotr_euint32_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(35n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(1839199560n); }); - it('test operator "rotr" overload (euint8, uint8) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(4n); + 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.contract5.rotr_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.rotr_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(4n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(67108864n); }); - it('test operator "rotr" overload (euint8, uint8) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(8n); + 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.contract5.rotr_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.rotr_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(8n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(134217728n); }); - it('test operator "rotr" overload (euint8, uint8) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add8(8n); + 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.contract5.rotr_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract11.rotr_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract5.res8()); - expect(res).to.equal(128n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(2147483648n); }); - it('test operator "shl" overload (euint16, euint8) => euint16 test 1 (43733, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(43733n); - input.add8(1n); + 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.contract5.shl_euint16_euint8( + const tx = await this.contract11.shl_euint64_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(21930n); + const res = await decrypt64(await this.contract11.res64()); + expect(res).to.equal(17941654469459553984n); }); - it('test operator "shl" overload (euint16, euint8) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(4n); + 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.contract5.shl_euint16_euint8( + const tx = await this.contract11.shl_euint64_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); + const res = await decrypt64(await this.contract11.res64()); 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.contract5Address, this.signers.alice.address); - input.add16(8n); + 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.contract5.shl_euint16_euint8( + const tx = await this.contract11.shl_euint64_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); + const res = await decrypt64(await this.contract11.res64()); 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.contract5Address, this.signers.alice.address); - input.add16(8n); + 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.contract5.shl_euint16_euint8( + const tx = await this.contract11.shl_euint64_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); + const res = await decrypt64(await this.contract11.res64()); expect(res).to.equal(128n); }); - it('test operator "shl" overload (euint16, uint8) => euint16 test 1 (43733, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(43733n); + 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.contract5.shl_euint16_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof); + const tx = await this.contract11.shl_euint64_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(21930n); + const res = await decrypt64(await this.contract11.res64()); + expect(res).to.equal(17941654469459553984n); }); - it('test operator "shl" overload (euint16, uint8) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(4n); + 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.contract5.shl_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.shl_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); + const res = await decrypt64(await this.contract11.res64()); 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.contract5Address, this.signers.alice.address); - input.add16(8n); + 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.contract5.shl_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.shl_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); + const res = await decrypt64(await this.contract11.res64()); 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.contract5Address, this.signers.alice.address); - input.add16(8n); + 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.contract5.shl_euint16_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract11.shl_euint64_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); + const res = await decrypt64(await this.contract11.res64()); expect(res).to.equal(128n); }); - it('test operator "shr" overload (euint16, euint8) => euint16 test 1 (55114, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(55114n); - input.add8(1n); + 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.contract5.shr_euint16_euint8( + const tx = await this.contract11.shr_euint64_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(27557n); + const res = await decrypt64(await this.contract11.res64()); + expect(res).to.equal(288195095858059267n); }); - it('test operator "shr" overload (euint16, euint8) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(4n); + 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.contract5.shr_euint16_euint8( + const tx = await this.contract11.shr_euint64_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); + const res = await decrypt64(await this.contract11.res64()); 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.contract5Address, this.signers.alice.address); - input.add16(8n); + 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.contract5.shr_euint16_euint8( + const tx = await this.contract11.shr_euint64_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); + const res = await decrypt64(await this.contract11.res64()); 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.contract5Address, this.signers.alice.address); - input.add16(8n); + 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.contract5.shr_euint16_euint8( + const tx = await this.contract11.shr_euint64_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); + const res = await decrypt64(await this.contract11.res64()); expect(res).to.equal(0n); }); - it('test operator "shr" overload (euint16, uint8) => euint16 test 1 (55114, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(55114n); + 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.contract5.shr_euint16_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof); + const tx = await this.contract11.shr_euint64_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(27557n); + const res = await decrypt64(await this.contract11.res64()); + expect(res).to.equal(288195095858059267n); }); - it('test operator "shr" overload (euint16, uint8) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(4n); + 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.contract5.shr_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.shr_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); + const res = await decrypt64(await this.contract11.res64()); 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.contract5Address, this.signers.alice.address); - input.add16(8n); + 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.contract5.shr_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.shr_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); + const res = await decrypt64(await this.contract11.res64()); 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.contract5Address, this.signers.alice.address); - input.add16(8n); + 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.contract5.shr_euint16_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract11.shr_euint64_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); + const res = await decrypt64(await this.contract11.res64()); expect(res).to.equal(0n); }); - it('test operator "rotl" overload (euint16, euint8) => euint16 test 1 (12143, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(12143n); - input.add8(3n); + 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.contract5.rotl_euint16_euint8( + const tx = await this.contract11.rotl_euint64_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(31609n); + const res = await decrypt64(await this.contract11.res64()); + expect(res).to.equal(17646787786812531967n); }); - it('test operator "rotl" overload (euint16, euint8) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(4n); + 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.contract5.rotl_euint16_euint8( + const tx = await this.contract11.rotl_euint64_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); + const res = await decrypt64(await this.contract11.res64()); 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.contract5Address, this.signers.alice.address); - input.add16(8n); + 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.contract5.rotl_euint16_euint8( + const tx = await this.contract11.rotl_euint64_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); + const res = await decrypt64(await this.contract11.res64()); 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.contract5Address, this.signers.alice.address); - input.add16(8n); + 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.contract5.rotl_euint16_euint8( + const tx = await this.contract11.rotl_euint64_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); + const res = await decrypt64(await this.contract11.res64()); expect(res).to.equal(128n); }); - it('test operator "rotl" overload (euint16, uint8) => euint16 test 1 (12143, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(12143n); + 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.contract5.rotl_euint16_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); + const tx = await this.contract11.rotl_euint64_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(31609n); + const res = await decrypt64(await this.contract11.res64()); + expect(res).to.equal(17646787786812531967n); }); - it('test operator "rotl" overload (euint16, uint8) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(4n); + 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.contract5.rotl_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.rotl_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); + const res = await decrypt64(await this.contract11.res64()); 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.contract5Address, this.signers.alice.address); - input.add16(8n); + 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.contract5.rotl_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.rotl_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); + const res = await decrypt64(await this.contract11.res64()); 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.contract5Address, this.signers.alice.address); - input.add16(8n); + 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.contract5.rotl_euint16_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract11.rotl_euint64_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); + const res = await decrypt64(await this.contract11.res64()); expect(res).to.equal(128n); }); - it('test operator "rotr" overload (euint16, euint8) => euint16 test 1 (63583, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(63583n); - input.add8(1n); + 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.contract5.rotr_euint16_euint8( + const tx = await this.contract11.rotr_euint64_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(64559n); + const res = await decrypt64(await this.contract11.res64()); + expect(res).to.equal(4611402392562396189n); }); - it('test operator "rotr" overload (euint16, euint8) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(4n); + 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.contract5.rotr_euint16_euint8( + const tx = await this.contract11.rotr_euint64_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(1024n); + const res = await decrypt64(await this.contract11.res64()); + expect(res).to.equal(288230376151711744n); }); - it('test operator "rotr" overload (euint16, euint8) => euint16 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(8n); + 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.contract5.rotr_euint16_euint8( + const tx = await this.contract11.rotr_euint64_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(2048n); + const res = await decrypt64(await this.contract11.res64()); + expect(res).to.equal(576460752303423488n); }); - it('test operator "rotr" overload (euint16, euint8) => euint16 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(8n); + 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.contract5.rotr_euint16_euint8( + const tx = await this.contract11.rotr_euint64_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(32768n); + const res = await decrypt64(await this.contract11.res64()); + expect(res).to.equal(9223372036854775808n); }); - it('test operator "rotr" overload (euint16, uint8) => euint16 test 1 (63583, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(63583n); + 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.contract5.rotr_euint16_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof); + const tx = await this.contract11.rotr_euint64_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(64559n); + const res = await decrypt64(await this.contract11.res64()); + expect(res).to.equal(4611402392562396189n); }); - it('test operator "rotr" overload (euint16, uint8) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(4n); + 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.contract5.rotr_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.rotr_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(1024n); + const res = await decrypt64(await this.contract11.res64()); + expect(res).to.equal(288230376151711744n); }); - it('test operator "rotr" overload (euint16, uint8) => euint16 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(8n); + 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.contract5.rotr_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.rotr_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(2048n); + const res = await decrypt64(await this.contract11.res64()); + expect(res).to.equal(576460752303423488n); }); - it('test operator "rotr" overload (euint16, uint8) => euint16 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(8n); + 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.contract5.rotr_euint16_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract11.rotr_euint64_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(32768n); + const res = await decrypt64(await this.contract11.res64()); + expect(res).to.equal(9223372036854775808n); }); - it('test operator "shl" overload (euint32, euint8) => euint32 test 1 (1317463952, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1317463952n); - input.add8(4n); + 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.contract5.shl_euint32_euint8( + const tx = await this.contract11.shl_euint128_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(3899554048n); + const res = await decrypt128(await this.contract11.res128()); + expect(res).to.equal(340282366920938463463108564702744404128n); }); - it('test operator "shl" overload (euint32, euint8) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4n); + 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.contract5.shl_euint32_euint8( + const tx = await this.contract11.shl_euint128_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); + const res = await decrypt128(await this.contract11.res128()); 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.contract5Address, this.signers.alice.address); - input.add32(8n); + 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.contract5.shl_euint32_euint8( + const tx = await this.contract11.shl_euint128_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); + const res = await decrypt128(await this.contract11.res128()); 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.contract5Address, this.signers.alice.address); - input.add32(8n); + 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.contract5.shl_euint32_euint8( + const tx = await this.contract11.shl_euint128_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); + const res = await decrypt128(await this.contract11.res128()); expect(res).to.equal(128n); }); - it('test operator "shl" overload (euint32, uint8) => euint32 test 1 (1317463952, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1317463952n); + 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.contract5.shl_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract11.shl_euint128_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(3899554048n); + const res = await decrypt128(await this.contract11.res128()); + expect(res).to.equal(340282366920938463463108564702744404128n); }); - it('test operator "shl" overload (euint32, uint8) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4n); + 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.contract5.shl_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.shl_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); + const res = await decrypt128(await this.contract11.res128()); 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.contract5Address, this.signers.alice.address); - input.add32(8n); + 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.contract5.shl_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.shl_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); + const res = await decrypt128(await this.contract11.res128()); 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.contract5Address, this.signers.alice.address); - input.add32(8n); + 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.contract5.shl_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract11.shl_euint128_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); + const res = await decrypt128(await this.contract11.res128()); expect(res).to.equal(128n); }); - it('test operator "shr" overload (euint32, euint8) => euint32 test 1 (3048369776, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3048369776n); - input.add8(1n); + 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.contract5.shr_euint32_euint8( + const tx = await this.contract11.shr_euint128_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(1524184888n); + const res = await decrypt128(await this.contract11.res128()); + expect(res).to.equal(85070591730234615865842052056301262960n); }); - it('test operator "shr" overload (euint32, euint8) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4n); + 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.contract5.shr_euint32_euint8( + const tx = await this.contract11.shr_euint128_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); + const res = await decrypt128(await this.contract11.res128()); 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.contract5Address, this.signers.alice.address); - input.add32(8n); + 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.contract5.shr_euint32_euint8( + const tx = await this.contract11.shr_euint128_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); + const res = await decrypt128(await this.contract11.res128()); 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.contract5Address, this.signers.alice.address); - input.add32(8n); + 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.contract5.shr_euint32_euint8( + const tx = await this.contract11.shr_euint128_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); + const res = await decrypt128(await this.contract11.res128()); expect(res).to.equal(0n); }); - it('test operator "shr" overload (euint32, uint8) => euint32 test 1 (3048369776, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3048369776n); + 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.contract5.shr_euint32_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof); + const tx = await this.contract11.shr_euint128_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(1524184888n); + const res = await decrypt128(await this.contract11.res128()); + expect(res).to.equal(85070591730234615865842052056301262960n); }); - it('test operator "shr" overload (euint32, uint8) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4n); + 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.contract5.shr_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.shr_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); + const res = await decrypt128(await this.contract11.res128()); 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.contract5Address, this.signers.alice.address); - input.add32(8n); + 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.contract5.shr_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.shr_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); + const res = await decrypt128(await this.contract11.res128()); 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.contract5Address, this.signers.alice.address); - input.add32(8n); + 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.contract5.shr_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract11.shr_euint128_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); + const res = await decrypt128(await this.contract11.res128()); expect(res).to.equal(0n); }); - it('test operator "rotl" overload (euint32, euint8) => euint32 test 1 (2219902125, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(2219902125n); - input.add8(2n); + 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.contract5.rotl_euint32_euint8( + const tx = await this.contract11.rotl_euint128_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(289673910n); + const res = await decrypt128(await this.contract11.res128()); + expect(res).to.equal(340282366920938463463331599767640637039n); }); - it('test operator "rotl" overload (euint32, euint8) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4n); + 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.contract5.rotl_euint32_euint8( + const tx = await this.contract11.rotl_euint128_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); + const res = await decrypt128(await this.contract11.res128()); 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.contract5Address, this.signers.alice.address); - input.add32(8n); + 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.contract5.rotl_euint32_euint8( + const tx = await this.contract11.rotl_euint128_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); + const res = await decrypt128(await this.contract11.res128()); 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.contract5Address, this.signers.alice.address); - input.add32(8n); + 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.contract5.rotl_euint32_euint8( + const tx = await this.contract11.rotl_euint128_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); + const res = await decrypt128(await this.contract11.res128()); expect(res).to.equal(128n); }); - it('test operator "rotl" overload (euint32, uint8) => euint32 test 1 (2219902125, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(2219902125n); + 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.contract5.rotl_euint32_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); + const tx = await this.contract11.rotl_euint128_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(289673910n); + const res = await decrypt128(await this.contract11.res128()); + expect(res).to.equal(340282366920938463463331599767640637039n); }); - it('test operator "rotl" overload (euint32, uint8) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4n); + 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.contract5.rotl_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.rotl_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); + const res = await decrypt128(await this.contract11.res128()); 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.contract5Address, this.signers.alice.address); - input.add32(8n); + 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.contract5.rotl_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.rotl_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); + const res = await decrypt128(await this.contract11.res128()); 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.contract5Address, this.signers.alice.address); - input.add32(8n); + 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.contract5.rotl_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract11.rotl_euint128_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); + const res = await decrypt128(await this.contract11.res128()); expect(res).to.equal(128n); }); - it('test operator "rotr" overload (euint32, euint8) => euint32 test 1 (4127207673, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4127207673n); - input.add8(5n); + 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.contract5.rotr_euint32_euint8( + const tx = await this.contract11.rotr_euint128_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(3484418439n); + const res = await decrypt128(await this.contract11.res128()); + expect(res).to.equal(340282366920938463463372673696382084395n); }); - it('test operator "rotr" overload (euint32, euint8) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4n); + 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.contract5.rotr_euint32_euint8( + const tx = await this.contract11.rotr_euint128_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(67108864n); + const res = await decrypt128(await this.contract11.res128()); + expect(res).to.equal(5316911983139663491615228241121378304n); }); - it('test operator "rotr" overload (euint32, euint8) => euint32 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); + 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.contract5.rotr_euint32_euint8( + const tx = await this.contract11.rotr_euint128_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(134217728n); + const res = await decrypt128(await this.contract11.res128()); + expect(res).to.equal(10633823966279326983230456482242756608n); }); - it('test operator "rotr" overload (euint32, euint8) => euint32 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); + 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.contract5.rotr_euint32_euint8( + const tx = await this.contract11.rotr_euint128_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(2147483648n); + const res = await decrypt128(await this.contract11.res128()); + expect(res).to.equal(170141183460469231731687303715884105728n); }); - it('test operator "rotr" overload (euint32, uint8) => euint32 test 1 (4127207673, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4127207673n); + 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.contract5.rotr_euint32_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + const tx = await this.contract11.rotr_euint128_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(3484418439n); + const res = await decrypt128(await this.contract11.res128()); + expect(res).to.equal(340282366920938463463372673696382084395n); }); - it('test operator "rotr" overload (euint32, uint8) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4n); + 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.contract5.rotr_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.rotr_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(67108864n); + const res = await decrypt128(await this.contract11.res128()); + expect(res).to.equal(5316911983139663491615228241121378304n); }); - it('test operator "rotr" overload (euint32, uint8) => euint32 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); + 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.contract5.rotr_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.rotr_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(134217728n); + const res = await decrypt128(await this.contract11.res128()); + expect(res).to.equal(10633823966279326983230456482242756608n); }); - it('test operator "rotr" overload (euint32, uint8) => euint32 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); + 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.contract5.rotr_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract11.rotr_euint128_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(2147483648n); + const res = await decrypt128(await this.contract11.res128()); + expect(res).to.equal(170141183460469231731687303715884105728n); }); - it('test operator "shl" overload (euint64, euint8) => euint64 test 1 (18445637206389853441, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18445637206389853441n); - input.add8(6n); + 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.contract5.shl_euint64_euint8( + const tx = await this.contract11.shl_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18375904565248868416n); + const res = await decrypt256(await this.contract11.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039456888249304595046528n); }); - it('test operator "shl" overload (euint64, euint8) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(4n); + 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.contract5.shl_euint64_euint8( + const tx = await this.contract11.shl_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); + const res = await decrypt256(await this.contract11.res256()); 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.contract5Address, this.signers.alice.address); - input.add64(8n); + 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.contract5.shl_euint64_euint8( + const tx = await this.contract11.shl_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); + const res = await decrypt256(await this.contract11.res256()); 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.contract5Address, this.signers.alice.address); - input.add64(8n); + 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.contract5.shl_euint64_euint8( + const tx = await this.contract11.shl_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); + const res = await decrypt256(await this.contract11.res256()); expect(res).to.equal(128n); }); - it('test operator "shl" overload (euint64, uint8) => euint64 test 1 (18445637206389853441, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(18445637206389853441n); + 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.contract5.shl_euint64_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); + const tx = await this.contract11.shl_euint256_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18375904565248868416n); + const res = await decrypt256(await this.contract11.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039456888249304595046528n); }); - it('test operator "shl" overload (euint64, uint8) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add64(4n); + 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.contract5.shl_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.shl_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); + const res = await decrypt256(await this.contract11.res256()); 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.contract5Address, this.signers.alice.address); - input.add64(8n); + 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.contract5.shl_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.shl_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); + const res = await decrypt256(await this.contract11.res256()); 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.contract5Address, this.signers.alice.address); - input.add64(8n); + 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.contract5.shl_euint64_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract11.shl_euint256_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); + const res = await decrypt256(await this.contract11.res256()); expect(res).to.equal(128n); }); - it('test operator "shr" overload (euint64, euint8) => euint64 test 1 (18438869893773583255, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18438869893773583255n); - input.add8(5n); + 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.contract6.shr_euint64_euint8( + const tx = await this.contract11.shr_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(576214684180424476n); + const res = await decrypt256(await this.contract11.res256()); + expect(res).to.equal(28948022309329048855892746252171976963317496166410141009864394617667912493163n); }); - it('test operator "shr" overload (euint64, euint8) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(4n); + 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.contract6.shr_euint64_euint8( + const tx = await this.contract11.shr_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); + const res = await decrypt256(await this.contract11.res256()); 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.contract6Address, this.signers.alice.address); - input.add64(8n); + 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.contract6.shr_euint64_euint8( + const tx = await this.contract11.shr_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); + const res = await decrypt256(await this.contract11.res256()); 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.contract6Address, this.signers.alice.address); - input.add64(8n); + 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.contract6.shr_euint64_euint8( + const tx = await this.contract11.shr_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); + const res = await decrypt256(await this.contract11.res256()); expect(res).to.equal(0n); }); - it('test operator "shr" overload (euint64, uint8) => euint64 test 1 (18438869893773583255, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18438869893773583255n); + 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.contract6.shr_euint64_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + const tx = await this.contract11.shr_euint256_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(576214684180424476n); + const res = await decrypt256(await this.contract11.res256()); + expect(res).to.equal(28948022309329048855892746252171976963317496166410141009864394617667912493163n); }); - it('test operator "shr" overload (euint64, uint8) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(4n); + 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.contract6.shr_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.shr_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); + const res = await decrypt256(await this.contract11.res256()); 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.contract6Address, this.signers.alice.address); - input.add64(8n); + 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.contract6.shr_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.shr_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); + const res = await decrypt256(await this.contract11.res256()); 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.contract6Address, this.signers.alice.address); - input.add64(8n); + 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.contract6.shr_euint64_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract11.shr_euint256_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); + const res = await decrypt256(await this.contract11.res256()); expect(res).to.equal(0n); }); - it('test operator "rotl" overload (euint64, euint8) => euint64 test 1 (18442278686771288481, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18442278686771288481n); - input.add8(1n); + 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.contract6.rotl_euint64_euint8( + const tx = await this.contract11.rotl_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(18437813299833025347n); + const res = await decrypt256(await this.contract11.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457439917747657180927n); }); - it('test operator "rotl" overload (euint64, euint8) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(4n); + 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.contract6.rotl_euint64_euint8( + const tx = await this.contract11.rotl_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); + const res = await decrypt256(await this.contract11.res256()); 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.contract6Address, this.signers.alice.address); - input.add64(8n); + 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.contract6.rotl_euint64_euint8( + const tx = await this.contract11.rotl_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); + const res = await decrypt256(await this.contract11.res256()); 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.contract6Address, this.signers.alice.address); - input.add64(8n); + 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.contract6.rotl_euint64_euint8( + const tx = await this.contract11.rotl_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); + const res = await decrypt256(await this.contract11.res256()); expect(res).to.equal(128n); }); - it('test operator "rotl" overload (euint64, uint8) => euint64 test 1 (18442278686771288481, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18442278686771288481n); + 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.contract6.rotl_euint64_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof); + const tx = await this.contract11.rotl_euint256_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(18437813299833025347n); + const res = await decrypt256(await this.contract11.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457439917747657180927n); }); - it('test operator "rotl" overload (euint64, uint8) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(4n); + 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.contract6.rotl_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.rotl_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); + const res = await decrypt256(await this.contract11.res256()); 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.contract6Address, this.signers.alice.address); - input.add64(8n); + 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.contract6.rotl_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.rotl_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); + const res = await decrypt256(await this.contract11.res256()); 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.contract6Address, this.signers.alice.address); - input.add64(8n); + 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.contract6.rotl_euint64_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract11.rotl_euint256_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); + const res = await decrypt256(await this.contract11.res256()); expect(res).to.equal(128n); }); - it('test operator "rotr" overload (euint64, euint8) => euint64 test 1 (18441051342909802901, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18441051342909802901n); - input.add8(3n); + 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.contract6.rotr_euint64_euint8( + const tx = await this.contract11.rotr_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(13834346463932195122n); + const res = await decrypt256(await this.contract11.res256()); + expect(res).to.equal(57896044618658097711785492504343953926634992332820282019728791850030926829798n); }); - it('test operator "rotr" overload (euint64, euint8) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(4n); + 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.contract6.rotr_euint64_euint8( + const tx = await this.contract11.rotr_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(288230376151711744n); + const res = await decrypt256(await this.contract11.res256()); + expect(res).to.equal(1809251394333065553493296640760748560207343510400633813116524750123642650624n); }); - it('test operator "rotr" overload (euint64, euint8) => euint64 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(8n); + 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.contract6.rotr_euint64_euint8( + const tx = await this.contract11.rotr_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(576460752303423488n); + const res = await decrypt256(await this.contract11.res256()); + expect(res).to.equal(3618502788666131106986593281521497120414687020801267626233049500247285301248n); }); - it('test operator "rotr" overload (euint64, euint8) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(8n); + 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.contract6.rotr_euint64_euint8( + const tx = await this.contract11.rotr_euint256_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(9223372036854775808n); + const res = await decrypt256(await this.contract11.res256()); + expect(res).to.equal(57896044618658097711785492504343953926634992332820282019728792003956564819968n); }); - it('test operator "rotr" overload (euint64, uint8) => euint64 test 1 (18441051342909802901, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18441051342909802901n); + 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.contract6.rotr_euint64_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); + const tx = await this.contract11.rotr_euint256_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(13834346463932195122n); + const res = await decrypt256(await this.contract11.res256()); + expect(res).to.equal(57896044618658097711785492504343953926634992332820282019728791850030926829798n); }); - it('test operator "rotr" overload (euint64, uint8) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(4n); + 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.contract6.rotr_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.rotr_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(288230376151711744n); + const res = await decrypt256(await this.contract11.res256()); + expect(res).to.equal(1809251394333065553493296640760748560207343510400633813116524750123642650624n); }); - it('test operator "rotr" overload (euint64, uint8) => euint64 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(8n); + 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.contract6.rotr_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract11.rotr_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(576460752303423488n); + const res = await decrypt256(await this.contract11.res256()); + expect(res).to.equal(3618502788666131106986593281521497120414687020801267626233049500247285301248n); }); - it('test operator "rotr" overload (euint64, uint8) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(8n); + 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.contract6.rotr_euint64_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract11.rotr_euint256_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(9223372036854775808n); + const res = await decrypt256(await this.contract11.res256()); + expect(res).to.equal(57896044618658097711785492504343953926634992332820282019728792003956564819968n); }); - it('test operator "neg" overload (euint4) => euint4 test 1 (6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add4(6n); + 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.contract6.neg_euint4(encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract11.neg_euint4(encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract6.res4()); - expect(res).to.equal(10n); + 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.contract6Address, this.signers.alice.address); + const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); input.add4(4n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.not_euint4(encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract11.not_euint4(encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract6.res4()); + const res = await decrypt4(await this.contract11.res4()); expect(res).to.equal(11n); }); - it('test operator "neg" overload (euint8) => euint8 test 1 (186)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add8(186n); + 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.contract6.neg_euint8(encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract11.neg_euint16(encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract6.res8()); - expect(res).to.equal(70n); + const res = await decrypt16(await this.contract11.res16()); + expect(res).to.equal(38850n); }); - it('test operator "not" overload (euint8) => euint8 test 1 (29)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add8(29n); + 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.contract6.not_euint8(encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract11.not_euint16(encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract6.res8()); - expect(res).to.equal(226n); + const res = await decrypt16(await this.contract11.res16()); + expect(res).to.equal(63722n); }); - it('test operator "neg" overload (euint16) => euint16 test 1 (3993)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add16(3993n); + 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.contract6.neg_euint16(encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract11.neg_euint32(encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract6.res16()); - expect(res).to.equal(61543n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(893509919n); }); - it('test operator "not" overload (euint16) => euint16 test 1 (47885)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add16(47885n); + 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.contract6.not_euint16(encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract11.not_euint32(encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract6.res16()); - expect(res).to.equal(17650n); + const res = await decrypt32(await this.contract11.res32()); + expect(res).to.equal(1838158377n); }); - it('test operator "neg" overload (euint32) => euint32 test 1 (2747701293)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2747701293n); + 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.contract6.neg_euint32(encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract11.neg_euint64(encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1547266003n); + const res = await decrypt64(await this.contract11.res64()); + expect(res).to.equal(4759389784333841n); }); - it('test operator "not" overload (euint32) => euint32 test 1 (3731607282)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3731607282n); + 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.contract6.not_euint32(encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract11.not_euint64(encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(563360013n); + const res = await decrypt64(await this.contract11.res64()); + expect(res).to.equal(8272144049381776n); }); - it('test operator "neg" overload (euint64) => euint64 test 1 (18446646312005372999)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18446646312005372999n); + 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.contract6.neg_euint64(encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract11.neg_euint128(encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(97761704178617n); + const res = await decrypt128(await this.contract11.res128()); + expect(res).to.equal(1444837312499023n); }); - it('test operator "not" overload (euint64) => euint64 test 1 (18443812023863287611)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18443812023863287611n); + 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.contract6.not_euint64(encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract11.not_euint128(encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(2932049846264004n); + const res = await decrypt128(await this.contract11.res128()); + expect(res).to.equal(342614436860714n); }); }); diff --git a/test/tfheOperations/tfheOperations13.ts b/test/tfheOperations/tfheOperations13.ts new file mode 100644 index 00000000..db18a0e6 --- /dev/null +++ b/test/tfheOperations/tfheOperations13.ts @@ -0,0 +1,221 @@ +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/test/tfheOperations/tfheOperations2.ts b/test/tfheOperations/tfheOperations2.ts index 6b8b15fe..93245365 100644 --- a/test/tfheOperations/tfheOperations2.ts +++ b/test/tfheOperations/tfheOperations2.ts @@ -7,7 +7,22 @@ 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 { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance'; +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 { @@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise { 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); @@ -105,2227 +175,4183 @@ describe('TFHE operations 2', function () { 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 "sub" overload (euint4, euint32) => euint32 test 1 (8, 8)', async function () { + 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(8n); - input.add32(8n); + input.add4(5n); + input.add128(340282366920938463463372463025889881069n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.sub_euint4_euint32( + const tx = await this.contract1.le_euint4_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(0n); + const res = await decryptBool(await this.contract1.resb()); + expect(res).to.equal(true); }); - it('test operator "sub" overload (euint4, euint32) => euint32 test 2 (8, 4)', async function () { + 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(8n); - input.add32(4n); + input.add4(4n); + input.add128(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.sub_euint4_euint32( + const tx = await this.contract1.le_euint4_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(4n); + const res = await decryptBool(await this.contract1.resb()); + expect(res).to.equal(true); }); - it('test operator "mul" overload (euint4, euint32) => euint32 test 1 (2, 5)', async function () { + 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(2n); - input.add32(5n); + input.add4(8n); + input.add128(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint32( + const tx = await this.contract1.le_euint4_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(10n); + const res = await decryptBool(await this.contract1.resb()); + expect(res).to.equal(true); }); - it('test operator "mul" overload (euint4, euint32) => euint32 test 2 (3, 3)', async function () { + 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(3n); - input.add32(3n); + input.add4(8n); + input.add128(4n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint32( + const tx = await this.contract1.le_euint4_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(9n); + const res = await decryptBool(await this.contract1.resb()); + expect(res).to.equal(false); }); - it('test operator "mul" overload (euint4, euint32) => euint32 test 3 (3, 3)', async function () { + 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(3n); - input.add32(3n); + input.add4(8n); + input.add128(340282366920938463463367828600285579945n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint32( + const tx = await this.contract1.lt_euint4_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(9n); + const res = await decryptBool(await this.contract1.resb()); + expect(res).to.equal(true); }); - it('test operator "mul" overload (euint4, euint32) => euint32 test 4 (3, 3)', async function () { + 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(3n); - input.add32(3n); + input.add4(4n); + input.add128(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint32( + const tx = await this.contract1.lt_euint4_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(9n); + const res = await decryptBool(await this.contract1.resb()); + expect(res).to.equal(true); }); - it('test operator "and" overload (euint4, euint32) => euint32 test 1 (1, 1067388092)', async function () { + 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(1n); - input.add32(1067388092n); + input.add4(8n); + input.add128(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint32( + const tx = await this.contract1.lt_euint4_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(0n); + const res = await decryptBool(await this.contract1.resb()); + expect(res).to.equal(false); }); - it('test operator "and" overload (euint4, euint32) => euint32 test 2 (4, 8)', async function () { + 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(4n); - input.add32(8n); + input.add4(8n); + input.add128(4n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint32( + const tx = await this.contract1.lt_euint4_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(0n); + const res = await decryptBool(await this.contract1.resb()); + expect(res).to.equal(false); }); - it('test operator "and" overload (euint4, euint32) => euint32 test 3 (8, 8)', async function () { + 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(8n); - input.add32(8n); + input.add4(14n); + input.add128(340282366920938463463373484167219835469n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint32( + const tx = await this.contract1.min_euint4_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(8n); + const res = await decrypt128(await this.contract1.res128()); + expect(res).to.equal(14n); }); - it('test operator "and" overload (euint4, euint32) => euint32 test 4 (8, 4)', async function () { + 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(8n); - input.add32(4n); + input.add4(10n); + input.add128(14n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint32( + const tx = await this.contract1.min_euint4_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(0n); + const res = await decrypt128(await this.contract1.res128()); + expect(res).to.equal(10n); }); - it('test operator "or" overload (euint4, euint32) => euint32 test 1 (12, 3045135587)', async function () { + 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(12n); - input.add32(3045135587n); + input.add4(14n); + input.add128(14n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint32( + const tx = await this.contract1.min_euint4_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(3045135599n); + const res = await decrypt128(await this.contract1.res128()); + expect(res).to.equal(14n); }); - it('test operator "or" overload (euint4, euint32) => euint32 test 2 (8, 12)', async function () { + 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(8n); - input.add32(12n); + input.add4(14n); + input.add128(10n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint32( + const tx = await this.contract1.min_euint4_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(12n); + const res = await decrypt128(await this.contract1.res128()); + expect(res).to.equal(10n); }); - it('test operator "or" overload (euint4, euint32) => euint32 test 3 (12, 12)', async function () { + 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(12n); - input.add32(12n); + input.add4(1n); + input.add128(340282366920938463463366284713062311837n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint32( + const tx = await this.contract1.max_euint4_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(12n); + const res = await decrypt128(await this.contract1.res128()); + expect(res).to.equal(340282366920938463463366284713062311837n); }); - it('test operator "or" overload (euint4, euint32) => euint32 test 4 (12, 8)', async function () { + 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(12n); - input.add32(8n); + input.add4(4n); + input.add128(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint32( + const tx = await this.contract1.max_euint4_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(12n); + const res = await decrypt128(await this.contract1.res128()); + expect(res).to.equal(8n); }); - it('test operator "xor" overload (euint4, euint32) => euint32 test 1 (6, 1855370868)', async function () { + 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(6n); - input.add32(1855370868n); + input.add4(8n); + input.add128(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint32( + const tx = await this.contract1.max_euint4_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(1855370866n); + const res = await decrypt128(await this.contract1.res128()); + expect(res).to.equal(8n); }); - it('test operator "xor" overload (euint4, euint32) => euint32 test 2 (4, 8)', async function () { + 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(4n); - input.add32(8n); + input.add4(8n); + input.add128(4n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint32( + const tx = await this.contract1.max_euint4_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(12n); + const res = await decrypt128(await this.contract1.res128()); + expect(res).to.equal(8n); }); - it('test operator "xor" overload (euint4, euint32) => euint32 test 3 (8, 8)', async function () { + 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(8n); - input.add32(8n); + input.add4(2n); + input.add256(9n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint32( + const tx = await this.contract1.add_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(0n); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(11n); }); - it('test operator "xor" overload (euint4, euint32) => euint32 test 4 (8, 4)', async function () { + 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(8n); - input.add32(4n); + input.add4(4n); + input.add256(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint32( + const tx = await this.contract1.add_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); + const res = await decrypt256(await this.contract1.res256()); expect(res).to.equal(12n); }); - it('test operator "eq" overload (euint4, euint32) => ebool test 1 (2, 183972195)', async function () { + 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(2n); - input.add32(183972195n); + input.add4(5n); + input.add256(5n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint32( + const tx = await this.contract1.add_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(10n); }); - it('test operator "eq" overload (euint4, euint32) => ebool test 2 (4, 8)', async function () { + 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(4n); - input.add32(8n); + input.add4(8n); + input.add256(4n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint32( + const tx = await this.contract1.add_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(12n); }); - it('test operator "eq" overload (euint4, euint32) => ebool test 3 (8, 8)', async function () { + 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(8n); - input.add32(8n); + input.add4(14n); + input.add256(14n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint32( + const tx = await this.contract1.sub_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(0n); }); - it('test operator "eq" overload (euint4, euint32) => ebool test 4 (8, 4)', async function () { + 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(8n); - input.add32(4n); + input.add4(14n); + input.add256(10n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint32( + const tx = await this.contract1.sub_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(4n); }); - it('test operator "ne" overload (euint4, euint32) => ebool test 1 (14, 1312265251)', async function () { + 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(14n); - input.add32(1312265251n); + input.add4(2n); + input.add256(5n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint32( + const tx = await this.contract1.mul_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(10n); }); - it('test operator "ne" overload (euint4, euint32) => ebool test 2 (10, 14)', async function () { + 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(10n); - input.add32(14n); + input.add4(3n); + input.add256(5n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint32( + const tx = await this.contract1.mul_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(15n); }); - it('test operator "ne" overload (euint4, euint32) => ebool test 3 (14, 14)', async function () { + 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(14n); - input.add32(14n); + input.add4(3n); + input.add256(3n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint32( + const tx = await this.contract1.mul_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(9n); }); - it('test operator "ne" overload (euint4, euint32) => ebool test 4 (14, 10)', async function () { + 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(14n); - input.add32(10n); + input.add4(5n); + input.add256(3n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint32( + const tx = await this.contract1.mul_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(15n); }); - it('test operator "ge" overload (euint4, euint32) => ebool test 1 (3, 735253791)', async function () { + 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.add32(735253791n); + input.add256(115792089237316195423570985008687907853269984665640564039457581650107790454269n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint32( + const tx = await this.contract1.and_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(1n); }); - it('test operator "ge" overload (euint4, euint32) => ebool test 2 (4, 8)', async function () { + 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.add32(8n); + input.add256(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint32( + const tx = await this.contract1.and_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(0n); }); - it('test operator "ge" overload (euint4, euint32) => ebool test 3 (8, 8)', async function () { + 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.add32(8n); + input.add256(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint32( + const tx = await this.contract1.and_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(8n); }); - it('test operator "ge" overload (euint4, euint32) => ebool test 4 (8, 4)', async function () { + 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.add32(4n); + input.add256(4n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint32( + const tx = await this.contract1.and_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(0n); }); - it('test operator "gt" overload (euint4, euint32) => ebool test 1 (1, 2112514560)', async function () { + 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(1n); - input.add32(2112514560n); + input.add4(8n); + input.add256(115792089237316195423570985008687907853269984665640564039457583166606888282231n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint32( + const tx = await this.contract1.or_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457583166606888282239n); }); - it('test operator "gt" overload (euint4, euint32) => ebool test 2 (4, 8)', async function () { + 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.add32(8n); + input.add256(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint32( + const tx = await this.contract1.or_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(12n); }); - it('test operator "gt" overload (euint4, euint32) => ebool test 3 (8, 8)', async function () { + 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.add32(8n); + input.add256(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint32( + const tx = await this.contract1.or_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(8n); }); - it('test operator "gt" overload (euint4, euint32) => ebool test 4 (8, 4)', async function () { + 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.add32(4n); + input.add256(4n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint32( + const tx = await this.contract1.or_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(12n); }); - it('test operator "le" overload (euint4, euint32) => ebool test 1 (5, 3704560179)', async function () { + 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.add32(3704560179n); + input.add256(115792089237316195423570985008687907853269984665640564039457578855535245251769n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint32( + const tx = await this.contract1.xor_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457578855535245251772n); }); - it('test operator "le" overload (euint4, euint32) => ebool test 2 (4, 8)', async function () { + 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.add32(8n); + input.add256(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint32( + const tx = await this.contract1.xor_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(12n); }); - it('test operator "le" overload (euint4, euint32) => ebool test 3 (8, 8)', async function () { + 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.add32(8n); + input.add256(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint32( + const tx = await this.contract1.xor_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(0n); }); - it('test operator "le" overload (euint4, euint32) => ebool test 4 (8, 4)', async function () { + 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.add32(4n); + input.add256(4n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint32( + const tx = await this.contract1.xor_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt256(await this.contract1.res256()); + expect(res).to.equal(12n); }); - it('test operator "lt" overload (euint4, euint32) => ebool test 1 (6, 2034411051)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(6n); - input.add32(2034411051n); + 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.contract1.lt_euint4_euint32( + 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.contract1.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - 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); + 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.contract1.lt_euint4_euint32( + 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.contract1.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - 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); + 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.contract1.lt_euint4_euint32( + 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.contract1.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - 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); + 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.contract1.lt_euint4_euint32( + 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.contract1.resb()); + const res = await decryptBool(await this.contract2.resb()); expect(res).to.equal(false); }); - it('test operator "min" overload (euint4, euint32) => euint32 test 1 (10, 421626494)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add32(421626494n); + 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.contract1.min_euint4_euint32( + const tx = await this.contract2.ne_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(10n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (euint4, euint32) => euint32 test 2 (6, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(6n); - input.add32(10n); + 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.contract1.min_euint4_euint32( + const tx = await this.contract2.ne_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(6n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (euint4, euint32) => euint32 test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add32(10n); + 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.contract1.min_euint4_euint32( + const tx = await this.contract2.ne_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(10n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "min" overload (euint4, euint32) => euint32 test 4 (10, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add32(6n); + 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.contract1.min_euint4_euint32( + const tx = await this.contract2.ne_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(6n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "max" overload (euint4, euint32) => euint32 test 1 (12, 3887686486)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(12n); - input.add32(3887686486n); + 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.contract1.max_euint4_euint32( + const tx = await this.contract2.ge_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(3887686486n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - 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); + 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.contract1.max_euint4_euint32( + const tx = await this.contract2.ge_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(12n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - 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); + 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.contract1.max_euint4_euint32( + const tx = await this.contract2.ge_euint4_euint256( 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 (2, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(2n); - 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(11n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "add" overload (euint4, euint64) => euint64 test 2 (6, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(6n); - input.add64(8n); + 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.contract1.add_euint4_euint64( + const tx = await this.contract2.ge_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(14n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - 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); + 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.contract1.add_euint4_euint64( + const tx = await this.contract2.gt_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(10n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "add" overload (euint4, euint64) => euint64 test 4 (8, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add64(6n); + 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.contract1.add_euint4_euint64( + const tx = await this.contract2.gt_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(14n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "sub" overload (euint4, euint64) => euint64 test 1 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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.add64(8n); + input.add256(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.sub_euint4_euint64( + const tx = await this.contract2.gt_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(0n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "sub" overload (euint4, euint64) => euint64 test 2 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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.add64(4n); + input.add256(4n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.sub_euint4_euint64( + const tx = await this.contract2.gt_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(4n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - 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); + 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.contract1.mul_euint4_euint64( + const tx = await this.contract2.le_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(10n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - 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); + 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.contract1.mul_euint4_euint64( + const tx = await this.contract2.le_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(15n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - 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); + 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.contract1.mul_euint4_euint64( + const tx = await this.contract2.le_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(9n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - 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); + 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.contract1.mul_euint4_euint64( + const tx = await this.contract2.le_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(15n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "and" overload (euint4, euint64) => euint64 test 1 (11, 18444970625118669221)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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.add64(18444970625118669221n); + input.add256(115792089237316195423570985008687907853269984665640564039457582432165171824629n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint64( + const tx = await this.contract2.lt_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(1n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "and" overload (euint4, euint64) => euint64 test 2 (7, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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.add64(11n); + input.add256(11n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint64( + const tx = await this.contract2.lt_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(3n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "and" overload (euint4, euint64) => euint64 test 3 (11, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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.add64(11n); + input.add256(11n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint64( + const tx = await this.contract2.lt_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(11n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "and" overload (euint4, euint64) => euint64 test 4 (11, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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.add64(7n); + input.add256(7n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint64( + const tx = await this.contract2.lt_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(3n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "or" overload (euint4, euint64) => euint64 test 1 (5, 18439458059788568419)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add64(18439458059788568419n); + 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.contract1.or_euint4_euint64( + const tx = await this.contract2.min_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(18439458059788568423n); + const res = await decrypt256(await this.contract2.res256()); + expect(res).to.equal(1n); }); - it('test operator "or" overload (euint4, euint64) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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.add64(8n); + input.add256(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint64( + const tx = await this.contract2.min_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(12n); + const res = await decrypt256(await this.contract2.res256()); + expect(res).to.equal(4n); }); - it('test operator "or" overload (euint4, euint64) => euint64 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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.add64(8n); + input.add256(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint64( + const tx = await this.contract2.min_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); + const res = await decrypt256(await this.contract2.res256()); expect(res).to.equal(8n); }); - it('test operator "or" overload (euint4, euint64) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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.add64(4n); + input.add256(4n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint64( + const tx = await this.contract2.min_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(12n); + const res = await decrypt256(await this.contract2.res256()); + expect(res).to.equal(4n); }); - it('test operator "xor" overload (euint4, euint64) => euint64 test 1 (2, 18446366816185499095)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(2n); - input.add64(18446366816185499095n); + 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.contract1.xor_euint4_euint64( + const tx = await this.contract2.max_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(18446366816185499093n); + const res = await decrypt256(await this.contract2.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577693528211281505n); }); - 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); + 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.contract1.xor_euint4_euint64( + const tx = await this.contract2.max_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(12n); + const res = await decrypt256(await this.contract2.res256()); + expect(res).to.equal(9n); }); - 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); + 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.contract1.xor_euint4_euint64( + const tx = await this.contract2.max_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(0n); + const res = await decrypt256(await this.contract2.res256()); + expect(res).to.equal(9n); }); - 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); + 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.contract1.xor_euint4_euint64( + const tx = await this.contract2.max_euint4_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(12n); + const res = await decrypt256(await this.contract2.res256()); + expect(res).to.equal(9n); }); - it('test operator "eq" overload (euint4, euint64) => ebool test 1 (9, 18438414163462572393)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); - input.add64(18438414163462572393n); + const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.add_euint4_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(11n); }); - it('test operator "eq" overload (euint4, euint64) => ebool test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); - input.add64(9n); + const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.add_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(14n); }); - it('test operator "eq" overload (euint4, euint64) => ebool test 3 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add64(9n); + 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.contract1.eq_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.add_euint4_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(10n); }); - it('test operator "eq" overload (euint4, euint64) => ebool test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); - input.add64(5n); - 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, 18441024342807508949)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(7n); - input.add64(18441024342807508949n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.add_euint4_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(14n); }); - 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); + 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.contract1.ne_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.add_uint8_euint4(6n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(15n); }); - 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); + 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.contract1.ne_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.add_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(14n); }); - 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); + 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.contract1.ne_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.add_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(10n); }); - it('test operator "ge" overload (euint4, euint64) => ebool test 1 (7, 18446430329213146395)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(7n); - input.add64(18446430329213146395n); + 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.contract1.ge_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.add_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(14n); }); - it('test operator "ge" 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); + 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.contract1.ge_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.sub_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(0n); }); - it('test operator "ge" overload (euint4, euint64) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); - input.add64(8n); + const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.sub_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(4n); }); - it('test operator "ge" 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); + 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.contract1.ge_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.sub_uint8_euint4(14n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(0n); }); - it('test operator "gt" overload (euint4, euint64) => ebool test 1 (10, 18442574847292216251)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); - input.add64(18442574847292216251n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.sub_uint8_euint4(14n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(4n); }); - it('test operator "gt" overload (euint4, euint64) => ebool test 2 (6, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(6n); - input.add64(10n); + 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.contract1.gt_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.mul_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(12n); }); - it('test operator "gt" overload (euint4, euint64) => ebool test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add64(10n); + 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.contract1.gt_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.mul_euint4_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(15n); }); - it('test operator "gt" overload (euint4, euint64) => ebool test 4 (10, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add64(6n); + 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.contract1.gt_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.mul_euint4_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(9n); }); - it('test operator "le" overload (euint4, euint64) => ebool test 1 (9, 18445100928210525947)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add64(18445100928210525947n); + 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.contract1.le_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.mul_euint4_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(15n); }); - it('test operator "le" overload (euint4, euint64) => ebool test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); - input.add64(9n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.mul_uint8_euint4(3n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(15n); }); - it('test operator "le" overload (euint4, euint64) => ebool test 3 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add64(9n); + 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.contract1.le_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.mul_uint8_euint4(3n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(9n); }); - it('test operator "le" overload (euint4, euint64) => ebool test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add64(5n); + 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.contract1.le_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.mul_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(15n); }); - it('test operator "lt" overload (euint4, euint64) => ebool test 1 (7, 18445391148064274615)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(7n); - input.add64(18445391148064274615n); + 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.contract1.lt_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.div_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(1n); }); - it('test operator "lt" 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); + 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.contract1.lt_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.div_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(0n); }); - it('test operator "lt" 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); + 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.contract1.lt_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.div_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(1n); }); - it('test operator "lt" 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); + 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.contract1.lt_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.div_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(1n); }); - it('test operator "min" overload (euint4, euint64) => euint64 test 1 (12, 18438956406288597713)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(12n); - input.add64(18438956406288597713n); + 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.contract1.min_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.rem_euint4_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(12n); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(1n); }); - 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); + 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.contract1.min_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.rem_euint4_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(8n); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(9n); }); - 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); + 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.contract1.min_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.rem_euint4_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(12n); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(0n); }); - 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); + 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.contract1.min_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.rem_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(8n); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(4n); }); - it('test operator "max" overload (euint4, euint64) => euint64 test 1 (5, 18446478225770660877)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add64(18446478225770660877n); + 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.contract1.max_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.and_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(18446478225770660877n); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(0n); }); - it('test operator "max" 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); + 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.contract1.max_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.and_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(8n); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(2n); }); - it('test operator "max" overload (euint4, euint64) => euint64 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); - input.add64(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.and_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(8n); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(0n); }); - it('test operator "max" overload (euint4, euint64) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); - input.add64(4n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract2.and_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); + const res = await decrypt4(await this.contract2.res4()); expect(res).to.equal(8n); }); - it('test operator "add" overload (euint4, uint8) => euint4 test 1 (1, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(1n); + 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.contract1.add_euint4_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof); + const tx = await this.contract2.and_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(2n); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(0n); }); - it('test operator "add" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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.contract1.add_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract2.or_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); + const res = await decrypt4(await this.contract2.res4()); expect(res).to.equal(12n); }); - it('test operator "add" overload (euint4, uint8) => euint4 test 3 (5, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); + 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.contract1.add_euint4_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + const tx = await this.contract2.or_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(10n); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(8n); }); - it('test operator "add" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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.contract1.add_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract2.or_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); + const res = await decrypt4(await this.contract2.res4()); expect(res).to.equal(12n); }); - it('test operator "add" overload (uint8, euint4) => euint4 test 1 (1, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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(2n); + input.add4(3n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_uint8_euint4(1n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.or_uint8_euint4(13n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(3n); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(15n); }); - it('test operator "add" overload (uint8, euint4) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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.contract1.add_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.or_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); + const res = await decrypt4(await this.contract2.res4()); expect(res).to.equal(12n); }); - it('test operator "add" overload (uint8, euint4) => euint4 test 3 (5, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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(5n); + input.add4(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.or_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(10n); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(8n); }); - it('test operator "add" overload (uint8, euint4) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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.contract1.add_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.or_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); + const res = await decrypt4(await this.contract2.res4()); expect(res).to.equal(12n); }); - it('test operator "sub" overload (euint4, uint8) => euint4 test 1 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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.contract1.sub_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); + const tx = await this.contract2.xor_euint4_uint8(encryptedAmount.handles[0], 12n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(0n); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(6n); }); - it('test operator "sub" overload (euint4, uint8) => euint4 test 2 (10, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); + 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.contract1.sub_euint4_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); + const tx = await this.contract2.xor_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(4n); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(12n); }); - it('test operator "sub" overload (uint8, euint4) => euint4 test 1 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); - input.add4(9n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.sub_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.xor_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); + const res = await decrypt4(await this.contract2.res4()); expect(res).to.equal(0n); }); - it('test operator "sub" overload (uint8, euint4) => euint4 test 2 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); - input.add4(5n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.sub_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.xor_euint4_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(4n); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(12n); }); - it('test operator "mul" overload (euint4, uint8) => euint4 test 1 (5, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); + 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.contract1.mul_euint4_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); + const tx = await this.contract2.xor_uint8_euint4(1n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(10n); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(5n); }); - it('test operator "mul" overload (euint4, uint8) => euint4 test 2 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); + 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.contract1.mul_euint4_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); + const tx = await this.contract2.xor_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(9n); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(12n); }); - it('test operator "mul" overload (euint4, uint8) => euint4 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); + 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.contract1.mul_euint4_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); + const tx = await this.contract2.xor_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(9n); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(0n); }); - it('test operator "mul" overload (euint4, uint8) => euint4 test 4 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); + 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.contract1.mul_euint4_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); + const tx = await this.contract2.xor_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(9n); + const res = await decrypt4(await this.contract2.res4()); + expect(res).to.equal(12n); }); - it('test operator "mul" overload (uint8, euint4) => euint4 test 1 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); - input.add4(3n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_uint8_euint4(3n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.eq_euint4_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(9n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "mul" overload (uint8, euint4) => euint4 test 2 (3, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); - input.add4(5n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_uint8_euint4(3n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.eq_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(15n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "mul" overload (uint8, euint4) => euint4 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); - input.add4(3n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_uint8_euint4(3n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.eq_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(9n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "mul" overload (uint8, euint4) => euint4 test 4 (5, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); - input.add4(3n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.eq_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(15n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "div" overload (euint4, uint8) => euint4 test 1 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); + 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.contract1.div_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof); + const tx = await this.contract2.eq_uint8_euint4(1n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(1n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "div" overload (euint4, uint8) => euint4 test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); + 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.contract1.div_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof); + const tx = await this.contract2.eq_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(0n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "div" overload (euint4, uint8) => euint4 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); + 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.contract1.div_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof); + const tx = await this.contract2.eq_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(1n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "div" overload (euint4, uint8) => euint4 test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); + 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.contract1.div_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); + const tx = await this.contract2.ne_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(1n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "rem" overload (euint4, uint8) => euint4 test 1 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); + 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.contract1.rem_euint4_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + const tx = await this.contract2.ne_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(4n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "rem" overload (euint4, uint8) => euint4 test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); + 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.contract1.rem_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); + const tx = await this.contract2.ne_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(5n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "rem" overload (euint4, uint8) => euint4 test 3 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); + 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.contract1.rem_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); + const tx = await this.contract2.ne_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(0n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "rem" overload (euint4, uint8) => euint4 test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); + 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.contract1.rem_euint4_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + const tx = await this.contract2.ne_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(4n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "eq" overload (euint4, uint8) => ebool test 1 (4, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); + 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.contract1.eq_euint4_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof); + const tx = await this.contract2.ne_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "eq" overload (euint4, uint8) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); + 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.contract1.eq_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract2.ne_uint8_euint4(13n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + 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.contract1Address, this.signers.alice.address); - input.add4(8n); + 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.contract1.eq_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract2.ne_uint8_euint4(13n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + 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.contract1Address, this.signers.alice.address); - input.add4(8n); + 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.contract1.eq_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract2.ge_euint4_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + const res = await decryptBool(await this.contract2.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (uint8, euint4) => ebool test 1 (2, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); - input.add4(7n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_uint8_euint4(2n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.ge_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + const res = await decryptBool(await this.contract2.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (uint8, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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.contract1.eq_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.ge_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "eq" overload (uint8, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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(8n); + input.add4(1n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.ge_uint8_euint4(14n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + const res = await decryptBool(await this.contract2.resb()); expect(res).to.equal(true); }); - it('test operator "eq" overload (uint8, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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(4n); + input.add4(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.ge_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + const res = await decryptBool(await this.contract2.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint4, uint8) => ebool test 1 (4, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); + 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.contract1.ne_euint4_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); + const tx = await this.contract2.ge_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + 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.contract1Address, this.signers.alice.address); - input.add4(4n); + 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.contract1.ne_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract2.ge_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + 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.contract1Address, this.signers.alice.address); - input.add4(8n); + 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.contract1.ne_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract2.gt_euint4_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + 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.contract1Address, this.signers.alice.address); - input.add4(8n); + 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.contract1.ne_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract2.gt_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "ne" overload (uint8, euint4) => ebool test 1 (3, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); - input.add4(14n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_uint8_euint4(3n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.gt_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "ne" overload (uint8, euint4) => ebool test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); - input.add4(14n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_uint8_euint4(10n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.gt_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + const res = await decryptBool(await this.contract2.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (uint8, euint4) => ebool test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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(14n); + input.add4(5n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_uint8_euint4(14n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.gt_uint8_euint4(1n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + const res = await decryptBool(await this.contract2.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (uint8, euint4) => ebool test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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(10n); + input.add4(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_uint8_euint4(14n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.gt_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "ge" overload (euint4, uint8) => ebool test 1 (13, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); + 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.contract1.ge_euint4_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); + const tx = await this.contract2.gt_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "ge" overload (euint4, uint8) => ebool test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); + 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.contract1.ge_euint4_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof); + const tx = await this.contract2.gt_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "ge" overload (euint4, uint8) => ebool test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); + 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.contract1.ge_euint4_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof); + const tx = await this.contract2.le_euint4_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + const res = await decryptBool(await this.contract2.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint4, uint8) => ebool test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); + 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.contract1.ge_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); + const tx = await this.contract2.le_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + const res = await decryptBool(await this.contract2.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (uint8, euint4) => ebool test 1 (1, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); - input.add4(12n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_uint8_euint4(1n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.le_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "ge" overload (uint8, euint4) => ebool test 2 (8, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); - input.add4(12n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.le_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + const res = await decryptBool(await this.contract2.resb()); expect(res).to.equal(false); }); - it('test operator "ge" overload (uint8, euint4) => ebool test 3 (12, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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(12n); + input.add4(10n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_uint8_euint4(12n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.le_uint8_euint4(11n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "ge" overload (uint8, euint4) => ebool test 4 (12, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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(8n); + input.add4(10n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_uint8_euint4(12n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.le_uint8_euint4(6n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + const res = await decryptBool(await this.contract2.resb()); expect(res).to.equal(true); }); - it('test operator "gt" overload (euint4, uint8) => ebool test 1 (14, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); + 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.contract1.gt_euint4_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof); + const tx = await this.contract2.le_uint8_euint4(10n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + const res = await decryptBool(await this.contract2.resb()); expect(res).to.equal(true); }); - it('test operator "gt" overload (euint4, uint8) => ebool test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); + 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.contract1.gt_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof); + const tx = await this.contract2.le_uint8_euint4(10n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + const res = await decryptBool(await this.contract2.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint4, uint8) => ebool test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); + 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.contract1.gt_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof); + const tx = await this.contract2.lt_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + const res = await decryptBool(await this.contract2.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint4, uint8) => ebool test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); + 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.contract1.gt_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); + const tx = await this.contract2.lt_euint4_uint8(encryptedAmount.handles[0], 12n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + const res = await decryptBool(await this.contract2.resb()); expect(res).to.equal(true); }); - it('test operator "gt" overload (uint8, euint4) => ebool test 1 (1, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); - input.add4(2n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_uint8_euint4(1n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.lt_euint4_uint8(encryptedAmount.handles[0], 12n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + 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.contract1Address, this.signers.alice.address); + 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); - input.add4(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.lt_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); + 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.contract1Address, this.signers.alice.address); + 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); + }); - input.add4(8n); + 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.contract1.gt_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); + 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.contract1.resb()); + 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 "gt" overload (uint8, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + 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); + }); - input.add4(4n); + 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.contract1.gt_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); + 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.contract1.resb()); + 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/test/tfheOperations/tfheOperations3.ts b/test/tfheOperations/tfheOperations3.ts index 8fd24457..33df958e 100644 --- a/test/tfheOperations/tfheOperations3.ts +++ b/test/tfheOperations/tfheOperations3.ts @@ -7,7 +7,22 @@ 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 { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance'; +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 { @@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise { 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); @@ -105,878 +175,996 @@ describe('TFHE operations 3', function () { 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, uint8) => ebool test 1 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - + 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.contract1.le_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); + const tx = await this.contract2.or_euint8_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); + const res = await decrypt16(await this.contract2.res16()); + expect(res).to.equal(28060n); }); - it('test operator "le" overload (euint4, uint8) => ebool test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - + 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.contract1.le_euint4_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof); + const tx = await this.contract2.or_euint8_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); + const res = await decrypt16(await this.contract2.res16()); + expect(res).to.equal(20n); }); - it('test operator "le" overload (euint4, uint8) => ebool test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - + 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.contract1.le_euint4_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof); + const tx = await this.contract2.or_euint8_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); + const res = await decrypt16(await this.contract2.res16()); + expect(res).to.equal(20n); }); - it('test operator "le" overload (euint4, uint8) => ebool test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - + 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.contract1.le_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); + const tx = await this.contract2.or_euint8_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); + const res = await decrypt16(await this.contract2.res16()); + expect(res).to.equal(20n); }); - it('test operator "le" overload (uint8, euint4) => ebool test 1 (8, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - - input.add4(13n); + 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.contract1.le_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.xor_euint8_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); + const res = await decrypt16(await this.contract2.res16()); + expect(res).to.equal(6614n); }); - it('test operator "le" overload (uint8, euint4) => ebool test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - - input.add4(13n); + 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.contract1.le_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.xor_euint8_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); + const res = await decrypt16(await this.contract2.res16()); + expect(res).to.equal(12n); }); - it('test operator "le" overload (uint8, euint4) => ebool test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - - input.add4(13n); + 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.contract1.le_uint8_euint4(13n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.xor_euint8_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); + const res = await decrypt16(await this.contract2.res16()); + expect(res).to.equal(0n); }); - it('test operator "le" overload (uint8, euint4) => ebool test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - - input.add4(9n); + 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.contract1.le_uint8_euint4(13n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.xor_euint8_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); + const res = await decrypt16(await this.contract2.res16()); + expect(res).to.equal(12n); }); - it('test operator "lt" overload (euint4, uint8) => ebool test 1 (13, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - + 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.contract1.lt_euint4_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof); + 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.contract1.resb()); + const res = await decryptBool(await this.contract2.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint4, uint8) => ebool test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - + 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.contract1.lt_euint4_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof); + 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.contract1.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "lt" overload (euint4, uint8) => ebool test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - + 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.contract1.lt_euint4_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof); + 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.contract1.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "lt" overload (euint4, uint8) => ebool test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - + 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.contract1.lt_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); + 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.contract1.resb()); + const res = await decryptBool(await this.contract2.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (uint8, euint4) => ebool test 1 (11, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - - input.add4(14n); + 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.contract1.lt_uint8_euint4(11n, encryptedAmount.handles[0], encryptedAmount.inputProof); + 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.contract1.resb()); + const res = await decryptBool(await this.contract2.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (uint8, euint4) => ebool test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - - input.add4(14n); + 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.contract1.lt_uint8_euint4(10n, encryptedAmount.handles[0], encryptedAmount.inputProof); + 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.contract1.resb()); + const res = await decryptBool(await this.contract2.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (uint8, euint4) => ebool test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - - input.add4(14n); + 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.contract1.lt_uint8_euint4(14n, encryptedAmount.handles[0], encryptedAmount.inputProof); + 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.contract1.resb()); + const res = await decryptBool(await this.contract2.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (uint8, euint4) => ebool test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - - input.add4(10n); + 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.contract1.lt_uint8_euint4(14n, encryptedAmount.handles[0], encryptedAmount.inputProof); + 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.contract1.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (euint4, uint8) => euint4 test 1 (8, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - + 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.contract1.min_euint4_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + const tx = await this.contract2.ge_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(7n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "min" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - + 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.contract1.min_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract2.ge_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(4n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "min" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - + 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.contract1.min_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract2.ge_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(8n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - + 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.contract1.min_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract2.ge_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(4n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (uint8, euint4) => euint4 test 1 (5, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - - input.add4(3n); + 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.contract1.min_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.gt_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(3n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "min" overload (uint8, euint4) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - - input.add4(8n); + 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.contract1.min_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.gt_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(4n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "min" overload (uint8, euint4) => euint4 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - - input.add4(8n); + 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.contract1.min_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.gt_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(8n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "min" overload (uint8, euint4) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - - input.add4(4n); + 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.contract1.min_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(4n); - }); - - it('test operator "max" overload (euint4, uint8) => euint4 test 1 (1, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(1n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(2n); - }); - - it('test operator "max" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract2.gt_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(8n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "max" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - + 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.contract1.max_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + const tx = await this.contract2.le_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(8n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "max" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - + 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.contract1.max_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + const tx = await this.contract2.le_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(8n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "max" overload (uint8, euint4) => euint4 test 1 (10, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - - input.add4(11n); + 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.contract1.max_uint8_euint4(10n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.le_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(11n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "max" overload (uint8, euint4) => euint4 test 2 (7, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - - input.add4(11n); + 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.contract1.max_uint8_euint4(7n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.le_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(11n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "max" overload (uint8, euint4) => euint4 test 3 (11, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - - input.add4(11n); + 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.contract1.max_uint8_euint4(11n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.lt_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(11n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "max" overload (uint8, euint4) => euint4 test 4 (11, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - - input.add4(7n); + 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.contract1.max_uint8_euint4(11n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract2.lt_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(11n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "add" overload (euint8, euint4) => euint8 test 1 (10, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(10n); - input.add4(2n); + 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.contract1.add_euint8_euint4( + const tx = await this.contract2.lt_euint8_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(12n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "add" overload (euint8, euint4) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(4n); - input.add4(8n); + 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.contract1.add_euint8_euint4( + const tx = await this.contract2.lt_euint8_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(12n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "add" overload (euint8, euint4) => euint8 test 3 (5, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(5n); - input.add4(5n); + 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.contract1.add_euint8_euint4( + const tx = await this.contract2.min_euint8_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(10n); + const res = await decrypt16(await this.contract2.res16()); + expect(res).to.equal(83n); }); - it('test operator "add" overload (euint8, euint4) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(8n); - input.add4(4n); + 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.contract1.add_euint8_euint4( + const tx = await this.contract2.min_euint8_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(12n); + const res = await decrypt16(await this.contract2.res16()); + expect(res).to.equal(79n); }); - it('test operator "sub" overload (euint8, euint4) => euint8 test 1 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(9n); - input.add4(9n); + 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.contract1.sub_euint8_euint4( + const tx = await this.contract2.min_euint8_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(0n); + const res = await decrypt16(await this.contract2.res16()); + expect(res).to.equal(83n); }); - it('test operator "sub" overload (euint8, euint4) => euint8 test 2 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(9n); - input.add4(5n); + 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.contract1.sub_euint8_euint4( + const tx = await this.contract2.min_euint8_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(4n); + const res = await decrypt16(await this.contract2.res16()); + expect(res).to.equal(79n); }); - it('test operator "mul" overload (euint8, euint4) => euint8 test 1 (5, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(5n); - input.add4(2n); + 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.contract1.mul_euint8_euint4( + const tx = await this.contract2.max_euint8_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(10n); + const res = await decrypt16(await this.contract2.res16()); + expect(res).to.equal(21942n); }); - it('test operator "mul" overload (euint8, euint4) => euint8 test 2 (3, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(3n); - input.add4(5n); + 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.contract1.mul_euint8_euint4( + const tx = await this.contract2.max_euint8_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(15n); + const res = await decrypt16(await this.contract2.res16()); + expect(res).to.equal(252n); }); - it('test operator "mul" overload (euint8, euint4) => euint8 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(3n); - input.add4(3n); + 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.contract1.mul_euint8_euint4( + const tx = await this.contract2.max_euint8_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(9n); + const res = await decrypt16(await this.contract2.res16()); + expect(res).to.equal(252n); }); - it('test operator "mul" overload (euint8, euint4) => euint8 test 4 (5, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(5n); - input.add4(3n); + 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.contract1.mul_euint8_euint4( + const tx = await this.contract2.max_euint8_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(15n); + const res = await decrypt16(await this.contract2.res16()); + expect(res).to.equal(252n); }); - it('test operator "and" overload (euint8, euint4) => euint8 test 1 (185, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(185n); - input.add4(9n); + 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.contract1.and_euint8_euint4( + const tx = await this.contract2.add_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(9n); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(253n); }); - it('test operator "and" overload (euint8, euint4) => euint8 test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(5n); - input.add4(9n); + 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.contract1.and_euint8_euint4( + const tx = await this.contract2.add_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(1n); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(122n); }); - it('test operator "and" overload (euint8, euint4) => euint8 test 3 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(9n); - input.add4(9n); + 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.contract1.and_euint8_euint4( + const tx = await this.contract2.add_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(9n); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(126n); }); - it('test operator "and" overload (euint8, euint4) => euint8 test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(9n); - input.add4(5n); + 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.contract1.and_euint8_euint4( + const tx = await this.contract2.add_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(1n); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(122n); }); - it('test operator "or" overload (euint8, euint4) => euint8 test 1 (37, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(37n); - input.add4(6n); + 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.contract1.or_euint8_euint4( + const tx = await this.contract2.sub_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(39n); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(0n); }); - it('test operator "or" overload (euint8, euint4) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(4n); - input.add4(8n); + 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.contract1.or_euint8_euint4( + const tx = await this.contract2.sub_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(12n); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(4n); }); - it('test operator "or" overload (euint8, euint4) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(8n); - input.add4(8n); + 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.contract1.or_euint8_euint4( + const tx = await this.contract2.mul_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(8n); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(158n); }); - it('test operator "or" overload (euint8, euint4) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(8n); - input.add4(4n); + 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.contract1.or_euint8_euint4( + const tx = await this.contract2.mul_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(12n); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(140n); }); - it('test operator "xor" overload (euint8, euint4) => euint8 test 1 (253, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(253n); - input.add4(3n); + 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.contract1.xor_euint8_euint4( + const tx = await this.contract2.mul_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(254n); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(196n); }); - it('test operator "xor" overload (euint8, euint4) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(4n); - input.add4(8n); + 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.contract1.xor_euint8_euint4( + const tx = await this.contract2.mul_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(12n); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(140n); }); - it('test operator "xor" overload (euint8, euint4) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(8n); - input.add4(8n); + 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.contract1.xor_euint8_euint4( + const tx = await this.contract2.and_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(0n); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(48n); }); - it('test operator "xor" overload (euint8, euint4) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add8(8n); - input.add4(4n); + 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.contract1.xor_euint8_euint4( + const tx = await this.contract2.and_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(12n); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(98n); }); - it('test operator "eq" overload (euint8, euint4) => ebool test 1 (37, 7)', async function () { + 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(37n); - input.add4(7n); + input.add8(114n); + input.add32(114n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint8_euint4( + const tx = await this.contract2.and_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); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(114n); }); - it('test operator "eq" overload (euint8, euint4) => ebool test 2 (4, 8)', async function () { + 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(4n); - input.add4(8n); + input.add8(114n); + input.add32(110n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint8_euint4( + const tx = await this.contract2.and_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); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(98n); }); - it('test operator "eq" overload (euint8, euint4) => ebool test 3 (8, 8)', async function () { + 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(8n); - input.add4(8n); + input.add8(64n); + input.add32(694910711n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint8_euint4( + const tx = await this.contract2.or_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); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(694910711n); }); - it('test operator "eq" overload (euint8, euint4) => ebool test 4 (8, 4)', async function () { + 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(8n); - input.add4(4n); + input.add8(60n); + input.add32(64n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint8_euint4( + const tx = await this.contract2.or_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); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(124n); }); - it('test operator "ne" overload (euint8, euint4) => ebool test 1 (145, 14)', async function () { + 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(145n); - input.add4(14n); + input.add8(64n); + input.add32(64n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint4( + const tx = await this.contract2.or_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); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(64n); }); - it('test operator "ne" overload (euint8, euint4) => ebool test 2 (10, 14)', async function () { + 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(10n); - input.add4(14n); + input.add8(64n); + input.add32(60n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint4( + const tx = await this.contract2.or_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); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(124n); }); - it('test operator "ne" overload (euint8, euint4) => ebool test 3 (14, 14)', async function () { + 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(14n); - input.add4(14n); + input.add8(200n); + input.add32(3474428988n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint4( + const tx = await this.contract2.xor_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); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(3474429172n); }); - it('test operator "ne" overload (euint8, euint4) => ebool test 4 (14, 10)', async function () { + 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(14n); - input.add4(10n); + input.add8(196n); + input.add32(200n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint4( + const tx = await this.contract2.xor_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); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(12n); }); - it('test operator "ge" overload (euint8, euint4) => ebool test 1 (85, 12)', async function () { + 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(85n); - input.add4(12n); + input.add8(200n); + input.add32(200n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint8_euint4( + const tx = await this.contract2.xor_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); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(0n); }); - it('test operator "ge" overload (euint8, euint4) => ebool test 2 (8, 12)', async function () { + 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(8n); - input.add4(12n); + input.add8(200n); + input.add32(196n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint8_euint4( + const tx = await this.contract2.xor_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); + const res = await decrypt32(await this.contract2.res32()); + expect(res).to.equal(12n); }); - it('test operator "ge" overload (euint8, euint4) => ebool test 3 (12, 12)', async function () { + 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(12n); - input.add4(12n); + input.add8(226n); + input.add32(3320102390n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint8_euint4( + 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); + expect(res).to.equal(false); }); - it('test operator "ge" overload (euint8, euint4) => ebool test 4 (12, 8)', async function () { + 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(12n); - input.add4(8n); + input.add8(222n); + input.add32(226n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint8_euint4( + 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); + expect(res).to.equal(false); }); - it('test operator "gt" overload (euint8, euint4) => ebool test 1 (248, 2)', async function () { + 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(248n); - input.add4(2n); + input.add8(226n); + input.add32(226n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint8_euint4( + const tx = await this.contract2.eq_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, @@ -986,12 +1174,12 @@ describe('TFHE operations 3', function () { expect(res).to.equal(true); }); - it('test operator "gt" overload (euint8, euint4) => ebool test 2 (4, 8)', async function () { + 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(4n); - input.add4(8n); + input.add8(226n); + input.add32(222n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint8_euint4( + const tx = await this.contract2.eq_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, @@ -1001,27 +1189,27 @@ describe('TFHE operations 3', function () { expect(res).to.equal(false); }); - it('test operator "gt" overload (euint8, euint4) => ebool test 3 (8, 8)', async function () { + 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(8n); - input.add4(8n); + input.add8(134n); + input.add32(943645708n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint8_euint4( + 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); + expect(res).to.equal(true); }); - it('test operator "gt" overload (euint8, euint4) => ebool test 4 (8, 4)', async function () { + 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(8n); - input.add4(4n); + input.add8(130n); + input.add32(134n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint8_euint4( + const tx = await this.contract2.ne_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, @@ -1031,12 +1219,12 @@ describe('TFHE operations 3', function () { expect(res).to.equal(true); }); - it('test operator "le" overload (euint8, euint4) => ebool test 1 (92, 13)', async function () { + 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(92n); - input.add4(13n); + input.add8(134n); + input.add32(134n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint8_euint4( + const tx = await this.contract2.ne_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, @@ -1046,12 +1234,12 @@ describe('TFHE operations 3', function () { expect(res).to.equal(false); }); - it('test operator "le" overload (euint8, euint4) => ebool test 2 (9, 13)', async function () { + 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(9n); - input.add4(13n); + input.add8(134n); + input.add32(130n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint8_euint4( + const tx = await this.contract2.ne_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, @@ -1061,27 +1249,27 @@ describe('TFHE operations 3', function () { expect(res).to.equal(true); }); - it('test operator "le" overload (euint8, euint4) => ebool test 3 (13, 13)', async function () { + 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(13n); - input.add4(13n); + input.add8(108n); + input.add32(54055221n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint8_euint4( + 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); + expect(res).to.equal(false); }); - it('test operator "le" overload (euint8, euint4) => ebool test 4 (13, 9)', async function () { + 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(13n); - input.add4(9n); + input.add8(104n); + input.add32(108n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint8_euint4( + const tx = await this.contract2.ge_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, @@ -1091,27 +1279,27 @@ describe('TFHE operations 3', function () { expect(res).to.equal(false); }); - it('test operator "lt" overload (euint8, euint4) => ebool test 1 (195, 14)', async function () { + 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(195n); - input.add4(14n); + input.add8(108n); + input.add32(108n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint8_euint4( + 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); + expect(res).to.equal(true); }); - it('test operator "lt" overload (euint8, euint4) => ebool test 2 (10, 14)', async function () { + 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(10n); - input.add4(14n); + input.add8(108n); + input.add32(104n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint8_euint4( + const tx = await this.contract2.ge_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, @@ -1121,12 +1309,12 @@ describe('TFHE operations 3', function () { expect(res).to.equal(true); }); - it('test operator "lt" overload (euint8, euint4) => ebool test 3 (14, 14)', async function () { + 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(14n); - input.add4(14n); + input.add8(16n); + input.add32(2217853328n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint8_euint4( + const tx = await this.contract2.gt_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, @@ -1136,12 +1324,12 @@ describe('TFHE operations 3', function () { expect(res).to.equal(false); }); - it('test operator "lt" overload (euint8, euint4) => ebool test 4 (14, 10)', async function () { + 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(14n); - input.add4(10n); + input.add8(12n); + input.add32(16n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint8_euint4( + const tx = await this.contract2.gt_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, @@ -1151,1323 +1339,3275 @@ describe('TFHE operations 3', function () { expect(res).to.equal(false); }); - it('test operator "min" overload (euint8, euint4) => euint8 test 1 (55, 3)', async function () { + 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(55n); - input.add4(3n); + input.add8(16n); + input.add32(16n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint8_euint4( + const tx = await this.contract2.gt_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(3n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(false); }); - it('test operator "min" overload (euint8, euint4) => euint8 test 2 (4, 8)', async function () { + 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(4n); - input.add4(8n); + input.add8(16n); + input.add32(12n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint8_euint4( + const tx = await this.contract2.gt_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(4n); + const res = await decryptBool(await this.contract2.resb()); + expect(res).to.equal(true); }); - it('test operator "min" 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); + 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.contract2.min_euint8_euint4( + const tx = await this.contract3.le_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(8n); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(true); }); - it('test operator "min" 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); + 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.contract2.min_euint8_euint4( + const tx = await this.contract3.le_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(4n); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(true); }); - it('test operator "max" overload (euint8, euint4) => euint8 test 1 (41, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(41n); - input.add4(11n); + 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.contract2.max_euint8_euint4( + const tx = await this.contract3.le_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(41n); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(true); }); - it('test operator "max" 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); + 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.contract2.max_euint8_euint4( + const tx = await this.contract3.le_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(11n); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(false); }); - it('test operator "max" 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); + 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.contract2.max_euint8_euint4( + const tx = await this.contract3.lt_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(11n); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(true); }); - it('test operator "max" 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); + 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.contract2.max_euint8_euint4( + const tx = await this.contract3.lt_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(11n); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(true); }); - it('test operator "add" overload (euint8, euint8) => euint8 test 1 (56, 89)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(56n); - input.add8(89n); + 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.contract2.add_euint8_euint8( + const tx = await this.contract3.lt_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(145n); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(false); }); - it('test operator "add" overload (euint8, euint8) => euint8 test 2 (52, 56)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(52n); - input.add8(56n); + 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.contract2.add_euint8_euint8( + const tx = await this.contract3.lt_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(108n); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(false); }); - it('test operator "add" overload (euint8, euint8) => euint8 test 3 (56, 56)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(56n); - input.add8(56n); + 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.contract2.add_euint8_euint8( + const tx = await this.contract3.min_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(112n); + const res = await decrypt32(await this.contract3.res32()); + expect(res).to.equal(248n); }); - it('test operator "add" overload (euint8, euint8) => euint8 test 4 (56, 52)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(56n); - input.add8(52n); + 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.contract2.add_euint8_euint8( + const tx = await this.contract3.min_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(108n); + const res = await decrypt32(await this.contract3.res32()); + expect(res).to.equal(244n); }); - it('test operator "sub" overload (euint8, euint8) => euint8 test 1 (64, 64)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(64n); - input.add8(64n); + 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.contract2.sub_euint8_euint8( + const tx = await this.contract3.min_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(0n); + const res = await decrypt32(await this.contract3.res32()); + expect(res).to.equal(248n); }); - it('test operator "sub" overload (euint8, euint8) => euint8 test 2 (64, 60)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(64n); - input.add8(60n); + 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.contract2.sub_euint8_euint8( + const tx = await this.contract3.min_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(4n); + const res = await decrypt32(await this.contract3.res32()); + expect(res).to.equal(244n); }); - it('test operator "mul" overload (euint8, euint8) => euint8 test 1 (14, 15)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(14n); - input.add8(15n); + 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.contract2.mul_euint8_euint8( + const tx = await this.contract3.max_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(210n); + const res = await decrypt32(await this.contract3.res32()); + expect(res).to.equal(3976371021n); }); - it('test operator "mul" overload (euint8, euint8) => euint8 test 2 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(14n); - input.add8(14n); + 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.contract2.mul_euint8_euint8( + const tx = await this.contract3.max_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(196n); + const res = await decrypt32(await this.contract3.res32()); + expect(res).to.equal(31n); }); - 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); + 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.contract2.mul_euint8_euint8( + const tx = await this.contract3.max_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(196n); + const res = await decrypt32(await this.contract3.res32()); + expect(res).to.equal(31n); }); - it('test operator "mul" overload (euint8, euint8) => euint8 test 4 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(14n); - input.add8(14n); + 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.contract2.mul_euint8_euint8( + const tx = await this.contract3.max_euint8_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(196n); + const res = await decrypt32(await this.contract3.res32()); + expect(res).to.equal(31n); }); - it('test operator "and" overload (euint8, euint8) => euint8 test 1 (68, 245)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(68n); - input.add8(245n); + 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.contract2.and_euint8_euint8( + const tx = await this.contract3.add_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(68n); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(131n); }); - it('test operator "and" overload (euint8, euint8) => euint8 test 2 (64, 68)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(64n); - input.add8(68n); + 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.contract2.and_euint8_euint8( + const tx = await this.contract3.add_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(64n); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(178n); }); - it('test operator "and" overload (euint8, euint8) => euint8 test 3 (68, 68)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(68n); - input.add8(68n); + 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.contract2.and_euint8_euint8( + const tx = await this.contract3.add_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(68n); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(182n); }); - it('test operator "and" overload (euint8, euint8) => euint8 test 4 (68, 64)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(68n); - input.add8(64n); + 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.contract2.and_euint8_euint8( + const tx = await this.contract3.add_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(64n); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(178n); }); - it('test operator "or" overload (euint8, euint8) => euint8 test 1 (245, 47)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(245n); - input.add8(47n); + 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.contract2.or_euint8_euint8( + const tx = await this.contract3.sub_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(255n); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(0n); }); - it('test operator "or" overload (euint8, euint8) => euint8 test 2 (43, 47)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(43n); - input.add8(47n); + 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.contract2.or_euint8_euint8( + const tx = await this.contract3.sub_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(47n); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(4n); }); - it('test operator "or" overload (euint8, euint8) => euint8 test 3 (47, 47)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(47n); - input.add8(47n); + 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.contract2.or_euint8_euint8( + const tx = await this.contract3.mul_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(47n); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(130n); }); - it('test operator "or" overload (euint8, euint8) => euint8 test 4 (47, 43)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(47n); - input.add8(43n); + 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.contract2.or_euint8_euint8( + const tx = await this.contract3.mul_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(47n); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(80n); }); - it('test operator "xor" overload (euint8, euint8) => euint8 test 1 (213, 62)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(213n); - input.add8(62n); + 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.contract2.xor_euint8_euint8( + const tx = await this.contract3.mul_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(235n); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(100n); }); - it('test operator "xor" overload (euint8, euint8) => euint8 test 2 (58, 62)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(58n); - input.add8(62n); + 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.contract2.xor_euint8_euint8( + const tx = await this.contract3.mul_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(4n); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(80n); }); - it('test operator "xor" overload (euint8, euint8) => euint8 test 3 (62, 62)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(62n); - input.add8(62n); + 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.contract2.xor_euint8_euint8( + const tx = await this.contract3.and_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(0n); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(9n); }); - it('test operator "xor" overload (euint8, euint8) => euint8 test 4 (62, 58)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(62n); - input.add8(58n); + 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.contract2.xor_euint8_euint8( + const tx = await this.contract3.and_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(4n); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(195n); }); - it('test operator "eq" overload (euint8, euint8) => ebool test 1 (51, 70)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(51n); - input.add8(70n); + 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.contract2.eq_euint8_euint8( + const tx = await this.contract3.and_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(203n); }); - it('test operator "eq" overload (euint8, euint8) => ebool test 2 (47, 51)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(47n); - input.add8(51n); + 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.contract2.eq_euint8_euint8( + const tx = await this.contract3.and_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(195n); }); - it('test operator "eq" overload (euint8, euint8) => ebool test 3 (51, 51)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(51n); - input.add8(51n); + 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.contract2.eq_euint8_euint8( + const tx = await this.contract3.or_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(18446578065470955231n); }); - it('test operator "eq" overload (euint8, euint8) => ebool test 4 (51, 47)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(51n); - input.add8(47n); + 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.contract2.eq_euint8_euint8( + const tx = await this.contract3.or_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(22n); }); - it('test operator "ne" overload (euint8, euint8) => ebool test 1 (236, 26)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(236n); - input.add8(26n); + 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.contract2.ne_euint8_euint8( + const tx = await this.contract3.or_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(22n); }); - it('test operator "ne" overload (euint8, euint8) => ebool test 2 (22, 26)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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.add8(26n); + input.add64(18n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint8( + const tx = await this.contract3.or_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(22n); }); - it('test operator "ne" overload (euint8, euint8) => ebool test 3 (26, 26)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(26n); - input.add8(26n); + 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.contract2.ne_euint8_euint8( + const tx = await this.contract3.xor_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(18438760776575020847n); }); - it('test operator "ne" overload (euint8, euint8) => ebool test 4 (26, 22)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(26n); - input.add8(22n); + 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.contract2.ne_euint8_euint8( + const tx = await this.contract3.xor_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(12n); }); - it('test operator "ge" overload (euint8, euint8) => ebool test 1 (89, 227)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(89n); - input.add8(227n); + 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.contract2.ge_euint8_euint8( + const tx = await this.contract3.xor_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(0n); }); - it('test operator "ge" overload (euint8, euint8) => ebool test 2 (85, 89)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(85n); - input.add8(89n); + 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.contract2.ge_euint8_euint8( + const tx = await this.contract3.xor_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(12n); }); - it('test operator "ge" overload (euint8, euint8) => ebool test 3 (89, 89)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(89n); - input.add8(89n); + 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.contract2.ge_euint8_euint8( + 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.contract2.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(false); }); - it('test operator "ge" overload (euint8, euint8) => ebool test 4 (89, 85)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(89n); - input.add8(85n); + 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.contract2.ge_euint8_euint8( + 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.contract2.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(false); }); - it('test operator "gt" overload (euint8, euint8) => ebool test 1 (247, 56)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(247n); - input.add8(56n); + 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.contract2.gt_euint8_euint8( + 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.contract2.resb()); + const res = await decryptBool(await this.contract3.resb()); expect(res).to.equal(true); }); - it('test operator "gt" overload (euint8, euint8) => ebool test 2 (52, 56)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(52n); - input.add8(56n); + 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.contract2.gt_euint8_euint8( + 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.contract2.resb()); + const res = await decryptBool(await this.contract3.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint8, euint8) => ebool test 3 (56, 56)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(56n); - input.add8(56n); + 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.contract2.gt_euint8_euint8( + 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.contract2.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(true); }); - it('test operator "gt" overload (euint8, euint8) => ebool test 4 (56, 52)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(56n); - input.add8(52n); + 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.contract2.gt_euint8_euint8( + 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.contract2.resb()); + const res = await decryptBool(await this.contract3.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint8, euint8) => ebool test 1 (182, 238)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(182n); - input.add8(238n); + 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.contract2.le_euint8_euint8( + 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.contract2.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(false); }); - it('test operator "le" overload (euint8, euint8) => ebool test 2 (178, 182)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(178n); - input.add8(182n); + 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.contract2.le_euint8_euint8( + 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.contract2.resb()); + const res = await decryptBool(await this.contract3.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint8, euint8) => ebool test 3 (182, 182)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(182n); - input.add8(182n); + 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.contract2.le_euint8_euint8( + 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.contract2.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(false); }); - it('test operator "le" overload (euint8, euint8) => ebool test 4 (182, 178)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(182n); - input.add8(178n); + 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.contract2.le_euint8_euint8( + 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.contract2.resb()); + const res = await decryptBool(await this.contract3.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint8, euint8) => ebool test 1 (44, 62)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(44n); - input.add8(62n); + 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.contract2.lt_euint8_euint8( + 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.contract2.resb()); + const res = await decryptBool(await this.contract3.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (euint8, euint8) => ebool test 2 (40, 44)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(40n); - input.add8(44n); + 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.contract2.lt_euint8_euint8( + 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.contract2.resb()); + const res = await decryptBool(await this.contract3.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (euint8, euint8) => ebool test 3 (44, 44)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(44n); - input.add8(44n); + 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.contract2.lt_euint8_euint8( + 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.contract2.resb()); + const res = await decryptBool(await this.contract3.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint8, euint8) => ebool test 4 (44, 40)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(44n); - input.add8(40n); + 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.contract2.lt_euint8_euint8( + 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.contract2.resb()); + const res = await decryptBool(await this.contract3.resb()); expect(res).to.equal(false); }); - it('test operator "min" overload (euint8, euint8) => euint8 test 1 (254, 73)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(254n); - input.add8(73n); + 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.contract2.min_euint8_euint8( + const tx = await this.contract3.gt_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(73n); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(false); }); - it('test operator "min" overload (euint8, euint8) => euint8 test 2 (69, 73)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(69n); - input.add8(73n); + 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.contract2.min_euint8_euint8( + const tx = await this.contract3.gt_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(69n); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (euint8, euint8) => euint8 test 3 (73, 73)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(73n); - input.add8(73n); + 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.contract2.min_euint8_euint8( + const tx = await this.contract3.le_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(73n); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (euint8, euint8) => euint8 test 4 (73, 69)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(73n); - input.add8(69n); + 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.contract2.min_euint8_euint8( + const tx = await this.contract3.le_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(69n); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(true); }); - it('test operator "max" overload (euint8, euint8) => euint8 test 1 (227, 29)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(227n); - input.add8(29n); + 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.contract2.max_euint8_euint8( + const tx = await this.contract3.le_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(227n); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(true); }); - it('test operator "max" overload (euint8, euint8) => euint8 test 2 (25, 29)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(25n); - input.add8(29n); + 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.contract2.max_euint8_euint8( + const tx = await this.contract3.le_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(29n); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(false); }); - it('test operator "max" overload (euint8, euint8) => euint8 test 3 (29, 29)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(29n); - input.add8(29n); + 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.contract2.max_euint8_euint8( + const tx = await this.contract3.lt_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(29n); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(true); }); - it('test operator "max" overload (euint8, euint8) => euint8 test 4 (29, 25)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(29n); - input.add8(25n); + 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.contract2.max_euint8_euint8( + const tx = await this.contract3.lt_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(29n); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(true); }); - it('test operator "add" overload (euint8, euint16) => euint16 test 1 (2, 246)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(2n); - input.add16(246n); + 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.contract2.add_euint8_euint16( + const tx = await this.contract3.lt_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(248n); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(false); }); - it('test operator "add" overload (euint8, euint16) => euint16 test 2 (104, 106)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(104n); - input.add16(106n); + 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.contract2.add_euint8_euint16( + const tx = await this.contract3.lt_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(210n); + const res = await decryptBool(await this.contract3.resb()); + expect(res).to.equal(false); }); - it('test operator "add" overload (euint8, euint16) => euint16 test 3 (106, 106)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(106n); - input.add16(106n); + 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.contract2.add_euint8_euint16( + const tx = await this.contract3.min_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(212n); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(6n); }); - it('test operator "add" overload (euint8, euint16) => euint16 test 4 (106, 104)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(106n); - input.add16(104n); + 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.contract2.add_euint8_euint16( + const tx = await this.contract3.min_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(210n); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(4n); }); - it('test operator "sub" overload (euint8, euint16) => euint16 test 1 (17, 17)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(17n); - input.add16(17n); + 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.contract2.sub_euint8_euint16( + const tx = await this.contract3.min_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(0n); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(8n); }); - it('test operator "sub" overload (euint8, euint16) => euint16 test 2 (17, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(17n); - input.add16(13n); + 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.contract2.sub_euint8_euint16( + const tx = await this.contract3.min_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); + const res = await decrypt64(await this.contract3.res64()); expect(res).to.equal(4n); }); - it('test operator "mul" overload (euint8, euint16) => euint16 test 1 (2, 56)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(2n); - input.add16(56n); + 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.contract2.mul_euint8_euint16( + const tx = await this.contract3.max_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(112n); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(18441870389911940983n); }); - it('test operator "mul" overload (euint8, euint16) => euint16 test 2 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(10n); - input.add16(10n); + 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.contract2.mul_euint8_euint16( + const tx = await this.contract3.max_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(100n); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(217n); }); - it('test operator "mul" overload (euint8, euint16) => euint16 test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(10n); - input.add16(10n); + 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.contract2.mul_euint8_euint16( + const tx = await this.contract3.max_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(100n); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(217n); }); - it('test operator "mul" overload (euint8, euint16) => euint16 test 4 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(10n); - input.add16(10n); + 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.contract2.mul_euint8_euint16( + const tx = await this.contract3.max_euint8_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(100n); + const res = await decrypt64(await this.contract3.res64()); + expect(res).to.equal(217n); }); - it('test operator "and" overload (euint8, euint16) => euint16 test 1 (140, 15292)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(140n); - input.add16(15292n); + 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.contract2.and_euint8_euint16( + const tx = await this.contract3.add_euint8_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(140n); + const res = await decrypt128(await this.contract3.res128()); + expect(res).to.equal(131n); }); - it('test operator "and" overload (euint8, euint16) => euint16 test 2 (136, 140)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(136n); - input.add16(140n); + 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.contract2.and_euint8_euint16( + const tx = await this.contract3.add_euint8_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(136n); + const res = await decrypt128(await this.contract3.res128()); + expect(res).to.equal(36n); }); - it('test operator "and" overload (euint8, euint16) => euint16 test 3 (140, 140)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(140n); - input.add16(140n); + 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.contract2.and_euint8_euint16( + const tx = await this.contract3.add_euint8_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(140n); + const res = await decrypt128(await this.contract3.res128()); + expect(res).to.equal(40n); }); - it('test operator "and" overload (euint8, euint16) => euint16 test 4 (140, 136)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(140n); - input.add16(136n); + 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.contract2.and_euint8_euint16( + const tx = await this.contract3.add_euint8_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(136n); + const res = await decrypt128(await this.contract3.res128()); + expect(res).to.equal(36n); }); - it('test operator "or" overload (euint8, euint16) => euint16 test 1 (140, 39215)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(140n); - input.add16(39215n); + 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.contract2.or_euint8_euint16( + const tx = await this.contract3.sub_euint8_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(39343n); + const res = await decrypt128(await this.contract3.res128()); + expect(res).to.equal(0n); }); - it('test operator "or" overload (euint8, euint16) => euint16 test 2 (136, 140)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(136n); - input.add16(140n); + 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.contract2.or_euint8_euint16( + const tx = await this.contract3.sub_euint8_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(140n); + const res = await decrypt128(await this.contract3.res128()); + expect(res).to.equal(4n); }); - it('test operator "or" overload (euint8, euint16) => euint16 test 3 (140, 140)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(140n); - input.add16(140n); + 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.contract2.or_euint8_euint16( + const tx = await this.contract3.mul_euint8_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(140n); + const res = await decrypt128(await this.contract3.res128()); + expect(res).to.equal(130n); }); - it('test operator "or" overload (euint8, euint16) => euint16 test 4 (140, 136)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(140n); - input.add16(136n); + 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.contract2.or_euint8_euint16( + const tx = await this.contract3.mul_euint8_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(140n); + const res = await decrypt128(await this.contract3.res128()); + expect(res).to.equal(90n); }); - it('test operator "xor" overload (euint8, euint16) => euint16 test 1 (2, 64716)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(2n); - input.add16(64716n); + 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.contract2.xor_euint8_euint16( + const tx = await this.contract3.mul_euint8_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(64718n); + const res = await decrypt128(await this.contract3.res128()); + expect(res).to.equal(100n); }); - it('test operator "xor" 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); + 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.contract2.xor_euint8_euint16( + const tx = await this.contract3.mul_euint8_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(12n); + const res = await decrypt128(await this.contract3.res128()); + expect(res).to.equal(90n); }); - it('test operator "xor" 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); + 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.contract2.xor_euint8_euint16( + const tx = await this.contract3.and_euint8_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(0n); + const res = await decrypt128(await this.contract3.res128()); + expect(res).to.equal(8n); }); - it('test operator "xor" 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); + 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.contract2.xor_euint8_euint16( + const tx = await this.contract3.and_euint8_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(12n); + const res = await decrypt128(await this.contract3.res128()); + expect(res).to.equal(64n); }); - it('test operator "eq" overload (euint8, euint16) => ebool test 1 (22, 5993)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(22n); - input.add16(5993n); + 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.contract2.eq_euint8_euint16( + const tx = await this.contract3.and_euint8_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); + 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, euint16) => ebool test 2 (18, 22)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(18n); - input.add16(22n); + 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.contract2.eq_euint8_euint16( + 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.contract2.resb()); + const res = await decryptBool(await this.contract3.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint8, euint16) => ebool test 3 (22, 22)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(22n); - input.add16(22n); + 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.contract2.eq_euint8_euint16( + 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.contract2.resb()); + const res = await decryptBool(await this.contract3.resb()); expect(res).to.equal(true); }); - it('test operator "eq" overload (euint8, euint16) => ebool test 4 (22, 18)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(22n); - input.add16(18n); + 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.contract2.eq_euint8_euint16( + 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.contract2.resb()); + 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/test/tfheOperations/tfheOperations4.ts b/test/tfheOperations/tfheOperations4.ts index 3380044a..6dbd34d9 100644 --- a/test/tfheOperations/tfheOperations4.ts +++ b/test/tfheOperations/tfheOperations4.ts @@ -7,7 +7,22 @@ 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 { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance'; +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 { @@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise { 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); @@ -105,2355 +175,4421 @@ describe('TFHE operations 4', function () { 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 "ne" overload (euint8, euint16) => ebool test 1 (201, 56595)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(201n); - input.add16(56595n); + 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.contract2.ne_euint8_euint16( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint8, euint16) => ebool test 2 (197, 201)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(197n); - input.add16(201n); + 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.contract2.ne_euint8_euint16( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint8, euint16) => ebool test 3 (201, 201)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(201n); - input.add16(201n); + 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.contract2.ne_euint8_euint16( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint8, euint16) => ebool test 4 (201, 197)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(201n); - input.add16(197n); + 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.contract2.ne_euint8_euint16( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint8, euint16) => ebool test 1 (12, 41571)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(12n); - input.add16(41571n); + 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.contract2.ge_euint8_euint16( + 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.contract2.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract4.resb()); + expect(res).to.equal(true); }); - it('test operator "ge" overload (euint8, euint16) => ebool test 2 (8, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(8n); - input.add16(12n); + 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.contract2.ge_euint8_euint16( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "ge" overload (euint8, euint16) => ebool test 3 (12, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(12n); - input.add16(12n); + 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.contract2.ge_euint8_euint16( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint8, euint16) => ebool test 4 (12, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(12n); - input.add16(8n); + 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.contract2.ge_euint8_euint16( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "gt" overload (euint8, euint16) => ebool test 1 (67, 34612)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(67n); - input.add16(34612n); + 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.contract2.gt_euint8_euint16( + 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.contract2.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract4.resb()); + expect(res).to.equal(true); }); - it('test operator "gt" overload (euint8, euint16) => ebool test 2 (63, 67)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(63n); - input.add16(67n); + 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.contract2.gt_euint8_euint16( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint8, euint16) => ebool test 3 (67, 67)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(67n); - input.add16(67n); + 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.contract2.gt_euint8_euint16( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint8, euint16) => ebool test 4 (67, 63)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(67n); - input.add16(63n); + 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.contract2.gt_euint8_euint16( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint8, euint16) => ebool test 1 (157, 25391)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(157n); - input.add16(25391n); + 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.contract2.le_euint8_euint16( + 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.contract2.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract4.resb()); + expect(res).to.equal(false); }); - it('test operator "le" overload (euint8, euint16) => ebool test 2 (153, 157)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(153n); - input.add16(157n); + 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.contract2.le_euint8_euint16( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint8, euint16) => ebool test 3 (157, 157)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(157n); - input.add16(157n); + 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.contract2.le_euint8_euint16( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint8, euint16) => ebool test 4 (157, 153)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(157n); - input.add16(153n); + 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.contract2.le_euint8_euint16( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint8, euint16) => ebool test 1 (115, 9566)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(115n); - input.add16(9566n); + 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.contract2.lt_euint8_euint16( + 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.contract2.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract4.resb()); + expect(res).to.equal(false); }); - it('test operator "lt" overload (euint8, euint16) => ebool test 2 (111, 115)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(111n); - input.add16(115n); + 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.contract2.lt_euint8_euint16( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (euint8, euint16) => ebool test 3 (115, 115)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(115n); - input.add16(115n); + 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.contract2.lt_euint8_euint16( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint8, euint16) => ebool test 4 (115, 111)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(115n); - input.add16(111n); + 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.contract2.lt_euint8_euint16( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "min" overload (euint8, euint16) => euint16 test 1 (59, 17033)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(59n); - input.add16(17033n); + 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.contract2.min_euint8_euint16( + 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.contract2.res16()); - expect(res).to.equal(59n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(238n); }); - it('test operator "min" overload (euint8, euint16) => euint16 test 2 (55, 59)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(55n); - input.add16(59n); + 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.contract2.min_euint8_euint16( + 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.contract2.res16()); - expect(res).to.equal(55n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(234n); }); - it('test operator "min" overload (euint8, euint16) => euint16 test 3 (59, 59)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(59n); - input.add16(59n); + 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.contract2.min_euint8_euint16( + 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.contract2.res16()); - expect(res).to.equal(59n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(238n); }); - it('test operator "min" overload (euint8, euint16) => euint16 test 4 (59, 55)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(59n); - input.add16(55n); + 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.contract2.min_euint8_euint16( + 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.contract2.res16()); - expect(res).to.equal(55n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(234n); }); - it('test operator "max" overload (euint8, euint16) => euint16 test 1 (76, 60931)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(76n); - input.add16(60931n); + 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.contract2.max_euint8_euint16( + 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.contract2.res16()); - expect(res).to.equal(60931n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(22246n); }); - it('test operator "max" overload (euint8, euint16) => euint16 test 2 (72, 76)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(72n); - input.add16(76n); + 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.contract2.max_euint8_euint16( + 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.contract2.res16()); - expect(res).to.equal(76n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(39n); }); - it('test operator "max" overload (euint8, euint16) => euint16 test 3 (76, 76)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(76n); - input.add16(76n); + 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.contract2.max_euint8_euint16( + 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.contract2.res16()); - expect(res).to.equal(76n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(39n); }); - it('test operator "max" overload (euint8, euint16) => euint16 test 4 (76, 72)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(76n); - input.add16(72n); + 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.contract2.max_euint8_euint16( + 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.contract2.res16()); - expect(res).to.equal(76n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(39n); }); - it('test operator "add" overload (euint8, euint32) => euint32 test 1 (2, 131)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(2n); - input.add32(131n); + 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.contract2.add_euint8_euint32( + const tx = await this.contract4.add_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(133n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(62350n); }); - it('test operator "add" overload (euint8, euint32) => euint32 test 2 (88, 92)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(88n); - input.add32(92n); + 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.contract2.add_euint8_euint32( + const tx = await this.contract4.add_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(180n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(52052n); }); - it('test operator "add" overload (euint8, euint32) => euint32 test 3 (92, 92)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(92n); - input.add32(92n); + 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.contract2.add_euint8_euint32( + const tx = await this.contract4.add_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(184n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(52056n); }); - it('test operator "add" overload (euint8, euint32) => euint32 test 4 (92, 88)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(92n); - input.add32(88n); + 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.contract2.add_euint8_euint32( + const tx = await this.contract4.add_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(180n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(52052n); }); - it('test operator "sub" overload (euint8, euint32) => euint32 test 1 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(10n); - input.add32(10n); + 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.contract2.sub_euint8_euint32( + const tx = await this.contract4.sub_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); + const res = await decrypt16(await this.contract4.res16()); expect(res).to.equal(0n); }); - it('test operator "sub" overload (euint8, euint32) => euint32 test 2 (10, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(10n); - input.add32(6n); + 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.contract2.sub_euint8_euint32( + const tx = await this.contract4.sub_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); + const res = await decrypt16(await this.contract4.res16()); 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); + 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.contract2.mul_euint8_euint32( + const tx = await this.contract4.mul_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(158n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(23400n); }); - it('test operator "mul" overload (euint8, euint32) => euint32 test 2 (10, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(10n); - input.add32(11n); + 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.contract2.mul_euint8_euint32( + const tx = await this.contract4.mul_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(110n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(54289n); }); - it('test operator "mul" overload (euint8, euint32) => euint32 test 3 (11, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(11n); - input.add32(11n); + 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.contract2.mul_euint8_euint32( + const tx = await this.contract4.mul_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(121n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(54289n); }); - it('test operator "mul" overload (euint8, euint32) => euint32 test 4 (11, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(11n); - input.add32(10n); + 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.contract2.mul_euint8_euint32( + const tx = await this.contract4.mul_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(110n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(54289n); }); - it('test operator "and" overload (euint8, euint32) => euint32 test 1 (39, 58691136)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(39n); - input.add32(58691136n); + 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.contract2.and_euint8_euint32( + const tx = await this.contract4.and_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(0n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(1360n); }); - it('test operator "and" overload (euint8, euint32) => euint32 test 2 (35, 39)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(35n); - input.add32(39n); + 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.contract2.and_euint8_euint32( + const tx = await this.contract4.and_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(35n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(25953n); }); - it('test operator "and" overload (euint8, euint32) => euint32 test 3 (39, 39)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(39n); - input.add32(39n); + 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.contract2.and_euint8_euint32( + const tx = await this.contract4.and_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(39n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(25969n); }); - it('test operator "and" overload (euint8, euint32) => euint32 test 4 (39, 35)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(39n); - input.add32(35n); + 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.contract2.and_euint8_euint32( + const tx = await this.contract4.and_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(35n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(25953n); }); - it('test operator "or" overload (euint8, euint32) => euint32 test 1 (99, 1264632675)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(99n); - input.add32(1264632675n); + 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.contract2.or_euint8_euint32( + const tx = await this.contract4.or_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(1264632675n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(46079n); }); - it('test operator "or" overload (euint8, euint32) => euint32 test 2 (95, 99)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(95n); - input.add32(99n); + 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.contract2.or_euint8_euint32( + const tx = await this.contract4.or_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(127n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(37567n); }); - it('test operator "or" overload (euint8, euint32) => euint32 test 3 (99, 99)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(99n); - input.add32(99n); + 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.contract2.or_euint8_euint32( + const tx = await this.contract4.or_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(99n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(37567n); }); - it('test operator "or" overload (euint8, euint32) => euint32 test 4 (99, 95)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(99n); - input.add32(95n); + 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.contract2.or_euint8_euint32( + const tx = await this.contract4.or_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(127n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(37567n); }); - it('test operator "xor" overload (euint8, euint32) => euint32 test 1 (184, 3590065955)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(184n); - input.add32(3590065955n); + 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.contract2.xor_euint8_euint32( + const tx = await this.contract4.xor_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(3590066075n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(40165n); }); - it('test operator "xor" overload (euint8, euint32) => euint32 test 2 (180, 184)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(180n); - input.add32(184n); + 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.contract2.xor_euint8_euint32( + const tx = await this.contract4.xor_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); + const res = await decrypt16(await this.contract4.res16()); expect(res).to.equal(12n); }); - it('test operator "xor" overload (euint8, euint32) => euint32 test 3 (184, 184)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(184n); - input.add32(184n); + 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.contract2.xor_euint8_euint32( + const tx = await this.contract4.xor_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); + const res = await decrypt16(await this.contract4.res16()); expect(res).to.equal(0n); }); - it('test operator "xor" overload (euint8, euint32) => euint32 test 4 (184, 180)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(184n); - input.add32(180n); + 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.contract2.xor_euint8_euint32( + const tx = await this.contract4.xor_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); + const res = await decrypt16(await this.contract4.res16()); expect(res).to.equal(12n); }); - it('test operator "eq" overload (euint8, euint32) => ebool test 1 (110, 224862953)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(110n); - input.add32(224862953n); + 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.contract2.eq_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint8, euint32) => ebool test 2 (106, 110)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(106n); - input.add32(110n); + 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.contract2.eq_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint8, euint32) => ebool test 3 (110, 110)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(110n); - input.add32(110n); + 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.contract2.eq_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "eq" overload (euint8, euint32) => ebool test 4 (110, 106)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(110n); - input.add32(106n); + 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.contract2.eq_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint8, euint32) => ebool test 1 (189, 472792825)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(189n); - input.add32(472792825n); + 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.contract2.ne_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint8, euint32) => ebool test 2 (185, 189)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(185n); - input.add32(189n); + 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.contract2.ne_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint8, euint32) => ebool test 3 (189, 189)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(189n); - input.add32(189n); + 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.contract2.ne_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint8, euint32) => ebool test 4 (189, 185)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(189n); - input.add32(185n); + 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.contract2.ne_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint8, euint32) => ebool test 1 (222, 4025894176)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(222n); - input.add32(4025894176n); + 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.contract2.ge_euint8_euint32( + 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.contract2.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract4.resb()); + expect(res).to.equal(true); }); - it('test operator "ge" overload (euint8, euint32) => ebool test 2 (218, 222)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(218n); - input.add32(222n); + 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.contract2.ge_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "ge" overload (euint8, euint32) => ebool test 3 (222, 222)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(222n); - input.add32(222n); + 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.contract2.ge_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint8, euint32) => ebool test 4 (222, 218)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(222n); - input.add32(218n); + 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.contract2.ge_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "gt" overload (euint8, euint32) => ebool test 1 (193, 1536979513)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(193n); - input.add32(1536979513n); + 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.contract2.gt_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint8, euint32) => ebool test 2 (189, 193)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(189n); - input.add32(193n); + 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.contract2.gt_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint8, euint32) => ebool test 3 (193, 193)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(193n); - input.add32(193n); + 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.contract2.gt_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint8, euint32) => ebool test 4 (193, 189)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(193n); - input.add32(189n); + 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.contract2.gt_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint8, euint32) => ebool test 1 (217, 193633124)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(217n); - input.add32(193633124n); + 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.contract2.le_euint8_euint32( + 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.contract2.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract4.resb()); + expect(res).to.equal(false); }); - it('test operator "le" overload (euint8, euint32) => ebool test 2 (213, 217)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(213n); - input.add32(217n); + 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.contract2.le_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint8, euint32) => ebool test 3 (217, 217)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(217n); - input.add32(217n); + 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.contract2.le_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint8, euint32) => ebool test 4 (217, 213)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(217n); - input.add32(213n); + 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.contract2.le_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint8, euint32) => ebool test 1 (97, 73387652)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(97n); - input.add32(73387652n); + 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.contract2.lt_euint8_euint32( + 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.contract2.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract4.resb()); + expect(res).to.equal(false); }); - it('test operator "lt" overload (euint8, euint32) => ebool test 2 (93, 97)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(93n); - input.add32(97n); + 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.contract2.lt_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (euint8, euint32) => ebool test 3 (97, 97)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(97n); - input.add32(97n); + 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.contract2.lt_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint8, euint32) => ebool test 4 (97, 93)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(97n); - input.add32(93n); + 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.contract2.lt_euint8_euint32( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "min" overload (euint8, euint32) => euint32 test 1 (47, 1833760772)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(47n); - input.add32(1833760772n); + 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.contract2.min_euint8_euint32( + const tx = await this.contract4.min_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(47n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(8269n); }); - it('test operator "min" overload (euint8, euint32) => euint32 test 2 (43, 47)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(43n); - input.add32(47n); + 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.contract2.min_euint8_euint32( + const tx = await this.contract4.min_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(43n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(8265n); }); - it('test operator "min" overload (euint8, euint32) => euint32 test 3 (47, 47)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(47n); - input.add32(47n); + 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.contract2.min_euint8_euint32( + const tx = await this.contract4.min_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(47n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(8269n); }); - it('test operator "min" overload (euint8, euint32) => euint32 test 4 (47, 43)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(47n); - input.add32(43n); + 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.contract2.min_euint8_euint32( + const tx = await this.contract4.min_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(43n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(8265n); }); - it('test operator "max" overload (euint8, euint32) => euint32 test 1 (103, 990460263)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(103n); - input.add32(990460263n); + 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.contract2.max_euint8_euint32( + const tx = await this.contract4.max_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(990460263n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(37775n); }); - it('test operator "max" overload (euint8, euint32) => euint32 test 2 (99, 103)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(99n); - input.add32(103n); + 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.contract2.max_euint8_euint32( + const tx = await this.contract4.max_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(103n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(22432n); }); - it('test operator "max" overload (euint8, euint32) => euint32 test 3 (103, 103)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(103n); - input.add32(103n); + 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.contract2.max_euint8_euint32( + const tx = await this.contract4.max_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(103n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(22432n); }); - it('test operator "max" overload (euint8, euint32) => euint32 test 4 (103, 99)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(103n); - input.add32(99n); + 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.contract2.max_euint8_euint32( + const tx = await this.contract4.max_euint16_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(103n); + const res = await decrypt16(await this.contract4.res16()); + expect(res).to.equal(22432n); }); - it('test operator "add" overload (euint8, euint64) => euint64 test 1 (2, 129)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(2n); - input.add64(129n); + 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.contract2.add_euint8_euint64( + const tx = await this.contract4.add_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(131n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(52898n); }); - it('test operator "add" overload (euint8, euint64) => euint64 test 2 (12, 16)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(12n); - input.add64(16n); + 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.contract2.add_euint8_euint64( + const tx = await this.contract4.add_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(28n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(38372n); }); - it('test operator "add" overload (euint8, euint64) => euint64 test 3 (16, 16)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(16n); - input.add64(16n); + 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.contract2.add_euint8_euint64( + const tx = await this.contract4.add_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(32n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(38376n); }); - it('test operator "add" overload (euint8, euint64) => euint64 test 4 (16, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(16n); - input.add64(12n); + 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.contract2.add_euint8_euint64( + const tx = await this.contract4.add_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(28n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(38372n); }); - it('test operator "sub" overload (euint8, euint64) => euint64 test 1 (15, 15)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(15n); - input.add64(15n); + 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.contract2.sub_euint8_euint64( + const tx = await this.contract4.sub_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); + const res = await decrypt32(await this.contract4.res32()); expect(res).to.equal(0n); }); - it('test operator "sub" overload (euint8, euint64) => euint64 test 2 (15, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(15n); - input.add64(11n); + 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.contract2.sub_euint8_euint64( + const tx = await this.contract4.sub_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); + const res = await decrypt32(await this.contract4.res32()); 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.contract2Address, this.signers.alice.address); - input.add8(2n); - input.add64(65n); + 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.contract2.mul_euint8_euint64( + const tx = await this.contract4.mul_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(130n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(54328n); }); - it('test operator "mul" overload (euint8, euint64) => euint64 test 2 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(13n); - input.add64(13n); + 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.contract2.mul_euint8_euint64( + const tx = await this.contract4.mul_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(169n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(59536n); }); - it('test operator "mul" overload (euint8, euint64) => euint64 test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(13n); - input.add64(13n); + 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.contract2.mul_euint8_euint64( + const tx = await this.contract4.mul_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(169n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(59536n); }); - it('test operator "mul" overload (euint8, euint64) => euint64 test 4 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(13n); - input.add64(13n); + 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.contract2.mul_euint8_euint64( + const tx = await this.contract4.mul_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(169n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(59536n); }); - it('test operator "and" overload (euint8, euint64) => euint64 test 1 (62, 18441742416037218435)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(62n); - input.add64(18441742416037218435n); + 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.contract2.and_euint8_euint64( + const tx = await this.contract4.and_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(2n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(204n); }); - it('test operator "and" overload (euint8, euint64) => euint64 test 2 (58, 62)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(58n); - input.add64(62n); + 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.contract2.and_euint8_euint64( + const tx = await this.contract4.and_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(58n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(10440n); }); - it('test operator "and" overload (euint8, euint64) => euint64 test 3 (62, 62)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(62n); - input.add64(62n); + 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.contract2.and_euint8_euint64( + const tx = await this.contract4.and_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(62n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(10444n); }); - it('test operator "and" overload (euint8, euint64) => euint64 test 4 (62, 58)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(62n); - input.add64(58n); + 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.contract2.and_euint8_euint64( + const tx = await this.contract4.and_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(58n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(10440n); }); - it('test operator "or" overload (euint8, euint64) => euint64 test 1 (66, 18439693911625769587)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(66n); - input.add64(18439693911625769587n); + 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.contract2.or_euint8_euint64( + const tx = await this.contract4.or_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(18439693911625769587n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(3887910911n); }); - it('test operator "or" overload (euint8, euint64) => euint64 test 2 (62, 66)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(62n); - input.add64(66n); + 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.contract2.or_euint8_euint64( + const tx = await this.contract4.or_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(126n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(36607n); }); - it('test operator "or" overload (euint8, euint64) => euint64 test 3 (66, 66)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(66n); - input.add64(66n); + 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.contract2.or_euint8_euint64( + const tx = await this.contract4.or_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(66n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(36595n); }); - it('test operator "or" overload (euint8, euint64) => euint64 test 4 (66, 62)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(66n); - input.add64(62n); + 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.contract2.or_euint8_euint64( + const tx = await this.contract4.or_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(126n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(36607n); }); - it('test operator "xor" overload (euint8, euint64) => euint64 test 1 (212, 18437987864856647089)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(212n); - input.add64(18437987864856647089n); + 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.contract2.xor_euint8_euint64( + const tx = await this.contract4.xor_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(18437987864856647013n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(1351713605n); }); - it('test operator "xor" overload (euint8, euint64) => euint64 test 2 (208, 212)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(208n); - input.add64(212n); + 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.contract2.xor_euint8_euint64( + const tx = await this.contract4.xor_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(4n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(28n); }); - it('test operator "xor" overload (euint8, euint64) => euint64 test 3 (212, 212)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(212n); - input.add64(212n); + 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.contract2.xor_euint8_euint64( + const tx = await this.contract4.xor_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); + const res = await decrypt32(await this.contract4.res32()); expect(res).to.equal(0n); }); - it('test operator "xor" overload (euint8, euint64) => euint64 test 4 (212, 208)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(212n); - input.add64(208n); + 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.contract2.xor_euint8_euint64( + const tx = await this.contract4.xor_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(4n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(28n); }); - it('test operator "eq" overload (euint8, euint64) => ebool test 1 (151, 18441484264494857597)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(151n); - input.add64(18441484264494857597n); + 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.contract2.eq_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint8, euint64) => ebool test 2 (147, 151)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(147n); - input.add64(151n); + 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.contract2.eq_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint8, euint64) => ebool test 3 (151, 151)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(151n); - input.add64(151n); + 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.contract2.eq_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "eq" overload (euint8, euint64) => ebool test 4 (151, 147)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(151n); - input.add64(147n); + 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.contract2.eq_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint8, euint64) => ebool test 1 (174, 18439836363494569405)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(174n); - input.add64(18439836363494569405n); + 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.contract2.ne_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint8, euint64) => ebool test 2 (170, 174)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(170n); - input.add64(174n); + 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.contract2.ne_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint8, euint64) => ebool test 3 (174, 174)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(174n); - input.add64(174n); + 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.contract2.ne_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint8, euint64) => ebool test 4 (174, 170)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(174n); - input.add64(170n); + 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.contract2.ne_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint8, euint64) => ebool test 1 (201, 18443640492228529453)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(201n); - input.add64(18443640492228529453n); + 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.contract2.ge_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "ge" overload (euint8, euint64) => ebool test 2 (197, 201)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(197n); - input.add64(201n); + 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.contract2.ge_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "ge" overload (euint8, euint64) => ebool test 3 (201, 201)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(201n); - input.add64(201n); + 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.contract2.ge_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint8, euint64) => ebool test 4 (201, 197)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(201n); - input.add64(197n); + 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.contract2.ge_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "gt" overload (euint8, euint64) => ebool test 1 (237, 18441103586480031265)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(237n); - input.add64(18441103586480031265n); + 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.contract2.gt_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint8, euint64) => ebool test 2 (233, 237)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(233n); - input.add64(237n); + 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.contract2.gt_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint8, euint64) => ebool test 3 (237, 237)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(237n); - input.add64(237n); + 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.contract2.gt_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint8, euint64) => ebool test 4 (237, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(237n); - input.add64(233n); + 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.contract2.gt_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint8, euint64) => ebool test 1 (18, 18442364533783886901)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(18n); - input.add64(18442364533783886901n); + 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.contract2.le_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint8, euint64) => ebool test 2 (14, 18)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(14n); - input.add64(18n); + 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.contract2.le_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint8, euint64) => ebool test 3 (18, 18)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(18n); - input.add64(18n); + 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.contract2.le_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint8, euint64) => ebool test 4 (18, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(18n); - input.add64(14n); + 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.contract2.le_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint8, euint64) => ebool test 1 (1, 18442662886837590601)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(1n); - input.add64(18442662886837590601n); + 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.contract2.lt_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (euint8, euint64) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(4n); - input.add64(8n); + 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.contract2.lt_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (euint8, euint64) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(8n); - input.add64(8n); + 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.contract2.lt_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint8, euint64) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(8n); - input.add64(4n); + 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.contract2.lt_euint8_euint64( + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "min" overload (euint8, euint64) => euint64 test 1 (240, 18439345293201198903)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(240n); - input.add64(18439345293201198903n); + 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.contract2.min_euint8_euint64( + const tx = await this.contract4.min_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(240n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(8199n); }); - it('test operator "min" overload (euint8, euint64) => euint64 test 2 (236, 240)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(236n); - input.add64(240n); + 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.contract2.min_euint8_euint64( + const tx = await this.contract4.min_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(236n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(8195n); }); - it('test operator "min" overload (euint8, euint64) => euint64 test 3 (240, 240)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(240n); - input.add64(240n); + 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.contract2.min_euint8_euint64( + const tx = await this.contract4.min_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(240n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(8199n); }); - it('test operator "min" overload (euint8, euint64) => euint64 test 4 (240, 236)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(240n); - input.add64(236n); + 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.contract2.min_euint8_euint64( + const tx = await this.contract4.min_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(236n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(8195n); }); - it('test operator "max" overload (euint8, euint64) => euint64 test 1 (180, 18445785341899355785)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(180n); - input.add64(18445785341899355785n); + 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.contract2.max_euint8_euint64( + const tx = await this.contract4.max_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(18445785341899355785n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(2918687585n); }); - it('test operator "max" overload (euint8, euint64) => euint64 test 2 (176, 180)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(176n); - input.add64(180n); + 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.contract2.max_euint8_euint64( + const tx = await this.contract4.max_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(180n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(6434n); }); - it('test operator "max" overload (euint8, euint64) => euint64 test 3 (180, 180)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(180n); - input.add64(180n); + 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.contract2.max_euint8_euint64( + const tx = await this.contract4.max_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(180n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(6434n); }); - it('test operator "max" overload (euint8, euint64) => euint64 test 4 (180, 176)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(180n); - input.add64(176n); + 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.contract2.max_euint8_euint64( + const tx = await this.contract4.max_euint16_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract2.res64()); - expect(res).to.equal(180n); + const res = await decrypt32(await this.contract4.res32()); + expect(res).to.equal(6434n); }); - it('test operator "add" overload (euint8, uint8) => euint8 test 1 (56, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(56n); - + 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.contract2.add_euint8_uint8(encryptedAmount.handles[0], 11n, encryptedAmount.inputProof); + const tx = await this.contract4.add_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(67n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(65508n); }); - it('test operator "add" overload (euint8, uint8) => euint8 test 2 (52, 56)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(52n); - + 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.contract2.add_euint8_uint8(encryptedAmount.handles[0], 56n, encryptedAmount.inputProof); + const tx = await this.contract4.add_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(108n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(64696n); }); - it('test operator "add" overload (euint8, uint8) => euint8 test 3 (56, 56)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(56n); - + 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.contract2.add_euint8_uint8(encryptedAmount.handles[0], 56n, encryptedAmount.inputProof); + const tx = await this.contract4.add_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(112n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(64698n); }); - it('test operator "add" overload (euint8, uint8) => euint8 test 4 (56, 52)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(56n); - + 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.contract2.add_euint8_uint8(encryptedAmount.handles[0], 52n, encryptedAmount.inputProof); + const tx = await this.contract4.add_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(108n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(64696n); }); - it('test operator "add" overload (uint8, euint8) => euint8 test 1 (69, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add8(11n); + 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.contract2.add_uint8_euint8(69n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract4.sub_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(80n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(0n); }); - it('test operator "add" overload (uint8, euint8) => euint8 test 2 (52, 56)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add8(56n); + 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.contract2.add_uint8_euint8(52n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract4.sub_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(108n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(4n); }); - it('test operator "add" overload (uint8, euint8) => euint8 test 3 (56, 56)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add8(56n); + 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.contract2.add_uint8_euint8(56n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract4.mul_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(112n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(65510n); }); - it('test operator "add" overload (uint8, euint8) => euint8 test 4 (56, 52)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add8(52n); + 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.contract2.add_uint8_euint8(56n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract4.mul_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(108n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(46656n); }); - it('test operator "sub" overload (euint8, uint8) => euint8 test 1 (64, 64)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(64n); - + 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.contract2.sub_euint8_uint8(encryptedAmount.handles[0], 64n, encryptedAmount.inputProof); + const tx = await this.contract4.mul_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(0n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(46656n); }); - it('test operator "sub" overload (euint8, uint8) => euint8 test 2 (64, 60)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(64n); - + 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.contract2.sub_euint8_uint8(encryptedAmount.handles[0], 60n, encryptedAmount.inputProof); + const tx = await this.contract4.mul_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(4n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(46656n); }); - it('test operator "sub" overload (uint8, euint8) => euint8 test 1 (64, 64)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add8(64n); + 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.contract2.sub_uint8_euint8(64n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract4.and_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(0n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(9600n); }); - it('test operator "sub" overload (uint8, euint8) => euint8 test 2 (64, 60)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add8(60n); + 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.contract2.sub_uint8_euint8(64n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract4.and_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(4n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(46466n); }); - it('test operator "mul" overload (euint8, uint8) => euint8 test 1 (8, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(8n); - + 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.contract2.mul_euint8_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof); + const tx = await this.contract4.and_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(112n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(46498n); }); - it('test operator "mul" overload (euint8, uint8) => euint8 test 2 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(14n); - + 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.contract2.mul_euint8_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof); + const tx = await this.contract4.and_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(196n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(46466n); }); - it('test operator "mul" overload (euint8, uint8) => euint8 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(14n); - + 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.contract2.mul_euint8_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof); + const tx = await this.contract4.or_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(196n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(18443891473910557439n); }); - it('test operator "mul" overload (euint8, uint8) => euint8 test 4 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(14n); - + 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.contract2.mul_euint8_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof); + const tx = await this.contract4.or_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(196n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(8318n); }); - it('test operator "mul" overload (uint8, euint8) => euint8 test 1 (8, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add8(14n); + 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.contract2.mul_uint8_euint8(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract4.or_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(112n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(8318n); }); - it('test operator "mul" overload (uint8, euint8) => euint8 test 2 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add8(14n); + 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.contract2.mul_uint8_euint8(14n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract4.or_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(196n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(8318n); }); - it('test operator "mul" overload (uint8, euint8) => euint8 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add8(14n); + 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.contract2.mul_uint8_euint8(14n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract4.xor_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(196n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(18446725910384382322n); }); - it('test operator "mul" overload (uint8, euint8) => euint8 test 4 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add8(14n); + 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.contract2.mul_uint8_euint8(14n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract4.xor_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(196n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(12n); }); - it('test operator "div" overload (euint8, uint8) => euint8 test 1 (168, 148)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(168n); - + 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.contract2.div_euint8_uint8(encryptedAmount.handles[0], 148n, encryptedAmount.inputProof); + const tx = await this.contract4.xor_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(1n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(0n); }); - it('test operator "div" overload (euint8, uint8) => euint8 test 2 (164, 168)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(164n); - + 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.contract2.div_euint8_uint8(encryptedAmount.handles[0], 168n, encryptedAmount.inputProof); + const tx = await this.contract4.xor_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(0n); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(12n); }); - it('test operator "div" overload (euint8, uint8) => euint8 test 3 (168, 168)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(168n); - + 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.contract2.div_euint8_uint8(encryptedAmount.handles[0], 168n, encryptedAmount.inputProof); + const tx = await this.contract4.eq_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(1n); + const res = await decryptBool(await this.contract4.resb()); + expect(res).to.equal(false); }); - it('test operator "div" overload (euint8, uint8) => euint8 test 4 (168, 164)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(168n); - + 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.contract2.div_euint8_uint8(encryptedAmount.handles[0], 164n, encryptedAmount.inputProof); + const tx = await this.contract4.eq_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(1n); + const res = await decryptBool(await this.contract4.resb()); + expect(res).to.equal(false); }); - it('test operator "rem" overload (euint8, uint8) => euint8 test 1 (225, 242)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(225n); - + 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.contract2.rem_euint8_uint8(encryptedAmount.handles[0], 242n, encryptedAmount.inputProof); + const tx = await this.contract4.eq_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(225n); + const res = await decryptBool(await this.contract4.resb()); + expect(res).to.equal(true); }); - it('test operator "rem" overload (euint8, uint8) => euint8 test 2 (183, 187)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(183n); - + 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.contract2.rem_euint8_uint8(encryptedAmount.handles[0], 187n, encryptedAmount.inputProof); + const tx = await this.contract4.eq_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(183n); + const res = await decryptBool(await this.contract4.resb()); + expect(res).to.equal(false); }); - it('test operator "rem" overload (euint8, uint8) => euint8 test 3 (187, 187)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(187n); + 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.contract2.rem_euint8_uint8(encryptedAmount.handles[0], 187n, encryptedAmount.inputProof); + const tx = await this.contract4.ne_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(0n); + const res = await decryptBool(await this.contract4.resb()); + expect(res).to.equal(true); }); - it('test operator "rem" overload (euint8, uint8) => euint8 test 4 (187, 183)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(187n); + 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.contract2.rem_euint8_uint8(encryptedAmount.handles[0], 183n, encryptedAmount.inputProof); + const tx = await this.contract4.ne_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(4n); + const res = await decryptBool(await this.contract4.resb()); + expect(res).to.equal(true); }); }); diff --git a/test/tfheOperations/tfheOperations5.ts b/test/tfheOperations/tfheOperations5.ts index 652b9c57..8bdaf504 100644 --- a/test/tfheOperations/tfheOperations5.ts +++ b/test/tfheOperations/tfheOperations5.ts @@ -7,7 +7,22 @@ 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 { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance'; +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 { @@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise { 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); @@ -105,2271 +175,4183 @@ describe('TFHE operations 5', function () { 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 (51, 215)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(51n); - + 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.contract2.eq_euint8_uint8(encryptedAmount.handles[0], 215n, encryptedAmount.inputProof); + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint8, uint8) => ebool test 2 (47, 51)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(47n); - + 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.contract2.eq_euint8_uint8(encryptedAmount.handles[0], 51n, encryptedAmount.inputProof); + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint8, uint8) => ebool test 3 (51, 51)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(51n); - + 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.contract2.eq_euint8_uint8(encryptedAmount.handles[0], 51n, encryptedAmount.inputProof); + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "eq" overload (euint8, uint8) => ebool test 4 (51, 47)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(51n); + 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.contract2.eq_euint8_uint8(encryptedAmount.handles[0], 47n, encryptedAmount.inputProof); + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (uint8, euint8) => ebool test 1 (31, 215)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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); + }); - input.add8(215n); + 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.contract2.eq_uint8_euint8(31n, encryptedAmount.handles[0], encryptedAmount.inputProof); + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (uint8, euint8) => ebool test 2 (47, 51)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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); + }); - input.add8(51n); + 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.contract2.eq_uint8_euint8(47n, encryptedAmount.handles[0], encryptedAmount.inputProof); + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (uint8, euint8) => ebool test 3 (51, 51)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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); + }); - input.add8(51n); + 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.contract2.eq_uint8_euint8(51n, encryptedAmount.handles[0], encryptedAmount.inputProof); + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(true); }); - it('test operator "eq" overload (uint8, euint8) => ebool test 4 (51, 47)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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); + }); - input.add8(47n); + 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.contract2.eq_uint8_euint8(51n, encryptedAmount.handles[0], encryptedAmount.inputProof); + 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.contract2.resb()); + const res = await decryptBool(await this.contract4.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint8, uint8) => ebool test 1 (236, 213)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(236n); + 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.contract2.ne_euint8_uint8(encryptedAmount.handles[0], 213n, encryptedAmount.inputProof); + const tx = await this.contract4.min_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(64764n); }); - it('test operator "ne" overload (euint8, uint8) => ebool test 2 (22, 26)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(22n); + 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.contract2.ne_euint8_uint8(encryptedAmount.handles[0], 26n, encryptedAmount.inputProof); + const tx = await this.contract4.min_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt64(await this.contract4.res64()); + expect(res).to.equal(64764n); }); - it('test operator "ne" overload (euint8, uint8) => ebool test 3 (26, 26)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(26n); + 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.contract2.ne_euint8_uint8(encryptedAmount.handles[0], 26n, encryptedAmount.inputProof); + const tx = await this.contract4.max_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + 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 "ne" overload (euint8, uint8) => ebool test 4 (26, 22)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(26n); + 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.contract2.ne_euint8_uint8(encryptedAmount.handles[0], 22n, encryptedAmount.inputProof); + const tx = await this.contract4.add_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt128(await this.contract4.res128()); + expect(res).to.equal(32771n); }); - it('test operator "ne" overload (uint8, euint8) => ebool test 1 (66, 213)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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); + }); - input.add8(213n); + 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.contract2.ne_uint8_euint8(66n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract4.add_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + 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 "ne" overload (uint8, euint8) => ebool test 2 (22, 26)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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); - input.add8(26n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_uint8_euint8(22n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.rem_euint16_uint16(encryptedAmount.handles[0], 40821n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(0n); }); - it('test operator "ne" overload (uint8, euint8) => ebool test 3 (26, 26)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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); - input.add8(26n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_uint8_euint8(26n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.rem_euint16_uint16(encryptedAmount.handles[0], 40817n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(4n); }); - it('test operator "ne" overload (uint8, euint8) => ebool test 4 (26, 22)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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); - input.add8(22n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_uint8_euint8(26n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.and_euint16_uint16(encryptedAmount.handles[0], 39616n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(64n); }); - it('test operator "ge" overload (euint8, uint8) => ebool test 1 (89, 157)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(89n); + 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.contract2.ge_euint8_uint8(encryptedAmount.handles[0], 157n, encryptedAmount.inputProof); + const tx = await this.contract5.and_euint16_uint16(encryptedAmount.handles[0], 25969n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(25953n); }); - it('test operator "ge" overload (euint8, uint8) => ebool test 2 (85, 89)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(85n); + 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.contract2.ge_euint8_uint8(encryptedAmount.handles[0], 89n, encryptedAmount.inputProof); + const tx = await this.contract5.and_euint16_uint16(encryptedAmount.handles[0], 25969n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(25969n); }); - it('test operator "ge" overload (euint8, uint8) => ebool test 3 (89, 89)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(89n); + 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.contract2.ge_euint8_uint8(encryptedAmount.handles[0], 89n, encryptedAmount.inputProof); + const tx = await this.contract5.and_euint16_uint16(encryptedAmount.handles[0], 25965n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(25953n); }); - it('test operator "ge" overload (euint8, uint8) => ebool test 4 (89, 85)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(89n); + 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.contract2.ge_euint8_uint8(encryptedAmount.handles[0], 85n, encryptedAmount.inputProof); + const tx = await this.contract5.and_uint16_euint16(12551n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(4096n); }); - it('test operator "ge" overload (uint8, euint8) => ebool test 1 (164, 157)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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.add8(157n); + input.add16(25969n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_uint8_euint8(164n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.and_uint16_euint16(25965n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(25953n); }); - it('test operator "ge" overload (uint8, euint8) => ebool test 2 (85, 89)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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.add8(89n); + input.add16(25969n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_uint8_euint8(85n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.and_uint16_euint16(25969n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(25969n); }); - it('test operator "ge" overload (uint8, euint8) => ebool test 3 (89, 89)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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.add8(89n); + input.add16(25965n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_uint8_euint8(89n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.and_uint16_euint16(25969n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(25953n); }); - it('test operator "ge" overload (uint8, euint8) => ebool test 4 (89, 85)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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); - input.add8(85n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_uint8_euint8(89n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.or_euint16_uint16(encryptedAmount.handles[0], 27184n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(60412n); }); - it('test operator "gt" overload (euint8, uint8) => ebool test 1 (247, 141)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(247n); + 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.contract2.gt_euint8_uint8(encryptedAmount.handles[0], 141n, encryptedAmount.inputProof); + const tx = await this.contract5.or_euint16_uint16(encryptedAmount.handles[0], 37567n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(37567n); }); - it('test operator "gt" overload (euint8, uint8) => ebool test 2 (52, 56)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(52n); + 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.contract2.gt_euint8_uint8(encryptedAmount.handles[0], 56n, encryptedAmount.inputProof); + const tx = await this.contract5.or_euint16_uint16(encryptedAmount.handles[0], 37567n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(37567n); }); - it('test operator "gt" overload (euint8, uint8) => ebool test 3 (56, 56)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(56n); + 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.contract2.gt_euint8_uint8(encryptedAmount.handles[0], 56n, encryptedAmount.inputProof); + const tx = await this.contract5.or_euint16_uint16(encryptedAmount.handles[0], 37563n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(37567n); }); - it('test operator "gt" overload (euint8, uint8) => ebool test 4 (56, 52)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(56n); + 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.contract2.gt_euint8_uint8(encryptedAmount.handles[0], 52n, encryptedAmount.inputProof); + const tx = await this.contract5.or_uint16_euint16(65174n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(65206n); }); - it('test operator "gt" overload (uint8, euint8) => ebool test 1 (186, 141)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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.add8(141n); + input.add16(37567n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_uint8_euint8(186n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.or_uint16_euint16(37563n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(37567n); }); - it('test operator "gt" overload (uint8, euint8) => ebool test 2 (52, 56)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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.add8(56n); + input.add16(37567n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_uint8_euint8(52n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.or_uint16_euint16(37567n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(37567n); }); - it('test operator "gt" overload (uint8, euint8) => ebool test 3 (56, 56)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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.add8(56n); + input.add16(37563n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_uint8_euint8(56n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.or_uint16_euint16(37567n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(37567n); }); - it('test operator "gt" overload (uint8, euint8) => ebool test 4 (56, 52)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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); - input.add8(52n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_uint8_euint8(56n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.xor_euint16_uint16(encryptedAmount.handles[0], 31297n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(34158n); }); - it('test operator "le" overload (euint8, uint8) => ebool test 1 (182, 83)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(182n); + 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.contract2.le_euint8_uint8(encryptedAmount.handles[0], 83n, encryptedAmount.inputProof); + const tx = await this.contract5.xor_euint16_uint16(encryptedAmount.handles[0], 25546n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(12n); }); - it('test operator "le" overload (euint8, uint8) => ebool test 2 (178, 182)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(178n); + 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.contract2.le_euint8_uint8(encryptedAmount.handles[0], 182n, encryptedAmount.inputProof); + const tx = await this.contract5.xor_euint16_uint16(encryptedAmount.handles[0], 25546n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(0n); }); - it('test operator "le" overload (euint8, uint8) => ebool test 3 (182, 182)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(182n); + 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.contract2.le_euint8_uint8(encryptedAmount.handles[0], 182n, encryptedAmount.inputProof); + const tx = await this.contract5.xor_euint16_uint16(encryptedAmount.handles[0], 25542n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(12n); }); - it('test operator "le" overload (euint8, uint8) => ebool test 4 (182, 178)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(182n); + 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.contract2.le_euint8_uint8(encryptedAmount.handles[0], 178n, encryptedAmount.inputProof); + const tx = await this.contract5.xor_uint16_euint16(33651n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(63794n); }); - it('test operator "le" overload (uint8, euint8) => ebool test 1 (14, 83)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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.add8(83n); + input.add16(25546n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_uint8_euint8(14n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.xor_uint16_euint16(25542n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(12n); }); - it('test operator "le" overload (uint8, euint8) => ebool test 2 (178, 182)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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.add8(182n); + input.add16(25546n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_uint8_euint8(178n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.xor_uint16_euint16(25546n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(0n); }); - it('test operator "le" overload (uint8, euint8) => ebool test 3 (182, 182)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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.add8(182n); + input.add16(25542n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_uint8_euint8(182n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.xor_uint16_euint16(25546n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(12n); }); - it('test operator "le" overload (uint8, euint8) => ebool test 4 (182, 178)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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); - input.add8(178n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_uint8_euint8(182n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.eq_euint16_uint16(encryptedAmount.handles[0], 25309n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint8, uint8) => ebool test 1 (44, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(44n); + 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.contract2.lt_euint8_uint8(encryptedAmount.handles[0], 12n, encryptedAmount.inputProof); + const tx = await this.contract5.eq_euint16_uint16(encryptedAmount.handles[0], 43845n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint8, uint8) => ebool test 2 (40, 44)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(40n); + 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.contract2.lt_euint8_uint8(encryptedAmount.handles[0], 44n, encryptedAmount.inputProof); + const tx = await this.contract5.eq_euint16_uint16(encryptedAmount.handles[0], 43845n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (euint8, uint8) => ebool test 3 (44, 44)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(44n); + 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.contract2.lt_euint8_uint8(encryptedAmount.handles[0], 44n, encryptedAmount.inputProof); + const tx = await this.contract5.eq_euint16_uint16(encryptedAmount.handles[0], 43841n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint8, uint8) => ebool test 4 (44, 40)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(44n); + 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.contract2.lt_euint8_uint8(encryptedAmount.handles[0], 40n, encryptedAmount.inputProof); + const tx = await this.contract5.eq_uint16_euint16(50532n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (uint8, euint8) => ebool test 1 (106, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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.add8(12n); + input.add16(43845n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_uint8_euint8(106n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.eq_uint16_euint16(43841n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (uint8, euint8) => ebool test 2 (40, 44)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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.add8(44n); + input.add16(43845n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_uint8_euint8(40n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.eq_uint16_euint16(43845n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (uint8, euint8) => ebool test 3 (44, 44)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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.add8(44n); + input.add16(43841n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_uint8_euint8(44n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.eq_uint16_euint16(43845n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (uint8, euint8) => ebool test 4 (44, 40)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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); - input.add8(40n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_uint8_euint8(44n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.ne_euint16_uint16(encryptedAmount.handles[0], 35706n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (euint8, uint8) => euint8 test 1 (254, 134)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(254n); + 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.contract2.min_euint8_uint8(encryptedAmount.handles[0], 134n, encryptedAmount.inputProof); + const tx = await this.contract5.ne_euint16_uint16(encryptedAmount.handles[0], 16378n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(134n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (euint8, uint8) => euint8 test 2 (69, 73)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(69n); + 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.contract2.min_euint8_uint8(encryptedAmount.handles[0], 73n, encryptedAmount.inputProof); + const tx = await this.contract5.ne_euint16_uint16(encryptedAmount.handles[0], 16378n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(69n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "min" overload (euint8, uint8) => euint8 test 3 (73, 73)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(73n); + 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.contract2.min_euint8_uint8(encryptedAmount.handles[0], 73n, encryptedAmount.inputProof); + const tx = await this.contract5.ne_euint16_uint16(encryptedAmount.handles[0], 16374n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(73n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (euint8, uint8) => euint8 test 4 (73, 69)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(73n); + 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.contract2.min_euint8_uint8(encryptedAmount.handles[0], 69n, encryptedAmount.inputProof); + const tx = await this.contract5.ne_uint16_euint16(43595n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(69n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (uint8, euint8) => euint8 test 1 (48, 134)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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.add8(134n); + input.add16(16378n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_uint8_euint8(48n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.ne_uint16_euint16(16374n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(48n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (uint8, euint8) => euint8 test 2 (69, 73)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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.add8(73n); + input.add16(16378n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_uint8_euint8(69n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.ne_uint16_euint16(16378n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(69n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "min" overload (uint8, euint8) => euint8 test 3 (73, 73)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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.add8(73n); + input.add16(16374n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_uint8_euint8(73n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.ne_uint16_euint16(16378n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(73n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (uint8, euint8) => euint8 test 4 (73, 69)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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); - input.add8(69n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_uint8_euint8(73n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.ge_euint16_uint16(encryptedAmount.handles[0], 48781n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(69n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "max" overload (euint8, uint8) => euint8 test 1 (227, 27)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(227n); + 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.contract2.max_euint8_uint8(encryptedAmount.handles[0], 27n, encryptedAmount.inputProof); + const tx = await this.contract5.ge_euint16_uint16(encryptedAmount.handles[0], 13068n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(227n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "max" overload (euint8, uint8) => euint8 test 2 (25, 29)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(25n); + 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.contract2.max_euint8_uint8(encryptedAmount.handles[0], 29n, encryptedAmount.inputProof); + const tx = await this.contract5.ge_euint16_uint16(encryptedAmount.handles[0], 13068n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(29n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "max" overload (euint8, uint8) => euint8 test 3 (29, 29)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(29n); + 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.contract2.max_euint8_uint8(encryptedAmount.handles[0], 29n, encryptedAmount.inputProof); + const tx = await this.contract5.ge_euint16_uint16(encryptedAmount.handles[0], 13064n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(29n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "max" overload (euint8, uint8) => euint8 test 4 (29, 25)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(29n); + 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.contract2.max_euint8_uint8(encryptedAmount.handles[0], 25n, encryptedAmount.inputProof); + const tx = await this.contract5.ge_uint16_euint16(60450n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(29n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "max" overload (uint8, euint8) => euint8 test 1 (174, 27)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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.add8(27n); + input.add16(13068n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_uint8_euint8(174n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.ge_uint16_euint16(13064n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(174n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "max" overload (uint8, euint8) => euint8 test 2 (25, 29)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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.add8(29n); + input.add16(13068n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_uint8_euint8(25n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.ge_uint16_euint16(13068n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(29n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "max" overload (uint8, euint8) => euint8 test 3 (29, 29)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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.add8(29n); + input.add16(13064n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_uint8_euint8(29n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.ge_uint16_euint16(13068n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(29n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "max" overload (uint8, euint8) => euint8 test 4 (29, 25)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + 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); - input.add8(25n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_uint8_euint8(29n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract5.gt_euint16_uint16(encryptedAmount.handles[0], 10749n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(29n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "add" overload (euint16, euint4) => euint16 test 1 (8, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(8n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(10n); - }); + 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); - it('test operator "add" overload (euint16, euint4) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(4n); - input.add4(8n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.gt_euint16_uint16(encryptedAmount.handles[0], 49523n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(12n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "add" overload (euint16, euint4) => euint16 test 3 (5, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(5n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(10n); - }); + 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); - it('test operator "add" overload (euint16, euint4) => euint16 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(8n); - input.add4(4n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.gt_euint16_uint16(encryptedAmount.handles[0], 49523n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(12n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "sub" overload (euint16, euint4) => euint16 test 1 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(14n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.sub_euint16_euint4( - 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 "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); - it('test operator "sub" overload (euint16, euint4) => euint16 test 2 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(14n); - input.add4(10n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.sub_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.gt_euint16_uint16(encryptedAmount.handles[0], 49519n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(4n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "mul" overload (euint16, euint4) => euint16 test 1 (5, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(5n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(10n); - }); + 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); - it('test operator "mul" overload (euint16, euint4) => euint16 test 2 (3, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(3n); - input.add4(4n); + input.add16(10749n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.gt_uint16_euint16(38042n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(12n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "mul" overload (euint16, euint4) => euint16 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(3n); - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(9n); - }); + 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); - it('test operator "mul" overload (euint16, euint4) => euint16 test 4 (4, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(4n); - input.add4(3n); + input.add16(49523n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.gt_uint16_euint16(49519n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(12n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "and" overload (euint16, euint4) => euint16 test 1 (62185, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(62185n); - input.add4(11n); + 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.contract2.and_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.gt_uint16_euint16(49523n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(9n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "and" overload (euint16, euint4) => euint16 test 2 (7, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(7n); - input.add4(11n); + 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.contract2.and_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.gt_uint16_euint16(49523n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(3n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "and" overload (euint16, euint4) => euint16 test 3 (11, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(11n); - input.add4(11n); + 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.contract2.and_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.le_euint16_uint16(encryptedAmount.handles[0], 27442n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(11n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "and" overload (euint16, euint4) => euint16 test 4 (11, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(11n); - input.add4(7n); + 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.contract2.and_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.le_euint16_uint16(encryptedAmount.handles[0], 873n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(3n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "or" overload (euint16, euint4) => euint16 test 1 (40123, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(40123n); - input.add4(11n); + 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.contract2.or_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.le_euint16_uint16(encryptedAmount.handles[0], 873n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(40123n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "or" overload (euint16, euint4) => euint16 test 2 (7, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(7n); - input.add4(11n); + 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.contract2.or_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.le_euint16_uint16(encryptedAmount.handles[0], 869n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(15n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "or" overload (euint16, euint4) => euint16 test 3 (11, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(11n); - input.add4(11n); + 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.contract2.or_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.le_uint16_euint16(36363n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(11n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "or" overload (euint16, euint4) => euint16 test 4 (11, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(11n); - input.add4(7n); + 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.contract2.or_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.le_uint16_euint16(869n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(15n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "xor" overload (euint16, euint4) => euint16 test 1 (34235, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(34235n); - input.add4(7n); + 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.contract2.xor_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.le_uint16_euint16(873n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(34236n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "xor" overload (euint16, euint4) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(4n); - input.add4(8n); + 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.contract2.xor_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.le_uint16_euint16(873n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(12n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "xor" overload (euint16, euint4) => euint16 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(8n); - input.add4(8n); + 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.contract2.xor_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.lt_euint16_uint16(encryptedAmount.handles[0], 38499n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(0n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "xor" overload (euint16, euint4) => euint16 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(8n); - input.add4(4n); + 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.contract2.xor_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.lt_euint16_uint16(encryptedAmount.handles[0], 5146n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(12n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "eq" overload (euint16, euint4) => ebool test 1 (57152, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(57152n); - input.add4(3n); + 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.contract2.eq_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.lt_euint16_uint16(encryptedAmount.handles[0], 5146n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint16, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(4n); - input.add4(8n); + 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.contract2.eq_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.lt_euint16_uint16(encryptedAmount.handles[0], 5142n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint16, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(8n); - input.add4(8n); + 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.contract2.eq_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.lt_uint16_euint16(21462n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(true); }); - it('test operator "eq" overload (euint16, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(8n); - input.add4(4n); + 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.contract2.eq_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.lt_uint16_euint16(5142n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "ne" overload (euint16, euint4) => ebool test 1 (24920, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(24920n); - input.add4(3n); + 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.contract2.ne_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.lt_uint16_euint16(5146n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "ne" overload (euint16, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(4n); - input.add4(8n); + 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.contract2.ne_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.lt_uint16_euint16(5146n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "ne" overload (euint16, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(8n); - input.add4(8n); + 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.contract2.ne_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.min_euint16_uint16(encryptedAmount.handles[0], 54097n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(32718n); }); - it('test operator "ne" overload (euint16, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(8n); - input.add4(4n); + 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.contract2.ne_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.min_euint16_uint16(encryptedAmount.handles[0], 8269n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(8265n); }); - it('test operator "ge" overload (euint16, euint4) => ebool test 1 (27268, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(27268n); - input.add4(4n); + 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.contract2.ge_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.min_euint16_uint16(encryptedAmount.handles[0], 8269n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(8269n); }); - it('test operator "ge" overload (euint16, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(4n); - input.add4(8n); + 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.contract2.ge_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.min_euint16_uint16(encryptedAmount.handles[0], 8265n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(8265n); }); - it('test operator "ge" overload (euint16, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(8n); - input.add4(8n); + 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.contract2.ge_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.min_uint16_euint16(24240n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(24240n); }); - it('test operator "ge" overload (euint16, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(8n); - input.add4(4n); + 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.contract2.ge_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.min_uint16_euint16(8265n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(8265n); }); - it('test operator "gt" overload (euint16, euint4) => ebool test 1 (6870, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(6870n); - input.add4(8n); + 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.contract2.gt_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.min_uint16_euint16(8269n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(8269n); }); - it('test operator "gt" overload (euint16, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(4n); - input.add4(8n); + 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.contract2.gt_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.min_uint16_euint16(8269n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(8265n); }); - it('test operator "gt" overload (euint16, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(8n); - input.add4(8n); + 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.contract2.gt_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.max_euint16_uint16(encryptedAmount.handles[0], 25405n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(37775n); }); - it('test operator "gt" overload (euint16, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(8n); - input.add4(4n); + 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.contract2.gt_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.max_euint16_uint16(encryptedAmount.handles[0], 22432n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(22432n); }); - it('test operator "le" overload (euint16, euint4) => ebool test 1 (39104, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(39104n); - input.add4(8n); + 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.contract2.le_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.max_euint16_uint16(encryptedAmount.handles[0], 22432n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(22432n); }); - it('test operator "le" overload (euint16, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(4n); - input.add4(8n); + 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.contract2.le_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.max_euint16_uint16(encryptedAmount.handles[0], 22428n, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(22432n); }); - it('test operator "le" overload (euint16, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(8n); - input.add4(8n); + 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.contract2.le_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.max_uint16_euint16(1122n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(25405n); }); - it('test operator "le" overload (euint16, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(8n); - input.add4(4n); + 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.contract2.le_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.max_uint16_euint16(22428n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(22432n); }); - it('test operator "lt" overload (euint16, euint4) => ebool test 1 (57762, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(57762n); - input.add4(4n); + 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.contract2.lt_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.max_uint16_euint16(22432n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(22432n); }); - it('test operator "lt" overload (euint16, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(4n); - input.add4(8n); + 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.contract2.lt_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); + const tx = await this.contract5.max_uint16_euint16(22432n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); + const res = await decrypt16(await this.contract5.res16()); + expect(res).to.equal(22432n); }); - it('test operator "lt" overload (euint16, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(8n); - input.add4(8n); + 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.contract2.lt_euint16_euint4( + const tx = await this.contract5.add_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(11n); }); - it('test operator "lt" overload (euint16, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add16(8n); - input.add4(4n); + 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.contract2.lt_euint16_euint4( + const tx = await this.contract5.add_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(12n); }); - it('test operator "min" overload (euint16, euint4) => euint16 test 1 (10884, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(10884n); - input.add4(9n); + 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.contract3.min_euint16_euint4( + const tx = await this.contract5.add_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(10n); }); - it('test operator "min" overload (euint16, euint4) => euint16 test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(5n); - input.add4(9n); + 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.contract3.min_euint16_euint4( + const tx = await this.contract5.add_euint32_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(5n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(12n); }); - it('test operator "min" overload (euint16, euint4) => euint16 test 3 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(9n); - input.add4(9n); + 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.contract3.min_euint16_euint4( + const tx = await this.contract5.sub_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(0n); }); - it('test operator "min" overload (euint16, euint4) => euint16 test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(9n); - input.add4(5n); + 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.contract3.min_euint16_euint4( + const tx = await this.contract5.sub_euint32_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(5n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(4n); }); - it('test operator "max" overload (euint16, euint4) => euint16 test 1 (58569, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(58569n); - input.add4(10n); + 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.contract3.max_euint16_euint4( + const tx = await this.contract5.mul_euint32_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(58569n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(12n); }); - it('test operator "max" overload (euint16, euint4) => euint16 test 2 (6, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(6n); - input.add4(10n); + 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.contract3.max_euint16_euint4( + const tx = await this.contract5.mul_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(15n); }); - it('test operator "max" overload (euint16, euint4) => euint16 test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(10n); - input.add4(10n); + 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.contract3.max_euint16_euint4( + const tx = await this.contract5.mul_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(9n); }); - it('test operator "max" overload (euint16, euint4) => euint16 test 4 (10, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(10n); - input.add4(6n); + 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.contract3.max_euint16_euint4( + const tx = await this.contract5.mul_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(15n); }); - it('test operator "add" overload (euint16, euint8) => euint16 test 1 (147, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(147n); - input.add8(3n); + 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.contract3.add_euint16_euint8( + const tx = await this.contract5.and_euint32_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(150n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(0n); }); - it('test operator "add" overload (euint16, euint8) => euint16 test 2 (116, 118)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(116n); - input.add8(118n); + 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.contract3.add_euint16_euint8( + const tx = await this.contract5.and_euint32_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(234n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(0n); }); - it('test operator "add" overload (euint16, euint8) => euint16 test 3 (118, 118)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(118n); - input.add8(118n); + 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.contract3.add_euint16_euint8( + const tx = await this.contract5.and_euint32_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(236n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(8n); }); - it('test operator "add" overload (euint16, euint8) => euint16 test 4 (118, 116)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(118n); - input.add8(116n); + 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.contract3.add_euint16_euint8( + const tx = await this.contract5.and_euint32_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(234n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(0n); }); - it('test operator "sub" overload (euint16, euint8) => euint16 test 1 (143, 143)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(143n); - input.add8(143n); + 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.contract3.sub_euint16_euint8( + const tx = await this.contract5.or_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(1671920699n); }); - it('test operator "sub" overload (euint16, euint8) => euint16 test 2 (143, 139)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(143n); - input.add8(139n); + 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.contract3.sub_euint16_euint8( + const tx = await this.contract5.or_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(12n); }); - it('test operator "mul" overload (euint16, euint8) => euint16 test 1 (127, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(127n); - input.add8(2n); + 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.contract3.mul_euint16_euint8( + const tx = await this.contract5.or_euint32_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(254n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(8n); }); - it('test operator "mul" overload (euint16, euint8) => euint16 test 2 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(10n); - input.add8(10n); + 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.contract3.mul_euint16_euint8( + const tx = await this.contract5.or_euint32_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(100n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(12n); }); - it('test operator "mul" overload (euint16, euint8) => euint16 test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(10n); - input.add8(10n); + 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.contract3.mul_euint16_euint8( + const tx = await this.contract5.xor_euint32_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(100n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(4009369106n); }); - it('test operator "mul" overload (euint16, euint8) => euint16 test 4 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(10n); - input.add8(10n); + 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.contract3.mul_euint16_euint8( + const tx = await this.contract5.xor_euint32_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(100n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(12n); }); - it('test operator "and" overload (euint16, euint8) => euint16 test 1 (19261, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(19261n); - input.add8(5n); + 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.contract3.and_euint16_euint8( + const tx = await this.contract5.xor_euint32_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(5n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(0n); }); - it('test operator "and" overload (euint16, euint8) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(4n); - input.add8(8n); + 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.contract3.and_euint16_euint8( + const tx = await this.contract5.xor_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(12n); }); - it('test operator "and" overload (euint16, euint8) => euint16 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8n); - input.add8(8n); + 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.contract3.and_euint16_euint8( + const tx = await this.contract5.eq_euint32_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); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "and" overload (euint16, euint8) => euint16 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8n); - input.add8(4n); + 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.contract3.and_euint16_euint8( + const tx = await this.contract5.eq_euint32_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); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "or" overload (euint16, euint8) => euint16 test 1 (37227, 88)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(37227n); - input.add8(88n); + 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.contract3.or_euint16_euint8( + const tx = await this.contract5.eq_euint32_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(37243n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "or" overload (euint16, euint8) => euint16 test 2 (84, 88)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(84n); - input.add8(88n); + 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.contract3.or_euint16_euint8( + const tx = await this.contract5.eq_euint32_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(92n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "or" overload (euint16, euint8) => euint16 test 3 (88, 88)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(88n); - input.add8(88n); + 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.contract3.or_euint16_euint8( + const tx = await this.contract5.ne_euint32_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(88n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "or" overload (euint16, euint8) => euint16 test 4 (88, 84)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(88n); - input.add8(84n); + 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.contract3.or_euint16_euint8( + const tx = await this.contract5.ne_euint32_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(92n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "xor" overload (euint16, euint8) => euint16 test 1 (43168, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(43168n); - input.add8(233n); + 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.contract3.xor_euint16_euint8( + const tx = await this.contract5.ne_euint32_euint4( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(43081n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "xor" overload (euint16, euint8) => euint16 test 2 (229, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(229n); - input.add8(233n); + 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.contract3.xor_euint16_euint8( + const tx = await this.contract5.ne_euint32_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); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "xor" overload (euint16, euint8) => euint16 test 3 (233, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(233n); - input.add8(233n); + 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.contract3.xor_euint16_euint8( + const tx = await this.contract5.ge_euint32_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); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "xor" overload (euint16, euint8) => euint16 test 4 (233, 229)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(233n); - input.add8(229n); + 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.contract3.xor_euint16_euint8( + const tx = await this.contract5.ge_euint32_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); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "eq" overload (euint16, euint8) => ebool test 1 (64589, 145)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(64589n); - input.add8(145n); + 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.contract3.eq_euint16_euint8( + 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.contract3.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "eq" overload (euint16, euint8) => ebool test 2 (141, 145)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(141n); - input.add8(145n); + 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.contract3.eq_euint16_euint8( + 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.contract3.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "eq" overload (euint16, euint8) => ebool test 3 (145, 145)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(145n); - input.add8(145n); + 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.contract3.eq_euint16_euint8( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(true); }); - it('test operator "eq" overload (euint16, euint8) => ebool test 4 (145, 141)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(145n); - input.add8(141n); + 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.contract3.eq_euint16_euint8( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint16, euint8) => ebool test 1 (59614, 149)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(59614n); - input.add8(149n); + 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.contract3.ne_euint16_euint8( + 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.contract3.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "ne" overload (euint16, euint8) => ebool test 2 (145, 149)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(145n); - input.add8(149n); + 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.contract3.ne_euint16_euint8( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint16, euint8) => ebool test 3 (149, 149)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(149n); - input.add8(149n); + 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.contract3.ne_euint16_euint8( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint16, euint8) => ebool test 4 (149, 145)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(149n); - input.add8(145n); + 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.contract3.ne_euint16_euint8( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint16, euint8) => ebool test 1 (24994, 118)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(24994n); - input.add8(118n); + 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.contract3.ge_euint16_euint8( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint16, euint8) => ebool test 2 (114, 118)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(114n); - input.add8(118n); + 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.contract3.ge_euint16_euint8( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "ge" overload (euint16, euint8) => ebool test 3 (118, 118)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(118n); - input.add8(118n); + 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.contract3.ge_euint16_euint8( + 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.contract3.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "ge" overload (euint16, euint8) => ebool test 4 (118, 114)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(118n); - input.add8(114n); + 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.contract3.ge_euint16_euint8( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(true); }); - it('test operator "gt" overload (euint16, euint8) => ebool test 1 (15548, 171)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(15548n); - input.add8(171n); + 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.contract3.gt_euint16_euint8( + 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.contract3.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "gt" overload (euint16, euint8) => ebool test 2 (167, 171)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(167n); - input.add8(171n); + 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.contract3.gt_euint16_euint8( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint16, euint8) => ebool test 3 (171, 171)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(171n); - input.add8(171n); + 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.contract3.gt_euint16_euint8( + const tx = await this.contract5.min_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(11n); }); - it('test operator "gt" overload (euint16, euint8) => ebool test 4 (171, 167)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(171n); - input.add8(167n); + 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.contract3.gt_euint16_euint8( + const tx = await this.contract5.min_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(7n); }); - it('test operator "le" overload (euint16, euint8) => ebool test 1 (53893, 183)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(53893n); - input.add8(183n); + 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.contract3.le_euint16_euint8( + const tx = await this.contract5.min_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(11n); }); - it('test operator "le" overload (euint16, euint8) => ebool test 2 (179, 183)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(179n); - input.add8(183n); + 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.contract3.le_euint16_euint8( + const tx = await this.contract5.min_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(7n); }); - it('test operator "le" overload (euint16, euint8) => ebool test 3 (183, 183)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(183n); - input.add8(183n); + 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.contract3.le_euint16_euint8( + const tx = await this.contract5.max_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(1089745104n); }); - it('test operator "le" overload (euint16, euint8) => ebool test 4 (183, 179)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(183n); - input.add8(179n); + 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.contract3.le_euint16_euint8( + const tx = await this.contract5.max_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(8n); }); - it('test operator "lt" overload (euint16, euint8) => ebool test 1 (14349, 199)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(14349n); - input.add8(199n); + 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.contract3.lt_euint16_euint8( + const tx = await this.contract5.max_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(8n); }); - it('test operator "lt" overload (euint16, euint8) => ebool test 2 (195, 199)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(195n); - input.add8(199n); + 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.contract3.lt_euint16_euint8( + const tx = await this.contract5.max_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(8n); }); - it('test operator "lt" overload (euint16, euint8) => ebool test 3 (199, 199)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(199n); - input.add8(199n); + 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.contract3.lt_euint16_euint8( + const tx = await this.contract5.add_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(131n); }); - it('test operator "lt" overload (euint16, euint8) => ebool test 4 (199, 195)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(199n); - input.add8(195n); + 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.contract3.lt_euint16_euint8( + const tx = await this.contract5.add_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(160n); }); - it('test operator "min" overload (euint16, euint8) => euint16 test 1 (29386, 59)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(29386n); - input.add8(59n); + 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.contract3.min_euint16_euint8( + const tx = await this.contract5.add_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(59n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(162n); }); - it('test operator "min" overload (euint16, euint8) => euint16 test 2 (55, 59)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(55n); - input.add8(59n); + 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.contract3.min_euint16_euint8( + const tx = await this.contract5.add_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(55n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(160n); }); - it('test operator "min" overload (euint16, euint8) => euint16 test 3 (59, 59)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(59n); - input.add8(59n); + 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.contract3.min_euint16_euint8( + const tx = await this.contract5.sub_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(59n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(0n); }); - it('test operator "min" overload (euint16, euint8) => euint16 test 4 (59, 55)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(59n); - input.add8(55n); + 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.contract3.min_euint16_euint8( + const tx = await this.contract5.sub_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(55n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(4n); }); }); diff --git a/test/tfheOperations/tfheOperations6.ts b/test/tfheOperations/tfheOperations6.ts index 5f4ec0a2..08d806b1 100644 --- a/test/tfheOperations/tfheOperations6.ts +++ b/test/tfheOperations/tfheOperations6.ts @@ -7,7 +7,22 @@ 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 { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance'; +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 { @@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise { 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); @@ -105,2497 +175,4677 @@ describe('TFHE operations 6', function () { 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 "max" overload (euint16, euint8) => euint16 test 1 (46663, 31)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(46663n); - input.add8(31n); + 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.contract3.max_euint16_euint8( + const tx = await this.contract5.mul_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(46663n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(228n); }); - it('test operator "max" overload (euint16, euint8) => euint16 test 2 (27, 31)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(27n); - input.add8(31n); + 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.contract3.max_euint16_euint8( + const tx = await this.contract5.mul_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(31n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(240n); }); - it('test operator "max" overload (euint16, euint8) => euint16 test 3 (31, 31)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(31n); - input.add8(31n); + 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.contract3.max_euint16_euint8( + const tx = await this.contract5.mul_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(31n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(81n); }); - it('test operator "max" overload (euint16, euint8) => euint16 test 4 (31, 27)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(31n); - input.add8(27n); + 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.contract3.max_euint16_euint8( + const tx = await this.contract5.mul_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(31n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(240n); }); - it('test operator "add" overload (euint16, euint16) => euint16 test 1 (12135, 15379)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12135n); - input.add16(15379n); + 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.contract3.add_euint16_euint16( + const tx = await this.contract5.and_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(27514n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(32n); }); - it('test operator "add" overload (euint16, euint16) => euint16 test 2 (12131, 12135)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12131n); - input.add16(12135n); + 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.contract3.add_euint16_euint16( + const tx = await this.contract5.and_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(24266n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(2n); }); - it('test operator "add" overload (euint16, euint16) => euint16 test 3 (12135, 12135)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12135n); - input.add16(12135n); + 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.contract3.add_euint16_euint16( + const tx = await this.contract5.and_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(24270n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(34n); }); - it('test operator "add" overload (euint16, euint16) => euint16 test 4 (12135, 12131)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12135n); - input.add16(12131n); + 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.contract3.add_euint16_euint16( + const tx = await this.contract5.and_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(24266n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(2n); }); - it('test operator "sub" overload (euint16, euint16) => euint16 test 1 (3171, 3171)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(3171n); - input.add16(3171n); + 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.contract3.sub_euint16_euint16( + const tx = await this.contract5.or_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(0n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(143668920n); }); - it('test operator "sub" overload (euint16, euint16) => euint16 test 2 (3171, 3167)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(3171n); - input.add16(3167n); + 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.contract3.sub_euint16_euint16( + const tx = await this.contract5.or_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(4n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(188n); }); - it('test operator "mul" overload (euint16, euint16) => euint16 test 1 (78, 381)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(78n); - input.add16(381n); + 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.contract3.mul_euint16_euint16( + const tx = await this.contract5.or_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(29718n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(184n); }); - it('test operator "mul" overload (euint16, euint16) => euint16 test 2 (155, 155)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(155n); - input.add16(155n); + 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.contract3.mul_euint16_euint16( + const tx = await this.contract5.or_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(24025n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(188n); }); - it('test operator "mul" overload (euint16, euint16) => euint16 test 3 (155, 155)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(155n); - input.add16(155n); + 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.contract3.mul_euint16_euint16( + const tx = await this.contract5.xor_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(24025n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(1756251121n); }); - it('test operator "mul" overload (euint16, euint16) => euint16 test 4 (155, 155)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(155n); - input.add16(155n); + 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.contract3.mul_euint16_euint16( + const tx = await this.contract5.xor_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(24025n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(28n); }); - it('test operator "and" overload (euint16, euint16) => euint16 test 1 (3535, 5032)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(3535n); - input.add16(5032n); + 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.contract3.and_euint16_euint16( + const tx = await this.contract5.xor_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(392n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(0n); }); - it('test operator "and" overload (euint16, euint16) => euint16 test 2 (3531, 3535)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(3531n); - input.add16(3535n); + 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.contract3.and_euint16_euint16( + const tx = await this.contract5.xor_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(3531n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(28n); }); - it('test operator "and" overload (euint16, euint16) => euint16 test 3 (3535, 3535)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(3535n); - input.add16(3535n); + 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.contract3.and_euint16_euint16( + const tx = await this.contract5.eq_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(3535n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "and" overload (euint16, euint16) => euint16 test 4 (3535, 3531)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(3535n); - input.add16(3531n); + 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.contract3.and_euint16_euint16( + const tx = await this.contract5.eq_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(3531n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "or" overload (euint16, euint16) => euint16 test 1 (33634, 27003)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(33634n); - input.add16(27003n); + 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.contract3.or_euint16_euint16( + const tx = await this.contract5.eq_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(60283n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "or" overload (euint16, euint16) => euint16 test 2 (26999, 27003)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(26999n); - input.add16(27003n); + 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.contract3.or_euint16_euint16( + const tx = await this.contract5.eq_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(27007n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "or" overload (euint16, euint16) => euint16 test 3 (27003, 27003)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(27003n); - input.add16(27003n); + 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.contract3.or_euint16_euint16( + const tx = await this.contract5.ne_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(27003n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "or" overload (euint16, euint16) => euint16 test 4 (27003, 26999)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(27003n); - input.add16(26999n); + 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.contract3.or_euint16_euint16( + const tx = await this.contract5.ne_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(27007n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "xor" overload (euint16, euint16) => euint16 test 1 (64619, 2520)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(64619n); - input.add16(2520n); + 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.contract3.xor_euint16_euint16( + const tx = await this.contract5.ne_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(62899n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "xor" overload (euint16, euint16) => euint16 test 2 (2516, 2520)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(2516n); - input.add16(2520n); + 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.contract3.xor_euint16_euint16( + const tx = await this.contract5.ne_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(12n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "xor" overload (euint16, euint16) => euint16 test 3 (2520, 2520)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(2520n); - input.add16(2520n); + 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.contract3.xor_euint16_euint16( + const tx = await this.contract5.ge_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(0n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "xor" overload (euint16, euint16) => euint16 test 4 (2520, 2516)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(2520n); - input.add16(2516n); + 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.contract3.xor_euint16_euint16( + const tx = await this.contract5.ge_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(12n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "eq" overload (euint16, euint16) => ebool test 1 (63705, 3249)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(63705n); - input.add16(3249n); + 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.contract3.eq_euint16_euint16( + 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.contract3.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "eq" overload (euint16, euint16) => ebool test 2 (3245, 3249)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(3245n); - input.add16(3249n); + 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.contract3.eq_euint16_euint16( + 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.contract3.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "eq" overload (euint16, euint16) => ebool test 3 (3249, 3249)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(3249n); - input.add16(3249n); + 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.contract3.eq_euint16_euint16( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(true); }); - it('test operator "eq" overload (euint16, euint16) => ebool test 4 (3249, 3245)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(3249n); - input.add16(3245n); + 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.contract3.eq_euint16_euint16( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint16, euint16) => ebool test 1 (27750, 23851)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(27750n); - input.add16(23851n); + 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.contract3.ne_euint16_euint16( + 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.contract3.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "ne" overload (euint16, euint16) => ebool test 2 (23847, 23851)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(23847n); - input.add16(23851n); + 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.contract3.ne_euint16_euint16( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint16, euint16) => ebool test 3 (23851, 23851)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(23851n); - input.add16(23851n); + 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.contract3.ne_euint16_euint16( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint16, euint16) => ebool test 4 (23851, 23847)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(23851n); - input.add16(23847n); + 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.contract3.ne_euint16_euint16( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint16, euint16) => ebool test 1 (8825, 39131)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8825n); - input.add16(39131n); + 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.contract3.ge_euint16_euint16( + 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.contract3.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "ge" overload (euint16, euint16) => ebool test 2 (8821, 8825)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8821n); - input.add16(8825n); + 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.contract3.ge_euint16_euint16( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "ge" overload (euint16, euint16) => ebool test 3 (8825, 8825)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8825n); - input.add16(8825n); + 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.contract3.ge_euint16_euint16( + 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.contract3.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "ge" overload (euint16, euint16) => ebool test 4 (8825, 8821)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8825n); - input.add16(8821n); + 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.contract3.ge_euint16_euint16( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(true); }); - it('test operator "gt" overload (euint16, euint16) => ebool test 1 (33735, 54333)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(33735n); - input.add16(54333n); + 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.contract3.gt_euint16_euint16( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint16, euint16) => ebool test 2 (33731, 33735)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(33731n); - input.add16(33735n); + 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.contract3.gt_euint16_euint16( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint16, euint16) => ebool test 3 (33735, 33735)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(33735n); - input.add16(33735n); + 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.contract3.gt_euint16_euint16( + const tx = await this.contract5.min_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(28n); }); - it('test operator "gt" overload (euint16, euint16) => ebool test 4 (33735, 33731)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(33735n); - input.add16(33731n); + 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.contract3.gt_euint16_euint16( + const tx = await this.contract5.min_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(24n); }); - it('test operator "le" overload (euint16, euint16) => ebool test 1 (38605, 53936)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(38605n); - input.add16(53936n); + 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.contract3.le_euint16_euint16( + const tx = await this.contract5.min_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(28n); }); - it('test operator "le" overload (euint16, euint16) => ebool test 2 (38601, 38605)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(38601n); - input.add16(38605n); + 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.contract3.le_euint16_euint16( + const tx = await this.contract5.min_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(24n); }); - it('test operator "le" overload (euint16, euint16) => ebool test 3 (38605, 38605)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(38605n); - input.add16(38605n); + 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.contract3.le_euint16_euint16( + const tx = await this.contract5.max_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(2231185000n); }); - it('test operator "le" overload (euint16, euint16) => ebool test 4 (38605, 38601)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(38605n); - input.add16(38601n); + 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.contract3.le_euint16_euint16( + const tx = await this.contract5.max_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(65n); }); - it('test operator "lt" overload (euint16, euint16) => ebool test 1 (59332, 12427)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(59332n); - input.add16(12427n); + 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.contract3.lt_euint16_euint16( + const tx = await this.contract5.max_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(65n); }); - it('test operator "lt" overload (euint16, euint16) => ebool test 2 (12423, 12427)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12423n); - input.add16(12427n); + 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.contract3.lt_euint16_euint16( + const tx = await this.contract5.max_euint32_euint8( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(65n); }); - it('test operator "lt" overload (euint16, euint16) => ebool test 3 (12427, 12427)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12427n); - input.add16(12427n); + 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.contract3.lt_euint16_euint16( + const tx = await this.contract5.add_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(35606n); }); - it('test operator "lt" overload (euint16, euint16) => ebool test 4 (12427, 12423)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12427n); - input.add16(12423n); + 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.contract3.lt_euint16_euint16( + const tx = await this.contract5.add_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(36956n); }); - it('test operator "min" overload (euint16, euint16) => euint16 test 1 (18209, 14696)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(18209n); - input.add16(14696n); + 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.contract3.min_euint16_euint16( + const tx = await this.contract5.add_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(14696n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(36958n); }); - it('test operator "min" overload (euint16, euint16) => euint16 test 2 (14692, 14696)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(14692n); - input.add16(14696n); + 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.contract3.min_euint16_euint16( + const tx = await this.contract5.add_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(14692n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(36956n); }); - it('test operator "min" overload (euint16, euint16) => euint16 test 3 (14696, 14696)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(14696n); - input.add16(14696n); + 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.contract3.min_euint16_euint16( + const tx = await this.contract5.sub_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(14696n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(0n); }); - it('test operator "min" overload (euint16, euint16) => euint16 test 4 (14696, 14692)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(14696n); - input.add16(14692n); + 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.contract3.min_euint16_euint16( + const tx = await this.contract5.sub_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(14692n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(4n); }); - it('test operator "max" overload (euint16, euint16) => euint16 test 1 (35722, 7688)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(35722n); - input.add16(7688n); + 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.contract3.max_euint16_euint16( + const tx = await this.contract5.mul_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(35722n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(60448n); }); - it('test operator "max" overload (euint16, euint16) => euint16 test 2 (7684, 7688)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(7684n); - input.add16(7688n); + 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.contract3.max_euint16_euint16( + const tx = await this.contract5.mul_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(7688n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(25600n); }); - it('test operator "max" overload (euint16, euint16) => euint16 test 3 (7688, 7688)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(7688n); - input.add16(7688n); + 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.contract3.max_euint16_euint16( + const tx = await this.contract5.mul_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(7688n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(25600n); }); - it('test operator "max" overload (euint16, euint16) => euint16 test 4 (7688, 7684)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(7688n); - input.add16(7684n); + 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.contract3.max_euint16_euint16( + const tx = await this.contract5.mul_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(7688n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(25600n); }); - it('test operator "add" overload (euint16, euint32) => euint32 test 1 (2, 40496)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(2n); - input.add32(40496n); + 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.contract3.add_euint16_euint32( + 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.contract3.res32()); - expect(res).to.equal(40498n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(192n); }); - it('test operator "add" overload (euint16, euint32) => euint32 test 2 (18317, 18319)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(18317n); - input.add32(18319n); + 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.contract3.add_euint16_euint32( + 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.contract3.res32()); - expect(res).to.equal(36636n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(6848n); }); - it('test operator "add" overload (euint16, euint32) => euint32 test 3 (18319, 18319)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(18319n); - input.add32(18319n); + 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.contract3.add_euint16_euint32( + 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.contract3.res32()); - expect(res).to.equal(36638n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(6880n); }); - it('test operator "add" overload (euint16, euint32) => euint32 test 4 (18319, 18317)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(18319n); - input.add32(18317n); + 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.contract3.add_euint16_euint32( + 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.contract3.res32()); - expect(res).to.equal(36636n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(6848n); }); - it('test operator "sub" overload (euint16, euint32) => euint32 test 1 (17812, 17812)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(17812n); - input.add32(17812n); + 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.contract3.sub_euint16_euint32( + 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.contract3.res32()); - expect(res).to.equal(0n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(68742127n); }); - it('test operator "sub" overload (euint16, euint32) => euint32 test 2 (17812, 17808)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(17812n); - input.add32(17808n); + 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.contract3.sub_euint16_euint32( + 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.contract3.res32()); - expect(res).to.equal(4n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(41103n); }); - it('test operator "mul" overload (euint16, euint32) => euint32 test 1 (2, 18411)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(2n); - input.add32(18411n); + 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.contract3.mul_euint16_euint32( + 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.contract3.res32()); - expect(res).to.equal(36822n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(41103n); }); - it('test operator "mul" overload (euint16, euint32) => euint32 test 2 (139, 139)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(139n); - input.add32(139n); + 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.contract3.mul_euint16_euint32( + 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.contract3.res32()); - expect(res).to.equal(19321n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(41103n); }); - it('test operator "mul" overload (euint16, euint32) => euint32 test 3 (139, 139)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(139n); - input.add32(139n); + 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.contract3.mul_euint16_euint32( + 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.contract3.res32()); - expect(res).to.equal(19321n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(3818101134n); }); - it('test operator "mul" overload (euint16, euint32) => euint32 test 4 (139, 139)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(139n); - input.add32(139n); + 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.contract3.mul_euint16_euint32( + 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.contract3.res32()); - expect(res).to.equal(19321n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(4n); }); - it('test operator "and" overload (euint16, euint32) => euint32 test 1 (27862, 1736690738)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(27862n); - input.add32(1736690738n); + 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.contract3.and_euint16_euint32( + 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.contract3.res32()); - expect(res).to.equal(19474n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(0n); }); - it('test operator "and" overload (euint16, euint32) => euint32 test 2 (27858, 27862)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(27858n); - input.add32(27862n); + 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.contract3.and_euint16_euint32( + 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.contract3.res32()); - expect(res).to.equal(27858n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(4n); }); - it('test operator "and" overload (euint16, euint32) => euint32 test 3 (27862, 27862)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(27862n); - input.add32(27862n); + 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.contract3.and_euint16_euint32( + const tx = await this.contract5.eq_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(27862n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "and" overload (euint16, euint32) => euint32 test 4 (27862, 27858)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(27862n); - input.add32(27858n); + 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.contract3.and_euint16_euint32( + const tx = await this.contract5.eq_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(27858n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "or" overload (euint16, euint32) => euint32 test 1 (440, 1863142416)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(440n); - input.add32(1863142416n); + 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.contract3.or_euint16_euint32( + const tx = await this.contract5.eq_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(1863142840n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "or" overload (euint16, euint32) => euint32 test 2 (436, 440)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(436n); - input.add32(440n); + 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.contract3.or_euint16_euint32( + const tx = await this.contract5.eq_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(444n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "or" overload (euint16, euint32) => euint32 test 3 (440, 440)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(440n); - input.add32(440n); + 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.contract3.or_euint16_euint32( + const tx = await this.contract5.ne_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(440n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "or" overload (euint16, euint32) => euint32 test 4 (440, 436)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(440n); - input.add32(436n); + 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.contract3.or_euint16_euint32( + const tx = await this.contract5.ne_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(444n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "xor" overload (euint16, euint32) => euint32 test 1 (51717, 501889469)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(51717n); - input.add32(501889469n); + 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.contract3.xor_euint16_euint32( + const tx = await this.contract5.ne_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(501937080n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "xor" overload (euint16, euint32) => euint32 test 2 (51713, 51717)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(51713n); - input.add32(51717n); + 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.contract3.xor_euint16_euint32( + const tx = await this.contract5.ne_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(4n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "xor" overload (euint16, euint32) => euint32 test 3 (51717, 51717)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(51717n); - input.add32(51717n); + 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.contract3.xor_euint16_euint32( + const tx = await this.contract5.ge_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(0n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "xor" overload (euint16, euint32) => euint32 test 4 (51717, 51713)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(51717n); - input.add32(51713n); + 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.contract3.xor_euint16_euint32( + const tx = await this.contract5.ge_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(4n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "eq" overload (euint16, euint32) => ebool test 1 (19428, 3260350416)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(19428n); - input.add32(3260350416n); + 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.contract3.eq_euint16_euint32( + 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.contract3.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "eq" overload (euint16, euint32) => ebool test 2 (19424, 19428)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(19424n); - input.add32(19428n); + 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.contract3.eq_euint16_euint32( + 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.contract3.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "eq" overload (euint16, euint32) => ebool test 3 (19428, 19428)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(19428n); - input.add32(19428n); + 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.contract3.eq_euint16_euint32( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(true); }); - it('test operator "eq" overload (euint16, euint32) => ebool test 4 (19428, 19424)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(19428n); - input.add32(19424n); + 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.contract3.eq_euint16_euint32( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint16, euint32) => ebool test 1 (4461, 3322499889)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(4461n); - input.add32(3322499889n); + 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.contract3.ne_euint16_euint32( + 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.contract3.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "ne" overload (euint16, euint32) => ebool test 2 (4457, 4461)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(4457n); - input.add32(4461n); + 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.contract3.ne_euint16_euint32( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint16, euint32) => ebool test 3 (4461, 4461)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(4461n); - input.add32(4461n); + 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.contract3.ne_euint16_euint32( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint16, euint32) => ebool test 4 (4461, 4457)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(4461n); - input.add32(4457n); + 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.contract3.ne_euint16_euint32( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint16, euint32) => ebool test 1 (23826, 3191695510)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(23826n); - input.add32(3191695510n); + 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.contract3.ge_euint16_euint32( + 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.contract3.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "ge" overload (euint16, euint32) => ebool test 2 (23822, 23826)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(23822n); - input.add32(23826n); + 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.contract3.ge_euint16_euint32( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "ge" overload (euint16, euint32) => ebool test 3 (23826, 23826)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(23826n); - input.add32(23826n); + 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.contract3.ge_euint16_euint32( + 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.contract3.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "ge" overload (euint16, euint32) => ebool test 4 (23826, 23822)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(23826n); - input.add32(23822n); + 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.contract3.ge_euint16_euint32( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(true); }); - it('test operator "gt" overload (euint16, euint32) => ebool test 1 (20452, 2742403767)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(20452n); - input.add32(2742403767n); + 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.contract3.gt_euint16_euint32( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint16, euint32) => ebool test 2 (20448, 20452)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(20448n); - input.add32(20452n); + 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.contract3.gt_euint16_euint32( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint16, euint32) => ebool test 3 (20452, 20452)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(20452n); - input.add32(20452n); + 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.contract3.gt_euint16_euint32( + const tx = await this.contract5.min_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(25661n); }); - it('test operator "gt" overload (euint16, euint32) => ebool test 4 (20452, 20448)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(20452n); - input.add32(20448n); + 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.contract3.gt_euint16_euint32( + const tx = await this.contract5.min_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(25657n); }); - it('test operator "le" overload (euint16, euint32) => ebool test 1 (32489, 2097840840)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(32489n); - input.add32(2097840840n); + 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.contract3.le_euint16_euint32( + const tx = await this.contract5.min_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(25661n); }); - it('test operator "le" overload (euint16, euint32) => ebool test 2 (32485, 32489)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(32485n); - input.add32(32489n); + 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.contract3.le_euint16_euint32( + const tx = await this.contract5.min_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(25657n); }); - it('test operator "le" overload (euint16, euint32) => ebool test 3 (32489, 32489)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(32489n); - input.add32(32489n); + 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.contract3.le_euint16_euint32( + const tx = await this.contract5.max_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(1606859063n); }); - it('test operator "le" overload (euint16, euint32) => ebool test 4 (32489, 32485)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(32489n); - input.add32(32485n); + 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.contract3.le_euint16_euint32( + const tx = await this.contract5.max_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(42684n); }); - it('test operator "lt" overload (euint16, euint32) => ebool test 1 (46117, 3066026054)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(46117n); - input.add32(3066026054n); + 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.contract3.lt_euint16_euint32( + const tx = await this.contract5.max_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(42684n); }); - it('test operator "lt" overload (euint16, euint32) => ebool test 2 (46113, 46117)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(46113n); - input.add32(46117n); + 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.contract3.lt_euint16_euint32( + const tx = await this.contract5.max_euint32_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(42684n); }); - it('test operator "lt" overload (euint16, euint32) => ebool test 3 (46117, 46117)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(46117n); - input.add32(46117n); + 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.contract3.lt_euint16_euint32( + const tx = await this.contract5.add_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(3598566345n); }); - it('test operator "lt" overload (euint16, euint32) => ebool test 4 (46117, 46113)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(46117n); - input.add32(46113n); + 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.contract3.lt_euint16_euint32( + const tx = await this.contract5.add_euint32_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); + 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 "min" overload (euint16, euint32) => euint32 test 1 (5231, 2030449754)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(5231n); - input.add32(2030449754n); + 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.contract3.min_euint16_euint32( + 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.contract3.res32()); - expect(res).to.equal(5231n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(3486042884n); }); - it('test operator "min" overload (euint16, euint32) => euint32 test 2 (5227, 5231)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(5227n); - input.add32(5231n); + 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.contract3.min_euint16_euint32( + 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.contract3.res32()); - expect(res).to.equal(5227n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(0n); }); - it('test operator "min" overload (euint16, euint32) => euint32 test 3 (5231, 5231)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(5231n); - input.add32(5231n); + 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.contract3.min_euint16_euint32( + 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.contract3.res32()); - expect(res).to.equal(5231n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(4n); }); - it('test operator "min" overload (euint16, euint32) => euint32 test 4 (5231, 5227)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(5231n); - input.add32(5227n); + 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.contract3.min_euint16_euint32( + 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.contract3.res32()); - expect(res).to.equal(5227n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(2292824016n); }); - it('test operator "max" overload (euint16, euint32) => euint32 test 1 (34046, 3126513605)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(34046n); - input.add32(3126513605n); + 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.contract3.max_euint16_euint32( + 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.contract3.res32()); - expect(res).to.equal(3126513605n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(2276244100n); }); - it('test operator "max" overload (euint16, euint32) => euint32 test 2 (34042, 34046)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(34042n); - input.add32(34046n); + 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.contract3.max_euint16_euint32( + 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.contract3.res32()); - expect(res).to.equal(34046n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(2276244100n); }); - it('test operator "max" overload (euint16, euint32) => euint32 test 3 (34046, 34046)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(34046n); - input.add32(34046n); + 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.contract3.max_euint16_euint32( + 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.contract3.res32()); - expect(res).to.equal(34046n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(2276244100n); }); - it('test operator "max" overload (euint16, euint32) => euint32 test 4 (34046, 34042)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(34046n); - input.add32(34042n); + 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.contract3.max_euint16_euint32( + 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.contract3.res32()); - expect(res).to.equal(34046n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(1073759510n); }); - it('test operator "add" overload (euint16, euint64) => euint64 test 1 (2, 65506)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(2n); - input.add64(65506n); + 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.contract3.add_euint16_euint64( + const tx = await this.contract5.and_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(65508n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(1342588187n); }); - it('test operator "add" overload (euint16, euint64) => euint64 test 2 (12725, 12729)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12725n); - input.add64(12729n); + 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.contract3.add_euint16_euint64( + const tx = await this.contract5.and_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(25454n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(1342588191n); }); - it('test operator "add" overload (euint16, euint64) => euint64 test 3 (12729, 12729)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12729n); - input.add64(12729n); + 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.contract3.add_euint16_euint64( + const tx = await this.contract5.and_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(25458n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(1342588187n); }); - it('test operator "add" overload (euint16, euint64) => euint64 test 4 (12729, 12725)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12729n); - input.add64(12725n); + 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.contract3.add_euint16_euint64( + const tx = await this.contract5.or_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(25454n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(1877960095n); }); - it('test operator "sub" overload (euint16, euint64) => euint64 test 1 (45021, 45021)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(45021n); - input.add64(45021n); + 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.contract3.sub_euint16_euint64( + const tx = await this.contract5.or_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(0n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(1244554527n); }); - it('test operator "sub" overload (euint16, euint64) => euint64 test 2 (45021, 45017)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(45021n); - input.add64(45017n); + 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.contract3.sub_euint16_euint64( + const tx = await this.contract5.or_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(4n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(1244554527n); }); - it('test operator "mul" overload (euint16, euint64) => euint64 test 1 (2, 32761)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(2n); - input.add64(32761n); + 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.contract3.mul_euint16_euint64( + const tx = await this.contract5.or_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(65522n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(1244554527n); }); - it('test operator "mul" overload (euint16, euint64) => euint64 test 2 (221, 221)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(221n); - input.add64(221n); + 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.contract3.mul_euint16_euint64( + const tx = await this.contract5.xor_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(48841n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(881672303n); }); - it('test operator "mul" overload (euint16, euint64) => euint64 test 3 (221, 221)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(221n); - input.add64(221n); + 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.contract3.mul_euint16_euint64( + const tx = await this.contract5.xor_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(48841n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(28n); }); - it('test operator "mul" overload (euint16, euint64) => euint64 test 4 (221, 221)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(221n); - input.add64(221n); + 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.contract3.mul_euint16_euint64( + const tx = await this.contract5.xor_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(48841n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(0n); }); - it('test operator "and" overload (euint16, euint64) => euint64 test 1 (17953, 18443736631892089939)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(17953n); - input.add64(18443736631892089939n); + 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.contract3.and_euint16_euint64( + const tx = await this.contract5.xor_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(1025n); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(28n); }); - it('test operator "and" overload (euint16, euint64) => euint64 test 2 (17949, 17953)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(17949n); - input.add64(17953n); + 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.contract3.and_euint16_euint64( + const tx = await this.contract5.eq_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(17921n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "and" overload (euint16, euint64) => euint64 test 3 (17953, 17953)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(17953n); - input.add64(17953n); + 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.contract3.and_euint16_euint64( + const tx = await this.contract5.eq_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(17953n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "and" overload (euint16, euint64) => euint64 test 4 (17953, 17949)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(17953n); - input.add64(17949n); + 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.contract3.and_euint16_euint64( + const tx = await this.contract5.eq_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(17921n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "or" overload (euint16, euint64) => euint64 test 1 (12837, 18444850378165005521)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12837n); - input.add64(18444850378165005521n); + 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.contract3.or_euint16_euint64( + const tx = await this.contract5.eq_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(18444850378165010165n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "or" overload (euint16, euint64) => euint64 test 2 (12833, 12837)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12833n); - input.add64(12837n); + 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.contract3.or_euint16_euint64( + const tx = await this.contract5.ne_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(12837n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "or" overload (euint16, euint64) => euint64 test 3 (12837, 12837)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12837n); - input.add64(12837n); + 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.contract3.or_euint16_euint64( + const tx = await this.contract5.ne_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(12837n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "or" overload (euint16, euint64) => euint64 test 4 (12837, 12833)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12837n); - input.add64(12833n); + 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.contract3.or_euint16_euint64( + const tx = await this.contract5.ne_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(12837n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(false); }); - it('test operator "xor" overload (euint16, euint64) => euint64 test 1 (12673, 18438027026491597713)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12673n); - input.add64(18438027026491597713n); + 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.contract3.xor_euint16_euint64( + const tx = await this.contract5.ne_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(18438027026491593232n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "xor" overload (euint16, euint64) => euint64 test 2 (12669, 12673)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12669n); - input.add64(12673n); + 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.contract3.xor_euint16_euint64( + const tx = await this.contract5.ge_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(252n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "xor" overload (euint16, euint64) => euint64 test 3 (12673, 12673)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12673n); - input.add64(12673n); + 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.contract3.xor_euint16_euint64( + const tx = await this.contract5.ge_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(0n); + 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 "xor" overload (euint16, euint64) => euint64 test 4 (12673, 12669)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12673n); - input.add64(12669n); + 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.contract3.xor_euint16_euint64( + const tx = await this.contract5.gt_euint32_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(252n); + const res = await decryptBool(await this.contract5.resb()); + expect(res).to.equal(true); }); - it('test operator "eq" overload (euint16, euint64) => ebool test 1 (15185, 18442214214141554887)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(15185n); - input.add64(18442214214141554887n); + 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.contract3.eq_euint16_euint64( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint16, euint64) => ebool test 2 (15181, 15185)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(15181n); - input.add64(15185n); + 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.contract3.eq_euint16_euint64( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint16, euint64) => ebool test 3 (15185, 15185)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(15185n); - input.add64(15185n); + 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.contract3.eq_euint16_euint64( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(true); }); - it('test operator "eq" overload (euint16, euint64) => ebool test 4 (15185, 15181)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(15185n); - input.add64(15181n); + 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.contract3.eq_euint16_euint64( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint16, euint64) => ebool test 1 (6072, 18442627728041568827)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(6072n); - input.add64(18442627728041568827n); + 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.contract3.ne_euint16_euint64( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint16, euint64) => ebool test 2 (6068, 6072)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(6068n); - input.add64(6072n); + 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.contract3.ne_euint16_euint64( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint16, euint64) => ebool test 3 (6072, 6072)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(6072n); - input.add64(6072n); + 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.contract3.ne_euint16_euint64( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint16, euint64) => ebool test 4 (6072, 6068)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(6072n); - input.add64(6068n); + 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.contract3.ne_euint16_euint64( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint16, euint64) => ebool test 1 (63199, 18444428591303537867)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(63199n); - input.add64(18444428591303537867n); + 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.contract3.ge_euint16_euint64( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "ge" overload (euint16, euint64) => ebool test 2 (63195, 63199)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(63195n); - input.add64(63199n); + 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.contract3.ge_euint16_euint64( + 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.contract3.resb()); + const res = await decryptBool(await this.contract5.resb()); expect(res).to.equal(false); }); - it('test operator "ge" overload (euint16, euint64) => ebool test 3 (63199, 63199)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(63199n); - input.add64(63199n); + 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.contract3.ge_euint16_euint64( + const tx = await this.contract5.min_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(3167993396n); }); - it('test operator "ge" overload (euint16, euint64) => ebool test 4 (63199, 63195)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(63199n); - input.add64(63195n); + 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.contract3.ge_euint16_euint64( + const tx = await this.contract5.min_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(3167993392n); }); - it('test operator "gt" overload (euint16, euint64) => ebool test 1 (63105, 18440430414982980885)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(63105n); - input.add64(18440430414982980885n); + 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.contract3.gt_euint16_euint64( + const tx = await this.contract5.min_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(3167993396n); }); - it('test operator "gt" overload (euint16, euint64) => ebool test 2 (63101, 63105)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(63101n); - input.add64(63105n); + 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.contract3.gt_euint16_euint64( + const tx = await this.contract5.min_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(3167993392n); }); - it('test operator "gt" overload (euint16, euint64) => ebool test 3 (63105, 63105)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(63105n); - input.add64(63105n); + 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.contract3.gt_euint16_euint64( + const tx = await this.contract5.max_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(1943659319n); }); - it('test operator "gt" overload (euint16, euint64) => ebool test 4 (63105, 63101)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(63105n); - input.add64(63101n); + 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.contract3.gt_euint16_euint64( + const tx = await this.contract5.max_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(1310408559n); }); - it('test operator "le" overload (euint16, euint64) => ebool test 1 (46492, 18439416152876310159)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(46492n); - input.add64(18439416152876310159n); + 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.contract3.le_euint16_euint64( + const tx = await this.contract5.max_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(1310408559n); }); - it('test operator "le" overload (euint16, euint64) => ebool test 2 (46488, 46492)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(46488n); - input.add64(46492n); + 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.contract3.le_euint16_euint64( + const tx = await this.contract5.max_euint32_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); + const res = await decrypt32(await this.contract5.res32()); + expect(res).to.equal(1310408559n); }); - it('test operator "le" overload (euint16, euint64) => ebool test 3 (46492, 46492)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(46492n); - input.add64(46492n); + 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.contract3.le_euint16_euint64( + const tx = await this.contract5.add_euint32_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); + const res = await decrypt64(await this.contract5.res64()); + expect(res).to.equal(4294187633n); }); - it('test operator "le" overload (euint16, euint64) => ebool test 4 (46492, 46488)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(46492n); - input.add64(46488n); + 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.contract3.le_euint16_euint64( + const tx = await this.contract5.add_euint32_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); + const res = await decrypt64(await this.contract5.res64()); + expect(res).to.equal(3954984206n); }); - it('test operator "lt" overload (euint16, euint64) => ebool test 1 (20266, 18439286572290779257)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(20266n); - input.add64(18439286572290779257n); + 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.contract3.lt_euint16_euint64( + const tx = await this.contract5.add_euint32_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); + const res = await decrypt64(await this.contract5.res64()); + expect(res).to.equal(3954984210n); }); - it('test operator "lt" overload (euint16, euint64) => ebool test 2 (20262, 20266)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(20262n); - input.add64(20266n); + 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.contract3.lt_euint16_euint64( + const tx = await this.contract5.add_euint32_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); + const res = await decrypt64(await this.contract5.res64()); + expect(res).to.equal(3954984206n); }); - it('test operator "lt" overload (euint16, euint64) => ebool test 3 (20266, 20266)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(20266n); - input.add64(20266n); + 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.contract3.lt_euint16_euint64( + const tx = await this.contract5.sub_euint32_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); + const res = await decrypt64(await this.contract5.res64()); + expect(res).to.equal(0n); }); - it('test operator "lt" overload (euint16, euint64) => ebool test 4 (20266, 20262)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(20266n); - input.add64(20262n); + 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.contract3.lt_euint16_euint64( + const tx = await this.contract5.sub_euint32_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); + 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 "min" overload (euint16, euint64) => euint64 test 1 (44251, 18443711845572494969)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(44251n); - input.add64(18443711845572494969n); + 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.contract3.min_euint16_euint64( + 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.contract3.res64()); - expect(res).to.equal(44251n); + const res = await decrypt64(await this.contract5.res64()); + expect(res).to.equal(1745478464n); }); - it('test operator "min" overload (euint16, euint64) => euint64 test 2 (44247, 44251)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(44247n); - input.add64(44251n); + 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.contract3.min_euint16_euint64( + 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.contract3.res64()); - expect(res).to.equal(44247n); + const res = await decrypt64(await this.contract5.res64()); + expect(res).to.equal(18445417583755615999n); }); - it('test operator "min" overload (euint16, euint64) => euint64 test 3 (44251, 44251)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(44251n); - input.add64(44251n); + 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.contract3.min_euint16_euint64( + 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.contract3.res64()); - expect(res).to.equal(44251n); + const res = await decrypt64(await this.contract5.res64()); + expect(res).to.equal(1546853996n); }); - it('test operator "min" overload (euint16, euint64) => euint64 test 4 (44251, 44247)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(44251n); - input.add64(44247n); + 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.contract3.min_euint16_euint64( + 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.contract3.res64()); - expect(res).to.equal(44247n); + const res = await decrypt64(await this.contract5.res64()); + expect(res).to.equal(1546853992n); }); - it('test operator "max" overload (euint16, euint64) => euint64 test 1 (28367, 18440532375906129937)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(28367n); - input.add64(18440532375906129937n); + 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.contract3.max_euint16_euint64( + 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.contract3.res64()); - expect(res).to.equal(18440532375906129937n); + const res = await decrypt64(await this.contract5.res64()); + expect(res).to.equal(1546853996n); }); - it('test operator "max" overload (euint16, euint64) => euint64 test 2 (28363, 28367)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(28363n); - input.add64(28367n); + 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.contract3.max_euint16_euint64( + 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.contract3.res64()); - expect(res).to.equal(28367n); + const res = await decrypt64(await this.contract5.res64()); + expect(res).to.equal(18441970713904316280n); }); - it('test operator "max" overload (euint16, euint64) => euint64 test 3 (28367, 28367)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(28367n); - input.add64(28367n); + 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.contract3.max_euint16_euint64( + 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.contract3.res64()); - expect(res).to.equal(28367n); + const res = await decrypt64(await this.contract5.res64()); + expect(res).to.equal(4n); }); - it('test operator "max" overload (euint16, euint64) => euint64 test 4 (28367, 28363)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(28367n); - input.add64(28363n); + 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.contract3.max_euint16_euint64( + 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.contract3.res64()); - expect(res).to.equal(28367n); + 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/test/tfheOperations/tfheOperations7.ts b/test/tfheOperations/tfheOperations7.ts index 90f485ee..078e9d2d 100644 --- a/test/tfheOperations/tfheOperations7.ts +++ b/test/tfheOperations/tfheOperations7.ts @@ -7,7 +7,22 @@ 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 { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance'; +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 { @@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise { 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); @@ -105,2099 +175,4615 @@ describe('TFHE operations 7', function () { 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 (euint16, uint16) => euint16 test 1 (12135, 52126)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12135n); - + 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.contract3.add_euint16_uint16(encryptedAmount.handles[0], 52126n, encryptedAmount.inputProof); + const tx = await this.contract6.min_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(64261n); + const res = await decrypt256(await this.contract6.res256()); + expect(res).to.equal(3608929890n); }); - it('test operator "add" overload (euint16, uint16) => euint16 test 2 (12131, 12135)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12131n); - + 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.contract3.add_euint16_uint16(encryptedAmount.handles[0], 12135n, encryptedAmount.inputProof); + const tx = await this.contract6.min_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(24266n); + const res = await decrypt256(await this.contract6.res256()); + expect(res).to.equal(3608929886n); }); - it('test operator "add" overload (euint16, uint16) => euint16 test 3 (12135, 12135)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12135n); - + 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.contract3.add_euint16_uint16(encryptedAmount.handles[0], 12135n, encryptedAmount.inputProof); + const tx = await this.contract6.min_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(24270n); + const res = await decrypt256(await this.contract6.res256()); + expect(res).to.equal(3608929890n); }); - it('test operator "add" overload (euint16, uint16) => euint16 test 4 (12135, 12131)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12135n); - + 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.contract3.add_euint16_uint16(encryptedAmount.handles[0], 12131n, encryptedAmount.inputProof); + const tx = await this.contract6.min_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(24266n); + const res = await decrypt256(await this.contract6.res256()); + expect(res).to.equal(3608929886n); }); - it('test operator "add" overload (uint16, euint16) => euint16 test 1 (12140, 26064)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add16(26064n); + 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.contract3.add_uint16_euint16(12140n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.max_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(38204n); + const res = await decrypt256(await this.contract6.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579470316273335423n); }); - it('test operator "add" overload (uint16, euint16) => euint16 test 2 (12131, 12135)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add16(12135n); + 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.contract3.add_uint16_euint16(12131n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.max_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(24266n); + const res = await decrypt256(await this.contract6.res256()); + expect(res).to.equal(2079496081n); }); - it('test operator "add" overload (uint16, euint16) => euint16 test 3 (12135, 12135)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add16(12135n); + 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.contract3.add_uint16_euint16(12135n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.max_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(24270n); + const res = await decrypt256(await this.contract6.res256()); + expect(res).to.equal(2079496081n); }); - it('test operator "add" overload (uint16, euint16) => euint16 test 4 (12135, 12131)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add16(12131n); + 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.contract3.add_uint16_euint16(12135n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.max_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(24266n); + const res = await decrypt256(await this.contract6.res256()); + expect(res).to.equal(2079496081n); }); - it('test operator "sub" overload (euint16, uint16) => euint16 test 1 (3171, 3171)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(3171n); + 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.contract3.sub_euint16_uint16(encryptedAmount.handles[0], 3171n, encryptedAmount.inputProof); + const tx = await this.contract6.add_euint32_uint32( + encryptedAmount.handles[0], + 749023821n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(0n); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(2604568723n); }); - it('test operator "sub" overload (euint16, uint16) => euint16 test 2 (3171, 3167)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(3171n); + 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.contract3.sub_euint16_uint16(encryptedAmount.handles[0], 3167n, encryptedAmount.inputProof); + const tx = await this.contract6.add_euint32_uint32( + encryptedAmount.handles[0], + 1743021443n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(4n); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(3486042884n); }); - it('test operator "sub" overload (uint16, euint16) => euint16 test 1 (3171, 3171)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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); - input.add16(3171n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.sub_uint16_euint16(3171n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.add_euint32_uint32( + encryptedAmount.handles[0], + 1743021443n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(0n); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(3486042886n); }); - it('test operator "sub" overload (uint16, euint16) => euint16 test 2 (3171, 3167)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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); - input.add16(3167n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.sub_uint16_euint16(3171n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.add_euint32_uint32( + encryptedAmount.handles[0], + 1743021441n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(4n); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(3486042884n); }); - it('test operator "mul" overload (euint16, uint16) => euint16 test 1 (78, 344)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(78n); + 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.contract3.mul_euint16_uint16(encryptedAmount.handles[0], 344n, encryptedAmount.inputProof); + const tx = await this.contract6.add_uint32_euint32( + 1745146365n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(26832n); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(3243194005n); }); - it('test operator "mul" overload (euint16, uint16) => euint16 test 2 (155, 155)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(155n); + 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.contract3.mul_euint16_uint16(encryptedAmount.handles[0], 155n, encryptedAmount.inputProof); + const tx = await this.contract6.add_uint32_euint32( + 1743021441n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(24025n); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(3486042884n); }); - it('test operator "mul" overload (euint16, uint16) => euint16 test 3 (155, 155)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(155n); + 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.contract3.mul_euint16_uint16(encryptedAmount.handles[0], 155n, encryptedAmount.inputProof); + const tx = await this.contract6.add_uint32_euint32( + 1743021443n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(24025n); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(3486042886n); }); - it('test operator "mul" overload (euint16, uint16) => euint16 test 4 (155, 155)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(155n); + 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.contract3.mul_euint16_uint16(encryptedAmount.handles[0], 155n, encryptedAmount.inputProof); + const tx = await this.contract6.add_uint32_euint32( + 1743021443n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(24025n); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(3486042884n); }); - it('test operator "mul" overload (uint16, euint16) => euint16 test 1 (256, 173)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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); - input.add16(173n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_uint16_euint16(256n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.sub_euint32_uint32( + encryptedAmount.handles[0], + 1818111464n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(44288n); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(0n); }); - it('test operator "mul" overload (uint16, euint16) => euint16 test 2 (155, 155)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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); - input.add16(155n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_uint16_euint16(155n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.sub_euint32_uint32( + encryptedAmount.handles[0], + 1818111460n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(24025n); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(4n); }); - it('test operator "mul" overload (uint16, euint16) => euint16 test 3 (155, 155)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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.add16(155n); + input.add32(1818111464n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_uint16_euint16(155n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.sub_uint32_euint32( + 1818111464n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(24025n); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(0n); }); - it('test operator "mul" overload (uint16, euint16) => euint16 test 4 (155, 155)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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.add16(155n); + input.add32(1818111460n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_uint16_euint16(155n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.sub_uint32_euint32( + 1818111464n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(24025n); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(4n); }); - it('test operator "div" overload (euint16, uint16) => euint16 test 1 (8852, 38586)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8852n); + 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.contract3.div_euint16_uint16(encryptedAmount.handles[0], 38586n, encryptedAmount.inputProof); + const tx = await this.contract6.mul_euint32_uint32(encryptedAmount.handles[0], 45037n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(0n); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(2164298072n); }); - it('test operator "div" overload (euint16, uint16) => euint16 test 2 (8848, 8852)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8848n); + 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.contract3.div_euint16_uint16(encryptedAmount.handles[0], 8852n, encryptedAmount.inputProof); + const tx = await this.contract6.mul_euint32_uint32(encryptedAmount.handles[0], 47710n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(0n); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(2276244100n); }); - it('test operator "div" overload (euint16, uint16) => euint16 test 3 (8852, 8852)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8852n); + 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.contract3.div_euint16_uint16(encryptedAmount.handles[0], 8852n, encryptedAmount.inputProof); + const tx = await this.contract6.mul_euint32_uint32(encryptedAmount.handles[0], 47710n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(1n); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(2276244100n); }); - it('test operator "div" overload (euint16, uint16) => euint16 test 4 (8852, 8848)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8852n); + 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.contract3.div_euint16_uint16(encryptedAmount.handles[0], 8848n, encryptedAmount.inputProof); + const tx = await this.contract6.mul_euint32_uint32(encryptedAmount.handles[0], 47710n, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(1n); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(2276244100n); }); - it('test operator "rem" overload (euint16, uint16) => euint16 test 1 (53463, 2321)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(53463n); + 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.contract3.rem_euint16_uint16(encryptedAmount.handles[0], 2321n, encryptedAmount.inputProof); + const tx = await this.contract6.mul_uint32_euint32(25623n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(80n); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(1153983051n); }); - it('test operator "rem" overload (euint16, uint16) => euint16 test 2 (20898, 20902)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(20898n); + 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.contract3.rem_euint16_uint16(encryptedAmount.handles[0], 20902n, encryptedAmount.inputProof); + const tx = await this.contract6.mul_uint32_euint32(47710n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(20898n); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(2276244100n); }); - it('test operator "rem" overload (euint16, uint16) => euint16 test 3 (20902, 20902)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(20902n); + 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.contract3.rem_euint16_uint16(encryptedAmount.handles[0], 20902n, encryptedAmount.inputProof); + const tx = await this.contract6.mul_uint32_euint32(47710n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(0n); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(2276244100n); }); - it('test operator "rem" overload (euint16, uint16) => euint16 test 4 (20902, 20898)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(20902n); + 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.contract3.rem_euint16_uint16(encryptedAmount.handles[0], 20898n, encryptedAmount.inputProof); + const tx = await this.contract6.mul_uint32_euint32(47710n, encryptedAmount.handles[0], encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(4n); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(2276244100n); }); - it('test operator "eq" overload (euint16, uint16) => ebool test 1 (63705, 39705)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(63705n); + 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.contract3.eq_euint16_uint16(encryptedAmount.handles[0], 39705n, encryptedAmount.inputProof); + const tx = await this.contract6.div_euint32_uint32( + encryptedAmount.handles[0], + 1624831749n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(0n); }); - it('test operator "eq" overload (euint16, uint16) => ebool test 2 (3245, 3249)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(3245n); + 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.contract3.eq_euint16_uint16(encryptedAmount.handles[0], 3249n, encryptedAmount.inputProof); + const tx = await this.contract6.div_euint32_uint32( + encryptedAmount.handles[0], + 1492630984n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(0n); }); - it('test operator "eq" overload (euint16, uint16) => ebool test 3 (3249, 3249)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(3249n); + 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.contract3.eq_euint16_uint16(encryptedAmount.handles[0], 3249n, encryptedAmount.inputProof); + const tx = await this.contract6.div_euint32_uint32( + encryptedAmount.handles[0], + 1492630984n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(1n); }); - it('test operator "eq" overload (euint16, uint16) => ebool test 4 (3249, 3245)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(3249n); + 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.contract3.eq_euint16_uint16(encryptedAmount.handles[0], 3245n, encryptedAmount.inputProof); + const tx = await this.contract6.div_euint32_uint32( + encryptedAmount.handles[0], + 1492630980n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(1n); }); - it('test operator "eq" overload (uint16, euint16) => ebool test 1 (28254, 39705)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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); - input.add16(39705n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_uint16_euint16(28254n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.rem_euint32_uint32( + encryptedAmount.handles[0], + 2150413493n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(631407091n); }); - it('test operator "eq" overload (uint16, euint16) => ebool test 2 (3245, 3249)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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); - input.add16(3249n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_uint16_euint16(3245n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.rem_euint32_uint32( + encryptedAmount.handles[0], + 631407091n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(631407087n); }); - it('test operator "eq" overload (uint16, euint16) => ebool test 3 (3249, 3249)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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); - input.add16(3249n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_uint16_euint16(3249n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.rem_euint32_uint32( + encryptedAmount.handles[0], + 631407091n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(0n); }); - it('test operator "eq" overload (uint16, euint16) => ebool test 4 (3249, 3245)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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); - input.add16(3245n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_uint16_euint16(3249n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.rem_euint32_uint32( + encryptedAmount.handles[0], + 631407087n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(4n); }); - it('test operator "ne" overload (euint16, uint16) => ebool test 1 (27750, 3479)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(27750n); + 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.contract3.ne_euint16_uint16(encryptedAmount.handles[0], 3479n, encryptedAmount.inputProof); + const tx = await this.contract6.and_euint32_uint32( + encryptedAmount.handles[0], + 510484248n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(69816080n); }); - it('test operator "ne" overload (euint16, uint16) => ebool test 2 (23847, 23851)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(23847n); + 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.contract3.ne_euint16_uint16(encryptedAmount.handles[0], 23851n, encryptedAmount.inputProof); + const tx = await this.contract6.and_euint32_uint32( + encryptedAmount.handles[0], + 1342588191n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(1342588187n); }); - it('test operator "ne" overload (euint16, uint16) => ebool test 3 (23851, 23851)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(23851n); + 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.contract3.ne_euint16_uint16(encryptedAmount.handles[0], 23851n, encryptedAmount.inputProof); + const tx = await this.contract6.and_euint32_uint32( + encryptedAmount.handles[0], + 1342588191n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(1342588191n); }); - it('test operator "ne" overload (euint16, uint16) => ebool test 4 (23851, 23847)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(23851n); + 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.contract3.ne_euint16_uint16(encryptedAmount.handles[0], 23847n, encryptedAmount.inputProof); + const tx = await this.contract6.and_euint32_uint32( + encryptedAmount.handles[0], + 1342588187n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(1342588187n); }); - it('test operator "ne" overload (uint16, euint16) => ebool test 1 (20385, 3479)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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.add16(3479n); + input.add32(510484248n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_uint16_euint16(20385n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.and_uint32_euint32( + 3731064608n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(509675264n); }); - it('test operator "ne" overload (uint16, euint16) => ebool test 2 (23847, 23851)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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.add16(23851n); + input.add32(1342588191n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_uint16_euint16(23847n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.and_uint32_euint32( + 1342588187n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(1342588187n); }); - it('test operator "ne" overload (uint16, euint16) => ebool test 3 (23851, 23851)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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.add16(23851n); + input.add32(1342588191n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_uint16_euint16(23851n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.and_uint32_euint32( + 1342588191n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(1342588191n); }); - it('test operator "ne" overload (uint16, euint16) => ebool test 4 (23851, 23847)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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.add16(23847n); + input.add32(1342588187n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_uint16_euint16(23851n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.and_uint32_euint32( + 1342588191n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(1342588187n); }); - it('test operator "ge" overload (euint16, uint16) => ebool test 1 (8825, 23737)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8825n); + 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.contract3.ge_euint16_uint16(encryptedAmount.handles[0], 23737n, encryptedAmount.inputProof); + const tx = await this.contract6.or_euint32_uint32( + encryptedAmount.handles[0], + 1007760424n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(2111255979n); }); - it('test operator "ge" overload (euint16, uint16) => ebool test 2 (8821, 8825)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8821n); + 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.contract3.ge_euint16_uint16(encryptedAmount.handles[0], 8825n, encryptedAmount.inputProof); + const tx = await this.contract6.or_euint32_uint32( + encryptedAmount.handles[0], + 1244554527n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(1244554527n); }); - it('test operator "ge" overload (euint16, uint16) => ebool test 3 (8825, 8825)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8825n); + 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.contract3.ge_euint16_uint16(encryptedAmount.handles[0], 8825n, encryptedAmount.inputProof); + const tx = await this.contract6.or_euint32_uint32( + encryptedAmount.handles[0], + 1244554527n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(1244554527n); }); - it('test operator "ge" overload (euint16, uint16) => ebool test 4 (8825, 8821)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8825n); + 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.contract3.ge_euint16_uint16(encryptedAmount.handles[0], 8821n, encryptedAmount.inputProof); + const tx = await this.contract6.or_euint32_uint32( + encryptedAmount.handles[0], + 1244554523n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(1244554527n); }); - it('test operator "ge" overload (uint16, euint16) => ebool test 1 (43508, 23737)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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.add16(23737n); + input.add32(1007760424n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_uint16_euint16(43508n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.or_uint32_euint32( + 1405809228n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(2145121900n); }); - it('test operator "ge" overload (uint16, euint16) => ebool test 2 (8821, 8825)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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.add16(8825n); + input.add32(1244554527n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_uint16_euint16(8821n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.or_uint32_euint32( + 1244554523n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(1244554527n); }); - it('test operator "ge" overload (uint16, euint16) => ebool test 3 (8825, 8825)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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.add16(8825n); + input.add32(1244554527n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_uint16_euint16(8825n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.or_uint32_euint32( + 1244554527n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(1244554527n); }); - it('test operator "ge" overload (uint16, euint16) => ebool test 4 (8825, 8821)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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.add16(8821n); + input.add32(1244554523n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_uint16_euint16(8825n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.or_uint32_euint32( + 1244554527n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(1244554527n); }); - it('test operator "gt" overload (euint16, uint16) => ebool test 1 (33735, 40439)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(33735n); + 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.contract3.gt_euint16_uint16(encryptedAmount.handles[0], 40439n, encryptedAmount.inputProof); + const tx = await this.contract6.xor_euint32_uint32( + encryptedAmount.handles[0], + 3890491814n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(124052762n); }); - it('test operator "gt" overload (euint16, uint16) => ebool test 2 (33731, 33735)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(33731n); + 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.contract3.gt_euint16_uint16(encryptedAmount.handles[0], 33735n, encryptedAmount.inputProof); + const tx = await this.contract6.xor_euint32_uint32( + encryptedAmount.handles[0], + 3557659859n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(28n); }); - it('test operator "gt" overload (euint16, uint16) => ebool test 3 (33735, 33735)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(33735n); + 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.contract3.gt_euint16_uint16(encryptedAmount.handles[0], 33735n, encryptedAmount.inputProof); + const tx = await this.contract6.xor_euint32_uint32( + encryptedAmount.handles[0], + 3557659859n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); + const res = await decrypt32(await this.contract6.res32()); + expect(res).to.equal(0n); }); - it('test operator "gt" overload (euint16, uint16) => ebool test 4 (33735, 33731)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(33735n); + 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.contract3.gt_euint16_uint16(encryptedAmount.handles[0], 33731n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); + 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 "gt" overload (uint16, euint16) => ebool test 1 (47103, 40439)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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.add16(40439n); + input.add32(826320072n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_uint16_euint16(47103n, encryptedAmount.handles[0], encryptedAmount.inputProof); + 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.contract3.resb()); + const res = await decryptBool(await this.contract6.resb()); expect(res).to.equal(true); }); - it('test operator "gt" overload (uint16, euint16) => ebool test 2 (33731, 33735)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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.add16(33735n); + input.add32(440396727n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_uint16_euint16(33731n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.ne_uint32_euint32( + 440396727n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); + const res = await decryptBool(await this.contract6.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (uint16, euint16) => ebool test 3 (33735, 33735)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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); - input.add16(33735n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_uint16_euint16(33735n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.ge_euint32_uint32( + encryptedAmount.handles[0], + 907768232n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); + const res = await decryptBool(await this.contract6.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (uint16, euint16) => ebool test 4 (33735, 33731)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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.add16(33731n); + input.add32(603878469n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_uint16_euint16(33735n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.ge_uint32_euint32( + 2155494187n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); + const res = await decryptBool(await this.contract6.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint16, uint16) => ebool test 1 (38605, 15668)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(38605n); + 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.contract3.le_euint16_uint16(encryptedAmount.handles[0], 15668n, encryptedAmount.inputProof); + const tx = await this.contract6.ge_uint32_euint32( + 907768228n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); + const res = await decryptBool(await this.contract6.resb()); expect(res).to.equal(false); }); - it('test operator "le" overload (euint16, uint16) => ebool test 2 (38601, 38605)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(38601n); + 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.contract3.le_euint16_uint16(encryptedAmount.handles[0], 38605n, encryptedAmount.inputProof); + const tx = await this.contract6.gt_euint32_uint32( + encryptedAmount.handles[0], + 3726690353n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); + const res = await decryptBool(await this.contract6.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint16, uint16) => ebool test 3 (38605, 38605)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(38605n); + 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.contract3.le_euint16_uint16(encryptedAmount.handles[0], 38605n, encryptedAmount.inputProof); + const tx = await this.contract6.gt_euint32_uint32( + encryptedAmount.handles[0], + 619151912n, + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); + const res = await decryptBool(await this.contract6.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint16, uint16) => ebool test 4 (38605, 38601)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(38605n); + 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.contract3.le_euint16_uint16(encryptedAmount.handles[0], 38601n, encryptedAmount.inputProof); + const tx = await this.contract6.gt_uint32_euint32( + 3642906183n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); + const res = await decryptBool(await this.contract6.resb()); expect(res).to.equal(false); }); - it('test operator "le" overload (uint16, euint16) => ebool test 1 (26564, 15668)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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.add16(15668n); + input.add32(619151916n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_uint16_euint16(26564n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.gt_uint32_euint32( + 619151912n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); + const res = await decryptBool(await this.contract6.resb()); expect(res).to.equal(false); }); - it('test operator "le" overload (uint16, euint16) => ebool test 2 (38601, 38605)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + 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.add16(38605n); + input.add32(619151916n); const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_uint16_euint16(38601n, encryptedAmount.handles[0], encryptedAmount.inputProof); + 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.contract3.resb()); + const res = await decryptBool(await this.contract6.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (uint16, euint16) => ebool test 3 (38605, 38605)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add16(38605n); + 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.contract3.le_uint16_euint16(38605n, encryptedAmount.handles[0], encryptedAmount.inputProof); + 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.contract3.resb()); + const res = await decryptBool(await this.contract6.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (uint16, euint16) => ebool test 4 (38605, 38601)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add16(38601n); + 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.contract3.le_uint16_euint16(38605n, encryptedAmount.handles[0], encryptedAmount.inputProof); + 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.contract3.resb()); + const res = await decryptBool(await this.contract6.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint16, uint16) => ebool test 1 (59332, 5218)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(59332n); - + 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.contract3.lt_euint16_uint16(encryptedAmount.handles[0], 5218n, encryptedAmount.inputProof); + 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.contract3.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract6.resb()); + expect(res).to.equal(true); }); - it('test operator "lt" overload (euint16, uint16) => ebool test 2 (12423, 12427)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12423n); - + 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.contract3.lt_euint16_uint16(encryptedAmount.handles[0], 12427n, encryptedAmount.inputProof); + 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.contract3.resb()); + const res = await decryptBool(await this.contract6.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (euint16, uint16) => ebool test 3 (12427, 12427)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12427n); - + 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.contract3.lt_euint16_uint16(encryptedAmount.handles[0], 12427n, encryptedAmount.inputProof); + 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.contract3.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract6.resb()); + expect(res).to.equal(true); }); - it('test operator "lt" overload (euint16, uint16) => ebool test 4 (12427, 12423)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12427n); - + 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.contract3.lt_euint16_uint16(encryptedAmount.handles[0], 12423n, encryptedAmount.inputProof); + 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.contract3.resb()); + const res = await decryptBool(await this.contract6.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (uint16, euint16) => ebool test 1 (8638, 5218)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add16(5218n); + 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.contract3.lt_uint16_euint16(8638n, encryptedAmount.handles[0], encryptedAmount.inputProof); + 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.contract3.resb()); + const res = await decryptBool(await this.contract6.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (uint16, euint16) => ebool test 2 (12423, 12427)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add16(12427n); + 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.contract3.lt_uint16_euint16(12423n, encryptedAmount.handles[0], encryptedAmount.inputProof); + 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.contract3.resb()); + const res = await decryptBool(await this.contract6.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (uint16, euint16) => ebool test 3 (12427, 12427)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add16(12427n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_uint16_euint16(12427n, 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 (uint16, euint16) => ebool test 4 (12427, 12423)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add16(12423n); + 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.contract3.lt_uint16_euint16(12427n, encryptedAmount.handles[0], encryptedAmount.inputProof); + 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.contract3.resb()); + const res = await decryptBool(await this.contract6.resb()); expect(res).to.equal(false); }); - it('test operator "min" overload (euint16, uint16) => euint16 test 1 (18209, 9598)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(18209n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint16_uint16(encryptedAmount.handles[0], 9598n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(9598n); - }); - - it('test operator "min" overload (euint16, uint16) => euint16 test 2 (14692, 14696)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(14692n); - + 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.contract3.min_euint16_uint16(encryptedAmount.handles[0], 14696n, encryptedAmount.inputProof); + const tx = await this.contract6.le_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(14692n); + const res = await decryptBool(await this.contract6.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (euint16, uint16) => euint16 test 3 (14696, 14696)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(14696n); - + 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.contract3.min_euint16_uint16(encryptedAmount.handles[0], 14696n, encryptedAmount.inputProof); + const tx = await this.contract6.le_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(14696n); + const res = await decryptBool(await this.contract6.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (euint16, uint16) => euint16 test 4 (14696, 14692)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(14696n); - + 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.contract3.min_euint16_uint16(encryptedAmount.handles[0], 14692n, encryptedAmount.inputProof); + const tx = await this.contract6.le_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(14692n); + const res = await decryptBool(await this.contract6.resb()); + expect(res).to.equal(false); }); - it('test operator "min" overload (uint16, euint16) => euint16 test 1 (16454, 9598)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add16(9598n); + 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.contract3.min_uint16_euint16(16454n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.lt_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(9598n); + const res = await decryptBool(await this.contract6.resb()); + expect(res).to.equal(false); }); - it('test operator "min" overload (uint16, euint16) => euint16 test 2 (14692, 14696)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add16(14696n); + 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.contract3.min_uint16_euint16(14692n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.lt_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(14692n); + const res = await decryptBool(await this.contract6.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (uint16, euint16) => euint16 test 3 (14696, 14696)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add16(14696n); + 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.contract3.min_uint16_euint16(14696n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.lt_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(14696n); + const res = await decryptBool(await this.contract6.resb()); + expect(res).to.equal(false); }); - it('test operator "min" overload (uint16, euint16) => euint16 test 4 (14696, 14692)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add16(14692n); + 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.contract3.min_uint16_euint16(14696n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.lt_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(14692n); + const res = await decryptBool(await this.contract6.resb()); + expect(res).to.equal(false); }); - it('test operator "max" overload (euint16, uint16) => euint16 test 1 (35722, 5145)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(35722n); - + 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.contract3.max_euint16_uint16(encryptedAmount.handles[0], 5145n, encryptedAmount.inputProof); + const tx = await this.contract6.min_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(35722n); + const res = await decrypt64(await this.contract6.res64()); + expect(res).to.equal(64n); }); - it('test operator "max" overload (euint16, uint16) => euint16 test 2 (7684, 7688)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(7684n); - + 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.contract3.max_euint16_uint16(encryptedAmount.handles[0], 7688n, encryptedAmount.inputProof); + const tx = await this.contract6.min_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(7688n); + const res = await decrypt64(await this.contract6.res64()); + expect(res).to.equal(60n); }); - it('test operator "max" overload (euint16, uint16) => euint16 test 3 (7688, 7688)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(7688n); - + 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.contract3.max_euint16_uint16(encryptedAmount.handles[0], 7688n, encryptedAmount.inputProof); + const tx = await this.contract6.min_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(7688n); + const res = await decrypt64(await this.contract6.res64()); + expect(res).to.equal(64n); }); - it('test operator "max" overload (euint16, uint16) => euint16 test 4 (7688, 7684)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(7688n); - + 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.contract3.max_euint16_uint16(encryptedAmount.handles[0], 7684n, encryptedAmount.inputProof); + const tx = await this.contract6.min_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(7688n); + const res = await decrypt64(await this.contract6.res64()); + expect(res).to.equal(60n); }); - it('test operator "max" overload (uint16, euint16) => euint16 test 1 (56359, 5145)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add16(5145n); + 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.contract3.max_uint16_euint16(56359n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.max_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(56359n); + const res = await decrypt64(await this.contract6.res64()); + expect(res).to.equal(18437818308322976495n); }); - it('test operator "max" overload (uint16, euint16) => euint16 test 2 (7684, 7688)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add16(7688n); + 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.contract3.max_uint16_euint16(7684n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.max_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(7688n); + const res = await decrypt64(await this.contract6.res64()); + expect(res).to.equal(86n); }); - it('test operator "max" overload (uint16, euint16) => euint16 test 3 (7688, 7688)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add16(7688n); + 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.contract3.max_uint16_euint16(7688n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.max_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(7688n); + const res = await decrypt64(await this.contract6.res64()); + expect(res).to.equal(86n); }); - it('test operator "max" overload (uint16, euint16) => euint16 test 4 (7688, 7684)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add16(7684n); + 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.contract3.max_uint16_euint16(7688n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract6.max_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(7688n); + const res = await decrypt64(await this.contract6.res64()); + expect(res).to.equal(86n); }); - it('test operator "add" overload (euint32, euint4) => euint32 test 1 (12, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(12n); - input.add4(2n); + 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.contract3.add_euint32_euint4( + const tx = await this.contract7.add_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(14n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(65534n); }); - it('test operator "add" overload (euint32, euint4) => euint32 test 2 (4, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(4n); - input.add4(6n); + 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.contract3.add_euint32_euint4( + const tx = await this.contract7.add_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(10n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(46010n); }); - it('test operator "add" overload (euint32, euint4) => euint32 test 3 (6, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(6n); - input.add4(6n); + 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.contract3.add_euint32_euint4( + const tx = await this.contract7.add_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(12n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(46012n); }); - it('test operator "add" overload (euint32, euint4) => euint32 test 4 (6, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(6n); - input.add4(4n); + 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.contract3.add_euint32_euint4( + const tx = await this.contract7.add_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(10n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(46010n); }); - it('test operator "sub" overload (euint32, euint4) => euint32 test 1 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(8n); - input.add4(8n); + 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.contract3.sub_euint32_euint4( + const tx = await this.contract7.sub_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); + const res = await decrypt64(await this.contract7.res64()); 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.contract3Address, this.signers.alice.address); - input.add32(8n); - input.add4(4n); + 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.contract3.sub_euint32_euint4( + const tx = await this.contract7.sub_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); + const res = await decrypt64(await this.contract7.res64()); expect(res).to.equal(4n); }); - it('test operator "mul" overload (euint32, euint4) => euint32 test 1 (5, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(5n); - input.add4(2n); + 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.contract3.mul_euint32_euint4( + const tx = await this.contract7.mul_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(10n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(65508n); }); - it('test operator "mul" overload (euint32, euint4) => euint32 test 2 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(3n); - input.add4(3n); + 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.contract3.mul_euint32_euint4( + const tx = await this.contract7.mul_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(9n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(36481n); }); - it('test operator "mul" overload (euint32, euint4) => euint32 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(3n); - input.add4(3n); + 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.contract3.mul_euint32_euint4( + const tx = await this.contract7.mul_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(9n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(36481n); }); - it('test operator "mul" overload (euint32, euint4) => euint32 test 4 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(3n); - input.add4(3n); + 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.contract3.mul_euint32_euint4( + const tx = await this.contract7.mul_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(9n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(36481n); }); - it('test operator "and" overload (euint32, euint4) => euint32 test 1 (2599330540, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(2599330540n); - input.add4(1n); + 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.contract3.and_euint32_euint4( + const tx = await this.contract7.and_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(0n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(6184n); }); - it('test operator "and" overload (euint32, euint4) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(4n); - input.add4(8n); + 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.contract3.and_euint32_euint4( + const tx = await this.contract7.and_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(0n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(48176n); }); - it('test operator "and" overload (euint32, euint4) => euint32 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(8n); - input.add4(8n); + 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.contract3.and_euint32_euint4( + const tx = await this.contract7.and_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(8n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(48184n); }); - it('test operator "and" overload (euint32, euint4) => euint32 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(8n); - input.add4(4n); + 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.contract3.and_euint32_euint4( + const tx = await this.contract7.and_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(0n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(48176n); }); - it('test operator "or" overload (euint32, euint4) => euint32 test 1 (2761097401, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(2761097401n); - input.add4(13n); + 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.contract3.or_euint32_euint4( + const tx = await this.contract7.or_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(2761097405n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18445256696814041085n); }); - it('test operator "or" overload (euint32, euint4) => euint32 test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(9n); - input.add4(13n); + 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.contract3.or_euint32_euint4( + const tx = await this.contract7.or_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(13n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(63476n); }); - it('test operator "or" overload (euint32, euint4) => euint32 test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(13n); - input.add4(13n); + 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.contract3.or_euint32_euint4( + const tx = await this.contract7.or_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(13n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(63476n); }); - it('test operator "or" overload (euint32, euint4) => euint32 test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(13n); - input.add4(9n); + 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.contract3.or_euint32_euint4( + const tx = await this.contract7.or_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(13n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(63476n); }); - it('test operator "xor" overload (euint32, euint4) => euint32 test 1 (2588014920, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(2588014920n); - input.add4(3n); + 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.contract3.xor_euint32_euint4( + const tx = await this.contract7.xor_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(2588014923n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18446196219353101576n); }); - it('test operator "xor" overload (euint32, euint4) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(4n); - input.add4(8n); + 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.contract3.xor_euint32_euint4( + const tx = await this.contract7.xor_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(12n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(4n); }); - it('test operator "xor" overload (euint32, euint4) => euint32 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(8n); - input.add4(8n); + 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.contract3.xor_euint32_euint4( + const tx = await this.contract7.xor_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); + const res = await decrypt64(await this.contract7.res64()); 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.contract3Address, this.signers.alice.address); - input.add32(8n); - input.add4(4n); + 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.contract3.xor_euint32_euint4( + const tx = await this.contract7.xor_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(12n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(4n); }); - it('test operator "eq" overload (euint32, euint4) => ebool test 1 (3027950561, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(3027950561n); - input.add4(14n); + 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.contract3.eq_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint32, euint4) => ebool test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(10n); - input.add4(14n); + 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.contract3.eq_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint32, euint4) => ebool test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(14n); - input.add4(14n); + 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.contract3.eq_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "eq" overload (euint32, euint4) => ebool test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(14n); - input.add4(10n); + 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.contract3.eq_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint32, euint4) => ebool test 1 (2599901708, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(2599901708n); - input.add4(3n); + 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.contract3.ne_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint32, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(4n); - input.add4(8n); + 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.contract3.ne_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint32, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(8n); - input.add4(8n); + 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.contract3.ne_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint32, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(8n); - input.add4(4n); + 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.contract3.ne_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint32, euint4) => ebool test 1 (1601227311, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(1601227311n); - input.add4(14n); + 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.contract3.ge_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint32, euint4) => ebool test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(10n); - input.add4(14n); + 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.contract3.ge_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "ge" overload (euint32, euint4) => ebool test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(14n); - input.add4(14n); + 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.contract3.ge_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint32, euint4) => ebool test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(14n); - input.add4(10n); + 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.contract3.ge_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "gt" overload (euint32, euint4) => ebool test 1 (3548820179, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(3548820179n); - input.add4(1n); + 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.contract3.gt_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.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.contract3Address, this.signers.alice.address); - input.add32(4n); - input.add4(8n); + 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.contract3.gt_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.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.contract3Address, this.signers.alice.address); - input.add32(8n); - input.add4(8n); + 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.contract3.gt_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.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.contract3Address, this.signers.alice.address); - input.add32(8n); - input.add4(4n); + 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.contract3.gt_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint32, euint4) => ebool test 1 (681177958, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(681177958n); - input.add4(4n); + 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.contract3.le_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.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.contract3Address, this.signers.alice.address); - input.add32(4n); - input.add4(8n); + 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.contract3.le_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.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.contract3Address, this.signers.alice.address); - input.add32(8n); - input.add4(8n); + 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.contract3.le_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.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.contract3Address, this.signers.alice.address); - input.add32(8n); - input.add4(4n); + 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.contract3.le_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint32, euint4) => ebool test 1 (928445097, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(928445097n); - input.add4(2n); + 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.contract3.lt_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.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.contract3Address, this.signers.alice.address); - input.add32(4n); - input.add4(8n); + 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.contract3.lt_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.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.contract3Address, this.signers.alice.address); - input.add32(8n); - input.add4(8n); + 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.contract3.lt_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.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.contract3Address, this.signers.alice.address); - input.add32(8n); - input.add4(4n); + 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.contract3.lt_euint32_euint4( + 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.contract3.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "min" overload (euint32, euint4) => euint32 test 1 (2403125524, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(2403125524n); - input.add4(11n); + 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.contract3.min_euint32_euint4( + const tx = await this.contract7.min_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(11n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(42816n); }); - it('test operator "min" overload (euint32, euint4) => euint32 test 2 (7, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(7n); - input.add4(11n); + 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.contract3.min_euint32_euint4( + const tx = await this.contract7.min_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(7n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(42812n); }); - it('test operator "min" overload (euint32, euint4) => euint32 test 3 (11, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(11n); - input.add4(11n); + 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.contract3.min_euint32_euint4( + const tx = await this.contract7.min_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(11n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(42816n); }); - it('test operator "min" overload (euint32, euint4) => euint32 test 4 (11, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(11n); - input.add4(7n); + 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.contract3.min_euint32_euint4( + const tx = await this.contract7.min_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(7n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(42812n); }); - it('test operator "max" overload (euint32, euint4) => euint32 test 1 (1272584917, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(1272584917n); - input.add4(14n); + 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.contract3.max_euint32_euint4( + const tx = await this.contract7.max_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(1272584917n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18446109140882718991n); }); - it('test operator "max" overload (euint32, euint4) => euint32 test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(10n); - input.add4(14n); + 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.contract3.max_euint32_euint4( + const tx = await this.contract7.max_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(14n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(19434n); }); - it('test operator "max" overload (euint32, euint4) => euint32 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(14n); - input.add4(14n); + 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.contract3.max_euint32_euint4( + const tx = await this.contract7.max_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(14n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(19434n); }); - it('test operator "max" overload (euint32, euint4) => euint32 test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(14n); - input.add4(10n); + 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.contract3.max_euint32_euint4( + const tx = await this.contract7.max_euint64_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(14n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(19434n); }); - it('test operator "add" overload (euint32, euint8) => euint32 test 1 (153, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(153n); - input.add8(2n); + 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.contract3.add_euint32_euint8( + const tx = await this.contract7.add_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(155n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(4294529097n); }); - it('test operator "add" overload (euint32, euint8) => euint32 test 2 (123, 125)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(123n); - input.add8(125n); + 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.contract3.add_euint32_euint8( + const tx = await this.contract7.add_euint64_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); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(3545338196n); }); - it('test operator "add" overload (euint32, euint8) => euint32 test 3 (125, 125)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(125n); - input.add8(125n); + 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.contract3.add_euint32_euint8( + const tx = await this.contract7.add_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(250n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(3545338198n); }); - it('test operator "add" overload (euint32, euint8) => euint32 test 4 (125, 123)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(125n); - input.add8(123n); + 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.contract3.add_euint32_euint8( + const tx = await this.contract7.add_euint64_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); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(3545338196n); }); - it('test operator "sub" overload (euint32, euint8) => euint32 test 1 (52, 52)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(52n); - input.add8(52n); + 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.contract3.sub_euint32_euint8( + const tx = await this.contract7.sub_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); + const res = await decrypt64(await this.contract7.res64()); expect(res).to.equal(0n); }); - it('test operator "sub" overload (euint32, euint8) => euint32 test 2 (52, 48)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(52n); - input.add8(48n); + 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.contract3.sub_euint32_euint8( + const tx = await this.contract7.sub_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); + const res = await decrypt64(await this.contract7.res64()); expect(res).to.equal(4n); }); - it('test operator "mul" overload (euint32, euint8) => euint32 test 1 (102, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(102n); - input.add8(2n); + 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.contract3.mul_euint32_euint8( + const tx = await this.contract7.mul_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(204n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(4294926604n); }); - it('test operator "mul" overload (euint32, euint8) => euint32 test 2 (10, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(10n); - input.add8(12n); + 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.contract3.mul_euint32_euint8( + const tx = await this.contract7.mul_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(120n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(3882909969n); }); - it('test operator "mul" overload (euint32, euint8) => euint32 test 3 (12, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(12n); - input.add8(12n); + 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.contract3.mul_euint32_euint8( + const tx = await this.contract7.mul_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(144n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(3882909969n); }); - it('test operator "mul" overload (euint32, euint8) => euint32 test 4 (12, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(12n); - input.add8(10n); + 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.contract3.mul_euint32_euint8( + const tx = await this.contract7.mul_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(120n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(3882909969n); }); - it('test operator "and" overload (euint32, euint8) => euint32 test 1 (2756559333, 33)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(2756559333n); - input.add8(33n); + 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.contract3.and_euint32_euint8( + const tx = await this.contract7.and_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(33n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(33564993n); }); - it('test operator "and" overload (euint32, euint8) => euint32 test 2 (29, 33)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(29n); - input.add8(33n); + 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.contract3.and_euint32_euint8( + const tx = await this.contract7.and_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(1n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(840706819n); }); - it('test operator "and" overload (euint32, euint8) => euint32 test 3 (33, 33)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(33n); - input.add8(33n); + 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.contract3.and_euint32_euint8( + const tx = await this.contract7.and_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(33n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(840706883n); }); - it('test operator "and" overload (euint32, euint8) => euint32 test 4 (33, 29)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add32(33n); - input.add8(29n); + 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.contract3.and_euint32_euint8( + const tx = await this.contract7.and_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(1n); + 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 "or" overload (euint32, euint8) => euint32 test 1 (1062322837, 212)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1062322837n); - input.add8(212n); + 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.contract4.or_euint32_euint8( + const tx = await this.contract7.xor_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1062322901n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18440012896823678471n); }); - it('test operator "or" overload (euint32, euint8) => euint32 test 2 (208, 212)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(208n); - input.add8(212n); + 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.contract4.or_euint32_euint8( + const tx = await this.contract7.xor_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(212n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(60n); }); - it('test operator "or" overload (euint32, euint8) => euint32 test 3 (212, 212)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(212n); - input.add8(212n); + 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.contract4.or_euint32_euint8( + const tx = await this.contract7.xor_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(212n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(0n); }); - it('test operator "or" overload (euint32, euint8) => euint32 test 4 (212, 208)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(212n); - input.add8(208n); + 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.contract4.or_euint32_euint8( + const tx = await this.contract7.xor_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(212n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(60n); }); }); diff --git a/test/tfheOperations/tfheOperations8.ts b/test/tfheOperations/tfheOperations8.ts index 261e7412..4b38a2ec 100644 --- a/test/tfheOperations/tfheOperations8.ts +++ b/test/tfheOperations/tfheOperations8.ts @@ -7,7 +7,22 @@ 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 { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance'; +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 { @@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise { 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); @@ -105,2497 +175,4677 @@ describe('TFHE operations 8', function () { this.contract6Address = await contract6.getAddress(); this.contract6 = contract6; - const instances = await createInstances(this.signers); - this.instances = instances; - }); + const contract7 = await deployTfheTestFixture7(); + this.contract7Address = await contract7.getAddress(); + this.contract7 = contract7; - it('test operator "xor" overload (euint32, euint8) => euint32 test 1 (2442028658, 23)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2442028658n); - input.add8(23n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2442028645n); - }); + const contract8 = await deployTfheTestFixture8(); + this.contract8Address = await contract8.getAddress(); + this.contract8 = contract8; - it('test operator "xor" overload (euint32, euint8) => euint32 test 2 (19, 23)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(19n); - input.add8(23n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(4n); - }); + const contract9 = await deployTfheTestFixture9(); + this.contract9Address = await contract9.getAddress(); + this.contract9 = contract9; - it('test operator "xor" overload (euint32, euint8) => euint32 test 3 (23, 23)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(23n); - input.add8(23n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(0n); - }); + const contract10 = await deployTfheTestFixture10(); + this.contract10Address = await contract10.getAddress(); + this.contract10 = contract10; - it('test operator "xor" overload (euint32, euint8) => euint32 test 4 (23, 19)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(23n); - input.add8(19n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(4n); + 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 (euint32, euint8) => ebool test 1 (1831274090, 104)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1831274090n); - input.add8(104n); + 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.contract4.eq_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint32, euint8) => ebool test 2 (100, 104)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(100n); - input.add8(104n); + 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.contract4.eq_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint32, euint8) => ebool test 3 (104, 104)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(104n); - input.add8(104n); + 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.contract4.eq_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "eq" overload (euint32, euint8) => ebool test 4 (104, 100)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(104n); - input.add8(100n); + 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.contract4.eq_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint32, euint8) => ebool test 1 (3821365412, 152)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(3821365412n); - input.add8(152n); + 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.contract4.ne_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint32, euint8) => ebool test 2 (148, 152)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(148n); - input.add8(152n); + 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.contract4.ne_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint32, euint8) => ebool test 3 (152, 152)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(152n); - input.add8(152n); + 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.contract4.ne_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint32, euint8) => ebool test 4 (152, 148)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(152n); - input.add8(148n); + 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.contract4.ne_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint32, euint8) => ebool test 1 (1799963609, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1799963609n); - input.add8(233n); + 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.contract4.ge_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint32, euint8) => ebool test 2 (229, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(229n); - input.add8(233n); + 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.contract4.ge_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "ge" overload (euint32, euint8) => ebool test 3 (233, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(233n); - input.add8(233n); + 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.contract4.ge_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint32, euint8) => ebool test 4 (233, 229)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(233n); - input.add8(229n); + 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.contract4.ge_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "gt" overload (euint32, euint8) => ebool test 1 (3893344872, 37)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(3893344872n); - input.add8(37n); + 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.contract4.gt_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "gt" overload (euint32, euint8) => ebool test 2 (33, 37)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(33n); - input.add8(37n); + 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.contract4.gt_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint32, euint8) => ebool test 3 (37, 37)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(37n); - input.add8(37n); + 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.contract4.gt_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint32, euint8) => ebool test 4 (37, 33)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(37n); - input.add8(33n); + 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.contract4.gt_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint32, euint8) => ebool test 1 (804391035, 133)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(804391035n); - input.add8(133n); + 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.contract4.le_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "le" overload (euint32, euint8) => ebool test 2 (129, 133)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(129n); - input.add8(133n); + 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.contract4.le_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint32, euint8) => ebool test 3 (133, 133)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(133n); - input.add8(133n); + 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.contract4.le_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint32, euint8) => ebool test 4 (133, 129)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(133n); - input.add8(129n); + 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.contract4.le_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint32, euint8) => ebool test 1 (3782116241, 158)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(3782116241n); - input.add8(158n); + 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.contract4.lt_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint32, euint8) => ebool test 2 (154, 158)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(154n); - input.add8(158n); + 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.contract4.lt_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (euint32, euint8) => ebool test 3 (158, 158)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(158n); - input.add8(158n); + 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.contract4.lt_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint32, euint8) => ebool test 4 (158, 154)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(158n); - input.add8(154n); + 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.contract4.lt_euint32_euint8( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "min" overload (euint32, euint8) => euint32 test 1 (2689679661, 114)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2689679661n); - input.add8(114n); + 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.contract4.min_euint32_euint8( + const tx = await this.contract7.min_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(114n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(1078993829n); }); - it('test operator "min" overload (euint32, euint8) => euint32 test 2 (110, 114)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(110n); - input.add8(114n); + 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.contract4.min_euint32_euint8( + const tx = await this.contract7.min_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(110n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(1078993825n); }); - it('test operator "min" overload (euint32, euint8) => euint32 test 3 (114, 114)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(114n); - input.add8(114n); + 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.contract4.min_euint32_euint8( + const tx = await this.contract7.min_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(114n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(1078993829n); }); - it('test operator "min" overload (euint32, euint8) => euint32 test 4 (114, 110)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(114n); - input.add8(110n); + 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.contract4.min_euint32_euint8( + const tx = await this.contract7.min_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(110n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(1078993825n); }); - it('test operator "max" overload (euint32, euint8) => euint32 test 1 (2001471362, 68)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2001471362n); - input.add8(68n); + 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.contract4.max_euint32_euint8( + const tx = await this.contract7.max_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2001471362n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18438142521959169981n); }); - it('test operator "max" overload (euint32, euint8) => euint32 test 2 (64, 68)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(64n); - input.add8(68n); + 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.contract4.max_euint32_euint8( + const tx = await this.contract7.max_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(68n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(4265760124n); }); - it('test operator "max" overload (euint32, euint8) => euint32 test 3 (68, 68)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(68n); - input.add8(68n); + 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.contract4.max_euint32_euint8( + const tx = await this.contract7.max_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(68n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(4265760124n); }); - it('test operator "max" overload (euint32, euint8) => euint32 test 4 (68, 64)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(68n); - input.add8(64n); + 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.contract4.max_euint32_euint8( + const tx = await this.contract7.max_euint64_euint32( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(68n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(4265760124n); }); - it('test operator "add" overload (euint32, euint16) => euint32 test 1 (62662, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(62662n); - input.add16(2n); + 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.contract4.add_euint32_euint16( + const tx = await this.contract7.add_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(62664n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18444328681445562230n); }); - it('test operator "add" overload (euint32, euint16) => euint32 test 2 (19188, 19190)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(19188n); - input.add16(19190n); + 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.contract4.add_euint32_euint16( + const tx = await this.contract7.add_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(38378n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18444011000981126512n); }); - it('test operator "add" overload (euint32, euint16) => euint32 test 3 (19190, 19190)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(19190n); - input.add16(19190n); + 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.contract4.add_euint32_euint16( + const tx = await this.contract7.add_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(38380n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18444011000981126514n); }); - it('test operator "add" overload (euint32, euint16) => euint32 test 4 (19190, 19188)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(19190n); - input.add16(19188n); + 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.contract4.add_euint32_euint16( + const tx = await this.contract7.add_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(38378n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18444011000981126512n); }); - it('test operator "sub" overload (euint32, euint16) => euint32 test 1 (35686, 35686)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(35686n); - input.add16(35686n); + 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.contract4.sub_euint32_euint16( + const tx = await this.contract7.sub_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); + const res = await decrypt64(await this.contract7.res64()); expect(res).to.equal(0n); }); - it('test operator "sub" overload (euint32, euint16) => euint32 test 2 (35686, 35682)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(35686n); - input.add16(35682n); + 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.contract4.sub_euint32_euint16( + const tx = await this.contract7.sub_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); + const res = await decrypt64(await this.contract7.res64()); expect(res).to.equal(4n); }); - it('test operator "mul" overload (euint32, euint16) => euint32 test 1 (22131, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(22131n); - input.add16(2n); + 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.contract4.mul_euint32_euint16( + const tx = await this.contract7.mul_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(44262n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18443899955185329625n); }); - it('test operator "mul" overload (euint32, euint16) => euint32 test 2 (158, 158)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(158n); - input.add16(158n); + 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.contract4.mul_euint32_euint16( + const tx = await this.contract7.mul_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(24964n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18442583163668265625n); }); - it('test operator "mul" overload (euint32, euint16) => euint32 test 3 (158, 158)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(158n); - input.add16(158n); + 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.contract4.mul_euint32_euint16( + const tx = await this.contract7.mul_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(24964n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18442583163668265625n); }); - it('test operator "mul" overload (euint32, euint16) => euint32 test 4 (158, 158)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(158n); - input.add16(158n); + 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.contract4.mul_euint32_euint16( + const tx = await this.contract7.mul_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(24964n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18442583163668265625n); }); - it('test operator "and" overload (euint32, euint16) => euint32 test 1 (46593294, 4785)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(46593294n); - input.add16(4785n); + 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.contract4.and_euint32_euint16( + const tx = await this.contract7.and_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(4096n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18442294351260348709n); }); - it('test operator "and" overload (euint32, euint16) => euint32 test 2 (4781, 4785)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(4781n); - input.add16(4785n); + 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.contract4.and_euint32_euint16( + const tx = await this.contract7.and_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(4769n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18442657213736743283n); }); - it('test operator "and" overload (euint32, euint16) => euint32 test 3 (4785, 4785)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(4785n); - input.add16(4785n); + 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.contract4.and_euint32_euint16( + const tx = await this.contract7.and_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(4785n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18442657213736743287n); }); - it('test operator "and" overload (euint32, euint16) => euint32 test 4 (4785, 4781)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(4785n); - input.add16(4781n); + 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.contract4.and_euint32_euint16( + const tx = await this.contract7.and_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(4769n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18442657213736743283n); }); - it('test operator "or" overload (euint32, euint16) => euint32 test 1 (1914437939, 49825)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1914437939n); - input.add16(49825n); + 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.contract4.or_euint32_euint16( + const tx = await this.contract7.or_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1914487731n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18446141532670781815n); }); - it('test operator "or" overload (euint32, euint16) => euint32 test 2 (49821, 49825)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(49821n); - input.add16(49825n); + 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.contract4.or_euint32_euint16( + const tx = await this.contract7.or_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(49853n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18440297605680046453n); }); - it('test operator "or" overload (euint32, euint16) => euint32 test 3 (49825, 49825)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(49825n); - input.add16(49825n); + 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.contract4.or_euint32_euint16( + const tx = await this.contract7.or_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(49825n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18440297605680046453n); }); - it('test operator "or" overload (euint32, euint16) => euint32 test 4 (49825, 49821)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(49825n); - input.add16(49821n); + 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.contract4.or_euint32_euint16( + const tx = await this.contract7.or_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(49853n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18440297605680046453n); }); - it('test operator "xor" overload (euint32, euint16) => euint32 test 1 (4035221230, 58371)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(4035221230n); - input.add16(58371n); + 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.contract4.xor_euint32_euint16( + const tx = await this.contract7.xor_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(4035212013n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(3444795783188562n); }); - it('test operator "xor" overload (euint32, euint16) => euint32 test 2 (58367, 58371)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(58367n); - input.add16(58371n); + 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.contract4.xor_euint32_euint16( + const tx = await this.contract7.xor_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2044n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(4n); }); - it('test operator "xor" overload (euint32, euint16) => euint32 test 3 (58371, 58371)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(58371n); - input.add16(58371n); + 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.contract4.xor_euint32_euint16( + const tx = await this.contract7.xor_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); + const res = await decrypt64(await this.contract7.res64()); expect(res).to.equal(0n); }); - it('test operator "xor" overload (euint32, euint16) => euint32 test 4 (58371, 58367)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(58371n); - input.add16(58367n); + 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.contract4.xor_euint32_euint16( + const tx = await this.contract7.xor_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2044n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(4n); }); - it('test operator "eq" overload (euint32, euint16) => ebool test 1 (3944731587, 33929)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(3944731587n); - input.add16(33929n); + 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.contract4.eq_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint32, euint16) => ebool test 2 (33925, 33929)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(33925n); - input.add16(33929n); + 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.contract4.eq_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint32, euint16) => ebool test 3 (33929, 33929)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(33929n); - input.add16(33929n); + 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.contract4.eq_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "eq" overload (euint32, euint16) => ebool test 4 (33929, 33925)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(33929n); - input.add16(33925n); + 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.contract4.eq_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint32, euint16) => ebool test 1 (3302913406, 10832)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(3302913406n); - input.add16(10832n); + 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.contract4.ne_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint32, euint16) => ebool test 2 (10828, 10832)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(10828n); - input.add16(10832n); + 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.contract4.ne_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint32, euint16) => ebool test 3 (10832, 10832)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(10832n); - input.add16(10832n); + 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.contract4.ne_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint32, euint16) => ebool test 4 (10832, 10828)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(10832n); - input.add16(10828n); + 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.contract4.ne_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint32, euint16) => ebool test 1 (1742405068, 56059)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1742405068n); - input.add16(56059n); + 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.contract4.ge_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint32, euint16) => ebool test 2 (56055, 56059)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(56055n); - input.add16(56059n); + 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.contract4.ge_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "ge" overload (euint32, euint16) => ebool test 3 (56059, 56059)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(56059n); - input.add16(56059n); + 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.contract4.ge_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint32, euint16) => ebool test 4 (56059, 56055)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(56059n); - input.add16(56055n); + 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.contract4.ge_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "gt" overload (euint32, euint16) => ebool test 1 (4017313863, 63284)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(4017313863n); - input.add16(63284n); + 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.contract4.gt_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "gt" overload (euint32, euint16) => ebool test 2 (63280, 63284)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(63280n); - input.add16(63284n); + 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.contract4.gt_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint32, euint16) => ebool test 3 (63284, 63284)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(63284n); - input.add16(63284n); + 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.contract4.gt_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint32, euint16) => ebool test 4 (63284, 63280)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(63284n); - input.add16(63280n); + 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.contract4.gt_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint32, euint16) => ebool test 1 (1660443539, 63916)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1660443539n); - input.add16(63916n); + 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.contract4.le_euint32_euint16( + 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.contract4.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract7.resb()); + expect(res).to.equal(true); }); - it('test operator "le" overload (euint32, euint16) => ebool test 2 (63912, 63916)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(63912n); - input.add16(63916n); + 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.contract4.le_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint32, euint16) => ebool test 3 (63916, 63916)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(63916n); - input.add16(63916n); + 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.contract4.le_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint32, euint16) => ebool test 4 (63916, 63912)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(63916n); - input.add16(63912n); + 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.contract4.le_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint32, euint16) => ebool test 1 (1150183024, 6871)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1150183024n); - input.add16(6871n); + 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.contract4.lt_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint32, euint16) => ebool test 2 (6867, 6871)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(6867n); - input.add16(6871n); + 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.contract4.lt_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (euint32, euint16) => ebool test 3 (6871, 6871)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(6871n); - input.add16(6871n); + 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.contract4.lt_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint32, euint16) => ebool test 4 (6871, 6867)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(6871n); - input.add16(6867n); + 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.contract4.lt_euint32_euint16( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "min" overload (euint32, euint16) => euint32 test 1 (2355937467, 15361)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2355937467n); - input.add16(15361n); + 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.contract4.min_euint32_euint16( + const tx = await this.contract7.min_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(15361n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18438422972288340001n); }); - it('test operator "min" overload (euint32, euint16) => euint32 test 2 (15357, 15361)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(15357n); - input.add16(15361n); + 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.contract4.min_euint32_euint16( + const tx = await this.contract7.min_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(15357n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18438422972288339997n); }); - it('test operator "min" overload (euint32, euint16) => euint32 test 3 (15361, 15361)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(15361n); - input.add16(15361n); + 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.contract4.min_euint32_euint16( + const tx = await this.contract7.min_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(15361n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18438422972288340001n); }); - it('test operator "min" overload (euint32, euint16) => euint32 test 4 (15361, 15357)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(15361n); - input.add16(15357n); + 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.contract4.min_euint32_euint16( + const tx = await this.contract7.min_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(15357n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18438422972288339997n); }); - it('test operator "max" overload (euint32, euint16) => euint32 test 1 (4156714889, 5440)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(4156714889n); - input.add16(5440n); + 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.contract4.max_euint32_euint16( + const tx = await this.contract7.max_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(4156714889n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18445852065991763771n); }); - it('test operator "max" overload (euint32, euint16) => euint32 test 2 (5436, 5440)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(5436n); - input.add16(5440n); + 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.contract4.max_euint32_euint16( + const tx = await this.contract7.max_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(5440n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18440937538047974893n); }); - it('test operator "max" overload (euint32, euint16) => euint32 test 3 (5440, 5440)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(5440n); - input.add16(5440n); + 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.contract4.max_euint32_euint16( + const tx = await this.contract7.max_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(5440n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18440937538047974893n); }); - it('test operator "max" overload (euint32, euint16) => euint32 test 4 (5440, 5436)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(5440n); - input.add16(5436n); + 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.contract4.max_euint32_euint16( + const tx = await this.contract7.max_euint64_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(5440n); + const res = await decrypt64(await this.contract7.res64()); + expect(res).to.equal(18440937538047974893n); }); - it('test operator "add" overload (euint32, euint32) => euint32 test 1 (451501910, 1802073207)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(451501910n); - input.add32(1802073207n); + 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.contract4.add_euint32_euint32( + const tx = await this.contract7.add_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2253575117n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(9223372036854775811n); }); - it('test operator "add" overload (euint32, euint32) => euint32 test 2 (903003814, 903003818)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(903003814n); - input.add32(903003818n); + 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.contract4.add_euint32_euint32( + const tx = await this.contract7.add_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1806007632n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(18440038570285496238n); }); - it('test operator "add" overload (euint32, euint32) => euint32 test 3 (903003818, 903003818)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(903003818n); - input.add32(903003818n); + 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.contract4.add_euint32_euint32( + const tx = await this.contract7.add_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1806007636n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(18440038570285496240n); }); - it('test operator "add" overload (euint32, euint32) => euint32 test 4 (903003818, 903003814)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(903003818n); - input.add32(903003814n); + 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.contract4.add_euint32_euint32( + const tx = await this.contract7.add_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1806007632n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(18440038570285496238n); }); - it('test operator "sub" overload (euint32, euint32) => euint32 test 1 (296156690, 296156690)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(296156690n); - input.add32(296156690n); + 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.contract4.sub_euint32_euint32( + const tx = await this.contract7.sub_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); + const res = await decrypt128(await this.contract7.res128()); expect(res).to.equal(0n); }); - it('test operator "sub" overload (euint32, euint32) => euint32 test 2 (296156690, 296156686)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(296156690n); - input.add32(296156686n); + 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.contract4.sub_euint32_euint32( + const tx = await this.contract7.sub_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); + const res = await decrypt128(await this.contract7.res128()); expect(res).to.equal(4n); }); - it('test operator "mul" overload (euint32, euint32) => euint32 test 1 (54583, 21224)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(54583n); - input.add32(21224n); + 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.contract4.mul_euint32_euint32( + const tx = await this.contract7.mul_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1158469592n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(9223372036854775810n); }); - it('test operator "mul" overload (euint32, euint32) => euint32 test 2 (42446, 42446)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(42446n); - input.add32(42446n); + 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.contract4.mul_euint32_euint32( + const tx = await this.contract7.mul_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1801662916n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(18435453817360285696n); }); - it('test operator "mul" overload (euint32, euint32) => euint32 test 3 (42446, 42446)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(42446n); - input.add32(42446n); + 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.contract4.mul_euint32_euint32( + const tx = await this.contract7.mul_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1801662916n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(18435453817360285696n); }); - it('test operator "mul" overload (euint32, euint32) => euint32 test 4 (42446, 42446)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(42446n); - input.add32(42446n); + 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.contract4.mul_euint32_euint32( + const tx = await this.contract7.mul_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1801662916n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(18435453817360285696n); }); - it('test operator "and" overload (euint32, euint32) => euint32 test 1 (2522719500, 2344855070)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2522719500n); - input.add32(2344855070n); + 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.contract4.and_euint32_euint32( + const tx = await this.contract7.and_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2185339916n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(18438894284827860993n); }); - it('test operator "and" overload (euint32, euint32) => euint32 test 2 (2344855066, 2344855070)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2344855066n); - input.add32(2344855070n); + 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.contract4.and_euint32_euint32( + const tx = await this.contract7.and_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2344855066n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(18438964653643998721n); }); - it('test operator "and" overload (euint32, euint32) => euint32 test 3 (2344855070, 2344855070)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2344855070n); - input.add32(2344855070n); + 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.contract4.and_euint32_euint32( + const tx = await this.contract7.and_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2344855070n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(18438964653643998977n); }); - it('test operator "and" overload (euint32, euint32) => euint32 test 4 (2344855070, 2344855066)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2344855070n); - input.add32(2344855066n); + 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.contract4.and_euint32_euint32( + const tx = await this.contract7.and_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2344855066n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(18438964653643998721n); }); - it('test operator "or" overload (euint32, euint32) => euint32 test 1 (1757798833, 311935858)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1757798833n); - input.add32(311935858n); + 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.contract4.or_euint32_euint32( + const tx = await this.contract7.or_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2060968947n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(340282366920938463463374396049659246975n); }); - it('test operator "or" overload (euint32, euint32) => euint32 test 2 (311935854, 311935858)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(311935854n); - input.add32(311935858n); + 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.contract4.or_euint32_euint32( + const tx = await this.contract7.or_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(311935870n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(18444253937643069461n); }); - it('test operator "or" overload (euint32, euint32) => euint32 test 3 (311935858, 311935858)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(311935858n); - input.add32(311935858n); + 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.contract4.or_euint32_euint32( + const tx = await this.contract7.or_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(311935858n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(18444253937643069461n); }); - it('test operator "or" overload (euint32, euint32) => euint32 test 4 (311935858, 311935854)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(311935858n); - input.add32(311935854n); + 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.contract4.or_euint32_euint32( + const tx = await this.contract7.or_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(311935870n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(18444253937643069461n); }); - it('test operator "xor" overload (euint32, euint32) => euint32 test 1 (3321450403, 449148535)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(3321450403n); - input.add32(449148535n); + 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.contract4.xor_euint32_euint32( + const tx = await this.contract7.xor_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(3745266132n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(340282366920938463444930285940062611838n); }); - it('test operator "xor" overload (euint32, euint32) => euint32 test 2 (449148531, 449148535)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(449148531n); - input.add32(449148535n); + 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.contract4.xor_euint32_euint32( + const tx = await this.contract7.xor_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(4n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(28n); }); - it('test operator "xor" overload (euint32, euint32) => euint32 test 3 (449148535, 449148535)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(449148535n); - input.add32(449148535n); + 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.contract4.xor_euint32_euint32( + const tx = await this.contract7.xor_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); + const res = await decrypt128(await this.contract7.res128()); expect(res).to.equal(0n); }); - it('test operator "xor" overload (euint32, euint32) => euint32 test 4 (449148535, 449148531)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(449148535n); - input.add32(449148531n); + 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.contract4.xor_euint32_euint32( + const tx = await this.contract7.xor_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(4n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(28n); }); - it('test operator "eq" overload (euint32, euint32) => ebool test 1 (287391998, 2464993294)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(287391998n); - input.add32(2464993294n); + 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.contract4.eq_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint32, euint32) => ebool test 2 (287391994, 287391998)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(287391994n); - input.add32(287391998n); + 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.contract4.eq_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint32, euint32) => ebool test 3 (287391998, 287391998)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(287391998n); - input.add32(287391998n); + 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.contract4.eq_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "eq" overload (euint32, euint32) => ebool test 4 (287391998, 287391994)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(287391998n); - input.add32(287391994n); + 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.contract4.eq_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint32, euint32) => ebool test 1 (221510600, 3939036059)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(221510600n); - input.add32(3939036059n); + 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.contract4.ne_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint32, euint32) => ebool test 2 (221510596, 221510600)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(221510596n); - input.add32(221510600n); + 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.contract4.ne_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint32, euint32) => ebool test 3 (221510600, 221510600)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(221510600n); - input.add32(221510600n); + 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.contract4.ne_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint32, euint32) => ebool test 4 (221510600, 221510596)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(221510600n); - input.add32(221510596n); + 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.contract4.ne_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint32, euint32) => ebool test 1 (1736787381, 970577162)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1736787381n); - input.add32(970577162n); + 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.contract4.ge_euint32_euint32( + 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.contract4.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract7.resb()); + expect(res).to.equal(false); }); - it('test operator "ge" overload (euint32, euint32) => ebool test 2 (970577158, 970577162)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(970577158n); - input.add32(970577162n); + 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.contract4.ge_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "ge" overload (euint32, euint32) => ebool test 3 (970577162, 970577162)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(970577162n); - input.add32(970577162n); + 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.contract4.ge_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint32, euint32) => ebool test 4 (970577162, 970577158)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(970577162n); - input.add32(970577158n); + 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.contract4.ge_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "gt" overload (euint32, euint32) => ebool test 1 (212629196, 2875731526)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(212629196n); - input.add32(2875731526n); + 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.contract4.gt_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint32, euint32) => ebool test 2 (212629192, 212629196)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(212629192n); - input.add32(212629196n); + 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.contract4.gt_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint32, euint32) => ebool test 3 (212629196, 212629196)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(212629196n); - input.add32(212629196n); + 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.contract4.gt_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint32, euint32) => ebool test 4 (212629196, 212629192)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(212629196n); - input.add32(212629192n); + 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.contract4.gt_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint32, euint32) => ebool test 1 (2708913268, 1446383134)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2708913268n); - input.add32(1446383134n); + 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.contract4.le_euint32_euint32( + 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.contract4.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract7.resb()); + expect(res).to.equal(true); }); - it('test operator "le" overload (euint32, euint32) => ebool test 2 (1446383130, 1446383134)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1446383130n); - input.add32(1446383134n); + 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.contract4.le_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint32, euint32) => ebool test 3 (1446383134, 1446383134)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1446383134n); - input.add32(1446383134n); + 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.contract4.le_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint32, euint32) => ebool test 4 (1446383134, 1446383130)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1446383134n); - input.add32(1446383130n); + 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.contract4.le_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint32, euint32) => ebool test 1 (1837089382, 4089682184)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1837089382n); - input.add32(4089682184n); + 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.contract4.lt_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (euint32, euint32) => ebool test 2 (1837089378, 1837089382)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1837089378n); - input.add32(1837089382n); + 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.contract4.lt_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (euint32, euint32) => ebool test 3 (1837089382, 1837089382)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1837089382n); - input.add32(1837089382n); + 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.contract4.lt_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint32, euint32) => ebool test 4 (1837089382, 1837089378)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1837089382n); - input.add32(1837089378n); + 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.contract4.lt_euint32_euint32( + 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.contract4.resb()); + const res = await decryptBool(await this.contract7.resb()); expect(res).to.equal(false); }); - it('test operator "min" overload (euint32, euint32) => euint32 test 1 (4226618007, 2940808913)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(4226618007n); - input.add32(2940808913n); + 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.contract4.min_euint32_euint32( + const tx = await this.contract7.min_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2940808913n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(18444900314492723695n); }); - it('test operator "min" overload (euint32, euint32) => euint32 test 2 (2940808909, 2940808913)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2940808909n); - input.add32(2940808913n); + 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.contract4.min_euint32_euint32( + const tx = await this.contract7.min_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2940808909n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(18444900314492723691n); }); - it('test operator "min" overload (euint32, euint32) => euint32 test 3 (2940808913, 2940808913)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2940808913n); - input.add32(2940808913n); + 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.contract4.min_euint32_euint32( + const tx = await this.contract7.min_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2940808913n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(18444900314492723695n); }); - it('test operator "min" overload (euint32, euint32) => euint32 test 4 (2940808913, 2940808909)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2940808913n); - input.add32(2940808909n); + 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.contract4.min_euint32_euint32( + const tx = await this.contract7.min_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2940808909n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(18444900314492723691n); }); - it('test operator "max" overload (euint32, euint32) => euint32 test 1 (3535438432, 2851290845)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(3535438432n); - input.add32(2851290845n); + 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.contract4.max_euint32_euint32( + const tx = await this.contract7.max_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(3535438432n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(340282366920938463463371310064926977589n); }); - it('test operator "max" overload (euint32, euint32) => euint32 test 2 (2851290841, 2851290845)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2851290841n); - input.add32(2851290845n); + 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.contract4.max_euint32_euint32( + const tx = await this.contract7.max_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2851290845n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(18444589551829336117n); }); - it('test operator "max" overload (euint32, euint32) => euint32 test 3 (2851290845, 2851290845)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2851290845n); - input.add32(2851290845n); + 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.contract4.max_euint32_euint32( + const tx = await this.contract7.max_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2851290845n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(18444589551829336117n); }); - it('test operator "max" overload (euint32, euint32) => euint32 test 4 (2851290845, 2851290841)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2851290845n); - input.add32(2851290841n); + 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.contract4.max_euint32_euint32( + const tx = await this.contract7.max_euint64_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2851290845n); + const res = await decrypt128(await this.contract7.res128()); + expect(res).to.equal(18444589551829336117n); }); - it('test operator "add" overload (euint32, euint64) => euint64 test 1 (2, 4294200415)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2n); - input.add64(4294200415n); + 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.contract4.add_euint32_euint64( + const tx = await this.contract7.add_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(4294200417n); + const res = await decrypt256(await this.contract7.res256()); + expect(res).to.equal(9223372036854775811n); }); - it('test operator "add" overload (euint32, euint64) => euint64 test 2 (184177949, 184177953)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(184177949n); - input.add64(184177953n); + 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.contract4.add_euint32_euint64( + const tx = await this.contract7.add_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(368355902n); + const res = await decrypt256(await this.contract7.res256()); + expect(res).to.equal(18446004812601965184n); }); - it('test operator "add" overload (euint32, euint64) => euint64 test 3 (184177953, 184177953)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(184177953n); - input.add64(184177953n); + 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.contract4.add_euint32_euint64( + const tx = await this.contract7.add_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(368355906n); + const res = await decrypt256(await this.contract7.res256()); + expect(res).to.equal(18446004812601965186n); }); - it('test operator "add" overload (euint32, euint64) => euint64 test 4 (184177953, 184177949)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(184177953n); - input.add64(184177949n); + 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.contract4.add_euint32_euint64( + const tx = await this.contract7.add_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(368355902n); + const res = await decrypt256(await this.contract7.res256()); + expect(res).to.equal(18446004812601965184n); }); - it('test operator "sub" overload (euint32, euint64) => euint64 test 1 (2163998221, 2163998221)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2163998221n); - input.add64(2163998221n); + 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.contract4.sub_euint32_euint64( + const tx = await this.contract7.sub_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); + const res = await decrypt256(await this.contract7.res256()); expect(res).to.equal(0n); }); - it('test operator "sub" overload (euint32, euint64) => euint64 test 2 (2163998221, 2163998217)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2163998221n); - input.add64(2163998217n); + 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.contract4.sub_euint32_euint64( + const tx = await this.contract7.sub_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); + const res = await decrypt256(await this.contract7.res256()); expect(res).to.equal(4n); }); - it('test operator "mul" overload (euint32, euint64) => euint64 test 1 (2, 2146443814)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2n); - input.add64(2146443814n); + 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.contract4.mul_euint32_euint64( + const tx = await this.contract7.mul_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(4292887628n); + const res = await decrypt256(await this.contract7.res256()); + expect(res).to.equal(9223372036854775810n); }); - it('test operator "mul" overload (euint32, euint64) => euint64 test 2 (61456, 61456)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(61456n); - input.add64(61456n); + 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.contract4.mul_euint32_euint64( + const tx = await this.contract7.mul_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(3776839936n); + const res = await decrypt256(await this.contract7.res256()); + expect(res).to.equal(18429269801576716681n); }); - it('test operator "mul" overload (euint32, euint64) => euint64 test 3 (61456, 61456)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(61456n); - input.add64(61456n); + 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.contract4.mul_euint32_euint64( + const tx = await this.contract7.mul_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(3776839936n); + const res = await decrypt256(await this.contract7.res256()); + expect(res).to.equal(18429269801576716681n); }); - it('test operator "mul" overload (euint32, euint64) => euint64 test 4 (61456, 61456)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(61456n); - input.add64(61456n); + 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.contract4.mul_euint32_euint64( + const tx = await this.contract7.mul_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(3776839936n); + const res = await decrypt256(await this.contract7.res256()); + expect(res).to.equal(18429269801576716681n); }); - it('test operator "and" overload (euint32, euint64) => euint64 test 1 (595906685, 18438632387690440007)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(595906685n); - input.add64(18438632387690440007n); + 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.contract4.and_euint32_euint64( + const tx = await this.contract7.and_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(537133125n); + const res = await decrypt256(await this.contract7.res256()); + expect(res).to.equal(18437737227820728321n); }); - it('test operator "and" overload (euint32, euint64) => euint64 test 2 (595906681, 595906685)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(595906681n); - input.add64(595906685n); + 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.contract4.and_euint32_euint64( + const tx = await this.contract7.and_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(595906681n); + const res = await decrypt256(await this.contract7.res256()); + expect(res).to.equal(18443960605514453859n); }); - it('test operator "and" overload (euint32, euint64) => euint64 test 3 (595906685, 595906685)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(595906685n); - input.add64(595906685n); + 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.contract4.and_euint32_euint64( + const tx = await this.contract7.and_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(595906685n); + const res = await decrypt256(await this.contract7.res256()); + expect(res).to.equal(18443960605514453875n); }); - it('test operator "and" overload (euint32, euint64) => euint64 test 4 (595906685, 595906681)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(595906685n); - input.add64(595906681n); + 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.contract4.and_euint32_euint64( + const tx = await this.contract7.and_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(595906681n); + const res = await decrypt256(await this.contract7.res256()); + expect(res).to.equal(18443960605514453859n); }); - it('test operator "or" overload (euint32, euint64) => euint64 test 1 (1312726121, 18440203558036734807)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1312726121n); - input.add64(18440203558036734807n); + 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.contract4.or_euint32_euint64( + const tx = await this.contract7.or_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(18440203559245881215n); + const res = await decrypt256(await this.contract7.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457583990276981260157n); }); - it('test operator "or" overload (euint32, euint64) => euint64 test 2 (1312726117, 1312726121)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1312726117n); - input.add64(1312726121n); + 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.contract4.or_euint32_euint64( + const tx = await this.contract7.or_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(1312726125n); + const res = await decrypt256(await this.contract7.res256()); + expect(res).to.equal(18444891827197945405n); }); - it('test operator "or" overload (euint32, euint64) => euint64 test 3 (1312726121, 1312726121)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1312726121n); - input.add64(1312726121n); + 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.contract4.or_euint32_euint64( + const tx = await this.contract7.or_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(1312726121n); + const res = await decrypt256(await this.contract7.res256()); + expect(res).to.equal(18444891827197945405n); }); - it('test operator "or" overload (euint32, euint64) => euint64 test 4 (1312726121, 1312726117)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1312726121n); - input.add64(1312726117n); + 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.contract4.or_euint32_euint64( + const tx = await this.contract7.or_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(1312726125n); + const res = await decrypt256(await this.contract7.res256()); + expect(res).to.equal(18444891827197945405n); }); - it('test operator "xor" overload (euint32, euint64) => euint64 test 1 (3933920874, 18441384818446198365)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(3933920874n); - input.add64(18441384818446198365n); + 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.contract4.xor_euint32_euint64( + const tx = await this.contract7.xor_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(18441384821297952823n); + const res = await decrypt256(await this.contract7.res256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039439139317222450136186n); }); - it('test operator "xor" overload (euint32, euint64) => euint64 test 2 (3933920870, 3933920874)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(3933920870n); - input.add64(3933920874n); + 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.contract4.xor_euint32_euint64( + const tx = await this.contract7.xor_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(12n); + const res = await decrypt256(await this.contract7.res256()); + expect(res).to.equal(4n); }); - it('test operator "xor" overload (euint32, euint64) => euint64 test 3 (3933920874, 3933920874)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(3933920874n); - input.add64(3933920874n); + 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.contract4.xor_euint32_euint64( + const tx = await this.contract7.xor_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); + const res = await decrypt256(await this.contract7.res256()); expect(res).to.equal(0n); }); - it('test operator "xor" overload (euint32, euint64) => euint64 test 4 (3933920874, 3933920870)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(3933920874n); - input.add64(3933920870n); + 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.contract4.xor_euint32_euint64( + const tx = await this.contract7.eq_euint64_euint256( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(12n); + 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/test/tfheOperations/tfheOperations9.ts b/test/tfheOperations/tfheOperations9.ts index 4c9a30bc..4ab60160 100644 --- a/test/tfheOperations/tfheOperations9.ts +++ b/test/tfheOperations/tfheOperations9.ts @@ -7,7 +7,22 @@ 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 { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance'; +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 { @@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise { 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); @@ -93,2477 +163,4659 @@ describe('TFHE operations 9', function () { this.contract3Address = await contract3.getAddress(); this.contract3 = contract3; - const contract4 = await deployTfheTestFixture4(); - this.contract4Address = await contract4.getAddress(); - this.contract4 = contract4; + 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); + }); - const contract5 = await deployTfheTestFixture5(); - this.contract5Address = await contract5.getAddress(); - this.contract5 = contract5; + 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); + }); - const contract6 = await deployTfheTestFixture6(); - this.contract6Address = await contract6.getAddress(); - this.contract6 = contract6; + 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); + }); - const instances = await createInstances(this.signers); - this.instances = instances; + 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 (euint32, euint64) => ebool test 1 (709957546, 18441724614470442911)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(709957546n); - input.add64(18441724614470442911n); + 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.contract4.eq_euint32_euint64( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint32, euint64) => ebool test 2 (709957542, 709957546)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(709957542n); - input.add64(709957546n); + 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.contract4.eq_euint32_euint64( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint32, euint64) => ebool test 3 (709957546, 709957546)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(709957546n); - input.add64(709957546n); + 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.contract4.eq_euint32_euint64( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(true); }); - it('test operator "eq" overload (euint32, euint64) => ebool test 4 (709957546, 709957542)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(709957546n); - input.add64(709957542n); + 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.contract4.eq_euint32_euint64( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint32, euint64) => ebool test 1 (897008808, 18446223426742336677)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(897008808n); - input.add64(18446223426742336677n); + 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.contract4.ne_euint32_euint64( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint32, euint64) => ebool test 2 (897008804, 897008808)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(897008804n); - input.add64(897008808n); + 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.contract4.ne_euint32_euint64( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(true); }); - it('test operator "ne" overload (euint32, euint64) => ebool test 3 (897008808, 897008808)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(897008808n); - input.add64(897008808n); + 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.contract4.ne_euint32_euint64( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(false); }); - it('test operator "ne" overload (euint32, euint64) => ebool test 4 (897008808, 897008804)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(897008808n); - input.add64(897008804n); + 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.contract4.ne_euint32_euint64( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint32, euint64) => ebool test 1 (2551620349, 18444102078323452175)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2551620349n); - input.add64(18444102078323452175n); + 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.contract4.ge_euint32_euint64( + 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.contract4.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(true); }); - it('test operator "ge" overload (euint32, euint64) => ebool test 2 (2551620345, 2551620349)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2551620345n); - input.add64(2551620349n); + 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.contract4.ge_euint32_euint64( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(false); }); - it('test operator "ge" overload (euint32, euint64) => ebool test 3 (2551620349, 2551620349)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2551620349n); - input.add64(2551620349n); + 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.contract4.ge_euint32_euint64( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint32, euint64) => ebool test 4 (2551620349, 2551620345)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2551620349n); - input.add64(2551620345n); + 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.contract4.ge_euint32_euint64( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(true); }); - it('test operator "gt" overload (euint32, euint64) => ebool test 1 (2256977835, 18442208006659778105)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2256977835n); - input.add64(18442208006659778105n); + 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.contract4.gt_euint32_euint64( + 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.contract4.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(true); }); - it('test operator "gt" overload (euint32, euint64) => ebool test 2 (2256977831, 2256977835)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2256977831n); - input.add64(2256977835n); + 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.contract4.gt_euint32_euint64( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint32, euint64) => ebool test 3 (2256977835, 2256977835)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2256977835n); - input.add64(2256977835n); + 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.contract4.gt_euint32_euint64( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(false); }); - it('test operator "gt" overload (euint32, euint64) => ebool test 4 (2256977835, 2256977831)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2256977835n); - input.add64(2256977831n); + 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.contract4.gt_euint32_euint64( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint32, euint64) => ebool test 1 (557237517, 18442682499983449751)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(557237517n); - input.add64(18442682499983449751n); + 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.contract4.le_euint32_euint64( + 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.contract4.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "le" overload (euint32, euint64) => ebool test 2 (557237513, 557237517)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(557237513n); - input.add64(557237517n); + 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.contract4.le_euint32_euint64( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint32, euint64) => ebool test 3 (557237517, 557237517)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(557237517n); - input.add64(557237517n); + 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.contract4.le_euint32_euint64( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint32, euint64) => ebool test 4 (557237517, 557237513)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(557237517n); - input.add64(557237513n); + 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.contract4.le_euint32_euint64( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint32, euint64) => ebool test 1 (1941297565, 18438856464497751915)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1941297565n); - input.add64(18438856464497751915n); + 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.contract4.lt_euint32_euint64( + 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.contract4.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "lt" overload (euint32, euint64) => ebool test 2 (1941297561, 1941297565)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1941297561n); - input.add64(1941297565n); + 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.contract4.lt_euint32_euint64( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (euint32, euint64) => ebool test 3 (1941297565, 1941297565)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1941297565n); - input.add64(1941297565n); + 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.contract4.lt_euint32_euint64( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint32, euint64) => ebool test 4 (1941297565, 1941297561)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1941297565n); - input.add64(1941297561n); + 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.contract4.lt_euint32_euint64( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(false); }); - it('test operator "min" overload (euint32, euint64) => euint64 test 1 (3364933042, 18443534177311383841)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(3364933042n); - input.add64(18443534177311383841n); + 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.contract4.min_euint32_euint64( + const tx = await this.contract8.min_euint128_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(3364933042n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(9714n); }); - it('test operator "min" overload (euint32, euint64) => euint64 test 2 (3364933038, 3364933042)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(3364933038n); - input.add64(3364933042n); + 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.contract4.min_euint32_euint64( + const tx = await this.contract8.min_euint128_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(3364933038n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(9710n); }); - it('test operator "min" overload (euint32, euint64) => euint64 test 3 (3364933042, 3364933042)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(3364933042n); - input.add64(3364933042n); + 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.contract4.min_euint32_euint64( + const tx = await this.contract8.min_euint128_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(3364933042n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(9714n); }); - it('test operator "min" overload (euint32, euint64) => euint64 test 4 (3364933042, 3364933038)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(3364933042n); - input.add64(3364933038n); + 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.contract4.min_euint32_euint64( + const tx = await this.contract8.min_euint128_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(3364933038n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(9710n); }); - it('test operator "max" overload (euint32, euint64) => euint64 test 1 (821915788, 18441217303884363213)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(821915788n); - input.add64(18441217303884363213n); + 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.contract4.max_euint32_euint64( + const tx = await this.contract8.max_euint128_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(18441217303884363213n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(340282366920938463463370317782456018271n); }); - it('test operator "max" overload (euint32, euint64) => euint64 test 2 (821915784, 821915788)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(821915784n); - input.add64(821915788n); + 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.contract4.max_euint32_euint64( + const tx = await this.contract8.max_euint128_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(821915788n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(38332n); }); - it('test operator "max" overload (euint32, euint64) => euint64 test 3 (821915788, 821915788)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(821915788n); - input.add64(821915788n); + 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.contract4.max_euint32_euint64( + const tx = await this.contract8.max_euint128_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(821915788n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(38332n); }); - it('test operator "max" overload (euint32, euint64) => euint64 test 4 (821915788, 821915784)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(821915788n); - input.add64(821915784n); + 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.contract4.max_euint32_euint64( + const tx = await this.contract8.max_euint128_euint16( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(821915788n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(38332n); }); - it('test operator "add" overload (euint32, uint32) => euint32 test 1 (451501910, 2087738652)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(451501910n); - + 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.contract4.add_euint32_uint32( + const tx = await this.contract8.add_euint128_euint32( encryptedAmount.handles[0], - 2087738652n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2539240562n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(2147483651n); }); - it('test operator "add" overload (euint32, uint32) => euint32 test 2 (903003814, 903003818)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(903003814n); - + 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.contract4.add_euint32_uint32( + const tx = await this.contract8.add_euint128_euint32( encryptedAmount.handles[0], - 903003818n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1806007632n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(834769592n); }); - it('test operator "add" overload (euint32, uint32) => euint32 test 3 (903003818, 903003818)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(903003818n); - + 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.contract4.add_euint32_uint32( + const tx = await this.contract8.add_euint128_euint32( encryptedAmount.handles[0], - 903003818n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1806007636n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(834769596n); }); - it('test operator "add" overload (euint32, uint32) => euint32 test 4 (903003818, 903003814)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(903003818n); - + 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.contract4.add_euint32_uint32( + const tx = await this.contract8.add_euint128_euint32( encryptedAmount.handles[0], - 903003814n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1806007632n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(834769592n); }); - it('test operator "add" overload (uint32, euint32) => euint32 test 1 (823987277, 2087738652)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(2087738652n); + 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.contract4.add_uint32_euint32( - 823987277n, + const tx = await this.contract8.sub_euint128_euint32( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2911725929n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(0n); }); - it('test operator "add" overload (uint32, euint32) => euint32 test 2 (903003814, 903003818)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(903003818n); + 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.contract4.add_uint32_euint32( - 903003814n, + const tx = await this.contract8.sub_euint128_euint32( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1806007632n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(4n); }); - it('test operator "add" overload (uint32, euint32) => euint32 test 3 (903003818, 903003818)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(903003818n); + 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.contract4.add_uint32_euint32( - 903003818n, + const tx = await this.contract8.mul_euint128_euint32( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1806007636n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(2147483650n); }); - it('test operator "add" overload (uint32, euint32) => euint32 test 4 (903003818, 903003814)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(903003814n); + 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.contract4.add_uint32_euint32( - 903003818n, + const tx = await this.contract8.mul_euint128_euint32( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1806007632n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(2146561561n); }); - it('test operator "sub" overload (euint32, uint32) => euint32 test 1 (296156690, 296156690)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(296156690n); - + 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.contract4.sub_euint32_uint32( + const tx = await this.contract8.mul_euint128_euint32( encryptedAmount.handles[0], - 296156690n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(0n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(2146561561n); }); - it('test operator "sub" overload (euint32, uint32) => euint32 test 2 (296156690, 296156686)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(296156690n); - + 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.contract4.sub_euint32_uint32( + const tx = await this.contract8.mul_euint128_euint32( encryptedAmount.handles[0], - 296156686n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(4n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(2146561561n); }); - it('test operator "sub" overload (uint32, euint32) => euint32 test 1 (296156690, 296156690)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(296156690n); + 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.contract4.sub_uint32_euint32( - 296156690n, + const tx = await this.contract8.and_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(272629760n); }); - it('test operator "sub" overload (uint32, euint32) => euint32 test 2 (296156690, 296156686)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(296156686n); + 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.contract4.sub_uint32_euint32( - 296156690n, + const tx = await this.contract8.and_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(1038177720n); }); - it('test operator "mul" overload (euint32, uint32) => euint32 test 1 (54583, 52500)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(54583n); - + 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.contract4.mul_euint32_uint32(encryptedAmount.handles[0], 52500n, encryptedAmount.inputProof); + const tx = await this.contract8.and_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2865607500n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(1038177724n); }); - it('test operator "mul" overload (euint32, uint32) => euint32 test 2 (42446, 42446)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(42446n); - + 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.contract4.mul_euint32_uint32(encryptedAmount.handles[0], 42446n, encryptedAmount.inputProof); + const tx = await this.contract8.and_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1801662916n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(1038177720n); }); - it('test operator "mul" overload (euint32, uint32) => euint32 test 3 (42446, 42446)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(42446n); - + 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.contract4.mul_euint32_uint32(encryptedAmount.handles[0], 42446n, encryptedAmount.inputProof); + const tx = await this.contract8.or_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1801662916n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(340282366920938463463370714853213034477n); }); - it('test operator "mul" overload (euint32, uint32) => euint32 test 4 (42446, 42446)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(42446n); - + 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.contract4.mul_euint32_uint32(encryptedAmount.handles[0], 42446n, encryptedAmount.inputProof); + const tx = await this.contract8.or_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1801662916n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(1823556556n); }); - it('test operator "mul" overload (uint32, euint32) => euint32 test 1 (39745, 104998)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(104998n); + 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.contract4.mul_uint32_euint32(39745n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract8.or_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(4173145510n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(1823556556n); }); - it('test operator "mul" overload (uint32, euint32) => euint32 test 2 (42446, 42446)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(42446n); + 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.contract4.mul_uint32_euint32(42446n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract8.or_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1801662916n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(1823556556n); }); - it('test operator "mul" overload (uint32, euint32) => euint32 test 3 (42446, 42446)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(42446n); + 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.contract4.mul_uint32_euint32(42446n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract8.xor_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1801662916n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(340282366920938463463372336874538256436n); }); - it('test operator "mul" overload (uint32, euint32) => euint32 test 4 (42446, 42446)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(42446n); + 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.contract4.mul_uint32_euint32(42446n, encryptedAmount.handles[0], encryptedAmount.inputProof); + const tx = await this.contract8.xor_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1801662916n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(12n); }); - it('test operator "div" overload (euint32, uint32) => euint32 test 1 (1758653773, 1926631032)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1758653773n); - + 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.contract4.div_euint32_uint32( + const tx = await this.contract8.xor_euint128_euint32( encryptedAmount.handles[0], - 1926631032n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); + const res = await decrypt128(await this.contract8.res128()); expect(res).to.equal(0n); }); - it('test operator "div" overload (euint32, uint32) => euint32 test 2 (569518498, 569518502)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(569518498n); + 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.contract4.div_euint32_uint32( + const tx = await this.contract8.eq_euint128_euint32( encryptedAmount.handles[0], - 569518502n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(0n); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "div" overload (euint32, uint32) => euint32 test 3 (569518502, 569518502)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(569518502n); + 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.contract4.div_euint32_uint32( + const tx = await this.contract8.eq_euint128_euint32( encryptedAmount.handles[0], - 569518502n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1n); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(true); }); - it('test operator "div" overload (euint32, uint32) => euint32 test 4 (569518502, 569518498)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(569518502n); + 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.contract4.div_euint32_uint32( + const tx = await this.contract8.ne_euint128_euint32( encryptedAmount.handles[0], - 569518498n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1n); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(true); }); - it('test operator "rem" overload (euint32, uint32) => euint32 test 1 (514826887, 2242906184)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(514826887n); + 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.contract4.rem_euint32_uint32( + const tx = await this.contract8.ne_euint128_euint32( encryptedAmount.handles[0], - 2242906184n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(514826887n); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "rem" overload (euint32, uint32) => euint32 test 2 (514826883, 514826887)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(514826883n); + 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.contract4.rem_euint32_uint32( + const tx = await this.contract8.ge_euint128_euint32( encryptedAmount.handles[0], - 514826887n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(514826883n); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(true); }); - it('test operator "rem" overload (euint32, uint32) => euint32 test 3 (514826887, 514826887)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(514826887n); + 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.contract4.rem_euint32_uint32( + const tx = await this.contract8.ge_euint128_euint32( encryptedAmount.handles[0], - 514826887n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(0n); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(true); }); - it('test operator "rem" overload (euint32, uint32) => euint32 test 4 (514826887, 514826883)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(514826887n); + 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.contract4.rem_euint32_uint32( + const tx = await this.contract8.gt_euint128_euint32( encryptedAmount.handles[0], - 514826883n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(4n); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(true); }); - it('test operator "eq" overload (euint32, uint32) => ebool test 1 (287391998, 3065919083)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(287391998n); + 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.contract4.eq_euint32_uint32( + const tx = await this.contract8.gt_euint128_euint32( encryptedAmount.handles[0], - 3065919083n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint32, uint32) => ebool test 2 (287391994, 287391998)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(287391994n); + 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.contract4.eq_euint32_uint32( + const tx = await this.contract8.le_euint128_euint32( encryptedAmount.handles[0], - 287391998n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (euint32, uint32) => ebool test 3 (287391998, 287391998)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(287391998n); - + 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.contract4.eq_euint32_uint32( + const tx = await this.contract8.le_euint128_euint32( encryptedAmount.handles[0], - 287391998n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(true); }); - it('test operator "eq" overload (euint32, uint32) => ebool test 4 (287391998, 287391994)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(287391998n); + 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.contract4.eq_euint32_uint32( + const tx = await this.contract8.le_euint128_euint32( encryptedAmount.handles[0], - 287391994n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (uint32, euint32) => ebool test 1 (833280044, 3065919083)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(3065919083n); + 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.contract4.eq_uint32_euint32( - 833280044n, + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (uint32, euint32) => ebool test 2 (287391994, 287391998)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + 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); + }); - input.add32(287391998n); + 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.contract4.eq_uint32_euint32( - 287391994n, + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(false); }); - it('test operator "eq" overload (uint32, euint32) => ebool test 3 (287391998, 287391998)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(287391998n); + 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.contract4.eq_uint32_euint32( - 287391998n, + 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.contract4.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "eq" overload (uint32, euint32) => ebool test 4 (287391998, 287391994)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + 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); + }); - input.add32(287391994n); + 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.contract4.eq_uint32_euint32( - 287391998n, + const tx = await this.contract8.min_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(4076998771n); }); - it('test operator "ne" overload (euint32, uint32) => ebool test 1 (221510600, 454323706)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(221510600n); - + 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.contract4.ne_euint32_uint32( + const tx = await this.contract8.min_euint128_euint32( encryptedAmount.handles[0], - 454323706n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(4076998775n); }); - it('test operator "ne" overload (euint32, uint32) => ebool test 2 (221510596, 221510600)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(221510596n); - + 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.contract4.ne_euint32_uint32( + const tx = await this.contract8.min_euint128_euint32( encryptedAmount.handles[0], - 221510600n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(4076998771n); }); - it('test operator "ne" overload (euint32, uint32) => ebool test 3 (221510600, 221510600)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(221510600n); - + 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.contract4.ne_euint32_uint32( + const tx = await this.contract8.max_euint128_euint32( encryptedAmount.handles[0], - 221510600n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(340282366920938463463374411933353920761n); }); - it('test operator "ne" overload (euint32, uint32) => ebool test 4 (221510600, 221510596)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(221510600n); - + 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.contract4.ne_euint32_uint32( + const tx = await this.contract8.max_euint128_euint32( encryptedAmount.handles[0], - 221510596n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(2226263511n); }); - it('test operator "ne" overload (uint32, euint32) => ebool test 1 (2107136281, 454323706)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(454323706n); + 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.contract4.ne_uint32_euint32( - 2107136281n, + const tx = await this.contract8.max_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(2226263511n); }); - it('test operator "ne" overload (uint32, euint32) => ebool test 2 (221510596, 221510600)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(221510600n); + 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.contract4.ne_uint32_euint32( - 221510596n, + const tx = await this.contract8.max_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(2226263511n); }); - it('test operator "ne" overload (uint32, euint32) => ebool test 3 (221510600, 221510600)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(221510600n); + 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.contract4.ne_uint32_euint32( - 221510600n, + const tx = await this.contract8.add_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(9223372036854775811n); }); - it('test operator "ne" overload (uint32, euint32) => ebool test 4 (221510600, 221510596)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(221510596n); + 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.contract4.ne_uint32_euint32( - 221510600n, + const tx = await this.contract8.add_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(18439578154426851128n); }); - it('test operator "ge" overload (euint32, uint32) => ebool test 1 (1736787381, 3290514741)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1736787381n); - + 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.contract4.ge_euint32_uint32( + const tx = await this.contract8.add_euint128_euint64( encryptedAmount.handles[0], - 3290514741n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(18439578154426851130n); }); - it('test operator "ge" overload (euint32, uint32) => ebool test 2 (970577158, 970577162)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(970577158n); - + 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.contract4.ge_euint32_uint32( + const tx = await this.contract8.add_euint128_euint64( encryptedAmount.handles[0], - 970577162n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(18439578154426851128n); }); - it('test operator "ge" overload (euint32, uint32) => ebool test 3 (970577162, 970577162)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(970577162n); - + 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.contract4.ge_euint32_uint32( + const tx = await this.contract8.sub_euint128_euint64( encryptedAmount.handles[0], - 970577162n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(0n); }); - it('test operator "ge" overload (euint32, uint32) => ebool test 4 (970577162, 970577158)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(970577162n); - + 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.contract4.ge_euint32_uint32( + const tx = await this.contract8.sub_euint128_euint64( encryptedAmount.handles[0], - 970577158n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(4n); }); - it('test operator "ge" overload (uint32, euint32) => ebool test 1 (586395582, 3290514741)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(3290514741n); + 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.contract4.ge_uint32_euint32( - 586395582n, + const tx = await this.contract8.mul_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(9223372036854775810n); }); - it('test operator "ge" overload (uint32, euint32) => ebool test 2 (970577158, 970577162)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(970577162n); + 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.contract4.ge_uint32_euint32( - 970577158n, + const tx = await this.contract8.mul_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(18441052281005264689n); }); - it('test operator "ge" overload (uint32, euint32) => ebool test 3 (970577162, 970577162)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(970577162n); + 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.contract4.ge_uint32_euint32( - 970577162n, + const tx = await this.contract8.mul_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(18441052281005264689n); }); - it('test operator "ge" overload (uint32, euint32) => ebool test 4 (970577162, 970577158)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(970577158n); + 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.contract4.ge_uint32_euint32( - 970577162n, + const tx = await this.contract8.mul_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(18441052281005264689n); }); - it('test operator "gt" overload (euint32, uint32) => ebool test 1 (212629196, 4059879084)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(212629196n); - + 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.contract4.gt_euint32_uint32( + const tx = await this.contract8.and_euint128_euint64( encryptedAmount.handles[0], - 4059879084n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(18438019519441568309n); }); - it('test operator "gt" overload (euint32, uint32) => ebool test 2 (212629192, 212629196)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(212629192n); - + 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.contract4.gt_euint32_uint32( + const tx = await this.contract8.and_euint128_euint64( encryptedAmount.handles[0], - 212629196n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(18442558600081086193n); }); - it('test operator "gt" overload (euint32, uint32) => ebool test 3 (212629196, 212629196)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(212629196n); - + 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.contract4.gt_euint32_uint32( + const tx = await this.contract8.and_euint128_euint64( encryptedAmount.handles[0], - 212629196n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(18442558600081086197n); }); - it('test operator "gt" overload (euint32, uint32) => ebool test 4 (212629196, 212629192)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(212629196n); - + 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.contract4.gt_euint32_uint32( + const tx = await this.contract8.and_euint128_euint64( encryptedAmount.handles[0], - 212629192n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(18442558600081086193n); }); - it('test operator "gt" overload (uint32, euint32) => ebool test 1 (2732454384, 4059879084)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(4059879084n); + 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.contract4.gt_uint32_euint32( - 2732454384n, + const tx = await this.contract8.or_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(340282366920938463463372265437599364347n); }); - it('test operator "gt" overload (uint32, euint32) => ebool test 2 (212629192, 212629196)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(212629196n); + 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.contract4.gt_uint32_euint32( - 212629192n, + const tx = await this.contract8.or_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(18439052795332501695n); }); - it('test operator "gt" overload (uint32, euint32) => ebool test 3 (212629196, 212629196)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(212629196n); + 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.contract4.gt_uint32_euint32( - 212629196n, + const tx = await this.contract8.or_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(18439052795332501691n); }); - it('test operator "gt" overload (uint32, euint32) => ebool test 4 (212629196, 212629192)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(212629192n); + 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.contract4.gt_uint32_euint32( - 212629196n, + const tx = await this.contract8.or_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(18439052795332501695n); }); - it('test operator "le" overload (euint32, uint32) => ebool test 1 (2708913268, 3120465053)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2708913268n); - + 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.contract4.le_euint32_uint32( + const tx = await this.contract8.xor_euint128_euint64( encryptedAmount.handles[0], - 3120465053n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(340282366920938463444935023814972271182n); }); - it('test operator "le" overload (euint32, uint32) => ebool test 2 (1446383130, 1446383134)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1446383130n); - + 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.contract4.le_euint32_uint32( + const tx = await this.contract8.xor_euint128_euint64( encryptedAmount.handles[0], - 1446383134n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(4n); }); - it('test operator "le" overload (euint32, uint32) => ebool test 3 (1446383134, 1446383134)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1446383134n); - + 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.contract4.le_euint32_uint32( + const tx = await this.contract8.xor_euint128_euint64( encryptedAmount.handles[0], - 1446383134n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(0n); }); - it('test operator "le" overload (euint32, uint32) => ebool test 4 (1446383134, 1446383130)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1446383134n); - + 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.contract4.le_euint32_uint32( + const tx = await this.contract8.xor_euint128_euint64( encryptedAmount.handles[0], - 1446383130n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(4n); }); - it('test operator "le" overload (uint32, euint32) => ebool test 1 (518556131, 3120465053)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(3120465053n); + 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.contract4.le_uint32_euint32( - 518556131n, + 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.contract4.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "le" overload (uint32, euint32) => ebool test 2 (1446383130, 1446383134)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(1446383134n); + 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.contract4.le_uint32_euint32( - 1446383130n, + 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.contract4.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "le" overload (uint32, euint32) => ebool test 3 (1446383134, 1446383134)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(1446383134n); + 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.contract4.le_uint32_euint32( - 1446383134n, + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (uint32, euint32) => ebool test 4 (1446383134, 1446383130)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(1446383130n); + 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.contract4.le_uint32_euint32( - 1446383134n, + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint32, uint32) => ebool test 1 (1837089382, 2866298985)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1837089382n); - + 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.contract4.lt_euint32_uint32( + const tx = await this.contract8.ne_euint128_euint64( encryptedAmount.handles[0], - 2866298985n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (euint32, uint32) => ebool test 2 (1837089378, 1837089382)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1837089378n); - + 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.contract4.lt_euint32_uint32( + const tx = await this.contract8.ne_euint128_euint64( encryptedAmount.handles[0], - 1837089382n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (euint32, uint32) => ebool test 3 (1837089382, 1837089382)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1837089382n); - + 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.contract4.lt_euint32_uint32( + const tx = await this.contract8.ne_euint128_euint64( encryptedAmount.handles[0], - 1837089382n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(false); }); - it('test operator "lt" overload (euint32, uint32) => ebool test 4 (1837089382, 1837089378)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(1837089382n); - + 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.contract4.lt_euint32_uint32( + const tx = await this.contract8.ne_euint128_euint64( encryptedAmount.handles[0], - 1837089378n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(true); }); - it('test operator "lt" overload (uint32, euint32) => ebool test 1 (391192733, 2866298985)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(2866298985n); + 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.contract4.lt_uint32_euint32( - 391192733n, + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(true); }); - it('test operator "lt" overload (uint32, euint32) => ebool test 2 (1837089378, 1837089382)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(1837089382n); + 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.contract4.lt_uint32_euint32( - 1837089378n, + 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.contract4.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "lt" overload (uint32, euint32) => ebool test 3 (1837089382, 1837089382)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(1837089382n); + 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.contract4.lt_uint32_euint32( - 1837089382n, + 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.contract4.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(true); }); - it('test operator "lt" overload (uint32, euint32) => ebool test 4 (1837089382, 1837089378)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(1837089378n); + 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.contract4.lt_uint32_euint32( - 1837089382n, + 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.contract4.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (euint32, uint32) => euint32 test 1 (4226618007, 2039277146)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(4226618007n); - + 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.contract4.min_euint32_uint32( + const tx = await this.contract8.gt_euint128_euint64( encryptedAmount.handles[0], - 2039277146n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2039277146n); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (euint32, uint32) => euint32 test 2 (2940808909, 2940808913)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2940808909n); - + 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.contract4.min_euint32_uint32( + const tx = await this.contract8.gt_euint128_euint64( encryptedAmount.handles[0], - 2940808913n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2940808909n); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "min" overload (euint32, uint32) => euint32 test 3 (2940808913, 2940808913)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2940808913n); - + 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.contract4.min_euint32_uint32( + const tx = await this.contract8.gt_euint128_euint64( encryptedAmount.handles[0], - 2940808913n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2940808913n); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "min" overload (euint32, uint32) => euint32 test 4 (2940808913, 2940808909)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2940808913n); - + 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.contract4.min_euint32_uint32( + const tx = await this.contract8.gt_euint128_euint64( encryptedAmount.handles[0], - 2940808909n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2940808909n); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (uint32, euint32) => euint32 test 1 (1778120575, 2039277146)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(2039277146n); + 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.contract4.min_uint32_euint32( - 1778120575n, + const tx = await this.contract8.le_euint128_euint64( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1778120575n); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "min" overload (uint32, euint32) => euint32 test 2 (2940808909, 2940808913)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(2940808913n); + 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.contract4.min_uint32_euint32( - 2940808909n, + const tx = await this.contract8.le_euint128_euint64( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2940808909n); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (uint32, euint32) => euint32 test 3 (2940808913, 2940808913)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(2940808913n); + 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.contract4.min_uint32_euint32( - 2940808913n, + const tx = await this.contract8.le_euint128_euint64( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2940808913n); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(true); }); - it('test operator "min" overload (uint32, euint32) => euint32 test 4 (2940808913, 2940808909)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(2940808909n); + 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.contract4.min_uint32_euint32( - 2940808913n, + const tx = await this.contract8.le_euint128_euint64( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2940808909n); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "max" overload (euint32, uint32) => euint32 test 1 (3535438432, 1480992326)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(3535438432n); - + 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.contract4.max_euint32_uint32( + const tx = await this.contract8.lt_euint128_euint64( encryptedAmount.handles[0], - 1480992326n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(3535438432n); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "max" overload (euint32, uint32) => euint32 test 2 (2851290841, 2851290845)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2851290841n); - + 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.contract4.max_euint32_uint32( + const tx = await this.contract8.lt_euint128_euint64( encryptedAmount.handles[0], - 2851290845n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2851290845n); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(true); }); - it('test operator "max" overload (euint32, uint32) => euint32 test 3 (2851290845, 2851290845)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2851290845n); - + 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.contract4.max_euint32_uint32( + const tx = await this.contract8.lt_euint128_euint64( encryptedAmount.handles[0], - 2851290845n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2851290845n); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "max" overload (euint32, uint32) => euint32 test 4 (2851290845, 2851290841)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add32(2851290845n); - + 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.contract4.max_euint32_uint32( + const tx = await this.contract8.lt_euint128_euint64( encryptedAmount.handles[0], - 2851290841n, + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2851290845n); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "max" overload (uint32, euint32) => euint32 test 1 (760733114, 1480992326)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(1480992326n); + 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.contract4.max_uint32_euint32( - 760733114n, + const tx = await this.contract8.min_euint128_euint64( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1480992326n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(18437970528445398453n); }); - it('test operator "max" overload (uint32, euint32) => euint32 test 2 (2851290841, 2851290845)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(2851290845n); + 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.contract4.max_uint32_euint32( - 2851290841n, + const tx = await this.contract8.min_euint128_euint64( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2851290845n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(18437970528445398449n); }); - it('test operator "max" overload (uint32, euint32) => euint32 test 3 (2851290845, 2851290845)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(2851290845n); + 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.contract4.max_uint32_euint32( - 2851290845n, + const tx = await this.contract8.min_euint128_euint64( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2851290845n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(18437970528445398453n); }); - it('test operator "max" overload (uint32, euint32) => euint32 test 4 (2851290845, 2851290841)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add32(2851290841n); + 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.contract4.max_uint32_euint32( - 2851290845n, + const tx = await this.contract8.min_euint128_euint64( encryptedAmount.handles[0], + encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2851290845n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(18437970528445398449n); }); - it('test operator "add" overload (euint64, euint4) => euint64 test 1 (9, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(9n); - input.add4(2n); + 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.contract4.add_euint64_euint4( + const tx = await this.contract8.max_euint128_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(11n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(340282366920938463463373867307519267223n); }); - it('test operator "add" overload (euint64, euint4) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(4n); - input.add4(8n); + 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.contract4.add_euint64_euint4( + const tx = await this.contract8.max_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(18442144243272238465n); }); - it('test operator "add" overload (euint64, euint4) => euint64 test 3 (5, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(5n); - input.add4(5n); + 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.contract4.add_euint64_euint4( + const tx = await this.contract8.max_euint128_euint64( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(10n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(18442144243272238465n); }); - it('test operator "add" overload (euint64, euint4) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(8n); - input.add4(4n); + 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.contract4.add_euint64_euint4( + const tx = await this.contract8.max_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(18442144243272238465n); }); - it('test operator "sub" overload (euint64, euint4) => euint64 test 1 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(10n); - input.add4(10n); + 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.contract4.sub_euint64_euint4( + const tx = await this.contract8.add_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(0n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(340282366920938463463371817968349873711n); }); - it('test operator "sub" overload (euint64, euint4) => euint64 test 2 (10, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(10n); - input.add4(6n); + 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.contract4.sub_euint64_euint4( + const tx = await this.contract8.add_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(4n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(340282366920938463463370978518448300916n); }); - it('test operator "mul" overload (euint64, euint4) => euint64 test 1 (5, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(5n); - input.add4(2n); + 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.contract4.mul_euint64_euint4( + const tx = await this.contract8.add_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(10n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(340282366920938463463370978518448300918n); }); - it('test operator "mul" overload (euint64, euint4) => euint64 test 2 (3, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(3n); - input.add4(5n); + 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.contract4.mul_euint64_euint4( + const tx = await this.contract8.add_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(15n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(340282366920938463463370978518448300916n); }); - it('test operator "mul" overload (euint64, euint4) => euint64 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(3n); - input.add4(3n); + 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.contract4.mul_euint64_euint4( + const tx = await this.contract8.sub_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(9n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(0n); }); - it('test operator "mul" overload (euint64, euint4) => euint64 test 4 (5, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(5n); - input.add4(3n); + 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.contract4.mul_euint64_euint4( + const tx = await this.contract8.sub_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(15n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(4n); }); - it('test operator "and" overload (euint64, euint4) => euint64 test 1 (18444456172028398167, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(18444456172028398167n); - input.add4(8n); + 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.contract4.and_euint64_euint4( + const tx = await this.contract8.mul_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(0n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(85070591730234615884290395931651604481n); }); - it('test operator "and" overload (euint64, euint4) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(4n); - input.add4(8n); + 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.contract4.and_euint64_euint4( + const tx = await this.contract8.mul_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(0n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(85070591730234615884290395931651604481n); }); - it('test operator "and" overload (euint64, euint4) => euint64 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(8n); - input.add4(8n); + 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.contract4.and_euint64_euint4( + const tx = await this.contract8.mul_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(8n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(85070591730234615884290395931651604481n); }); - it('test operator "and" overload (euint64, euint4) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(8n); - input.add4(4n); + 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.contract4.and_euint64_euint4( + const tx = await this.contract8.mul_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(0n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(85070591730234615884290395931651604481n); }); - it('test operator "or" overload (euint64, euint4) => euint64 test 1 (18443742079082438219, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(18443742079082438219n); - input.add4(5n); + 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.contract4.or_euint64_euint4( + const tx = await this.contract8.and_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(18443742079082438223n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(340282366920938463463365750145734418537n); }); - it('test operator "or" overload (euint64, euint4) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(4n); - input.add4(8n); + 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.contract4.or_euint64_euint4( + const tx = await this.contract8.and_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(12n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(340282366920938463463365754576278416097n); }); - it('test operator "or" overload (euint64, euint4) => euint64 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(8n); - input.add4(8n); + 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.contract4.or_euint64_euint4( + const tx = await this.contract8.and_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(8n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(340282366920938463463365754576278416105n); }); - it('test operator "or" overload (euint64, euint4) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(8n); - input.add4(4n); + 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.contract4.or_euint64_euint4( + const tx = await this.contract8.and_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(12n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(340282366920938463463365754576278416097n); }); - it('test operator "xor" overload (euint64, euint4) => euint64 test 1 (18442015029052104347, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(18442015029052104347n); - input.add4(10n); + 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.contract4.xor_euint64_euint4( + const tx = await this.contract8.or_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(18442015029052104337n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(340282366920938463463374605231434923963n); }); - it('test operator "xor" overload (euint64, euint4) => euint64 test 2 (6, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(6n); - input.add4(10n); + 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.contract4.xor_euint64_euint4( + const tx = await this.contract8.or_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(12n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(340282366920938463463367655063545859647n); }); - it('test operator "xor" overload (euint64, euint4) => euint64 test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(10n); - input.add4(10n); + 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.contract4.xor_euint64_euint4( + const tx = await this.contract8.or_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(0n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(340282366920938463463367655063545859643n); }); - it('test operator "xor" overload (euint64, euint4) => euint64 test 4 (10, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(10n); - input.add4(6n); + 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.contract4.xor_euint64_euint4( + const tx = await this.contract8.or_euint128_euint128( encryptedAmount.handles[0], encryptedAmount.handles[1], encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(12n); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(340282366920938463463367655063545859647n); }); - it('test operator "eq" overload (euint64, euint4) => ebool test 1 (18446728320459652857, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(18446728320459652857n); - input.add4(10n); + 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.contract4.eq_euint64_euint4( + const tx = await this.contract8.xor_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(8122674366786796n); }); - it('test operator "eq" overload (euint64, euint4) => ebool test 2 (6, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(6n); - input.add4(10n); + 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.contract4.eq_euint64_euint4( + const tx = await this.contract8.xor_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(28n); }); - it('test operator "eq" overload (euint64, euint4) => ebool test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(10n); - input.add4(10n); + 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.contract4.eq_euint64_euint4( + const tx = await this.contract8.xor_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(0n); }); - it('test operator "eq" overload (euint64, euint4) => ebool test 4 (10, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(10n); - input.add4(6n); + 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.contract4.eq_euint64_euint4( + const tx = await this.contract8.xor_euint128_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); + const res = await decrypt128(await this.contract8.res128()); + expect(res).to.equal(28n); }); - it('test operator "ne" overload (euint64, euint4) => ebool test 1 (18446041636272307563, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(18446041636272307563n); - input.add4(8n); + 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.contract4.ne_euint64_euint4( + 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.contract4.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "ne" overload (euint64, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(4n); - input.add4(8n); + 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.contract4.ne_euint64_euint4( + 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.contract4.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "ne" overload (euint64, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(8n); - input.add4(8n); + 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.contract4.ne_euint64_euint4( + 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.contract4.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(true); }); - it('test operator "ne" overload (euint64, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(8n); - input.add4(4n); + 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.contract4.ne_euint64_euint4( + 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.contract4.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "ge" overload (euint64, euint4) => ebool test 1 (18439251641807718563, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(18439251641807718563n); - input.add4(9n); + 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.contract4.ge_euint64_euint4( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(true); }); - it('test operator "ge" overload (euint64, euint4) => ebool test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(5n); - input.add4(9n); + 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.contract4.ge_euint64_euint4( + 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.contract4.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(true); }); - it('test operator "ge" overload (euint64, euint4) => ebool test 3 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(9n); - input.add4(9n); + 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.contract4.ge_euint64_euint4( + 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.contract4.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "ge" overload (euint64, euint4) => ebool test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(9n); - input.add4(5n); + 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.contract4.ge_euint64_euint4( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(true); }); - it('test operator "gt" overload (euint64, euint4) => ebool test 1 (18441781451110763323, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(18441781451110763323n); - input.add4(1n); + 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.contract4.gt_euint64_euint4( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.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.contract4Address, this.signers.alice.address); - input.add64(4n); - input.add4(8n); + 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.contract4.gt_euint64_euint4( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.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.contract4Address, this.signers.alice.address); - input.add64(8n); - input.add4(8n); + 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.contract4.gt_euint64_euint4( + 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.contract4.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(true); }); - it('test operator "gt" overload (euint64, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(8n); - input.add4(4n); + 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.contract4.gt_euint64_euint4( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(true); }); - it('test operator "le" overload (euint64, euint4) => ebool test 1 (18438089675582739325, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(18438089675582739325n); - input.add4(8n); + 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.contract4.le_euint64_euint4( + 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.contract4.resb()); + const res = await decryptBool(await this.contract8.resb()); expect(res).to.equal(false); }); - it('test operator "le" overload (euint64, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(4n); - input.add4(8n); + 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.contract4.le_euint64_euint4( + 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.contract4.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "le" overload (euint64, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(8n); - input.add4(8n); + 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.contract4.le_euint64_euint4( + 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.contract4.resb()); - expect(res).to.equal(true); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(false); }); - it('test operator "le" overload (euint64, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add64(8n); - input.add4(4n); + 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.contract4.le_euint64_euint4( + 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.contract4.resb()); - expect(res).to.equal(false); + const res = await decryptBool(await this.contract8.resb()); + expect(res).to.equal(true); }); });