diff --git a/codegen/templates.ts b/codegen/templates.ts index eb9eeb79..ecaa6b29 100644 --- a/codegen/templates.ts +++ b/codegen/templates.ts @@ -13,6 +13,8 @@ type euint16 is uint256; type euint32 is uint256; type euint64 is uint256; type eaddress is uint256; +type ebytes256 is uint256; +type einput is bytes32; library Common { // Values used to communicate types to the runtime. @@ -24,6 +26,7 @@ library Common { uint8 internal constant euint64_t = 5; uint8 internal constant euint128_t = 6; uint8 internal constant euint160_t = 7; + uint8 internal constant ebytes256_t = 11; } `; } @@ -216,7 +219,7 @@ function fheLibCustomInterfaceFunctions(): string { return ` function reencrypt(uint256 ct, uint256 publicKey) external view returns (bytes memory); function fhePubKey(bytes1 fromLib) external view returns (bytes memory result); - function verifyCiphertext(bytes memory input) external pure returns (uint256 result); + function verifyCiphertext(bytes32 inputHandle, address callerAddress, bytes memory inputProof, bytes1 inputType) external pure returns (uint256 result); function cast(uint256 ct, bytes1 toType) external pure returns (uint256 result); function trivialEncrypt(uint256 ct, bytes1 toType) external pure returns (uint256 result); function decrypt(uint256 ct) external view returns (uint256 result); @@ -236,8 +239,8 @@ function tfheExecutorCustomFunctions(): string { function fhePubKey(bytes1 fromLib) public view returns (bytes memory result) { return FhevmLib(address(EXT_TFHE_LIBRARY)).fhePubKey(fromLib); } - function verifyCiphertext(bytes memory input) public returns (uint256 result) { - result = FhevmLib(address(EXT_TFHE_LIBRARY)).verifyCiphertext(input); + function verifyCiphertext(bytes32 inputHandle, address callerAddress, bytes memory inputProof, bytes1 inputType) public returns (uint256 result) { + result = FhevmLib(address(EXT_TFHE_LIBRARY)).verifyCiphertext(inputHandle, callerAddress, inputProof, inputType); acl.allowTransient(result, msg.sender); } function cast(uint256 ct, bytes1 toType) public returns (uint256 result) { @@ -702,8 +705,8 @@ function tfheAsEboolUnaryCast(bits: number): string { if (bits == 8) { res.push(` // Convert a serialized 'ciphertext' to an encrypted euint8 integer. - function asEbool(bytes memory ciphertext) internal returns (ebool) { - return ebool.wrap(Impl.verify(ciphertext, Common.ebool_t)); + function asEbool(einput inputHandle, bytes memory inputProof) internal returns (ebool) { + return ebool.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebool_t)); } // Convert a plaintext value to an encrypted euint8 integer. @@ -780,9 +783,9 @@ function tfheUnaryOperators(bits: number, operators: Operator[], signatures: Ove function tfheCustomUnaryOperators(bits: number, signatures: OverloadSignature[], mocked: boolean): string { let result = ` - // Convert a serialized 'ciphertext' to an encrypted euint${bits} integer. - function asEuint${bits}(bytes memory ciphertext) internal returns (euint${bits}) { - return euint${bits}.wrap(Impl.verify(ciphertext, Common.euint${bits}_t)); + // Convert the given inputHandle and inputProof to an encrypted euint${bits} integer. + function asEuint${bits}(einput inputHandle, bytes memory inputProof) internal returns (euint${bits}) { + return euint${bits}.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint${bits}_t)); } // Convert a plaintext value to an encrypted euint${bits} integer. @@ -948,21 +951,30 @@ function tfheCustomMethods(ctx: CodegenContext, mocked: boolean): string { return Impl.reencrypt(eaddress.unwrap(value), publicKey); } - // From bytes to eaddress - function asEaddress(bytes memory ciphertext) internal returns (eaddress) { - return eaddress.wrap(Impl.verify(ciphertext, Common.euint160_t)); - + // Convert the given inputHandle and 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. 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 ebytes256 value. + function asEbytes256(einput inputHandle, bytes memory inputProof) internal returns (ebytes256) { + return ebytes256.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebytes256_t)); + } - // Return true if the enrypted integer is initialized and false otherwise. + // Return true if the enrypted value 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(ebytes256 v) internal pure returns (bool) { + return ebytes256.unwrap(v) != 0; + } // Evaluate eq(a, b) and return the result. function eq(eaddress a, eaddress b) internal returns (ebool) { @@ -1021,6 +1033,20 @@ function tfheCustomMethods(ctx: CodegenContext, mocked: boolean): string { uint256 bProc = uint256(uint160(b)); return ebool.wrap(Impl.ne(eaddress.unwrap(a), bProc, 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"); + return ebool.wrap(Impl.eq(ebytes256.unwrap(a), ebytes256.unwrap(b), false)); + } + + // 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"); + return ebool.wrap(Impl.ne(ebytes256.unwrap(a), ebytes256.unwrap(b), false)); + } 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))); @@ -1070,11 +1096,11 @@ function implCustomMethods(ctx: CodegenContext): string { } function verify( - bytes memory _ciphertextBytes, - uint8 _toType + bytes32 inputHandle, + bytes memory inputProof, + uint8 toType ) internal returns (uint256 result) { - bytes memory input = bytes.concat(_ciphertextBytes, bytes1(_toType)); - result = exec.verifyCiphertext(input); + result = exec.verifyCiphertext(inputHandle, msg.sender, inputProof, bytes1(toType)); acl.allowTransient(result, msg.sender); } @@ -1298,19 +1324,22 @@ library Impl { key = hex"0123456789ABCDEF"; } - function verify(bytes memory _ciphertextBytes, uint8 /*_toType*/) internal returns (uint256 result) { + function verify(einput inputHandle, + bytes memory inputProof, + uint8 toType) internal returns (uint256 result) { + // TODO: fix implementation uint256 x; assembly { - switch gt(mload(_ciphertextBytes), 31) + switch gt(mload(inputProof), 31) case 1 { - x := mload(add(_ciphertextBytes, add(32, sub(mload(_ciphertextBytes), 32)))) + x := mload(add(inputProof, add(32, sub(mload(inputProof), 32)))) } default { - x := mload(add(_ciphertextBytes, 32)) + x := mload(add(inputProof, 32)) } } - if (_ciphertextBytes.length < 32) { - x = x >> ((32 - _ciphertextBytes.length) * 8); + if (inputProof.length < 32) { + x = x >> ((32 - inputProof.length) * 8); } return x; } diff --git a/codegen/testgen.ts b/codegen/testgen.ts index 4fda7c47..42bd3119 100644 --- a/codegen/testgen.ts +++ b/codegen/testgen.ts @@ -269,6 +269,7 @@ function signatureContractArguments(s: OverloadSignature): string { res.push(`${functionTypeToCalldataType(a)} ${String.fromCharCode(argName)}`); argName++; }); + res.push('bytes calldata inputProof'); return res.join(', '); } @@ -289,7 +290,7 @@ function signatureContractEncryptedSignature(s: OverloadSignature): string { function castExpressionToType(argExpr: string, outputType: FunctionType): string { switch (outputType.type) { case ArgumentType.EUint: - return `TFHE.asEuint${outputType.bits}(${argExpr})`; + return `TFHE.asEuint${outputType.bits}(${argExpr}, inputProof)`; case ArgumentType.Uint: return argExpr; case ArgumentType.Ebool: @@ -300,7 +301,7 @@ function castExpressionToType(argExpr: string, outputType: FunctionType): string function functionTypeToCalldataType(t: FunctionType): string { switch (t.type) { case ArgumentType.EUint: - return `bytes calldata`; + return `einput`; case ArgumentType.Uint: return getUint(t.bits); case ArgumentType.Ebool: diff --git a/examples/BlindAuction.sol b/examples/BlindAuction.sol index d1e70ba4..391e0316 100644 --- a/examples/BlindAuction.sol +++ b/examples/BlindAuction.sol @@ -57,8 +57,8 @@ contract BlindAuction is Reencrypt { } // Bid an `encryptedValue`. - function bid(bytes calldata encryptedValue) public onlyBeforeEnd { - euint64 value = TFHE.asEuint64(encryptedValue); + function bid(einput encryptedValue, bytes calldata inputProof) public onlyBeforeEnd { + euint64 value = TFHE.asEuint64(encryptedValue, inputProof); euint64 existingBid = bids[msg.sender]; if (TFHE.isInitialized(existingBid)) { euint64 balanceBefore = tokenContract.balanceOfMe(); diff --git a/examples/CMUX.sol b/examples/CMUX.sol index f9fd35a4..f66b5b2b 100644 --- a/examples/CMUX.sol +++ b/examples/CMUX.sol @@ -12,10 +12,10 @@ contract SELECT is Reencrypt { constructor() {} // Set result = if control { ifTrue } else { ifFalse } - function select(bytes calldata controlBytes, bytes calldata ifTrueBytes, bytes calldata ifFalseBytes) public { - ebool control = TFHE.asEbool(controlBytes); - euint8 ifTrue = TFHE.asEuint8(ifTrueBytes); - euint8 ifFalse = TFHE.asEuint8(ifFalseBytes); + function select(einput controlBytes, einput ifTrueBytes, einput ifFalseBytes, bytes calldata inputProof) public { + ebool control = TFHE.asEbool(controlBytes, inputProof); + euint8 ifTrue = TFHE.asEuint8(ifTrueBytes, inputProof); + euint8 ifFalse = TFHE.asEuint8(ifFalseBytes, inputProof); result = TFHE.select(control, ifTrue, ifFalse); } diff --git a/examples/EncryptedERC20.sol b/examples/EncryptedERC20.sol index 4b76fb52..54caf290 100644 --- a/examples/EncryptedERC20.sol +++ b/examples/EncryptedERC20.sol @@ -51,8 +51,8 @@ contract EncryptedERC20 is Ownable2Step { } // Transfers an encrypted amount from the message sender address to the `to` address. - function transfer(address to, bytes calldata encryptedAmount) public virtual { - transfer(to, TFHE.asEuint64(encryptedAmount)); + function transfer(address to, einput amount, bytes calldata inputProof) public virtual { + transfer(to, TFHE.asEuint64(amount, inputProof)); } // Transfers an amount from the message sender address to the `to` address. @@ -74,8 +74,8 @@ contract EncryptedERC20 is Ownable2Step { } // Sets the `encryptedAmount` as the allowance of `spender` over the caller's tokens. - function approve(address spender, bytes calldata encryptedAmount) public virtual returns (bool) { - approve(spender, TFHE.asEuint64(encryptedAmount)); + function approve(address spender, einput encryptedAmount, bytes calldata inputProof) public virtual returns (bool) { + approve(spender, TFHE.asEuint64(encryptedAmount, inputProof)); return true; } @@ -95,8 +95,8 @@ contract EncryptedERC20 is Ownable2Step { } // Transfers `encryptedAmount` tokens using the caller's allowance. - function transferFrom(address from, address to, bytes calldata encryptedAmount) public virtual { - transferFrom(from, to, TFHE.asEuint64(encryptedAmount)); + function transferFrom(address from, address to, einput encryptedAmount, bytes calldata inputProof) public virtual { + transferFrom(from, to, TFHE.asEuint64(encryptedAmount, inputProof)); } // Transfers `amount` tokens using the caller's allowance. diff --git a/examples/Governor/Comp.sol b/examples/Governor/Comp.sol index 38ac7fc9..e56bbb31 100644 --- a/examples/Governor/Comp.sol +++ b/examples/Governor/Comp.sol @@ -112,9 +112,9 @@ contract Comp is Reencrypt { * @param encryptedAmount The number of tokens that are approved * @return bool Whether or not the approval succeeded */ - function approve(address spender, bytes calldata encryptedAmount) external returns (bool) { + function approve(address spender, einput encryptedAmount, bytes calldata inputProof) external returns (bool) { address owner = msg.sender; - _approve(owner, spender, TFHE.asEuint64(encryptedAmount)); + _approve(owner, spender, TFHE.asEuint64(encryptedAmount, inputProof)); return true; } @@ -142,8 +142,8 @@ contract Comp is Reencrypt { * @param to The address of the destination account * @param encryptedAmount The number of tokens to transfer */ - function transfer(address to, bytes calldata encryptedAmount) public { - transfer(to, TFHE.asEuint64(encryptedAmount)); + function transfer(address to, einput encryptedAmount, bytes calldata inputProof) public { + transfer(to, TFHE.asEuint64(encryptedAmount, inputProof)); } /** @@ -162,8 +162,13 @@ contract Comp is Reencrypt { * @param encryptedAmount The number of tokens to transfer * @return bool Whether or not the transfer succeeded */ - function transferFrom(address from, address to, bytes calldata encryptedAmount) public returns (bool) { - transferFrom(from, to, TFHE.asEuint64(encryptedAmount)); + function transferFrom( + address from, + address to, + einput encryptedAmount, + bytes calldata inputProof + ) public returns (bool) { + transferFrom(from, to, TFHE.asEuint64(encryptedAmount, inputProof)); return true; } diff --git a/examples/Governor/GovernorZama.sol b/examples/Governor/GovernorZama.sol index a3843e41..af2687ad 100644 --- a/examples/Governor/GovernorZama.sol +++ b/examples/Governor/GovernorZama.sol @@ -337,16 +337,23 @@ contract GovernorZama { } } - function castVote(uint proposalId, bytes calldata support) public { - return castVote(proposalId, TFHE.asEbool(support)); + function castVote(uint proposalId, einput support, bytes calldata inputProof) public { + return castVote(proposalId, TFHE.asEbool(support, inputProof)); } function castVote(uint proposalId, ebool support) public { return _castVote(msg.sender, proposalId, support); } - function castVoteBySig(uint proposalId, bytes calldata support, uint8 v, bytes32 r, bytes32 s) public { - return castVoteBySig(proposalId, TFHE.asEbool(support), v, r, s); + function castVoteBySig( + uint proposalId, + einput support, + bytes calldata inputProof, + uint8 v, + bytes32 r, + bytes32 s + ) public { + return castVoteBySig(proposalId, TFHE.asEbool(support, inputProof), v, r, s); } function castVoteBySig(uint proposalId, ebool support, uint8 v, bytes32 r, bytes32 s) public { diff --git a/examples/Identity/IdentityRegistry.sol b/examples/Identity/IdentityRegistry.sol index b8402aa6..6c7b97f0 100644 --- a/examples/Identity/IdentityRegistry.sol +++ b/examples/Identity/IdentityRegistry.sol @@ -65,8 +65,13 @@ contract IdentityRegistry is Reencrypt, Ownable2Step { } // Set user's identifiers - function setIdentifier(address wallet, string calldata identifier, bytes calldata encryptedValue) public { - euint64 value = TFHE.asEuint64(encryptedValue); + function setIdentifier( + address wallet, + string calldata identifier, + einput encryptedValue, + bytes calldata inputProof + ) public { + euint64 value = TFHE.asEuint64(encryptedValue, inputProof); setIdentifier(wallet, identifier, value); } diff --git a/examples/tests/TFHEManualTestSuite.sol b/examples/tests/TFHEManualTestSuite.sol index b8b0ffa8..cd59051d 100644 --- a/examples/tests/TFHEManualTestSuite.sol +++ b/examples/tests/TFHEManualTestSuite.sol @@ -5,16 +5,11 @@ import "../../abstracts/Reencrypt.sol"; import "../../lib/TFHE.sol"; contract TFHEManualTestSuite is Reencrypt { - function test_eq_array_4( - bytes calldata a, - bytes calldata b, - bytes calldata c, - bytes calldata d - ) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint4 bProc = TFHE.asEuint4(b); - euint4 cProc = TFHE.asEuint4(c); - euint4 dProc = TFHE.asEuint4(d); + function test_eq_array_4(einput a, einput b, einput c, einput d, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); + euint4 cProc = TFHE.asEuint4(c, inputProof); + euint4 dProc = TFHE.asEuint4(d, inputProof); euint4[] memory arrA = new euint4[](2); arrA[0] = aProc; arrA[1] = bProc; @@ -25,16 +20,11 @@ contract TFHEManualTestSuite is Reencrypt { return TFHE.decrypt(result); } - function test_eq_array_8( - bytes calldata a, - bytes calldata b, - bytes calldata c, - bytes calldata d - ) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint8 bProc = TFHE.asEuint8(b); - euint8 cProc = TFHE.asEuint8(c); - euint8 dProc = TFHE.asEuint8(d); + function test_eq_array_8(einput a, einput b, einput c, einput d, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); + euint8 cProc = TFHE.asEuint8(c, inputProof); + euint8 dProc = TFHE.asEuint8(d, inputProof); euint8[] memory arrA = new euint8[](2); arrA[0] = aProc; arrA[1] = bProc; @@ -45,16 +35,11 @@ contract TFHEManualTestSuite is Reencrypt { return TFHE.decrypt(result); } - function test_eq_array_16( - bytes calldata a, - bytes calldata b, - bytes calldata c, - bytes calldata d - ) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint16 bProc = TFHE.asEuint16(b); - euint16 cProc = TFHE.asEuint16(c); - euint16 dProc = TFHE.asEuint16(d); + function test_eq_array_16(einput a, einput b, einput c, einput d, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); + euint16 cProc = TFHE.asEuint16(c, inputProof); + euint16 dProc = TFHE.asEuint16(d, inputProof); euint16[] memory arrA = new euint16[](2); arrA[0] = aProc; arrA[1] = bProc; @@ -65,16 +50,11 @@ contract TFHEManualTestSuite is Reencrypt { return TFHE.decrypt(result); } - function test_eq_array_32( - bytes calldata a, - bytes calldata b, - bytes calldata c, - bytes calldata d - ) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint32 bProc = TFHE.asEuint32(b); - euint32 cProc = TFHE.asEuint32(c); - euint32 dProc = TFHE.asEuint32(d); + function test_eq_array_32(einput a, einput b, einput c, einput d, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); + euint32 cProc = TFHE.asEuint32(c, inputProof); + euint32 dProc = TFHE.asEuint32(d, inputProof); euint32[] memory arrA = new euint32[](2); arrA[0] = aProc; arrA[1] = bProc; @@ -85,16 +65,11 @@ contract TFHEManualTestSuite is Reencrypt { return TFHE.decrypt(result); } - function test_eq_array_64( - bytes calldata a, - bytes calldata b, - bytes calldata c, - bytes calldata d - ) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint64 bProc = TFHE.asEuint64(b); - euint64 cProc = TFHE.asEuint64(c); - euint64 dProc = TFHE.asEuint64(d); + function test_eq_array_64(einput a, einput b, einput c, einput d, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); + euint64 cProc = TFHE.asEuint64(c, inputProof); + euint64 dProc = TFHE.asEuint64(d, inputProof); euint64[] memory arrA = new euint64[](2); arrA[0] = aProc; arrA[1] = bProc; @@ -106,105 +81,108 @@ contract TFHEManualTestSuite is Reencrypt { } function test_select( - bytes calldata control, - bytes calldata ifTrue, - bytes calldata ifFalse + einput control, + einput ifTrue, + einput ifFalse, + bytes calldata inputProof ) public returns (uint32) { - ebool controlProc = TFHE.asEbool(control); - euint32 ifTrueProc = TFHE.asEuint32(ifTrue); - euint32 ifFalseProc = TFHE.asEuint32(ifFalse); + ebool controlProc = TFHE.asEbool(control, inputProof); + euint32 ifTrueProc = TFHE.asEuint32(ifTrue, inputProof); + euint32 ifFalseProc = TFHE.asEuint32(ifFalse, inputProof); return TFHE.decrypt(TFHE.select(controlProc, ifTrueProc, ifFalseProc)); } function test_select_eaddress( - bytes calldata control, - bytes calldata ifTrue, - bytes calldata ifFalse + einput control, + einput ifTrue, + einput ifFalse, + bytes calldata inputProof ) public returns (address) { - ebool controlProc = TFHE.asEbool(control); - eaddress ifTrueProc = TFHE.asEaddress(ifTrue); - eaddress ifFalseProc = TFHE.asEaddress(ifFalse); + ebool controlProc = TFHE.asEbool(control, inputProof); + eaddress ifTrueProc = TFHE.asEaddress(ifTrue, inputProof); + eaddress ifFalseProc = TFHE.asEaddress(ifFalse, inputProof); return TFHE.decrypt(TFHE.select(controlProc, ifTrueProc, ifFalseProc)); } - function test_eq_eaddress_eaddress(bytes calldata a, bytes calldata b) public returns (bool) { - eaddress aProc = TFHE.asEaddress(a); - eaddress bProc = TFHE.asEaddress(b); + function test_eq_eaddress_eaddress(einput a, einput b, bytes calldata inputProof) public returns (bool) { + eaddress aProc = TFHE.asEaddress(a, inputProof); + eaddress bProc = TFHE.asEaddress(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function test_ne_eaddress_eaddress(bytes calldata a, bytes calldata b) public returns (bool) { - eaddress aProc = TFHE.asEaddress(a); - eaddress bProc = TFHE.asEaddress(b); + function test_ne_eaddress_eaddress(einput a, einput b, bytes calldata inputProof) public returns (bool) { + eaddress aProc = TFHE.asEaddress(a, inputProof); + eaddress bProc = TFHE.asEaddress(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function test_eq_eaddress_address(bytes calldata a, address b) public returns (bool) { - eaddress aProc = TFHE.asEaddress(a); + function test_eq_eaddress_address(einput a, bytes calldata inputProof, address b) public returns (bool) { + eaddress aProc = TFHE.asEaddress(a, inputProof); address bProc = b; ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function test_eq_address_eaddress(address b, bytes calldata a) public returns (bool) { - eaddress aProc = TFHE.asEaddress(a); + function test_eq_address_eaddress(address b, einput a, bytes calldata inputProof) public returns (bool) { + eaddress aProc = TFHE.asEaddress(a, inputProof); address bProc = b; ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function test_ne_eaddress_address(bytes calldata a, address b) public returns (bool) { - eaddress aProc = TFHE.asEaddress(a); + function test_ne_eaddress_address(einput a, bytes calldata inputProof, address b) public returns (bool) { + eaddress aProc = TFHE.asEaddress(a, inputProof); address bProc = b; ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function test_ne_address_eaddress(address b, bytes calldata a) public returns (bool) { - eaddress aProc = TFHE.asEaddress(a); + function test_ne_address_eaddress(address b, einput a, bytes calldata inputProof) public returns (bool) { + eaddress aProc = TFHE.asEaddress(a, inputProof); address bProc = b; ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function test_eaddress_decrypt(bytes calldata addr) public returns (address) { - eaddress addProc = TFHE.asEaddress(addr); + function test_eaddress_decrypt(einput addr, bytes calldata inputProof) public returns (address) { + eaddress addProc = TFHE.asEaddress(addr, inputProof); return TFHE.decrypt(addProc); } function test_reencrypt_eaddress( - bytes calldata addr, + einput addr, + bytes calldata inputProof, bytes32 publicKey, bytes calldata signature ) public virtual onlySignedPublicKey(publicKey, signature) returns (bytes memory) { - eaddress addProc = TFHE.asEaddress(addr); + eaddress addProc = TFHE.asEaddress(addr, inputProof); return TFHE.reencrypt(addProc, publicKey); } - function test_ebool_to_euint4_cast(bool input) public returns (uint16) { - return TFHE.decrypt(TFHE.asEuint4(TFHE.asEbool(input))); + function test_ebool_to_euint4_cast(bool inputProof) public returns (uint16) { + return TFHE.decrypt(TFHE.asEuint4(TFHE.asEbool(inputProof))); } - function test_ebool_to_euint8_cast(bool input) public returns (uint16) { - return TFHE.decrypt(TFHE.asEuint8(TFHE.asEbool(input))); + function test_ebool_to_euint8_cast(bool inputProof) public returns (uint16) { + return TFHE.decrypt(TFHE.asEuint8(TFHE.asEbool(inputProof))); } - function test_ebool_to_euint16_cast(bool input) public returns (uint16) { - return TFHE.decrypt(TFHE.asEuint16(TFHE.asEbool(input))); + function test_ebool_to_euint16_cast(bool inputProof) public returns (uint16) { + return TFHE.decrypt(TFHE.asEuint16(TFHE.asEbool(inputProof))); } - function test_ebool_to_euint32_cast(bool input) public returns (uint32) { - return TFHE.decrypt(TFHE.asEuint32(TFHE.asEbool(input))); + function test_ebool_to_euint32_cast(bool inputProof) public returns (uint32) { + return TFHE.decrypt(TFHE.asEuint32(TFHE.asEbool(inputProof))); } - function test_ebool_to_euint64_cast(bool input) public returns (uint64) { - return TFHE.decrypt(TFHE.asEuint64(TFHE.asEbool(input))); + function test_ebool_to_euint64_cast(bool inputProof) public returns (uint64) { + return TFHE.decrypt(TFHE.asEuint64(TFHE.asEbool(inputProof))); } - function test_ebool_not(bool input) public returns (bool) { - return TFHE.decrypt(TFHE.not(TFHE.asEbool(input))); + function test_ebool_not(bool inputProof) public returns (bool) { + return TFHE.decrypt(TFHE.not(TFHE.asEbool(inputProof))); } function test_ebool_and(bool a, bool b) public returns (bool) { diff --git a/examples/tests/TFHETestSuite1.sol b/examples/tests/TFHETestSuite1.sol index cdaa0b89..1221029c 100644 --- a/examples/tests/TFHETestSuite1.sol +++ b/examples/tests/TFHETestSuite1.sol @@ -4,702 +4,702 @@ pragma solidity ^0.8.20; import "../../lib/TFHE.sol"; contract TFHETestSuite1 { - function add_euint4_euint4(bytes calldata a, bytes calldata b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); - euint4 bProc = TFHE.asEuint4(b); + function add_euint4_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint4 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint4_euint4(bytes calldata a, bytes calldata b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); - euint4 bProc = TFHE.asEuint4(b); + function sub_euint4_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint4 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint4_euint4(bytes calldata a, bytes calldata b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); - euint4 bProc = TFHE.asEuint4(b); + function mul_euint4_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint4 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint4_euint4(bytes calldata a, bytes calldata b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); - euint4 bProc = TFHE.asEuint4(b); + function and_euint4_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint4 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint4_euint4(bytes calldata a, bytes calldata b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); - euint4 bProc = TFHE.asEuint4(b); + function or_euint4_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint4 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint4_euint4(bytes calldata a, bytes calldata b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); - euint4 bProc = TFHE.asEuint4(b); + function xor_euint4_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint4 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint4_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint4 bProc = TFHE.asEuint4(b); + function eq_euint4_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint4_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint4 bProc = TFHE.asEuint4(b); + function ne_euint4_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint4_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint4 bProc = TFHE.asEuint4(b); + function ge_euint4_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint4_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint4 bProc = TFHE.asEuint4(b); + function gt_euint4_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint4_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint4 bProc = TFHE.asEuint4(b); + function le_euint4_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint4_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint4 bProc = TFHE.asEuint4(b); + function lt_euint4_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint4_euint4(bytes calldata a, bytes calldata b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); - euint4 bProc = TFHE.asEuint4(b); + function min_euint4_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint4 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint4_euint4(bytes calldata a, bytes calldata b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); - euint4 bProc = TFHE.asEuint4(b); + function max_euint4_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint4 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint4_euint8(bytes calldata a, bytes calldata b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); - euint8 bProc = TFHE.asEuint8(b); + function add_euint4_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint4_euint8(bytes calldata a, bytes calldata b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); - euint8 bProc = TFHE.asEuint8(b); + function sub_euint4_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint4_euint8(bytes calldata a, bytes calldata b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); - euint8 bProc = TFHE.asEuint8(b); + function mul_euint4_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint4_euint8(bytes calldata a, bytes calldata b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); - euint8 bProc = TFHE.asEuint8(b); + function and_euint4_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint4_euint8(bytes calldata a, bytes calldata b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); - euint8 bProc = TFHE.asEuint8(b); + function or_euint4_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint4_euint8(bytes calldata a, bytes calldata b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); - euint8 bProc = TFHE.asEuint8(b); + function xor_euint4_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint4_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint8 bProc = TFHE.asEuint8(b); + function eq_euint4_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint4_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint8 bProc = TFHE.asEuint8(b); + function ne_euint4_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint4_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint8 bProc = TFHE.asEuint8(b); + function ge_euint4_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint4_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint8 bProc = TFHE.asEuint8(b); + function gt_euint4_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint4_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint8 bProc = TFHE.asEuint8(b); + function le_euint4_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint4_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint8 bProc = TFHE.asEuint8(b); + function lt_euint4_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint4_euint8(bytes calldata a, bytes calldata b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); - euint8 bProc = TFHE.asEuint8(b); + function min_euint4_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint4_euint8(bytes calldata a, bytes calldata b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); - euint8 bProc = TFHE.asEuint8(b); + function max_euint4_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint4_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint4 aProc = TFHE.asEuint4(a); - euint16 bProc = TFHE.asEuint16(b); + function add_euint4_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint4_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint4 aProc = TFHE.asEuint4(a); - euint16 bProc = TFHE.asEuint16(b); + function sub_euint4_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint4_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint4 aProc = TFHE.asEuint4(a); - euint16 bProc = TFHE.asEuint16(b); + function mul_euint4_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint4_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint4 aProc = TFHE.asEuint4(a); - euint16 bProc = TFHE.asEuint16(b); + function and_euint4_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint4_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint4 aProc = TFHE.asEuint4(a); - euint16 bProc = TFHE.asEuint16(b); + function or_euint4_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint4_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint4 aProc = TFHE.asEuint4(a); - euint16 bProc = TFHE.asEuint16(b); + function xor_euint4_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint4_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint16 bProc = TFHE.asEuint16(b); + function eq_euint4_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint4_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint16 bProc = TFHE.asEuint16(b); + function ne_euint4_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint4_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint16 bProc = TFHE.asEuint16(b); + function ge_euint4_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint4_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint16 bProc = TFHE.asEuint16(b); + function gt_euint4_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint4_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint16 bProc = TFHE.asEuint16(b); + function le_euint4_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint4_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint16 bProc = TFHE.asEuint16(b); + function lt_euint4_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint4_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint4 aProc = TFHE.asEuint4(a); - euint16 bProc = TFHE.asEuint16(b); + function min_euint4_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint4_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint4 aProc = TFHE.asEuint4(a); - euint16 bProc = TFHE.asEuint16(b); + function max_euint4_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint4_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint4 aProc = TFHE.asEuint4(a); - euint32 bProc = TFHE.asEuint32(b); + function add_euint4_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint4_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint4 aProc = TFHE.asEuint4(a); - euint32 bProc = TFHE.asEuint32(b); + function sub_euint4_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint4_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint4 aProc = TFHE.asEuint4(a); - euint32 bProc = TFHE.asEuint32(b); + function mul_euint4_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint4_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint4 aProc = TFHE.asEuint4(a); - euint32 bProc = TFHE.asEuint32(b); + function and_euint4_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint4_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint4 aProc = TFHE.asEuint4(a); - euint32 bProc = TFHE.asEuint32(b); + function or_euint4_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint4_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint4 aProc = TFHE.asEuint4(a); - euint32 bProc = TFHE.asEuint32(b); + function xor_euint4_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint4_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint32 bProc = TFHE.asEuint32(b); + function eq_euint4_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint4_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint32 bProc = TFHE.asEuint32(b); + function ne_euint4_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint4_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint32 bProc = TFHE.asEuint32(b); + function ge_euint4_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint4_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint32 bProc = TFHE.asEuint32(b); + function gt_euint4_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint4_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint32 bProc = TFHE.asEuint32(b); + function le_euint4_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint4_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint32 bProc = TFHE.asEuint32(b); + function lt_euint4_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint4_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint4 aProc = TFHE.asEuint4(a); - euint32 bProc = TFHE.asEuint32(b); + function min_euint4_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint4_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint4 aProc = TFHE.asEuint4(a); - euint32 bProc = TFHE.asEuint32(b); + function max_euint4_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint4_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint4 aProc = TFHE.asEuint4(a); - euint64 bProc = TFHE.asEuint64(b); + function add_euint4_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint4_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint4 aProc = TFHE.asEuint4(a); - euint64 bProc = TFHE.asEuint64(b); + function sub_euint4_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint4_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint4 aProc = TFHE.asEuint4(a); - euint64 bProc = TFHE.asEuint64(b); + function mul_euint4_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint4_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint4 aProc = TFHE.asEuint4(a); - euint64 bProc = TFHE.asEuint64(b); + function and_euint4_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint4_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint4 aProc = TFHE.asEuint4(a); - euint64 bProc = TFHE.asEuint64(b); + function or_euint4_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint4_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint4 aProc = TFHE.asEuint4(a); - euint64 bProc = TFHE.asEuint64(b); + function xor_euint4_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint4_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint64 bProc = TFHE.asEuint64(b); + function eq_euint4_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint4_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint64 bProc = TFHE.asEuint64(b); + function ne_euint4_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint4_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint64 bProc = TFHE.asEuint64(b); + function ge_euint4_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint4_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint64 bProc = TFHE.asEuint64(b); + function gt_euint4_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint4_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint64 bProc = TFHE.asEuint64(b); + function le_euint4_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint4_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); - euint64 bProc = TFHE.asEuint64(b); + function lt_euint4_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint4_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint4 aProc = TFHE.asEuint4(a); - euint64 bProc = TFHE.asEuint64(b); + function min_euint4_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint4_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint4 aProc = TFHE.asEuint4(a); - euint64 bProc = TFHE.asEuint64(b); + function max_euint4_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint4 aProc = TFHE.asEuint4(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint4_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); + function add_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); uint8 bProc = b; euint4 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function add_uint8_euint4(uint8 a, bytes calldata b) public returns (uint8) { + function add_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public returns (uint8) { uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint4 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint4_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); + function sub_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); uint8 bProc = b; euint4 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function sub_uint8_euint4(uint8 a, bytes calldata b) public returns (uint8) { + function sub_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public returns (uint8) { uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint4 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint4_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); + function mul_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); uint8 bProc = b; euint4 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function mul_uint8_euint4(uint8 a, bytes calldata b) public returns (uint8) { + function mul_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public returns (uint8) { uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint4 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function div_euint4_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); + function div_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); uint8 bProc = b; euint4 result = TFHE.div(aProc, bProc); return TFHE.decrypt(result); } - function rem_euint4_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); + function rem_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); uint8 bProc = b; euint4 result = TFHE.rem(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint4_uint8(bytes calldata a, uint8 b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); + function eq_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); uint8 bProc = b; ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function eq_uint8_euint4(uint8 a, bytes calldata b) public returns (bool) { + function eq_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public returns (bool) { uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint4_uint8(bytes calldata a, uint8 b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); + function ne_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); uint8 bProc = b; ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ne_uint8_euint4(uint8 a, bytes calldata b) public returns (bool) { + function ne_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public returns (bool) { uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint4_uint8(bytes calldata a, uint8 b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); + function ge_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); uint8 bProc = b; ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function ge_uint8_euint4(uint8 a, bytes calldata b) public returns (bool) { + function ge_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public returns (bool) { uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint4_uint8(bytes calldata a, uint8 b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); + function gt_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); uint8 bProc = b; ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function gt_uint8_euint4(uint8 a, bytes calldata b) public returns (bool) { + function gt_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public returns (bool) { uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint4_uint8(bytes calldata a, uint8 b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); + function le_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); uint8 bProc = b; ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function le_uint8_euint4(uint8 a, bytes calldata b) public returns (bool) { + function le_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public returns (bool) { uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint4_uint8(bytes calldata a, uint8 b) public returns (bool) { - euint4 aProc = TFHE.asEuint4(a); + function lt_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (bool) { + euint4 aProc = TFHE.asEuint4(a, inputProof); uint8 bProc = b; ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function lt_uint8_euint4(uint8 a, bytes calldata b) public returns (bool) { + function lt_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public returns (bool) { uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint4_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); + function min_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); uint8 bProc = b; euint4 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function min_uint8_euint4(uint8 a, bytes calldata b) public returns (uint8) { + function min_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public returns (uint8) { uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint4 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint4_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); + function max_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); uint8 bProc = b; euint4 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function max_uint8_euint4(uint8 a, bytes calldata b) public returns (uint8) { + function max_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public returns (uint8) { uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint4 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint8_euint4(bytes calldata a, bytes calldata b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); - euint4 bProc = TFHE.asEuint4(b); + function add_euint8_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint8 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint8_euint4(bytes calldata a, bytes calldata b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); - euint4 bProc = TFHE.asEuint4(b); + function sub_euint8_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint8 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint8_euint4(bytes calldata a, bytes calldata b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); - euint4 bProc = TFHE.asEuint4(b); + function mul_euint8_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint8 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint8_euint4(bytes calldata a, bytes calldata b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); - euint4 bProc = TFHE.asEuint4(b); + function and_euint8_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint8 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint8_euint4(bytes calldata a, bytes calldata b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); - euint4 bProc = TFHE.asEuint4(b); + function or_euint8_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint8 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint8_euint4(bytes calldata a, bytes calldata b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); - euint4 bProc = TFHE.asEuint4(b); + function xor_euint8_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint8 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } diff --git a/examples/tests/TFHETestSuite2.sol b/examples/tests/TFHETestSuite2.sol index d6e05200..b0cd7523 100644 --- a/examples/tests/TFHETestSuite2.sol +++ b/examples/tests/TFHETestSuite2.sol @@ -4,702 +4,702 @@ pragma solidity ^0.8.20; import "../../lib/TFHE.sol"; contract TFHETestSuite2 { - function eq_euint8_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint4 bProc = TFHE.asEuint4(b); + function eq_euint8_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint8_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint4 bProc = TFHE.asEuint4(b); + function ne_euint8_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint8_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint4 bProc = TFHE.asEuint4(b); + function ge_euint8_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint8_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint4 bProc = TFHE.asEuint4(b); + function gt_euint8_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint8_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint4 bProc = TFHE.asEuint4(b); + function le_euint8_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint8_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint4 bProc = TFHE.asEuint4(b); + function lt_euint8_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint8_euint4(bytes calldata a, bytes calldata b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); - euint4 bProc = TFHE.asEuint4(b); + function min_euint8_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint8 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint8_euint4(bytes calldata a, bytes calldata b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); - euint4 bProc = TFHE.asEuint4(b); + function max_euint8_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint8 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint8_euint8(bytes calldata a, bytes calldata b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); - euint8 bProc = TFHE.asEuint8(b); + function add_euint8_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint8_euint8(bytes calldata a, bytes calldata b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); - euint8 bProc = TFHE.asEuint8(b); + function sub_euint8_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint8_euint8(bytes calldata a, bytes calldata b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); - euint8 bProc = TFHE.asEuint8(b); + function mul_euint8_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint8_euint8(bytes calldata a, bytes calldata b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); - euint8 bProc = TFHE.asEuint8(b); + function and_euint8_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint8_euint8(bytes calldata a, bytes calldata b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); - euint8 bProc = TFHE.asEuint8(b); + function or_euint8_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint8_euint8(bytes calldata a, bytes calldata b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); - euint8 bProc = TFHE.asEuint8(b); + function xor_euint8_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint8_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint8 bProc = TFHE.asEuint8(b); + function eq_euint8_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint8_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint8 bProc = TFHE.asEuint8(b); + function ne_euint8_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint8_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint8 bProc = TFHE.asEuint8(b); + function ge_euint8_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint8_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint8 bProc = TFHE.asEuint8(b); + function gt_euint8_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint8_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint8 bProc = TFHE.asEuint8(b); + function le_euint8_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint8_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint8 bProc = TFHE.asEuint8(b); + function lt_euint8_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint8_euint8(bytes calldata a, bytes calldata b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); - euint8 bProc = TFHE.asEuint8(b); + function min_euint8_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint8_euint8(bytes calldata a, bytes calldata b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); - euint8 bProc = TFHE.asEuint8(b); + function max_euint8_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint8_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint8 aProc = TFHE.asEuint8(a); - euint16 bProc = TFHE.asEuint16(b); + function add_euint8_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint8_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint8 aProc = TFHE.asEuint8(a); - euint16 bProc = TFHE.asEuint16(b); + function sub_euint8_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint8_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint8 aProc = TFHE.asEuint8(a); - euint16 bProc = TFHE.asEuint16(b); + function mul_euint8_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint8_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint8 aProc = TFHE.asEuint8(a); - euint16 bProc = TFHE.asEuint16(b); + function and_euint8_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint8_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint8 aProc = TFHE.asEuint8(a); - euint16 bProc = TFHE.asEuint16(b); + function or_euint8_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint8_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint8 aProc = TFHE.asEuint8(a); - euint16 bProc = TFHE.asEuint16(b); + function xor_euint8_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint8_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint16 bProc = TFHE.asEuint16(b); + function eq_euint8_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint8_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint16 bProc = TFHE.asEuint16(b); + function ne_euint8_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint8_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint16 bProc = TFHE.asEuint16(b); + function ge_euint8_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint8_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint16 bProc = TFHE.asEuint16(b); + function gt_euint8_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint8_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint16 bProc = TFHE.asEuint16(b); + function le_euint8_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint8_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint16 bProc = TFHE.asEuint16(b); + function lt_euint8_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint8_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint8 aProc = TFHE.asEuint8(a); - euint16 bProc = TFHE.asEuint16(b); + function min_euint8_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint8_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint8 aProc = TFHE.asEuint8(a); - euint16 bProc = TFHE.asEuint16(b); + function max_euint8_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint8_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint8 aProc = TFHE.asEuint8(a); - euint32 bProc = TFHE.asEuint32(b); + function add_euint8_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint8_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint8 aProc = TFHE.asEuint8(a); - euint32 bProc = TFHE.asEuint32(b); + function sub_euint8_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint8_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint8 aProc = TFHE.asEuint8(a); - euint32 bProc = TFHE.asEuint32(b); + function mul_euint8_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint8_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint8 aProc = TFHE.asEuint8(a); - euint32 bProc = TFHE.asEuint32(b); + function and_euint8_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint8_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint8 aProc = TFHE.asEuint8(a); - euint32 bProc = TFHE.asEuint32(b); + function or_euint8_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint8_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint8 aProc = TFHE.asEuint8(a); - euint32 bProc = TFHE.asEuint32(b); + function xor_euint8_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint8_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint32 bProc = TFHE.asEuint32(b); + function eq_euint8_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint8_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint32 bProc = TFHE.asEuint32(b); + function ne_euint8_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint8_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint32 bProc = TFHE.asEuint32(b); + function ge_euint8_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint8_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint32 bProc = TFHE.asEuint32(b); + function gt_euint8_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint8_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint32 bProc = TFHE.asEuint32(b); + function le_euint8_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint8_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint32 bProc = TFHE.asEuint32(b); + function lt_euint8_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint8_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint8 aProc = TFHE.asEuint8(a); - euint32 bProc = TFHE.asEuint32(b); + function min_euint8_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint8_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint8 aProc = TFHE.asEuint8(a); - euint32 bProc = TFHE.asEuint32(b); + function max_euint8_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint8_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint8 aProc = TFHE.asEuint8(a); - euint64 bProc = TFHE.asEuint64(b); + function add_euint8_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint8_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint8 aProc = TFHE.asEuint8(a); - euint64 bProc = TFHE.asEuint64(b); + function sub_euint8_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint8_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint8 aProc = TFHE.asEuint8(a); - euint64 bProc = TFHE.asEuint64(b); + function mul_euint8_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint8_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint8 aProc = TFHE.asEuint8(a); - euint64 bProc = TFHE.asEuint64(b); + function and_euint8_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint8_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint8 aProc = TFHE.asEuint8(a); - euint64 bProc = TFHE.asEuint64(b); + function or_euint8_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint8_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint8 aProc = TFHE.asEuint8(a); - euint64 bProc = TFHE.asEuint64(b); + function xor_euint8_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint8_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint64 bProc = TFHE.asEuint64(b); + function eq_euint8_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint8_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint64 bProc = TFHE.asEuint64(b); + function ne_euint8_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint8_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint64 bProc = TFHE.asEuint64(b); + function ge_euint8_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint8_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint64 bProc = TFHE.asEuint64(b); + function gt_euint8_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint8_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint64 bProc = TFHE.asEuint64(b); + function le_euint8_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint8_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); - euint64 bProc = TFHE.asEuint64(b); + function lt_euint8_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint8_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint8 aProc = TFHE.asEuint8(a); - euint64 bProc = TFHE.asEuint64(b); + function min_euint8_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint8_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint8 aProc = TFHE.asEuint8(a); - euint64 bProc = TFHE.asEuint64(b); + function max_euint8_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint8_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); + function add_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); uint8 bProc = b; euint8 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function add_uint8_euint8(uint8 a, bytes calldata b) public returns (uint8) { + function add_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public returns (uint8) { uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint8_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); + function sub_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); uint8 bProc = b; euint8 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function sub_uint8_euint8(uint8 a, bytes calldata b) public returns (uint8) { + function sub_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public returns (uint8) { uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint8_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); + function mul_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); uint8 bProc = b; euint8 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function mul_uint8_euint8(uint8 a, bytes calldata b) public returns (uint8) { + function mul_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public returns (uint8) { uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function div_euint8_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); + function div_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); uint8 bProc = b; euint8 result = TFHE.div(aProc, bProc); return TFHE.decrypt(result); } - function rem_euint8_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); + function rem_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); uint8 bProc = b; euint8 result = TFHE.rem(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint8_uint8(bytes calldata a, uint8 b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); + function eq_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); uint8 bProc = b; ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function eq_uint8_euint8(uint8 a, bytes calldata b) public returns (bool) { + function eq_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public returns (bool) { uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint8_uint8(bytes calldata a, uint8 b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); + function ne_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); uint8 bProc = b; ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ne_uint8_euint8(uint8 a, bytes calldata b) public returns (bool) { + function ne_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public returns (bool) { uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint8_uint8(bytes calldata a, uint8 b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); + function ge_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); uint8 bProc = b; ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function ge_uint8_euint8(uint8 a, bytes calldata b) public returns (bool) { + function ge_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public returns (bool) { uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint8_uint8(bytes calldata a, uint8 b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); + function gt_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); uint8 bProc = b; ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function gt_uint8_euint8(uint8 a, bytes calldata b) public returns (bool) { + function gt_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public returns (bool) { uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint8_uint8(bytes calldata a, uint8 b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); + function le_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); uint8 bProc = b; ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function le_uint8_euint8(uint8 a, bytes calldata b) public returns (bool) { + function le_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public returns (bool) { uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint8_uint8(bytes calldata a, uint8 b) public returns (bool) { - euint8 aProc = TFHE.asEuint8(a); + function lt_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (bool) { + euint8 aProc = TFHE.asEuint8(a, inputProof); uint8 bProc = b; ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function lt_uint8_euint8(uint8 a, bytes calldata b) public returns (bool) { + function lt_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public returns (bool) { uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint8_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); + function min_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); uint8 bProc = b; euint8 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function min_uint8_euint8(uint8 a, bytes calldata b) public returns (uint8) { + function min_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public returns (uint8) { uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint8_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); + function max_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); uint8 bProc = b; euint8 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function max_uint8_euint8(uint8 a, bytes calldata b) public returns (uint8) { + function max_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public returns (uint8) { uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint16_euint4(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint4 bProc = TFHE.asEuint4(b); + function add_euint16_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint16 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint16_euint4(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint4 bProc = TFHE.asEuint4(b); + function sub_euint16_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint16 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint16_euint4(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint4 bProc = TFHE.asEuint4(b); + function mul_euint16_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint16 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint16_euint4(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint4 bProc = TFHE.asEuint4(b); + function and_euint16_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint16 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint16_euint4(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint4 bProc = TFHE.asEuint4(b); + function or_euint16_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint16 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint16_euint4(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint4 bProc = TFHE.asEuint4(b); + function xor_euint16_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint16 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint16_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint4 bProc = TFHE.asEuint4(b); + function eq_euint16_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint16_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint4 bProc = TFHE.asEuint4(b); + function ne_euint16_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint16_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint4 bProc = TFHE.asEuint4(b); + function ge_euint16_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint16_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint4 bProc = TFHE.asEuint4(b); + function gt_euint16_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint16_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint4 bProc = TFHE.asEuint4(b); + function le_euint16_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint16_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint4 bProc = TFHE.asEuint4(b); + function lt_euint16_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } diff --git a/examples/tests/TFHETestSuite3.sol b/examples/tests/TFHETestSuite3.sol index 94c3e79b..7b16e6ed 100644 --- a/examples/tests/TFHETestSuite3.sol +++ b/examples/tests/TFHETestSuite3.sol @@ -4,702 +4,702 @@ pragma solidity ^0.8.20; import "../../lib/TFHE.sol"; contract TFHETestSuite3 { - function min_euint16_euint4(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint4 bProc = TFHE.asEuint4(b); + function min_euint16_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint16 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint16_euint4(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint4 bProc = TFHE.asEuint4(b); + function max_euint16_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint16 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint16_euint8(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint8 bProc = TFHE.asEuint8(b); + function add_euint16_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint16 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint16_euint8(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint8 bProc = TFHE.asEuint8(b); + function sub_euint16_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint16 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint16_euint8(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint8 bProc = TFHE.asEuint8(b); + function mul_euint16_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint16 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint16_euint8(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint8 bProc = TFHE.asEuint8(b); + function and_euint16_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint16 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint16_euint8(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint8 bProc = TFHE.asEuint8(b); + function or_euint16_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint16 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint16_euint8(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint8 bProc = TFHE.asEuint8(b); + function xor_euint16_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint16 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint16_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint8 bProc = TFHE.asEuint8(b); + function eq_euint16_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint16_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint8 bProc = TFHE.asEuint8(b); + function ne_euint16_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint16_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint8 bProc = TFHE.asEuint8(b); + function ge_euint16_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint16_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint8 bProc = TFHE.asEuint8(b); + function gt_euint16_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint16_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint8 bProc = TFHE.asEuint8(b); + function le_euint16_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint16_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint8 bProc = TFHE.asEuint8(b); + function lt_euint16_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint16_euint8(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint8 bProc = TFHE.asEuint8(b); + function min_euint16_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint16 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint16_euint8(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint8 bProc = TFHE.asEuint8(b); + function max_euint16_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint16 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint16_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint16 bProc = TFHE.asEuint16(b); + function add_euint16_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint16_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint16 bProc = TFHE.asEuint16(b); + function sub_euint16_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint16_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint16 bProc = TFHE.asEuint16(b); + function mul_euint16_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint16_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint16 bProc = TFHE.asEuint16(b); + function and_euint16_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint16_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint16 bProc = TFHE.asEuint16(b); + function or_euint16_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint16_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint16 bProc = TFHE.asEuint16(b); + function xor_euint16_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint16_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint16 bProc = TFHE.asEuint16(b); + function eq_euint16_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint16_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint16 bProc = TFHE.asEuint16(b); + function ne_euint16_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint16_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint16 bProc = TFHE.asEuint16(b); + function ge_euint16_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint16_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint16 bProc = TFHE.asEuint16(b); + function gt_euint16_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint16_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint16 bProc = TFHE.asEuint16(b); + function le_euint16_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint16_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint16 bProc = TFHE.asEuint16(b); + function lt_euint16_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint16_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint16 bProc = TFHE.asEuint16(b); + function min_euint16_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint16_euint16(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint16 bProc = TFHE.asEuint16(b); + function max_euint16_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint16_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint16 aProc = TFHE.asEuint16(a); - euint32 bProc = TFHE.asEuint32(b); + function add_euint16_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint16_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint16 aProc = TFHE.asEuint16(a); - euint32 bProc = TFHE.asEuint32(b); + function sub_euint16_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint16_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint16 aProc = TFHE.asEuint16(a); - euint32 bProc = TFHE.asEuint32(b); + function mul_euint16_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint16_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint16 aProc = TFHE.asEuint16(a); - euint32 bProc = TFHE.asEuint32(b); + function and_euint16_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint16_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint16 aProc = TFHE.asEuint16(a); - euint32 bProc = TFHE.asEuint32(b); + function or_euint16_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint16_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint16 aProc = TFHE.asEuint16(a); - euint32 bProc = TFHE.asEuint32(b); + function xor_euint16_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint16_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint32 bProc = TFHE.asEuint32(b); + function eq_euint16_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint16_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint32 bProc = TFHE.asEuint32(b); + function ne_euint16_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint16_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint32 bProc = TFHE.asEuint32(b); + function ge_euint16_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint16_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint32 bProc = TFHE.asEuint32(b); + function gt_euint16_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint16_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint32 bProc = TFHE.asEuint32(b); + function le_euint16_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint16_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint32 bProc = TFHE.asEuint32(b); + function lt_euint16_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint16_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint16 aProc = TFHE.asEuint16(a); - euint32 bProc = TFHE.asEuint32(b); + function min_euint16_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint16_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint16 aProc = TFHE.asEuint16(a); - euint32 bProc = TFHE.asEuint32(b); + function max_euint16_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint16_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint16 aProc = TFHE.asEuint16(a); - euint64 bProc = TFHE.asEuint64(b); + function add_euint16_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint16_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint16 aProc = TFHE.asEuint16(a); - euint64 bProc = TFHE.asEuint64(b); + function sub_euint16_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint16_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint16 aProc = TFHE.asEuint16(a); - euint64 bProc = TFHE.asEuint64(b); + function mul_euint16_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint16_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint16 aProc = TFHE.asEuint16(a); - euint64 bProc = TFHE.asEuint64(b); + function and_euint16_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint16_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint16 aProc = TFHE.asEuint16(a); - euint64 bProc = TFHE.asEuint64(b); + function or_euint16_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint16_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint16 aProc = TFHE.asEuint16(a); - euint64 bProc = TFHE.asEuint64(b); + function xor_euint16_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint16_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint64 bProc = TFHE.asEuint64(b); + function eq_euint16_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint16_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint64 bProc = TFHE.asEuint64(b); + function ne_euint16_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint16_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint64 bProc = TFHE.asEuint64(b); + function ge_euint16_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint16_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint64 bProc = TFHE.asEuint64(b); + function gt_euint16_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint16_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint64 bProc = TFHE.asEuint64(b); + function le_euint16_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint16_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); - euint64 bProc = TFHE.asEuint64(b); + function lt_euint16_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint16_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint16 aProc = TFHE.asEuint16(a); - euint64 bProc = TFHE.asEuint64(b); + function min_euint16_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint16_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint16 aProc = TFHE.asEuint16(a); - euint64 bProc = TFHE.asEuint64(b); + function max_euint16_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint16_uint16(bytes calldata a, uint16 b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); + function add_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); uint16 bProc = b; euint16 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function add_uint16_euint16(uint16 a, bytes calldata b) public returns (uint16) { + function add_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public returns (uint16) { uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint16_uint16(bytes calldata a, uint16 b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); + function sub_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); uint16 bProc = b; euint16 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function sub_uint16_euint16(uint16 a, bytes calldata b) public returns (uint16) { + function sub_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public returns (uint16) { uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint16_uint16(bytes calldata a, uint16 b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); + function mul_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); uint16 bProc = b; euint16 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function mul_uint16_euint16(uint16 a, bytes calldata b) public returns (uint16) { + function mul_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public returns (uint16) { uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function div_euint16_uint16(bytes calldata a, uint16 b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); + function div_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); uint16 bProc = b; euint16 result = TFHE.div(aProc, bProc); return TFHE.decrypt(result); } - function rem_euint16_uint16(bytes calldata a, uint16 b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); + function rem_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); uint16 bProc = b; euint16 result = TFHE.rem(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint16_uint16(bytes calldata a, uint16 b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); + function eq_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); uint16 bProc = b; ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function eq_uint16_euint16(uint16 a, bytes calldata b) public returns (bool) { + function eq_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public returns (bool) { uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint16_uint16(bytes calldata a, uint16 b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); + function ne_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); uint16 bProc = b; ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ne_uint16_euint16(uint16 a, bytes calldata b) public returns (bool) { + function ne_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public returns (bool) { uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint16_uint16(bytes calldata a, uint16 b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); + function ge_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); uint16 bProc = b; ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function ge_uint16_euint16(uint16 a, bytes calldata b) public returns (bool) { + function ge_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public returns (bool) { uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint16_uint16(bytes calldata a, uint16 b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); + function gt_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); uint16 bProc = b; ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function gt_uint16_euint16(uint16 a, bytes calldata b) public returns (bool) { + function gt_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public returns (bool) { uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint16_uint16(bytes calldata a, uint16 b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); + function le_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); uint16 bProc = b; ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function le_uint16_euint16(uint16 a, bytes calldata b) public returns (bool) { + function le_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public returns (bool) { uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint16_uint16(bytes calldata a, uint16 b) public returns (bool) { - euint16 aProc = TFHE.asEuint16(a); + function lt_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public returns (bool) { + euint16 aProc = TFHE.asEuint16(a, inputProof); uint16 bProc = b; ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function lt_uint16_euint16(uint16 a, bytes calldata b) public returns (bool) { + function lt_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public returns (bool) { uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint16_uint16(bytes calldata a, uint16 b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); + function min_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); uint16 bProc = b; euint16 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function min_uint16_euint16(uint16 a, bytes calldata b) public returns (uint16) { + function min_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public returns (uint16) { uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint16_uint16(bytes calldata a, uint16 b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); + function max_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); uint16 bProc = b; euint16 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function max_uint16_euint16(uint16 a, bytes calldata b) public returns (uint16) { + function max_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public returns (uint16) { uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint16 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint32_euint4(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint4 bProc = TFHE.asEuint4(b); + function add_euint32_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint32 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint32_euint4(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint4 bProc = TFHE.asEuint4(b); + function sub_euint32_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint32 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint32_euint4(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint4 bProc = TFHE.asEuint4(b); + function mul_euint32_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint32 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint32_euint4(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint4 bProc = TFHE.asEuint4(b); + function and_euint32_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint32 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint32_euint4(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint4 bProc = TFHE.asEuint4(b); + function or_euint32_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint32 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint32_euint4(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint4 bProc = TFHE.asEuint4(b); + function xor_euint32_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint32 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint32_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint4 bProc = TFHE.asEuint4(b); + function eq_euint32_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint32_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint4 bProc = TFHE.asEuint4(b); + function ne_euint32_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint32_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint4 bProc = TFHE.asEuint4(b); + function ge_euint32_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint32_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint4 bProc = TFHE.asEuint4(b); + function gt_euint32_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint32_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint4 bProc = TFHE.asEuint4(b); + function le_euint32_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint32_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint4 bProc = TFHE.asEuint4(b); + function lt_euint32_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint32_euint4(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint4 bProc = TFHE.asEuint4(b); + function min_euint32_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint32 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint32_euint4(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint4 bProc = TFHE.asEuint4(b); + function max_euint32_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint32 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint32_euint8(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint8 bProc = TFHE.asEuint8(b); + function add_euint32_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint32 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint32_euint8(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint8 bProc = TFHE.asEuint8(b); + function sub_euint32_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint32 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint32_euint8(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint8 bProc = TFHE.asEuint8(b); + function mul_euint32_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint32 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint32_euint8(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint8 bProc = TFHE.asEuint8(b); + function and_euint32_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint32 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } diff --git a/examples/tests/TFHETestSuite4.sol b/examples/tests/TFHETestSuite4.sol index 2af41f99..65066f7d 100644 --- a/examples/tests/TFHETestSuite4.sol +++ b/examples/tests/TFHETestSuite4.sol @@ -4,702 +4,702 @@ pragma solidity ^0.8.20; import "../../lib/TFHE.sol"; contract TFHETestSuite4 { - function or_euint32_euint8(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint8 bProc = TFHE.asEuint8(b); + function or_euint32_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint32 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint32_euint8(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint8 bProc = TFHE.asEuint8(b); + function xor_euint32_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint32 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint32_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint8 bProc = TFHE.asEuint8(b); + function eq_euint32_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint32_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint8 bProc = TFHE.asEuint8(b); + function ne_euint32_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint32_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint8 bProc = TFHE.asEuint8(b); + function ge_euint32_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint32_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint8 bProc = TFHE.asEuint8(b); + function gt_euint32_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint32_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint8 bProc = TFHE.asEuint8(b); + function le_euint32_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint32_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint8 bProc = TFHE.asEuint8(b); + function lt_euint32_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint32_euint8(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint8 bProc = TFHE.asEuint8(b); + function min_euint32_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint32 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint32_euint8(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint8 bProc = TFHE.asEuint8(b); + function max_euint32_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint32 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint32_euint16(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint16 bProc = TFHE.asEuint16(b); + function add_euint32_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint32 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint32_euint16(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint16 bProc = TFHE.asEuint16(b); + function sub_euint32_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint32 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint32_euint16(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint16 bProc = TFHE.asEuint16(b); + function mul_euint32_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint32 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint32_euint16(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint16 bProc = TFHE.asEuint16(b); + function and_euint32_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint32 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint32_euint16(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint16 bProc = TFHE.asEuint16(b); + function or_euint32_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint32 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint32_euint16(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint16 bProc = TFHE.asEuint16(b); + function xor_euint32_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint32 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint32_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint16 bProc = TFHE.asEuint16(b); + function eq_euint32_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint32_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint16 bProc = TFHE.asEuint16(b); + function ne_euint32_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint32_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint16 bProc = TFHE.asEuint16(b); + function ge_euint32_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint32_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint16 bProc = TFHE.asEuint16(b); + function gt_euint32_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint32_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint16 bProc = TFHE.asEuint16(b); + function le_euint32_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint32_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint16 bProc = TFHE.asEuint16(b); + function lt_euint32_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint32_euint16(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint16 bProc = TFHE.asEuint16(b); + function min_euint32_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint32 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint32_euint16(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint16 bProc = TFHE.asEuint16(b); + function max_euint32_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint32 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint32_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint32 bProc = TFHE.asEuint32(b); + function add_euint32_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint32_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint32 bProc = TFHE.asEuint32(b); + function sub_euint32_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint32_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint32 bProc = TFHE.asEuint32(b); + function mul_euint32_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint32_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint32 bProc = TFHE.asEuint32(b); + function and_euint32_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint32_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint32 bProc = TFHE.asEuint32(b); + function or_euint32_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint32_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint32 bProc = TFHE.asEuint32(b); + function xor_euint32_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint32_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint32 bProc = TFHE.asEuint32(b); + function eq_euint32_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint32_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint32 bProc = TFHE.asEuint32(b); + function ne_euint32_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint32_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint32 bProc = TFHE.asEuint32(b); + function ge_euint32_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint32_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint32 bProc = TFHE.asEuint32(b); + function gt_euint32_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint32_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint32 bProc = TFHE.asEuint32(b); + function le_euint32_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint32_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint32 bProc = TFHE.asEuint32(b); + function lt_euint32_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint32_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint32 bProc = TFHE.asEuint32(b); + function min_euint32_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint32_euint32(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint32 bProc = TFHE.asEuint32(b); + function max_euint32_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint32_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint32 aProc = TFHE.asEuint32(a); - euint64 bProc = TFHE.asEuint64(b); + function add_euint32_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint32_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint32 aProc = TFHE.asEuint32(a); - euint64 bProc = TFHE.asEuint64(b); + function sub_euint32_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint32_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint32 aProc = TFHE.asEuint32(a); - euint64 bProc = TFHE.asEuint64(b); + function mul_euint32_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint32_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint32 aProc = TFHE.asEuint32(a); - euint64 bProc = TFHE.asEuint64(b); + function and_euint32_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint32_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint32 aProc = TFHE.asEuint32(a); - euint64 bProc = TFHE.asEuint64(b); + function or_euint32_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint32_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint32 aProc = TFHE.asEuint32(a); - euint64 bProc = TFHE.asEuint64(b); + function xor_euint32_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint32_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint64 bProc = TFHE.asEuint64(b); + function eq_euint32_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint32_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint64 bProc = TFHE.asEuint64(b); + function ne_euint32_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint32_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint64 bProc = TFHE.asEuint64(b); + function ge_euint32_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint32_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint64 bProc = TFHE.asEuint64(b); + function gt_euint32_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint32_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint64 bProc = TFHE.asEuint64(b); + function le_euint32_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint32_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); - euint64 bProc = TFHE.asEuint64(b); + function lt_euint32_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint32_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint32 aProc = TFHE.asEuint32(a); - euint64 bProc = TFHE.asEuint64(b); + function min_euint32_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint32_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint32 aProc = TFHE.asEuint32(a); - euint64 bProc = TFHE.asEuint64(b); + function max_euint32_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint32_uint32(bytes calldata a, uint32 b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); + function add_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); uint32 bProc = b; euint32 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function add_uint32_euint32(uint32 a, bytes calldata b) public returns (uint32) { + function add_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public returns (uint32) { uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint32_uint32(bytes calldata a, uint32 b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); + function sub_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); uint32 bProc = b; euint32 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function sub_uint32_euint32(uint32 a, bytes calldata b) public returns (uint32) { + function sub_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public returns (uint32) { uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint32_uint32(bytes calldata a, uint32 b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); + function mul_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); uint32 bProc = b; euint32 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function mul_uint32_euint32(uint32 a, bytes calldata b) public returns (uint32) { + function mul_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public returns (uint32) { uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function div_euint32_uint32(bytes calldata a, uint32 b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); + function div_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); uint32 bProc = b; euint32 result = TFHE.div(aProc, bProc); return TFHE.decrypt(result); } - function rem_euint32_uint32(bytes calldata a, uint32 b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); + function rem_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); uint32 bProc = b; euint32 result = TFHE.rem(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint32_uint32(bytes calldata a, uint32 b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); + function eq_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); uint32 bProc = b; ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function eq_uint32_euint32(uint32 a, bytes calldata b) public returns (bool) { + function eq_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public returns (bool) { uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint32_uint32(bytes calldata a, uint32 b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); + function ne_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); uint32 bProc = b; ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ne_uint32_euint32(uint32 a, bytes calldata b) public returns (bool) { + function ne_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public returns (bool) { uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint32_uint32(bytes calldata a, uint32 b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); + function ge_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); uint32 bProc = b; ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function ge_uint32_euint32(uint32 a, bytes calldata b) public returns (bool) { + function ge_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public returns (bool) { uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint32_uint32(bytes calldata a, uint32 b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); + function gt_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); uint32 bProc = b; ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function gt_uint32_euint32(uint32 a, bytes calldata b) public returns (bool) { + function gt_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public returns (bool) { uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint32_uint32(bytes calldata a, uint32 b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); + function le_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); uint32 bProc = b; ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function le_uint32_euint32(uint32 a, bytes calldata b) public returns (bool) { + function le_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public returns (bool) { uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint32_uint32(bytes calldata a, uint32 b) public returns (bool) { - euint32 aProc = TFHE.asEuint32(a); + function lt_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public returns (bool) { + euint32 aProc = TFHE.asEuint32(a, inputProof); uint32 bProc = b; ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function lt_uint32_euint32(uint32 a, bytes calldata b) public returns (bool) { + function lt_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public returns (bool) { uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint32_uint32(bytes calldata a, uint32 b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); + function min_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); uint32 bProc = b; euint32 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function min_uint32_euint32(uint32 a, bytes calldata b) public returns (uint32) { + function min_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public returns (uint32) { uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint32_uint32(bytes calldata a, uint32 b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); + function max_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); uint32 bProc = b; euint32 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function max_uint32_euint32(uint32 a, bytes calldata b) public returns (uint32) { + function max_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public returns (uint32) { uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint32 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint64_euint4(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint4 bProc = TFHE.asEuint4(b); + function add_euint64_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint64 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint64_euint4(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint4 bProc = TFHE.asEuint4(b); + function sub_euint64_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint64 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint64_euint4(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint4 bProc = TFHE.asEuint4(b); + function mul_euint64_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint64 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint64_euint4(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint4 bProc = TFHE.asEuint4(b); + function and_euint64_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint64 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint64_euint4(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint4 bProc = TFHE.asEuint4(b); + function or_euint64_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint64 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint64_euint4(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint4 bProc = TFHE.asEuint4(b); + function xor_euint64_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint64 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint64_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint4 bProc = TFHE.asEuint4(b); + function eq_euint64_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint64_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint4 bProc = TFHE.asEuint4(b); + function ne_euint64_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint64_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint4 bProc = TFHE.asEuint4(b); + function ge_euint64_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint64_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint4 bProc = TFHE.asEuint4(b); + function gt_euint64_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint64_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint4 bProc = TFHE.asEuint4(b); + function le_euint64_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint64_euint4(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint4 bProc = TFHE.asEuint4(b); + function lt_euint64_euint4(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint64_euint4(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint4 bProc = TFHE.asEuint4(b); + function min_euint64_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint64 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint64_euint4(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint4 bProc = TFHE.asEuint4(b); + function max_euint64_euint4(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint4 bProc = TFHE.asEuint4(b, inputProof); euint64 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint64_euint8(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint8 bProc = TFHE.asEuint8(b); + function add_euint64_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint64 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint64_euint8(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint8 bProc = TFHE.asEuint8(b); + function sub_euint64_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint64 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint64_euint8(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint8 bProc = TFHE.asEuint8(b); + function mul_euint64_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint64 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint64_euint8(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint8 bProc = TFHE.asEuint8(b); + function and_euint64_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint64 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint64_euint8(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint8 bProc = TFHE.asEuint8(b); + function or_euint64_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint64 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint64_euint8(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint8 bProc = TFHE.asEuint8(b); + function xor_euint64_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint64 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint64_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint8 bProc = TFHE.asEuint8(b); + function eq_euint64_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint64_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint8 bProc = TFHE.asEuint8(b); + function ne_euint64_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint64_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint8 bProc = TFHE.asEuint8(b); + function ge_euint64_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint64_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint8 bProc = TFHE.asEuint8(b); + function gt_euint64_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } diff --git a/examples/tests/TFHETestSuite5.sol b/examples/tests/TFHETestSuite5.sol index 6eb295d5..a140ee2d 100644 --- a/examples/tests/TFHETestSuite5.sol +++ b/examples/tests/TFHETestSuite5.sol @@ -4,701 +4,701 @@ pragma solidity ^0.8.20; import "../../lib/TFHE.sol"; contract TFHETestSuite5 { - function le_euint64_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint8 bProc = TFHE.asEuint8(b); + function le_euint64_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint64_euint8(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint8 bProc = TFHE.asEuint8(b); + function lt_euint64_euint8(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint64_euint8(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint8 bProc = TFHE.asEuint8(b); + function min_euint64_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint64 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint64_euint8(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint8 bProc = TFHE.asEuint8(b); + function max_euint64_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint64 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint64_euint16(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint16 bProc = TFHE.asEuint16(b); + function add_euint64_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint64 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint64_euint16(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint16 bProc = TFHE.asEuint16(b); + function sub_euint64_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint64 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint64_euint16(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint16 bProc = TFHE.asEuint16(b); + function mul_euint64_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint64 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint64_euint16(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint16 bProc = TFHE.asEuint16(b); + function and_euint64_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint64 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint64_euint16(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint16 bProc = TFHE.asEuint16(b); + function or_euint64_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint64 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint64_euint16(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint16 bProc = TFHE.asEuint16(b); + function xor_euint64_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint64 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint64_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint16 bProc = TFHE.asEuint16(b); + function eq_euint64_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint64_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint16 bProc = TFHE.asEuint16(b); + function ne_euint64_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint64_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint16 bProc = TFHE.asEuint16(b); + function ge_euint64_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint64_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint16 bProc = TFHE.asEuint16(b); + function gt_euint64_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint64_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint16 bProc = TFHE.asEuint16(b); + function le_euint64_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint64_euint16(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint16 bProc = TFHE.asEuint16(b); + function lt_euint64_euint16(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint64_euint16(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint16 bProc = TFHE.asEuint16(b); + function min_euint64_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint64 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint64_euint16(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint16 bProc = TFHE.asEuint16(b); + function max_euint64_euint16(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint16 bProc = TFHE.asEuint16(b, inputProof); euint64 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint64_euint32(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint32 bProc = TFHE.asEuint32(b); + function add_euint64_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint64 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint64_euint32(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint32 bProc = TFHE.asEuint32(b); + function sub_euint64_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint64 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint64_euint32(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint32 bProc = TFHE.asEuint32(b); + function mul_euint64_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint64 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint64_euint32(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint32 bProc = TFHE.asEuint32(b); + function and_euint64_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint64 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint64_euint32(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint32 bProc = TFHE.asEuint32(b); + function or_euint64_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint64 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint64_euint32(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint32 bProc = TFHE.asEuint32(b); + function xor_euint64_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint64 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint64_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint32 bProc = TFHE.asEuint32(b); + function eq_euint64_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint64_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint32 bProc = TFHE.asEuint32(b); + function ne_euint64_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint64_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint32 bProc = TFHE.asEuint32(b); + function ge_euint64_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint64_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint32 bProc = TFHE.asEuint32(b); + function gt_euint64_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint64_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint32 bProc = TFHE.asEuint32(b); + function le_euint64_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint64_euint32(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint32 bProc = TFHE.asEuint32(b); + function lt_euint64_euint32(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint64_euint32(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint32 bProc = TFHE.asEuint32(b); + function min_euint64_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint64 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint64_euint32(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint32 bProc = TFHE.asEuint32(b); + function max_euint64_euint32(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint32 bProc = TFHE.asEuint32(b, inputProof); euint64 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint64_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint64 bProc = TFHE.asEuint64(b); + function add_euint64_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint64_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint64 bProc = TFHE.asEuint64(b); + function sub_euint64_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint64_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint64 bProc = TFHE.asEuint64(b); + function mul_euint64_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function and_euint64_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint64 bProc = TFHE.asEuint64(b); + function and_euint64_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.and(aProc, bProc); return TFHE.decrypt(result); } - function or_euint64_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint64 bProc = TFHE.asEuint64(b); + function or_euint64_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.or(aProc, bProc); return TFHE.decrypt(result); } - function xor_euint64_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint64 bProc = TFHE.asEuint64(b); + function xor_euint64_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.xor(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint64_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint64 bProc = TFHE.asEuint64(b); + function eq_euint64_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint64_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint64 bProc = TFHE.asEuint64(b); + function ne_euint64_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint64_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint64 bProc = TFHE.asEuint64(b); + function ge_euint64_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint64_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint64 bProc = TFHE.asEuint64(b); + function gt_euint64_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint64_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint64 bProc = TFHE.asEuint64(b); + function le_euint64_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint64_euint64(bytes calldata a, bytes calldata b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); - euint64 bProc = TFHE.asEuint64(b); + function lt_euint64_euint64(einput a, einput b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint64_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint64 bProc = TFHE.asEuint64(b); + function min_euint64_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint64_euint64(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint64 bProc = TFHE.asEuint64(b); + function max_euint64_euint64(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function add_euint64_uint64(bytes calldata a, uint64 b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); + function add_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); uint64 bProc = b; euint64 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function add_uint64_euint64(uint64 a, bytes calldata b) public returns (uint64) { + function add_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public returns (uint64) { uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.add(aProc, bProc); return TFHE.decrypt(result); } - function sub_euint64_uint64(bytes calldata a, uint64 b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); + function sub_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); uint64 bProc = b; euint64 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function sub_uint64_euint64(uint64 a, bytes calldata b) public returns (uint64) { + function sub_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public returns (uint64) { uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.sub(aProc, bProc); return TFHE.decrypt(result); } - function mul_euint64_uint64(bytes calldata a, uint64 b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); + function mul_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); uint64 bProc = b; euint64 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function mul_uint64_euint64(uint64 a, bytes calldata b) public returns (uint64) { + function mul_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public returns (uint64) { uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.mul(aProc, bProc); return TFHE.decrypt(result); } - function div_euint64_uint64(bytes calldata a, uint64 b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); + function div_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); uint64 bProc = b; euint64 result = TFHE.div(aProc, bProc); return TFHE.decrypt(result); } - function rem_euint64_uint64(bytes calldata a, uint64 b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); + function rem_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); uint64 bProc = b; euint64 result = TFHE.rem(aProc, bProc); return TFHE.decrypt(result); } - function eq_euint64_uint64(bytes calldata a, uint64 b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); + function eq_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); uint64 bProc = b; ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function eq_uint64_euint64(uint64 a, bytes calldata b) public returns (bool) { + function eq_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public returns (bool) { uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.eq(aProc, bProc); return TFHE.decrypt(result); } - function ne_euint64_uint64(bytes calldata a, uint64 b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); + function ne_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); uint64 bProc = b; ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ne_uint64_euint64(uint64 a, bytes calldata b) public returns (bool) { + function ne_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public returns (bool) { uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.ne(aProc, bProc); return TFHE.decrypt(result); } - function ge_euint64_uint64(bytes calldata a, uint64 b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); + function ge_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); uint64 bProc = b; ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function ge_uint64_euint64(uint64 a, bytes calldata b) public returns (bool) { + function ge_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public returns (bool) { uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.ge(aProc, bProc); return TFHE.decrypt(result); } - function gt_euint64_uint64(bytes calldata a, uint64 b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); + function gt_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); uint64 bProc = b; ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function gt_uint64_euint64(uint64 a, bytes calldata b) public returns (bool) { + function gt_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public returns (bool) { uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.gt(aProc, bProc); return TFHE.decrypt(result); } - function le_euint64_uint64(bytes calldata a, uint64 b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); + function le_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); uint64 bProc = b; ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function le_uint64_euint64(uint64 a, bytes calldata b) public returns (bool) { + function le_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public returns (bool) { uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.le(aProc, bProc); return TFHE.decrypt(result); } - function lt_euint64_uint64(bytes calldata a, uint64 b) public returns (bool) { - euint64 aProc = TFHE.asEuint64(a); + function lt_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public returns (bool) { + euint64 aProc = TFHE.asEuint64(a, inputProof); uint64 bProc = b; ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function lt_uint64_euint64(uint64 a, bytes calldata b) public returns (bool) { + function lt_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public returns (bool) { uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b); + euint64 bProc = TFHE.asEuint64(b, inputProof); ebool result = TFHE.lt(aProc, bProc); return TFHE.decrypt(result); } - function min_euint64_uint64(bytes calldata a, uint64 b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); + function min_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); uint64 bProc = b; euint64 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function min_uint64_euint64(uint64 a, bytes calldata b) public returns (uint64) { + function min_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public returns (uint64) { uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.min(aProc, bProc); return TFHE.decrypt(result); } - function max_euint64_uint64(bytes calldata a, uint64 b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); + function max_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); uint64 bProc = b; euint64 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function max_uint64_euint64(uint64 a, bytes calldata b) public returns (uint64) { + function max_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public returns (uint64) { uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b); + euint64 bProc = TFHE.asEuint64(b, inputProof); euint64 result = TFHE.max(aProc, bProc); return TFHE.decrypt(result); } - function shl_euint4_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); + function shl_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); uint8 bProc = b; euint4 result = TFHE.shl(aProc, bProc); return TFHE.decrypt(result); } - function shr_euint4_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); + function shr_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); uint8 bProc = b; euint4 result = TFHE.shr(aProc, bProc); return TFHE.decrypt(result); } - function rotl_euint4_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); + function rotl_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); uint8 bProc = b; euint4 result = TFHE.rotl(aProc, bProc); return TFHE.decrypt(result); } - function rotr_euint4_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); + function rotr_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); uint8 bProc = b; euint4 result = TFHE.rotr(aProc, bProc); return TFHE.decrypt(result); } - function shl_euint8_euint8(bytes calldata a, bytes calldata b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); - euint8 bProc = TFHE.asEuint8(b); + function shl_euint8_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.shl(aProc, bProc); return TFHE.decrypt(result); } - function shl_euint8_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); + function shl_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); uint8 bProc = b; euint8 result = TFHE.shl(aProc, bProc); return TFHE.decrypt(result); } - function shr_euint8_euint8(bytes calldata a, bytes calldata b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); - euint8 bProc = TFHE.asEuint8(b); + function shr_euint8_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.shr(aProc, bProc); return TFHE.decrypt(result); } - function shr_euint8_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); + function shr_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); uint8 bProc = b; euint8 result = TFHE.shr(aProc, bProc); return TFHE.decrypt(result); } - function rotl_euint8_euint8(bytes calldata a, bytes calldata b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); - euint8 bProc = TFHE.asEuint8(b); + function rotl_euint8_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.rotl(aProc, bProc); return TFHE.decrypt(result); } - function rotl_euint8_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); + function rotl_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); uint8 bProc = b; euint8 result = TFHE.rotl(aProc, bProc); return TFHE.decrypt(result); } - function rotr_euint8_euint8(bytes calldata a, bytes calldata b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); - euint8 bProc = TFHE.asEuint8(b); + function rotr_euint8_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint8 result = TFHE.rotr(aProc, bProc); return TFHE.decrypt(result); } - function rotr_euint8_uint8(bytes calldata a, uint8 b) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); + function rotr_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); uint8 bProc = b; euint8 result = TFHE.rotr(aProc, bProc); return TFHE.decrypt(result); } - function shl_euint16_euint8(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint8 bProc = TFHE.asEuint8(b); + function shl_euint16_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint16 result = TFHE.shl(aProc, bProc); return TFHE.decrypt(result); } - function shl_euint16_uint8(bytes calldata a, uint8 b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); + function shl_euint16_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); uint8 bProc = b; euint16 result = TFHE.shl(aProc, bProc); return TFHE.decrypt(result); } - function shr_euint16_euint8(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint8 bProc = TFHE.asEuint8(b); + function shr_euint16_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint16 result = TFHE.shr(aProc, bProc); return TFHE.decrypt(result); } - function shr_euint16_uint8(bytes calldata a, uint8 b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); + function shr_euint16_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); uint8 bProc = b; euint16 result = TFHE.shr(aProc, bProc); return TFHE.decrypt(result); } - function rotl_euint16_euint8(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint8 bProc = TFHE.asEuint8(b); + function rotl_euint16_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint16 result = TFHE.rotl(aProc, bProc); return TFHE.decrypt(result); } - function rotl_euint16_uint8(bytes calldata a, uint8 b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); + function rotl_euint16_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); uint8 bProc = b; euint16 result = TFHE.rotl(aProc, bProc); return TFHE.decrypt(result); } - function rotr_euint16_euint8(bytes calldata a, bytes calldata b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); - euint8 bProc = TFHE.asEuint8(b); + function rotr_euint16_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint16 result = TFHE.rotr(aProc, bProc); return TFHE.decrypt(result); } - function rotr_euint16_uint8(bytes calldata a, uint8 b) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); + function rotr_euint16_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); uint8 bProc = b; euint16 result = TFHE.rotr(aProc, bProc); return TFHE.decrypt(result); } - function shl_euint32_euint8(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint8 bProc = TFHE.asEuint8(b); + function shl_euint32_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint32 result = TFHE.shl(aProc, bProc); return TFHE.decrypt(result); } - function shl_euint32_uint8(bytes calldata a, uint8 b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); + function shl_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); uint8 bProc = b; euint32 result = TFHE.shl(aProc, bProc); return TFHE.decrypt(result); } - function shr_euint32_euint8(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint8 bProc = TFHE.asEuint8(b); + function shr_euint32_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint32 result = TFHE.shr(aProc, bProc); return TFHE.decrypt(result); } - function shr_euint32_uint8(bytes calldata a, uint8 b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); + function shr_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); uint8 bProc = b; euint32 result = TFHE.shr(aProc, bProc); return TFHE.decrypt(result); } - function rotl_euint32_euint8(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint8 bProc = TFHE.asEuint8(b); + function rotl_euint32_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint32 result = TFHE.rotl(aProc, bProc); return TFHE.decrypt(result); } - function rotl_euint32_uint8(bytes calldata a, uint8 b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); + function rotl_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); uint8 bProc = b; euint32 result = TFHE.rotl(aProc, bProc); return TFHE.decrypt(result); } - function rotr_euint32_euint8(bytes calldata a, bytes calldata b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); - euint8 bProc = TFHE.asEuint8(b); + function rotr_euint32_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint32 result = TFHE.rotr(aProc, bProc); return TFHE.decrypt(result); } - function rotr_euint32_uint8(bytes calldata a, uint8 b) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); + function rotr_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); uint8 bProc = b; euint32 result = TFHE.rotr(aProc, bProc); return TFHE.decrypt(result); } - function shl_euint64_euint8(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint8 bProc = TFHE.asEuint8(b); + function shl_euint64_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint64 result = TFHE.shl(aProc, bProc); return TFHE.decrypt(result); } - function shl_euint64_uint8(bytes calldata a, uint8 b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); + function shl_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); uint8 bProc = b; euint64 result = TFHE.shl(aProc, bProc); return TFHE.decrypt(result); diff --git a/examples/tests/TFHETestSuite6.sol b/examples/tests/TFHETestSuite6.sol index f0762753..74208f9f 100644 --- a/examples/tests/TFHETestSuite6.sol +++ b/examples/tests/TFHETestSuite6.sol @@ -4,104 +4,104 @@ pragma solidity ^0.8.20; import "../../lib/TFHE.sol"; contract TFHETestSuite6 { - function shr_euint64_euint8(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint8 bProc = TFHE.asEuint8(b); + function shr_euint64_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint64 result = TFHE.shr(aProc, bProc); return TFHE.decrypt(result); } - function shr_euint64_uint8(bytes calldata a, uint8 b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); + function shr_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); uint8 bProc = b; euint64 result = TFHE.shr(aProc, bProc); return TFHE.decrypt(result); } - function rotl_euint64_euint8(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint8 bProc = TFHE.asEuint8(b); + function rotl_euint64_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint64 result = TFHE.rotl(aProc, bProc); return TFHE.decrypt(result); } - function rotl_euint64_uint8(bytes calldata a, uint8 b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); + function rotl_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); uint8 bProc = b; euint64 result = TFHE.rotl(aProc, bProc); return TFHE.decrypt(result); } - function rotr_euint64_euint8(bytes calldata a, bytes calldata b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); - euint8 bProc = TFHE.asEuint8(b); + function rotr_euint64_euint8(einput a, einput b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); + euint8 bProc = TFHE.asEuint8(b, inputProof); euint64 result = TFHE.rotr(aProc, bProc); return TFHE.decrypt(result); } - function rotr_euint64_uint8(bytes calldata a, uint8 b) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); + function rotr_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); uint8 bProc = b; euint64 result = TFHE.rotr(aProc, bProc); return TFHE.decrypt(result); } - function neg_euint4(bytes calldata a) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); + function neg_euint4(einput a, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); euint4 result = TFHE.neg(aProc); return TFHE.decrypt(result); } - function not_euint4(bytes calldata a) public returns (uint8) { - euint4 aProc = TFHE.asEuint4(a); + function not_euint4(einput a, bytes calldata inputProof) public returns (uint8) { + euint4 aProc = TFHE.asEuint4(a, inputProof); euint4 result = TFHE.not(aProc); return TFHE.decrypt(result); } - function neg_euint8(bytes calldata a) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); + function neg_euint8(einput a, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); euint8 result = TFHE.neg(aProc); return TFHE.decrypt(result); } - function not_euint8(bytes calldata a) public returns (uint8) { - euint8 aProc = TFHE.asEuint8(a); + function not_euint8(einput a, bytes calldata inputProof) public returns (uint8) { + euint8 aProc = TFHE.asEuint8(a, inputProof); euint8 result = TFHE.not(aProc); return TFHE.decrypt(result); } - function neg_euint16(bytes calldata a) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); + function neg_euint16(einput a, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint16 result = TFHE.neg(aProc); return TFHE.decrypt(result); } - function not_euint16(bytes calldata a) public returns (uint16) { - euint16 aProc = TFHE.asEuint16(a); + function not_euint16(einput a, bytes calldata inputProof) public returns (uint16) { + euint16 aProc = TFHE.asEuint16(a, inputProof); euint16 result = TFHE.not(aProc); return TFHE.decrypt(result); } - function neg_euint32(bytes calldata a) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); + function neg_euint32(einput a, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); euint32 result = TFHE.neg(aProc); return TFHE.decrypt(result); } - function not_euint32(bytes calldata a) public returns (uint32) { - euint32 aProc = TFHE.asEuint32(a); + function not_euint32(einput a, bytes calldata inputProof) public returns (uint32) { + euint32 aProc = TFHE.asEuint32(a, inputProof); euint32 result = TFHE.not(aProc); return TFHE.decrypt(result); } - function neg_euint64(bytes calldata a) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); + function neg_euint64(einput a, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); euint64 result = TFHE.neg(aProc); return TFHE.decrypt(result); } - function not_euint64(bytes calldata a) public returns (uint64) { - euint64 aProc = TFHE.asEuint64(a); + function not_euint64(einput a, bytes calldata inputProof) public returns (uint64) { + euint64 aProc = TFHE.asEuint64(a, inputProof); euint64 result = TFHE.not(aProc); return TFHE.decrypt(result); } diff --git a/hardhat.config.ts b/hardhat.config.ts index 26d6b9d8..bcd0bfd4 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -14,8 +14,8 @@ import './tasks/accounts'; import './tasks/getEthereumAddress'; import './tasks/mint'; import './tasks/taskDeploy'; -import './tasks/taskIdentity'; import './tasks/taskGatewayRelayer'; +import './tasks/taskIdentity'; import './tasks/taskTFHE'; // Function to recursively get all .sol files in a folder diff --git a/lib/FhevmLib.sol b/lib/FhevmLib.sol index 4e00bab2..acf8a1c3 100644 --- a/lib/FhevmLib.sol +++ b/lib/FhevmLib.sol @@ -51,7 +51,12 @@ interface FhevmLib { function fhePubKey(bytes1 fromLib) external view returns (bytes memory result); - function verifyCiphertext(bytes memory input) external pure returns (uint256 result); + function verifyCiphertext( + bytes32 inputHandle, + address callerAddress, + bytes memory inputProof, + bytes1 inputType + ) external pure returns (uint256 result); function cast(uint256 ct, bytes1 toType) external pure returns (uint256 result); diff --git a/lib/Impl.sol b/lib/Impl.sol index 0ac16844..e21c9460 100644 --- a/lib/Impl.sol +++ b/lib/Impl.sol @@ -126,9 +126,8 @@ library Impl { key = exec.fhePubKey(bytes1(0x01)); } - function verify(bytes memory _ciphertextBytes, uint8 _toType) internal returns (uint256 result) { - bytes memory input = bytes.concat(_ciphertextBytes, bytes1(_toType)); - result = exec.verifyCiphertext(input); + function verify(bytes32 inputHandle, bytes memory inputProof, uint8 toType) internal returns (uint256 result) { + result = exec.verifyCiphertext(inputHandle, msg.sender, inputProof, bytes1(toType)); acl.allowTransient(result, msg.sender); } diff --git a/lib/TFHE.sol b/lib/TFHE.sol index 94abaf64..f750c117 100644 --- a/lib/TFHE.sol +++ b/lib/TFHE.sol @@ -9,6 +9,8 @@ type euint16 is uint256; type euint32 is uint256; type euint64 is uint256; type eaddress is uint256; +type ebytes256 is uint256; +type einput is bytes32; library Common { // Values used to communicate types to the runtime. @@ -20,6 +22,7 @@ library Common { uint8 internal constant euint64_t = 5; uint8 internal constant euint128_t = 6; uint8 internal constant euint160_t = 7; + uint8 internal constant ebytes256_t = 11; } import "./Impl.sol"; @@ -5383,8 +5386,8 @@ library TFHE { } // Convert a serialized 'ciphertext' to an encrypted euint8 integer. - function asEbool(bytes memory ciphertext) internal returns (ebool) { - return ebool.wrap(Impl.verify(ciphertext, Common.ebool_t)); + function asEbool(einput inputHandle, bytes memory inputProof) internal returns (ebool) { + return ebool.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebool_t)); } // Convert a plaintext value to an encrypted euint8 integer. @@ -5555,9 +5558,9 @@ library TFHE { return euint64.wrap(Impl.not(euint64.unwrap(value))); } - // Convert a serialized 'ciphertext' to an encrypted euint4 integer. - function asEuint4(bytes memory ciphertext) internal returns (euint4) { - return euint4.wrap(Impl.verify(ciphertext, Common.euint4_t)); + // Convert the given inputHandle and 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)); } // Convert a plaintext value to an encrypted euint4 integer. @@ -5576,9 +5579,9 @@ library TFHE { return Impl.reencrypt(euint4.unwrap(value), publicKey); } - // Convert a serialized 'ciphertext' to an encrypted euint8 integer. - function asEuint8(bytes memory ciphertext) internal returns (euint8) { - return euint8.wrap(Impl.verify(ciphertext, Common.euint8_t)); + // Convert the given inputHandle and inputProof to an encrypted euint8 integer. + function asEuint8(einput inputHandle, bytes memory inputProof) internal returns (euint8) { + return euint8.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint8_t)); } // Convert a plaintext value to an encrypted euint8 integer. @@ -5597,9 +5600,9 @@ library TFHE { return Impl.reencrypt(euint8.unwrap(value), publicKey); } - // Convert a serialized 'ciphertext' to an encrypted euint16 integer. - function asEuint16(bytes memory ciphertext) internal returns (euint16) { - return euint16.wrap(Impl.verify(ciphertext, Common.euint16_t)); + // Convert the given inputHandle and inputProof to an encrypted euint16 integer. + function asEuint16(einput inputHandle, bytes memory inputProof) internal returns (euint16) { + return euint16.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint16_t)); } // Convert a plaintext value to an encrypted euint16 integer. @@ -5618,9 +5621,9 @@ library TFHE { return Impl.reencrypt(euint16.unwrap(value), publicKey); } - // Convert a serialized 'ciphertext' to an encrypted euint32 integer. - function asEuint32(bytes memory ciphertext) internal returns (euint32) { - return euint32.wrap(Impl.verify(ciphertext, Common.euint32_t)); + // Convert the given inputHandle and inputProof to an encrypted euint32 integer. + function asEuint32(einput inputHandle, bytes memory inputProof) internal returns (euint32) { + return euint32.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint32_t)); } // Convert a plaintext value to an encrypted euint32 integer. @@ -5639,9 +5642,9 @@ library TFHE { return Impl.reencrypt(euint32.unwrap(value), publicKey); } - // Convert a serialized 'ciphertext' to an encrypted euint64 integer. - function asEuint64(bytes memory ciphertext) internal returns (euint64) { - return euint64.wrap(Impl.verify(ciphertext, Common.euint64_t)); + // Convert the given inputHandle and inputProof to an encrypted euint64 integer. + function asEuint64(einput inputHandle, bytes memory inputProof) internal returns (euint64) { + return euint64.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint64_t)); } // Convert a plaintext value to an encrypted euint64 integer. @@ -5826,9 +5829,9 @@ library TFHE { return Impl.reencrypt(eaddress.unwrap(value), publicKey); } - // From bytes to eaddress - function asEaddress(bytes memory ciphertext) internal returns (eaddress) { - return eaddress.wrap(Impl.verify(ciphertext, Common.euint160_t)); + // Convert the given inputHandle and 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. @@ -5836,11 +5839,21 @@ library TFHE { return eaddress.wrap(Impl.trivialEncrypt(uint160(value), Common.euint160_t)); } - // Return true if the enrypted integer is initialized and false otherwise. + // 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)); + } + + // Return true if the enrypted value 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(ebytes256 v) internal pure returns (bool) { + return ebytes256.unwrap(v) != 0; + } + // Evaluate eq(a, b) and return the result. function eq(eaddress a, eaddress b) internal returns (ebool) { if (!isInitialized(a)) { @@ -5899,6 +5912,20 @@ library TFHE { return ebool.wrap(Impl.ne(eaddress.unwrap(a), bProc, 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"); + return ebool.wrap(Impl.eq(ebytes256.unwrap(a), ebytes256.unwrap(b), false)); + } + + // 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"); + return ebool.wrap(Impl.ne(ebytes256.unwrap(a), ebytes256.unwrap(b), false)); + } + 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))); } diff --git a/lib/TFHEExecutor.sol b/lib/TFHEExecutor.sol index 61b1604c..6d4f53b9 100644 --- a/lib/TFHEExecutor.sol +++ b/lib/TFHEExecutor.sol @@ -247,8 +247,18 @@ contract TFHEExecutor { return FhevmLib(address(EXT_TFHE_LIBRARY)).fhePubKey(fromLib); } - function verifyCiphertext(bytes memory input) public returns (uint256 result) { - result = FhevmLib(address(EXT_TFHE_LIBRARY)).verifyCiphertext(input); + function verifyCiphertext( + bytes32 inputHandle, + address callerAddress, + bytes memory inputProof, + bytes1 inputType + ) public returns (uint256 result) { + result = FhevmLib(address(EXT_TFHE_LIBRARY)).verifyCiphertext( + inputHandle, + callerAddress, + inputProof, + inputType + ); acl.allowTransient(result, msg.sender); } diff --git a/mocks/Impl.sol b/mocks/Impl.sol index b11459f2..706b2cdf 100644 --- a/mocks/Impl.sol +++ b/mocks/Impl.sol @@ -146,19 +146,20 @@ library Impl { key = hex"0123456789ABCDEF"; } - function verify(bytes memory _ciphertextBytes, uint8 /*_toType*/) internal returns (uint256 result) { + function verify(einput inputHandle, bytes memory inputProof, uint8 toType) internal returns (uint256 result) { + // TODO: fix implementation uint256 x; assembly { - switch gt(mload(_ciphertextBytes), 31) + switch gt(mload(inputProof), 31) case 1 { - x := mload(add(_ciphertextBytes, add(32, sub(mload(_ciphertextBytes), 32)))) + x := mload(add(inputProof, add(32, sub(mload(inputProof), 32)))) } default { - x := mload(add(_ciphertextBytes, 32)) + x := mload(add(inputProof, 32)) } } - if (_ciphertextBytes.length < 32) { - x = x >> ((32 - _ciphertextBytes.length) * 8); + if (inputProof.length < 32) { + x = x >> ((32 - inputProof.length) * 8); } return x; } diff --git a/mocks/TFHE.sol b/mocks/TFHE.sol index 881dd956..b2985d0f 100644 --- a/mocks/TFHE.sol +++ b/mocks/TFHE.sol @@ -9,6 +9,8 @@ type euint16 is uint256; type euint32 is uint256; type euint64 is uint256; type eaddress is uint256; +type ebytes256 is uint256; +type einput is bytes32; library Common { // Values used to communicate types to the runtime. @@ -20,6 +22,7 @@ library Common { uint8 internal constant euint64_t = 5; uint8 internal constant euint128_t = 6; uint8 internal constant euint160_t = 7; + uint8 internal constant ebytes256_t = 11; } import "./Impl.sol"; @@ -5383,8 +5386,8 @@ library TFHE { } // Convert a serialized 'ciphertext' to an encrypted euint8 integer. - function asEbool(bytes memory ciphertext) internal returns (ebool) { - return ebool.wrap(Impl.verify(ciphertext, Common.ebool_t)); + function asEbool(einput inputHandle, bytes memory inputProof) internal returns (ebool) { + return ebool.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebool_t)); } // Convert a plaintext value to an encrypted euint8 integer. @@ -5555,9 +5558,9 @@ library TFHE { return euint64.wrap(Impl.not(euint64.unwrap(value))); } - // Convert a serialized 'ciphertext' to an encrypted euint4 integer. - function asEuint4(bytes memory ciphertext) internal returns (euint4) { - return euint4.wrap(Impl.verify(ciphertext, Common.euint4_t)); + // Convert the given inputHandle and 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)); } // Convert a plaintext value to an encrypted euint4 integer. @@ -5576,9 +5579,9 @@ library TFHE { return Impl.reencrypt(euint4.unwrap(value) % 2 ** 4, publicKey); } - // Convert a serialized 'ciphertext' to an encrypted euint8 integer. - function asEuint8(bytes memory ciphertext) internal returns (euint8) { - return euint8.wrap(Impl.verify(ciphertext, Common.euint8_t)); + // Convert the given inputHandle and inputProof to an encrypted euint8 integer. + function asEuint8(einput inputHandle, bytes memory inputProof) internal returns (euint8) { + return euint8.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint8_t)); } // Convert a plaintext value to an encrypted euint8 integer. @@ -5597,9 +5600,9 @@ library TFHE { return Impl.reencrypt(euint8.unwrap(value) % 2 ** 8, publicKey); } - // Convert a serialized 'ciphertext' to an encrypted euint16 integer. - function asEuint16(bytes memory ciphertext) internal returns (euint16) { - return euint16.wrap(Impl.verify(ciphertext, Common.euint16_t)); + // Convert the given inputHandle and inputProof to an encrypted euint16 integer. + function asEuint16(einput inputHandle, bytes memory inputProof) internal returns (euint16) { + return euint16.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint16_t)); } // Convert a plaintext value to an encrypted euint16 integer. @@ -5618,9 +5621,9 @@ library TFHE { return Impl.reencrypt(euint16.unwrap(value) % 2 ** 16, publicKey); } - // Convert a serialized 'ciphertext' to an encrypted euint32 integer. - function asEuint32(bytes memory ciphertext) internal returns (euint32) { - return euint32.wrap(Impl.verify(ciphertext, Common.euint32_t)); + // Convert the given inputHandle and inputProof to an encrypted euint32 integer. + function asEuint32(einput inputHandle, bytes memory inputProof) internal returns (euint32) { + return euint32.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint32_t)); } // Convert a plaintext value to an encrypted euint32 integer. @@ -5639,9 +5642,9 @@ library TFHE { return Impl.reencrypt(euint32.unwrap(value) % 2 ** 32, publicKey); } - // Convert a serialized 'ciphertext' to an encrypted euint64 integer. - function asEuint64(bytes memory ciphertext) internal returns (euint64) { - return euint64.wrap(Impl.verify(ciphertext, Common.euint64_t)); + // Convert the given inputHandle and inputProof to an encrypted euint64 integer. + function asEuint64(einput inputHandle, bytes memory inputProof) internal returns (euint64) { + return euint64.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint64_t)); } // Convert a plaintext value to an encrypted euint64 integer. @@ -5826,9 +5829,9 @@ library TFHE { return Impl.reencrypt(eaddress.unwrap(value), publicKey); } - // From bytes to eaddress - function asEaddress(bytes memory ciphertext) internal returns (eaddress) { - return eaddress.wrap(Impl.verify(ciphertext, Common.euint160_t)); + // Convert the given inputHandle and 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. @@ -5836,11 +5839,21 @@ library TFHE { return eaddress.wrap(Impl.trivialEncrypt(uint160(value), Common.euint160_t)); } - // Return true if the enrypted integer is initialized and false otherwise. + // 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)); + } + + // Return true if the enrypted value 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(ebytes256 v) internal pure returns (bool) { + return ebytes256.unwrap(v) != 0; + } + // Evaluate eq(a, b) and return the result. function eq(eaddress a, eaddress b) internal returns (ebool) { if (!isInitialized(a)) { @@ -5899,6 +5912,20 @@ library TFHE { return ebool.wrap(Impl.ne(eaddress.unwrap(a), bProc, 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"); + return ebool.wrap(Impl.eq(ebytes256.unwrap(a), ebytes256.unwrap(b), false)); + } + + // 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"); + return ebool.wrap(Impl.ne(ebytes256.unwrap(a), ebytes256.unwrap(b), false)); + } + 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))); } diff --git a/package-lock.json b/package-lock.json index aa70a4b1..ad1687e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,7 +37,7 @@ "eslint": "^8.28.0", "eslint-config-prettier": "^8.5.0", "ethers": "^6.8.0", - "fhevmjs": "^0.5.0-1", + "fhevmjs": "^0.5.0-7", "fs-extra": "^10.1.0", "ganache": "^7.9.0", "hardhat": "^2.19.4", @@ -1998,15 +1998,12 @@ "integrity": "sha512-ytPc6eLGcHHnapAZ9S+5qsdomhjo6QBHTDRRBFfTxXIpsicMhVPouPgmUPebZZZGX7vt9USA+Z+0M0dSVtSUEA==" }, "node_modules/@scure/base": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz", - "integrity": "sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ] + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.7.tgz", + "integrity": "sha512-PPNYBslrLNNUQ/Yad37MHYsNQtK67EhWb6WtSvNLLPo7SdVZgkUjD6Dg+5On7zNwmskf8OX7I7Nx5oN+MIWE0g==", + "funding": { + "url": "https://paulmillr.com/funding/" + } }, "node_modules/@scure/bip32": { "version": "1.1.5", @@ -2353,6 +2350,15 @@ "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", "dev": true }, + "node_modules/@types/keccak": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/keccak/-/keccak-3.0.4.tgz", + "integrity": "sha512-hdnkmbie7tE0yXnQQvlIOqCyjEsoXDVEZ3ACqO+F305XgUOW4Z9ElWdogCXXRAW/khnZ7GxM0t/BGB5bORKt/g==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz", @@ -3001,6 +3007,21 @@ "node": ">= 4.0.0" } }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/axios": { "version": "0.21.4", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", @@ -3209,13 +3230,19 @@ } }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -3856,6 +3883,23 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -4003,6 +4047,27 @@ "node": ">=6" } }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -4686,19 +4751,23 @@ } }, "node_modules/fhevmjs": { - "version": "0.5.0-1", - "resolved": "https://registry.npmjs.org/fhevmjs/-/fhevmjs-0.5.0-1.tgz", - "integrity": "sha512-Z8vpYJ+lyt4orY/Jq4UYrcKQOhyovZmzZjJ1ooUYNu/36WFtK9v99W9kvnH182lyio2avYoiN9/2dg5qJNc6Zg==", + "version": "0.5.0-7", + "resolved": "https://registry.npmjs.org/fhevmjs/-/fhevmjs-0.5.0-7.tgz", + "integrity": "sha512-90jxicLWmKyPAKq7E/QK4j5dCajO9PUysACStMVQFB+/2qCLmsHigOIjhCVM2CiDAWKsLbqMFfEi7icxE6rGzg==", "dev": true, "dependencies": { + "@types/keccak": "^3.0.4", "bigint-buffer": "^1.1.5", "commander": "^11.0.0", "crypto-js": "^4.1.1", "ethers": "^6.6.4", + "keccak": "^3.0.4", "libsodium": "^0.7.11", "libsodium-wrappers": "^0.7.11", - "node-tfhe": "^0.6.1", - "tfhe": "^0.6.1" + "node-fetch": "^2.7.0", + "node-tfhe": "^0.6.2", + "tfhe": "^0.6.2", + "web3-validator": "^2.0.6" }, "bin": { "fhevm": "bin/fhevm.js" @@ -4829,6 +4898,15 @@ } } }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -4887,10 +4965,13 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/functional-red-black-tree": { "version": "1.0.1", @@ -5119,7 +5200,6 @@ "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.5.tgz", "integrity": "sha512-HTm14iMQKK2FjFLRTM5lAVcyaUzOnqbPtesFIvREgXpJHdQm8bWS+GkQgIkfaBYRHuCnea7w8UVNfwiAQhlr9A==", "dev": true, - "hasInstallScript": true, "optional": true, "dependencies": { "node-gyp-build": "^4.3.0" @@ -5477,7 +5557,6 @@ "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.7.tgz", "integrity": "sha512-vLt1O5Pp+flcArHGIyKEQq883nBt8nN8tVBcoL0qUXj2XT1n7p70yGIq2VK98I5FdZ1YHc0wk/koOnHjnXWk1Q==", "dev": true, - "hasInstallScript": true, "optional": true, "dependencies": { "node-gyp-build": "^4.3.0" @@ -5515,15 +5594,19 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5675,6 +5758,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -6056,18 +6151,6 @@ } } }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -6076,6 +6159,18 @@ "node": ">=4" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", @@ -6100,6 +6195,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/hash-base": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", @@ -6122,6 +6232,18 @@ "minimalistic-assert": "^1.0.1" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -6325,6 +6447,22 @@ "fp-ts": "^1.0.0" } }, + "node_modules/is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -6358,6 +6496,18 @@ "node": ">=4" } }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -6375,6 +6525,21 @@ "node": ">=4" } }, + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -6429,6 +6594,21 @@ "node": ">=8" } }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -6535,9 +6715,9 @@ } }, "node_modules/keccak": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.3.tgz", - "integrity": "sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.4.tgz", + "integrity": "sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q==", "hasInstallScript": true, "dependencies": { "node-addon-api": "^2.0.0", @@ -7049,6 +7229,26 @@ "lodash": "^4.17.21" } }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/node-gyp-build": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", @@ -7060,9 +7260,9 @@ } }, "node_modules/node-tfhe": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/node-tfhe/-/node-tfhe-0.6.1.tgz", - "integrity": "sha512-p2BidmylEO+3v1Q4KqErNJC8z/Y2R+b+Yd42omweeII41AbgPM12RJCmvE9GMvr/ZbAn/H762JPijLH08oBUYQ==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/node-tfhe/-/node-tfhe-0.6.3.tgz", + "integrity": "sha512-pnPDgBZ8aAPhLOs+LDIZP70dinuRHQxc7BROuXFmtyQu6ysyLIvwfmXVsdoQAap2OBcwg15kcu38b5G8YBpcaA==", "dev": true }, "node_modules/nofilter": { @@ -7353,6 +7553,15 @@ "node": ">=6" } }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -7962,6 +8171,23 @@ "randombytes": "^2.1.0" } }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -8623,9 +8849,9 @@ "dev": true }, "node_modules/tfhe": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/tfhe/-/tfhe-0.6.1.tgz", - "integrity": "sha512-csHYfEbejbQl4LVb1/37LY9AxiR9RqvzXsHT1wENMtGqIjNmev3T1aXyljooGc/4HuZmG8VjlUkX6CYvG4U80g==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/tfhe/-/tfhe-0.6.3.tgz", + "integrity": "sha512-u+GPQ2SfzHsuNnCmJWeh9tImCUING4/6zOJZOqRhQ2+8teH2CHlNx7YGUQJz3z1ITJ6/nUHRy2dyBr/dpa3xWw==", "dev": true }, "node_modules/then-request": { @@ -8709,6 +8935,12 @@ "node": ">=0.6" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, "node_modules/ts-command-line-args": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/ts-command-line-args/-/ts-command-line-args-2.5.1.tgz", @@ -9113,6 +9345,19 @@ "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==", "dev": true }, + "node_modules/util": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -9132,6 +9377,29 @@ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "devOptional": true }, + "node_modules/web3-errors": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/web3-errors/-/web3-errors-1.2.0.tgz", + "integrity": "sha512-58Kczou5zyjcm9LuSs5Hrm6VrG8t9p2J8X0yGArZrhKNPZL66gMGkOUpPx+EopE944Sk4yE+Q25hKv4H5BH+kA==", + "dev": true, + "dependencies": { + "web3-types": "^1.6.0" + }, + "engines": { + "node": ">=14", + "npm": ">=6.12.0" + } + }, + "node_modules/web3-types": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/web3-types/-/web3-types-1.7.0.tgz", + "integrity": "sha512-nhXxDJ7a5FesRw9UG5SZdP/C/3Q2EzHGnB39hkAV+YGXDMgwxBXFWebQLfEzZzuArfHnvC0sQqkIHNwSKcVjdA==", + "dev": true, + "engines": { + "node": ">=14", + "npm": ">=6.12.0" + } + }, "node_modules/web3-utils": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.10.0.tgz", @@ -9150,6 +9418,102 @@ "node": ">=8.0.0" } }, + "node_modules/web3-validator": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/web3-validator/-/web3-validator-2.0.6.tgz", + "integrity": "sha512-qn9id0/l1bWmvH4XfnG/JtGKKwut2Vokl6YXP5Kfg424npysmtRLe9DgiNBM9Op7QL/aSiaA0TVXibuIuWcizg==", + "dev": true, + "dependencies": { + "ethereum-cryptography": "^2.0.0", + "util": "^0.12.5", + "web3-errors": "^1.2.0", + "web3-types": "^1.6.0", + "zod": "^3.21.4" + }, + "engines": { + "node": ">=14", + "npm": ">=6.12.0" + } + }, + "node_modules/web3-validator/node_modules/@noble/curves": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.0.tgz", + "integrity": "sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==", + "dev": true, + "dependencies": { + "@noble/hashes": "1.4.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/web3-validator/node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "dev": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/web3-validator/node_modules/@scure/bip32": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", + "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", + "dev": true, + "dependencies": { + "@noble/curves": "~1.4.0", + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/web3-validator/node_modules/@scure/bip39": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", + "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", + "dev": true, + "dependencies": { + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/web3-validator/node_modules/ethereum-cryptography": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.0.tgz", + "integrity": "sha512-hsm9JhfytIf8QME/3B7j4bc8V+VdTU+Vas1aJlvIS96ffoNAosudXvGoEvWmc7QZYdkC8mrMJz9r0fcbw7GyCA==", + "dev": true, + "dependencies": { + "@noble/curves": "1.4.0", + "@noble/hashes": "1.4.0", + "@scure/bip32": "1.4.0", + "@scure/bip39": "1.3.0" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -9165,6 +9529,25 @@ "node": ">= 8" } }, + "node_modules/which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", @@ -9392,6 +9775,15 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zod": { + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } } }, "dependencies": { @@ -10708,9 +11100,9 @@ "integrity": "sha512-ytPc6eLGcHHnapAZ9S+5qsdomhjo6QBHTDRRBFfTxXIpsicMhVPouPgmUPebZZZGX7vt9USA+Z+0M0dSVtSUEA==" }, "@scure/base": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz", - "integrity": "sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==" + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.7.tgz", + "integrity": "sha512-PPNYBslrLNNUQ/Yad37MHYsNQtK67EhWb6WtSvNLLPo7SdVZgkUjD6Dg+5On7zNwmskf8OX7I7Nx5oN+MIWE0g==" }, "@scure/bip32": { "version": "1.1.5", @@ -11007,6 +11399,15 @@ "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", "dev": true }, + "@types/keccak": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/keccak/-/keccak-3.0.4.tgz", + "integrity": "sha512-hdnkmbie7tE0yXnQQvlIOqCyjEsoXDVEZ3ACqO+F305XgUOW4Z9ElWdogCXXRAW/khnZ7GxM0t/BGB5bORKt/g==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz", @@ -11478,6 +11879,15 @@ "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", "dev": true }, + "available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "requires": { + "possible-typed-array-names": "^1.0.0" + } + }, "axios": { "version": "0.21.4", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", @@ -11642,13 +12052,16 @@ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" }, "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" } }, "callsites": { @@ -12139,6 +12552,17 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -12251,6 +12675,21 @@ "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==" }, + "es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.4" + } + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true + }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -12784,19 +13223,23 @@ } }, "fhevmjs": { - "version": "0.5.0-1", - "resolved": "https://registry.npmjs.org/fhevmjs/-/fhevmjs-0.5.0-1.tgz", - "integrity": "sha512-Z8vpYJ+lyt4orY/Jq4UYrcKQOhyovZmzZjJ1ooUYNu/36WFtK9v99W9kvnH182lyio2avYoiN9/2dg5qJNc6Zg==", + "version": "0.5.0-7", + "resolved": "https://registry.npmjs.org/fhevmjs/-/fhevmjs-0.5.0-7.tgz", + "integrity": "sha512-90jxicLWmKyPAKq7E/QK4j5dCajO9PUysACStMVQFB+/2qCLmsHigOIjhCVM2CiDAWKsLbqMFfEi7icxE6rGzg==", "dev": true, "requires": { + "@types/keccak": "^3.0.4", "bigint-buffer": "^1.1.5", "commander": "^11.0.0", "crypto-js": "^4.1.1", "ethers": "^6.6.4", + "keccak": "^3.0.4", "libsodium": "^0.7.11", "libsodium-wrappers": "^0.7.11", - "node-tfhe": "^0.6.1", - "tfhe": "^0.6.1" + "node-fetch": "^2.7.0", + "node-tfhe": "^0.6.2", + "tfhe": "^0.6.2", + "web3-validator": "^2.0.6" } }, "file-entry-cache": { @@ -12885,6 +13328,15 @@ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==" }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "requires": { + "is-callable": "^1.1.3" + } + }, "form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -12930,9 +13382,9 @@ "optional": true }, "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true }, "functional-red-black-tree": { @@ -13385,15 +13837,16 @@ "dev": true }, "get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" } }, "get-port": { @@ -13507,6 +13960,15 @@ "slash": "^3.0.0" } }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.3" + } + }, "graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -13800,20 +14262,20 @@ "murmur-128": "^0.2.1" } }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" }, + "has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0" + } + }, "has-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", @@ -13826,6 +14288,15 @@ "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true }, + "has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.3" + } + }, "hash-base": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", @@ -13845,6 +14316,15 @@ "minimalistic-assert": "^1.0.1" } }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "requires": { + "function-bind": "^1.1.2" + } + }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -14000,6 +14480,16 @@ "fp-ts": "^1.0.0" } }, + "is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -14013,6 +14503,12 @@ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==" }, + "is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true + }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -14024,6 +14520,15 @@ "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", "dev": true }, + "is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -14059,6 +14564,15 @@ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==" }, + "is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "requires": { + "which-typed-array": "^1.1.14" + } + }, "is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -14141,9 +14655,9 @@ "dev": true }, "keccak": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.3.tgz", - "integrity": "sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.4.tgz", + "integrity": "sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q==", "requires": { "node-addon-api": "^2.0.0", "node-gyp-build": "^4.2.0", @@ -14548,15 +15062,24 @@ "lodash": "^4.17.21" } }, + "node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "requires": { + "whatwg-url": "^5.0.0" + } + }, "node-gyp-build": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==" }, "node-tfhe": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/node-tfhe/-/node-tfhe-0.6.1.tgz", - "integrity": "sha512-p2BidmylEO+3v1Q4KqErNJC8z/Y2R+b+Yd42omweeII41AbgPM12RJCmvE9GMvr/ZbAn/H762JPijLH08oBUYQ==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/node-tfhe/-/node-tfhe-0.6.3.tgz", + "integrity": "sha512-pnPDgBZ8aAPhLOs+LDIZP70dinuRHQxc7BROuXFmtyQu6ysyLIvwfmXVsdoQAap2OBcwg15kcu38b5G8YBpcaA==", "dev": true }, "nofilter": { @@ -14766,6 +15289,12 @@ "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true }, + "possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true + }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -15194,6 +15723,20 @@ "randombytes": "^2.1.0" } }, + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } + }, "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -15721,9 +16264,9 @@ "dev": true }, "tfhe": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/tfhe/-/tfhe-0.6.1.tgz", - "integrity": "sha512-csHYfEbejbQl4LVb1/37LY9AxiR9RqvzXsHT1wENMtGqIjNmev3T1aXyljooGc/4HuZmG8VjlUkX6CYvG4U80g==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/tfhe/-/tfhe-0.6.3.tgz", + "integrity": "sha512-u+GPQ2SfzHsuNnCmJWeh9tImCUING4/6zOJZOqRhQ2+8teH2CHlNx7YGUQJz3z1ITJ6/nUHRy2dyBr/dpa3xWw==", "dev": true }, "then-request": { @@ -15791,6 +16334,12 @@ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, "ts-command-line-args": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/ts-command-line-args/-/ts-command-line-args-2.5.1.tgz", @@ -16079,6 +16628,19 @@ "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==", "dev": true }, + "util": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -16095,6 +16657,21 @@ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "devOptional": true }, + "web3-errors": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/web3-errors/-/web3-errors-1.2.0.tgz", + "integrity": "sha512-58Kczou5zyjcm9LuSs5Hrm6VrG8t9p2J8X0yGArZrhKNPZL66gMGkOUpPx+EopE944Sk4yE+Q25hKv4H5BH+kA==", + "dev": true, + "requires": { + "web3-types": "^1.6.0" + } + }, + "web3-types": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/web3-types/-/web3-types-1.7.0.tgz", + "integrity": "sha512-nhXxDJ7a5FesRw9UG5SZdP/C/3Q2EzHGnB39hkAV+YGXDMgwxBXFWebQLfEzZzuArfHnvC0sQqkIHNwSKcVjdA==", + "dev": true + }, "web3-utils": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.10.0.tgz", @@ -16110,6 +16687,85 @@ "utf8": "3.0.0" } }, + "web3-validator": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/web3-validator/-/web3-validator-2.0.6.tgz", + "integrity": "sha512-qn9id0/l1bWmvH4XfnG/JtGKKwut2Vokl6YXP5Kfg424npysmtRLe9DgiNBM9Op7QL/aSiaA0TVXibuIuWcizg==", + "dev": true, + "requires": { + "ethereum-cryptography": "^2.0.0", + "util": "^0.12.5", + "web3-errors": "^1.2.0", + "web3-types": "^1.6.0", + "zod": "^3.21.4" + }, + "dependencies": { + "@noble/curves": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.0.tgz", + "integrity": "sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==", + "dev": true, + "requires": { + "@noble/hashes": "1.4.0" + } + }, + "@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "dev": true + }, + "@scure/bip32": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", + "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", + "dev": true, + "requires": { + "@noble/curves": "~1.4.0", + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + } + }, + "@scure/bip39": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", + "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", + "dev": true, + "requires": { + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + } + }, + "ethereum-cryptography": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.0.tgz", + "integrity": "sha512-hsm9JhfytIf8QME/3B7j4bc8V+VdTU+Vas1aJlvIS96ffoNAosudXvGoEvWmc7QZYdkC8mrMJz9r0fcbw7GyCA==", + "dev": true, + "requires": { + "@noble/curves": "1.4.0", + "@noble/hashes": "1.4.0", + "@scure/bip32": "1.4.0", + "@scure/bip39": "1.3.0" + } + } + } + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -16119,6 +16775,19 @@ "isexe": "^2.0.0" } }, + "which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + } + }, "word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", @@ -16281,6 +16950,12 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" + }, + "zod": { + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "dev": true } } } diff --git a/package.json b/package.json index a2fa80b8..cb2ad38f 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "eslint": "^8.28.0", "eslint-config-prettier": "^8.5.0", "ethers": "^6.8.0", - "fhevmjs": "^0.5.0-1", + "fhevmjs": "^0.5.0-7", "fs-extra": "^10.1.0", "ganache": "^7.9.0", "hardhat": "^2.19.4", diff --git a/tasks/taskDeploy.ts b/tasks/taskDeploy.ts index 7ce925a7..f43d5ce5 100644 --- a/tasks/taskDeploy.ts +++ b/tasks/taskDeploy.ts @@ -19,7 +19,9 @@ task('task:deployGateway') const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider); const envConfig2 = dotenv.parse(fs.readFileSync('lib/.env.kmsverifier')); const gatewayFactory = await ethers.getContractFactory('GatewayContract'); - const Gateway = await gatewayFactory.connect(deployer).deploy(taskArguments.ownerAddress, envConfig2.KMS_VERIFIER_CONTRACT_ADDRESS); + const Gateway = await gatewayFactory + .connect(deployer) + .deploy(taskArguments.ownerAddress, envConfig2.KMS_VERIFIER_CONTRACT_ADDRESS); await Gateway.waitForDeployment(); const GatewayContractAddress = await Gateway.getAddress(); const envConfig = dotenv.parse(fs.readFileSync('gateway/.env.gateway')); @@ -95,4 +97,4 @@ task('task:deployKmsVerifier').setAction(async function (taskArguments: TaskArgu throw new Error(`The nonce of the deployer account is not corret. Please relaunch a clean instance of the fhEVM`); } console.log('KmsVerifier was deployed at address:', address); -}); \ No newline at end of file +}); diff --git a/tasks/taskGatewayRelayer.ts b/tasks/taskGatewayRelayer.ts index c36ac71f..6edc0f8b 100644 --- a/tasks/taskGatewayRelayer.ts +++ b/tasks/taskGatewayRelayer.ts @@ -103,8 +103,8 @@ task('task:launchFhevm') await Promise.all([p1, p2, p3]); } await new Promise((res) => setTimeout(res, 5000)); // wait 5 seconds - console.log(`privateKey ${privKeyDeployer}`) - console.log(`ownerAddress ${ownerAddress}`) + console.log(`privateKey ${privKeyDeployer}`); + console.log(`ownerAddress ${ownerAddress}`); await hre.run('task:deployGateway', { privateKey: privKeyDeployer, ownerAddress: ownerAddress }); const parsedEnv = dotenv.parse(fs.readFileSync('gateway/.env.gateway')); diff --git a/tasks/taskTFHE.ts b/tasks/taskTFHE.ts index b138cf57..9a10ebbc 100644 --- a/tasks/taskTFHE.ts +++ b/tasks/taskTFHE.ts @@ -88,4 +88,4 @@ address constant Kms_VERIFIER_CONTRACT_ADDRESS = ${kmsVerfierAddress};\n`; } catch (error) { console.error('Failed to write ./lib/KmsVerifierAddress.sol', error); } -}); \ No newline at end of file +}); diff --git a/test/encryptedERC20/EncryptedERC20.ts b/test/encryptedERC20/EncryptedERC20.ts index 867dfca0..f47406ef 100644 --- a/test/encryptedERC20/EncryptedERC20.ts +++ b/test/encryptedERC20/EncryptedERC20.ts @@ -21,11 +21,6 @@ describe('EncryptedERC20', function () { it('should mint the contract', async function () { const transaction = await this.erc20.mint(1000); await transaction.wait(); - // Call the method - const token = this.instances.alice.getPublicKey(this.contractAddress) || { - signature: '', - publicKey: '', - }; const balanceHandle = await this.erc20.balanceOf(this.signers.alice); const balance = await decrypt64(balanceHandle); @@ -37,11 +32,19 @@ describe('EncryptedERC20', function () { it('should transfer tokens between two users', async function () { const transaction = await this.erc20.mint(10000); - await transaction.wait(); + const t1 = await transaction.wait(); + expect(t1?.status).to.eq(1); - const encryptedTransferAmount = this.instances.alice.encrypt64(1337); - const tx = await this.erc20['transfer(address,bytes)'](this.signers.bob.address, encryptedTransferAmount); - await tx.wait(); + const input = this.instances.alice.createEncryptedInput(this.contractAddress, this.contractAddress); + input.add64(1337); + const encryptedTransferAmount = input.encrypt(); + const tx = await this.erc20['transfer(address,bytes32,bytes)']( + this.signers.bob.address, + encryptedTransferAmount.inputs[0], + encryptedTransferAmount.data, + ); + const t2 = await tx.wait(); + expect(t2?.status).to.eq(1); // Decrypt Alice's balance const balanceHandleAlice = await this.erc20.balanceOf(this.signers.alice); @@ -58,8 +61,14 @@ describe('EncryptedERC20', function () { const transaction = await this.erc20.mint(1000); await transaction.wait(); - const encryptedTransferAmount = this.instances.alice.encrypt64(1337); - const tx = await this.erc20['transfer(address,bytes)'](this.signers.bob.address, encryptedTransferAmount); + const input = this.instances.alice.createEncryptedInput(this.contractAddress, this.contractAddress); + input.add64(1337); + const encryptedTransferAmount = input.encrypt(); + const tx = await this.erc20['transfer(address,bytes32,bytes)']( + this.signers.bob.address, + encryptedTransferAmount.inputs[0], + encryptedTransferAmount.data, + ); await tx.wait(); // Decrypt Alice's balance @@ -77,16 +86,25 @@ describe('EncryptedERC20', function () { const transaction = await this.erc20.mint(10000); await transaction.wait(); - const encryptedAllowanceAmount = this.instances.alice.encrypt64(1337); - const tx = await this.erc20['approve(address,bytes)'](this.signers.bob.address, encryptedAllowanceAmount); + const inputAlice = this.instances.alice.createEncryptedInput(this.contractAddress, this.contractAddress); + inputAlice.add64(1337); + const encryptedAllowanceAmount = inputAlice.encrypt(); + const tx = await this.erc20['approve(address,bytes32,bytes)']( + this.signers.bob.address, + encryptedAllowanceAmount.inputs[0], + encryptedAllowanceAmount.data, + ); await tx.wait(); const bobErc20 = this.erc20.connect(this.signers.bob); - const encryptedTransferAmount = this.instances.bob.encrypt64(1338); // above allowance so next tx should actually not send any token - const tx2 = await bobErc20['transferFrom(address,address,bytes)']( + const inputBob1 = this.instances.bob.createEncryptedInput(this.contractAddress, this.contractAddress); + inputBob1.add64(1338); // above allowance so next tx should actually not send any token + const encryptedTransferAmount = inputBob1.encrypt(); + const tx2 = await bobErc20['transferFrom(address,address,bytes32,bytes)']( this.signers.alice.address, this.signers.bob.address, - encryptedTransferAmount, + encryptedTransferAmount.inputs[0], + encryptedTransferAmount.data, ); await tx2.wait(); @@ -100,11 +118,14 @@ describe('EncryptedERC20', function () { const balanceBob = await decrypt64(balanceHandleBob); expect(balanceBob).to.equal(0); // check that transfer did not happen, as expected - const encryptedTransferAmount2 = this.instances.bob.encrypt64(1337); // below allowance so next tx should send token - const tx3 = await bobErc20['transferFrom(address,address,bytes)']( + const inputBob2 = this.instances.bob.createEncryptedInput(this.contractAddress, this.contractAddress); + inputBob2.add64(1337); // below allowance so next tx should send token + const encryptedTransferAmount2 = inputBob2.encrypt(); + const tx3 = await bobErc20['transferFrom(address,address,bytes32,bytes)']( this.signers.alice.address, this.signers.bob.address, - encryptedTransferAmount2, + encryptedTransferAmount2.inputs[0], + encryptedTransferAmount2.data, ); await tx3.wait(); diff --git a/test/instance.ts b/test/instance.ts index bb9cca64..75e7f4e4 100644 --- a/test/instance.ts +++ b/test/instance.ts @@ -1,6 +1,5 @@ -import { toBufferBE } from 'bigint-buffer'; import { Signer } from 'ethers'; -import fhevmjs, { FhevmInstance, clientKeyDecryptor, getCiphertextCallParams, getPublicKeyCallParams } from 'fhevmjs'; +import fhevmjs, { clientKeyDecryptor, getCiphertextCallParams, getPublicKeyCallParams } from 'fhevmjs'; import { readFileSync } from 'fs'; import { ethers, ethers as hethers } from 'hardhat'; import { homedir } from 'os'; @@ -9,6 +8,8 @@ import path from 'path'; import type { Signers } from './signers'; import { FhevmInstances } from './types'; +const hre = require('hardhat'); + const HARDHAT_NETWORK = process.env.HARDHAT_NETWORK; const FHE_CLIENT_KEY_PATH = process.env.FHE_CLIENT_KEY_PATH; @@ -37,9 +38,7 @@ export const createInstances = async ( }; export const createInstance = async (contractAddress: string, account: Signer, ethers: typeof hethers) => { - // 1. Get chain id const provider = ethers.provider; - const network = await provider.getNetwork(); chainId = +network.chainId.toString(); // Need to be a number try { @@ -50,47 +49,10 @@ export const createInstance = async (contractAddress: string, account: Signer, e } catch (e) { publicKey = undefined; } - - const instance = await fhevmjs.createInstance({ chainId, publicKey }); - - if (HARDHAT_NETWORK === 'hardhat') { - instance.encryptBool = createUintToUint8ArrayFunction(1); - instance.encrypt4 = createUintToUint8ArrayFunction(4); - instance.encrypt8 = createUintToUint8ArrayFunction(8); - instance.encrypt16 = createUintToUint8ArrayFunction(16); - instance.encrypt32 = createUintToUint8ArrayFunction(32); - instance.encrypt64 = createUintToUint8ArrayFunction(64); - instance.encryptAddress = createUintToUint8ArrayFunction(160); - instance.decrypt = (_, hexadecimalString) => BigInt(hexadecimalString); - instance.decryptAddress = (_, hexadecimalString) => ethers.getAddress(hexadecimalString.slice(26, 66)); - } - await generatePublicKey(contractAddress, account, instance); - + const instance = await fhevmjs.createInstance({ chainId, publicKey, networkUrl: hre.network.config.url }); return instance; }; -const generatePublicKey = async (contractAddress: string, signer: Signer, instance: FhevmInstance) => { - // Generate token to decrypt - const generatedToken = instance.generatePublicKey({ - verifyingContract: contractAddress, - }); - // Sign the public key - const signature = await signer.signTypedData( - generatedToken.eip712.domain, - { Reencrypt: generatedToken.eip712.types.Reencrypt }, // Need to remove EIP712Domain from types - generatedToken.eip712.message, - ); - instance.setSignature(contractAddress, signature); -}; - -function createUintToUint8ArrayFunction(numBits: number) { - const numBytes = Math.ceil(numBits / 8); - return function (uint: number | bigint | boolean) { - const buffer = toBufferBE(BigInt(uint), numBytes); - return buffer; - }; -} - const getCiphertext = async (handle: bigint, ethers: typeof hethers): Promise => { return ethers.provider.call(getCiphertextCallParams(handle)); };