From 0f1c8fb69a4cc2feaca7b577e97109b8fd77b85d Mon Sep 17 00:00:00 2001 From: PacificYield <173040337+PacificYield@users.noreply.github.com> Date: Thu, 2 Jan 2025 11:54:46 +0100 Subject: [PATCH 1/2] chore: updates codegen --- codegen/templates.ts | 761 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 632 insertions(+), 129 deletions(-) diff --git a/codegen/templates.ts b/codegen/templates.ts index b4b68819..91ab92b9 100644 --- a/codegen/templates.ts +++ b/codegen/templates.ts @@ -25,17 +25,38 @@ type einput is bytes32; * @notice This library contains all the values used to communicate types to the run time. */ library Common { + + /// @notice Runtime type for encrypted boolean. uint8 internal constant ebool_t = 0; + + /// @notice Runtime type for encrypted uint4. uint8 internal constant euint4_t = 1; + + /// @notice Runtime type for encrypted uint8. uint8 internal constant euint8_t = 2; + + /// @notice Runtime type for encrypted uint16. uint8 internal constant euint16_t = 3; + + /// @notice Runtime type for encrypted uint32. uint8 internal constant euint32_t = 4; + /// @notice Runtime type for encrypted uint64. uint8 internal constant euint64_t = 5; + /// @notice Runtime type for encrypted uint128. uint8 internal constant euint128_t = 6; + /// @notice Runtime type for encrypted addresses. uint8 internal constant euint160_t = 7; + + /// @notice Runtime type for encrypted uint256. uint8 internal constant euint256_t = 8; + + /// @notice Runtime type for encrypted bytes64. uint8 internal constant ebytes64_t = 9; + + /// @notice Runtime type for encrypted bytes128. uint8 internal constant ebytes128_t = 10; + + /// @notice Runtime type for encrypted bytes256. uint8 internal constant ebytes256_t = 11; } `; @@ -56,6 +77,9 @@ function binaryOperatorImpl(op: Operator): string { : `bytes1 scalarByte = ${scalarByte};`; return ( ` + /** + * @dev Returns the FHEVM config. + */ function ${op.name}(uint256 lhs, uint256 rhs${scalarArg}) internal returns (uint256 result) { ${scalarSection} FHEVMConfigStruct storage $ = getFHEVMConfig(); @@ -91,12 +115,19 @@ library Impl { /// @dev keccak256(abi.encode(uint256(keccak256("fhevm.storage.FHEVMConfig")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant FHEVMConfigLocation = 0xed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea600; + /** + * @dev Returns the FHEVM config. + */ function getFHEVMConfig() internal pure returns (FHEVMConfigStruct storage $) { assembly { $.slot := FHEVMConfigLocation } } + /** + * @notice Sets the FHEVM addresses. + * @param fhevmConfig FHEVM config struct that contains contract addresses. + */ function setFHEVM(FHEVMConfigStruct memory fhevmConfig) internal { FHEVMConfigStruct storage $ = getFHEVMConfig(); $.ACLAddress = fhevmConfig.ACLAddress; @@ -131,7 +162,6 @@ export function fhevmLibSol(operators: Operator[]): string { res.push(` // SPDX-License-Identifier: BSD-3-Clause-Clear - pragma solidity ^0.8.24; ${fheLibInterface} @@ -170,7 +200,7 @@ function generateImplCoprocessorInterface(operators: Operator[]): string { res.push(` /** * @title FHEVMConfigStruct - * @notice This struct contains all addresses of core contrats which are needed in a typical dApp. + * @notice This struct contains all addresses of core contracts, which are needed in a typical dApp. */ struct FHEVMConfigStruct { address ACLAddress; @@ -184,7 +214,6 @@ function generateImplCoprocessorInterface(operators: Operator[]): string { * @notice This interface contains all functions to conduct FHE operations. */ interface ITFHEExecutor {`); - operators.forEach((op) => { let functionName = operatorFheLibFunction(op); const tail = 'external returns (uint256 result);'; @@ -192,11 +221,27 @@ function generateImplCoprocessorInterface(operators: Operator[]): string { switch (op.arguments) { case OperatorArguments.Binary: functionArguments = '(uint256 lhs, uint256 rhs, bytes1 scalarByte)'; - res.push(` function ${functionName}${functionArguments} ${tail}`); + res.push(` + + /** + * @notice Computes ${functionName} operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ + function ${functionName}${functionArguments} ${tail}`); break; case OperatorArguments.Unary: functionArguments = '(uint256 ct)'; - res.push(` function ${functionName}${functionArguments} ${tail}`); + res.push(` + + /** + * @notice Computes ${functionName} operation. + * @param ct Ct + * @return result Result. + */ + function ${functionName}${functionArguments} ${tail}`); break; } }); @@ -210,20 +255,94 @@ function generateImplCoprocessorInterface(operators: Operator[]): string { function fheLibCustomInterfaceFunctions(): string { return ` + /** + * @notice Verifies the ciphertext. + * @param inputHandle Input handle. + * @param callerAddress Address of the caller. + * @param inputProof Input proof. + * @param inputType Input type. + * @return result Result. + */ function verifyCiphertext(bytes32 inputHandle, address callerAddress, address contractAddress, bytes memory inputProof, bytes1 inputType) external pure returns (uint256 result); `; } function coprocessorInterfaceCustomFunctions(): string { return ` + /** + * @notice Verifies the ciphertext. + * @param inputHandle Input handle. + * @param callerAddress Address of the caller. + * @param inputProof Input proof. + * @param inputType Input type. + * @return result Result. + */ function verifyCiphertext(bytes32 inputHandle, address callerAddress, bytes memory inputProof, bytes1 inputType) external returns (uint256 result); + + /** + * @notice Performs the casting to a target type. + * @param ct Value to cast. + * @param toType Target type. + * @return result Result value of the target type. + */ function cast(uint256 ct, bytes1 toType) external returns (uint256 result); + + /** + * @notice Does trivial encryption. + * @param ct Value to encrypt. + * @param toType Target type. + * @return result Result value of the target type. + */ function trivialEncrypt(uint256 ct, bytes1 toType) external returns (uint256 result); + + /** + * @notice Does trivial encryption. + * @param ct Value to encrypt. + * @param toType Target type. + * @return result Result value of the target type. + */ function trivialEncrypt(bytes memory ct, bytes1 toType) external returns (uint256 result); + + /** + * @notice Computes FHEEq operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheEq(uint256 lhs, bytes memory rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes FHENe operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheNe(uint256 lhs, bytes memory rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes FHEIfThenElse operation. + * @param control Control value. + * @param ifTrue If true. + * @param ifFalse If false. + * @return result Result. + */ function fheIfThenElse(uint256 control, uint256 ifTrue, uint256 ifFalse) external returns (uint256 result); + + /** + * @notice Computes FHERand operation. + * @param randType Type for the random result. + * @return result Result. + */ function fheRand(bytes1 randType) external returns (uint256 result); + + /** + * @notice Computes FHERandBounded operation. + * @param upperBound Upper bound value. + * @param randType Type for the random result. + * @return result Result. + */ function fheRandBounded(uint256 upperBound, bytes1 randType) external returns (uint256 result); `; } @@ -231,15 +350,49 @@ function coprocessorInterfaceCustomFunctions(): string { function generateACLInterface(): string { return ` /** - * @title IACL + * @title IACL. * @notice This interface contains all functions that are used to conduct operations * with the ACL contract. */ interface IACL { + /** + * @notice Allows the use of handle by address account for this transaction. + * @dev The caller must be allowed to use handle for allowTransient() to succeed. + * If not, allowTransient() reverts. + * The Coprocessor contract can always allowTransient(), contrarily to allow(). + * @param ciphertext Ciphertext. + * @param account Address of the account. + */ function allowTransient(uint256 ciphertext, address account) external; + + /** + * @notice Allows the use of handle for the address account. + * @dev The caller must be allowed to use handle for allow() to succeed. If not, allow() reverts. + * @param handle Handle. + * @param account Address of the account. + */ function allow(uint256 handle, address account) external; + + + /** + * @dev This function removes the transient allowances, which could be useful for integration with + * Account Abstraction when bundling several UserOps calling the TFHEExecutorCoprocessor. + */ function cleanTransientStorage() external; + + /** + * @notice Returns whether the account is allowed to use the handle, either due to + * allowTransient() or allow(). + * @param handle Handle. + * @param account Address of the account. + * @return isAllowed Whether the account can access the handle. + */ function isAllowed(uint256 handle, address account) external view returns(bool); + + /** + * @notice Allows a list of handles to be decrypted. + * @param handlesList List of handles. + */ function allowForDecryption(uint256[] memory handlesList) external; } `; @@ -252,7 +405,12 @@ function generateInputVerifierInterface(): string { * @notice This interface contains the only function required from InputVerifier. */ interface IInputVerifier { - function cleanTransientStorage() external; + + /** + * @dev This function removes the transient allowances, which could be useful for integration with + * Account Abstraction when bundling several UserOps calling the TFHEExecutorCoprocessor. + */ + function cleanTransientStorage() external; } `; } @@ -290,6 +448,10 @@ error InputLengthAbove128Bytes(uint256 inputLength); /// @notice Returned if the input's length is greater than 256 bytes. error InputLengthAbove256Bytes(uint256 inputLength); + /** + * @notice Sets the FHEVM addresses. + * @param fhevmConfig FHEVM config struct that contains contract addresses. + */ function setFHEVM(FHEVMConfigStruct memory fhevmConfig) internal { Impl.setFHEVM(fhevmConfig); } @@ -297,14 +459,18 @@ error InputLengthAbove256Bytes(uint256 inputLength); if (mocked) { res.push(` - // Return true if the enrypted bool is initialized and false otherwise. + /** + * @dev Returns true if the encrypted bool is initialized and false otherwise. + */ function isInitialized(ebool /*v*/) internal pure returns (bool) { return true; } `); supportedBits.forEach((b) => { res.push(` - // Return true if the enrypted integer is initialized and false otherwise. + /** + * @dev Returns true if the encrypted integer is initialized and false otherwise. + */ function isInitialized(euint${b} /*v*/) internal pure returns (bool) { return true; } @@ -312,14 +478,18 @@ error InputLengthAbove256Bytes(uint256 inputLength); }); } else { res.push(` - // Return true if the enrypted bool is initialized and false otherwise. + /** + * @dev Returns true if the encrypted integer is initialized and false otherwise. + */ function isInitialized(ebool v) internal pure returns (bool) { return ebool.unwrap(v) != 0; } `); supportedBits.forEach((b) => { res.push(` - // Return true if the enrypted integer is initialized and false otherwise. + /** + * @dev Returns true if the encrypted integer is initialized and false otherwise. + */ function isInitialized(euint${b} v) internal pure returns (bool) { return euint${b}.unwrap(v) != 0; } @@ -404,7 +574,9 @@ function tfheEncryptedOperator( returnType: { type: returnTypeOverload, bits: outputBits }, }); res.push(` - // Evaluate ${operator.name}(a, b) and return the result. + /** + * @dev Evaluates ${operator.name}(a, b) and returns the result. + */ function ${operator.name}(euint${lhsBits} a, euint${rhsBits} b) internal returns (${returnType}) { if (!isInitialized(a)) { a = asEuint${lhsBits}(0); @@ -466,7 +638,9 @@ function tfheScalarOperator( // rhs scalar res.push(` - // Evaluate ${operator.name}(a, b) and return the result. + /** + * @dev Evaluates ${operator.name}(a, b) and returns the result. + */ function ${operator.name}(euint${lhsBits} a, ${getUint(rhsBits)} b) internal returns (${returnType}) { if (!isInitialized(a)) { a = asEuint${lhsBits}(0); @@ -488,7 +662,9 @@ function tfheScalarOperator( res.push(` - // Evaluate ${operator.name}(a, b) and return the result. + /** + * @dev Evaluates ${operator.name}(a, b) and returns the result. + */ function ${operator.name}(${getUint(lhsBits)} a, euint${rhsBits} b) internal returns (${returnType}) { ${maybeEncryptLeft} if (!isInitialized(b)) { @@ -546,7 +722,9 @@ function tfheShiftOperators( }); res.push(` - // Evaluate ${operator.name}(a, b) and return the result. + /** + * @dev Evaluates ${operator.name}(a, b) and returns the result. + */ function ${operator.name}(euint${lhsBits} a, euint${rhsBits} b) internal returns (${returnType}) { if (!isInitialized(a)) { a = asEuint${lhsBits}(0); @@ -578,7 +756,9 @@ function tfheShiftOperators( returnType: { type: returnTypeOverload, bits: outputBits }, }); res.push(` - // Evaluate ${operator.name}(a, b) and return the result. + /** + * @dev Evaluates ${operator.name}(a, b) and returns the result. + */ function ${operator.name}(euint${lhsBits} a, ${getUint(rhsBits)} b) internal returns (${returnType}) { if (!isInitialized(a)) { a = asEuint${lhsBits}(0); @@ -591,8 +771,10 @@ function tfheShiftOperators( function tfheSelect(inputBits: number): string { return ` - // If 'control''s value is 'true', the result has the same value as 'a'. - // If 'control''s value is 'false', the result has the same value as 'b'. + /** + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. + */ function select(ebool control, euint${inputBits} a, euint${inputBits} b) internal returns (euint${inputBits}) { return euint${inputBits}.wrap(Impl.select(ebool.unwrap(control), euint${inputBits}.unwrap(a), euint${inputBits}.unwrap(b))); }`; @@ -604,7 +786,9 @@ function tfheAsEboolCustomCast(inputBits: number, outputBits: number): string { } return ` - // Cast an encrypted integer from euint${inputBits} to euint${outputBits}. + /** + * @dev Casts an encrypted integer from euint${inputBits} to euint${outputBits}. + */ function asEuint${outputBits}(euint${inputBits} value) internal returns (euint${outputBits}) { return euint${outputBits}.wrap(Impl.cast(euint${inputBits}.unwrap(value), Common.euint${outputBits}_t)); } @@ -614,7 +798,9 @@ function tfheAsEboolCustomCast(inputBits: number, outputBits: number): string { function tfheAsEboolUnaryCast(bits: number): string { const res: string[] = []; res.push(` - // Cast an encrypted integer from euint${bits} to ebool. + /** + * @dev Casts an encrypted integer from euint${bits} to ebool. + */ function asEbool(euint${bits} value) internal returns (ebool) { return ne(value, 0); } @@ -622,17 +808,23 @@ function tfheAsEboolUnaryCast(bits: number): string { if (bits == 8) { res.push(` - // Convert an inputHandle with corresponding inputProof to an encrypted boolean. + /** + * @dev Converts an inputHandle with corresponding inputProof to an encrypted boolean. + */ function asEbool(einput inputHandle, bytes memory inputProof) internal returns (ebool) { return ebool.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebool_t)); } - // Convert a plaintext value to an encrypted boolean. + /** + * @dev Converts a plaintext value to an encrypted boolean. + */ function asEbool(uint256 value) internal returns (ebool) { return ebool.wrap(Impl.trivialEncrypt(value, Common.ebool_t)); } - // Convert a plaintext boolean to an encrypted boolean. + /** + * @dev Converts a plaintext boolean to an encrypted boolean. + */ function asEbool(bool value) internal returns (ebool) { if (value) { return asEbool(1); @@ -641,52 +833,72 @@ function tfheAsEboolUnaryCast(bits: number): string { } } - // Converts an 'ebool' to an 'euint8'. - function asEuint8(ebool value) internal returns (euint8) { + /** + * @dev Converts an 'ebool' to an 'euint8'. + */ + function asEuint8(ebool value) internal returns (euint8) { return euint8.wrap(Impl.cast(ebool.unwrap(value), Common.euint8_t)); } - // Evaluate and(a, b) and return the result. - function and(ebool a, ebool b) internal returns (ebool) { + /** + * @dev Evaluates and(a, b) and returns the result. + */ + function and(ebool a, ebool b) internal returns (ebool) { return ebool.wrap(Impl.and(ebool.unwrap(a), ebool.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. - function and(ebool a, bool b) internal returns (ebool) { + /** + * @dev Evaluates and(a, b) and returns the result. + */ + function and(ebool a, bool b) internal returns (ebool) { return ebool.wrap(Impl.and(ebool.unwrap(a), b?1:0, true)); } - // Evaluate and(a, b) and return the result. - function and(bool a, ebool b) internal returns (ebool) { + /** + * @dev Evaluates and(a, b) and returns the result. + */ + function and(bool a, ebool b) internal returns (ebool) { return ebool.wrap(Impl.and(ebool.unwrap(b), a?1:0, true)); } - // Evaluate or(a, b) and return the result. - function or(ebool a, ebool b) internal returns (ebool) { + /** + * @dev Evaluates or(a, b) and returns the result. + */ + function or(ebool a, ebool b) internal returns (ebool) { return ebool.wrap(Impl.or(ebool.unwrap(a), ebool.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. - function or(ebool a, bool b) internal returns (ebool) { + /** + * @dev Evaluates or(a, b) and returns the result. + */ + function or(ebool a, bool b) internal returns (ebool) { return ebool.wrap(Impl.or(ebool.unwrap(a), b?1:0, true)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(bool a, ebool b) internal returns (ebool) { return ebool.wrap(Impl.or(ebool.unwrap(b), a?1:0, true)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(ebool a, ebool b) internal returns (ebool) { return ebool.wrap(Impl.xor(ebool.unwrap(a), ebool.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(ebool a, bool b) internal returns (ebool) { return ebool.wrap(Impl.xor(ebool.unwrap(a), b?1:0, true)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(bool a, ebool b) internal returns (ebool) { return ebool.wrap(Impl.xor(ebool.unwrap(b), a?1:0, true)); } @@ -697,7 +909,9 @@ function tfheAsEboolUnaryCast(bits: number): string { `); } else { res.push(` - // Converts an 'ebool' to an 'euint${bits}'. + /** + * @dev Converts an 'ebool' to an 'euint${bits}'. + */ function asEuint${bits}(ebool b) internal returns (euint${bits}) { return euint${bits}.wrap(Impl.cast(ebool.unwrap(b), Common.euint${bits}_t)); } @@ -731,12 +945,16 @@ function tfheUnaryOperators(bits: number, operators: Operator[], signatures: Ove function tfheCustomUnaryOperators(bits: number, signatures: OverloadSignature[], mocked: boolean): string { let result = ` - // Convert an inputHandle with corresponding inputProof to an encrypted euint${bits} integer. + /** + * @dev Convert an inputHandle with corresponding inputProof to an encrypted euint${bits} integer. + */ function asEuint${bits}(einput inputHandle, bytes memory inputProof) internal returns (euint${bits}) { return euint${bits}.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint${bits}_t)); } - // Convert a plaintext value to an encrypted euint${bits} integer. + /** + * @dev Convert a plaintext value to an encrypted euint${bits} integer. + */ function asEuint${bits}(uint256 value) internal returns (euint${bits}) { return euint${bits}.wrap(Impl.trivialEncrypt(value, Common.euint${bits}_t)); } @@ -760,14 +978,20 @@ function tfheAclMethods(supportedBits: number[]): string { res.push( ` - // cleans the transient storage of ACL containing all the allowedTransient accounts - // also cleans transient storage of InputVerifier containing cached inputProofs - // to be used for integration with Account Abstraction or when bundling UserOps calling the FHEVMCoprocessor + /** + * @dev This function cleans the transient storage for the ACL (accounts) and the InputVerifier + * (input proofs). + * This could be useful for integration with Account Abstraction when bundling several + * UserOps calling the TFHEExecutorCoprocessor. + */ function cleanTransientStorage() internal { Impl.cleanTransientStorageACL(); Impl.cleanTransientStorageInputVerifier(); } + /** + * @dev Returns whether the account is allowed to use the value. + */ function isAllowed(ebool value, address account) internal view returns (bool) { return Impl.isAllowed(ebool.unwrap(value), account); } @@ -775,21 +999,34 @@ function tfheAclMethods(supportedBits: number[]): string { ); supportedBits.forEach((bits) => - res.push(`function isAllowed(euint${bits} value, address account) internal view returns (bool) { + res.push(` + /** + * @dev Returns whether the account is allowed to use the value. + */ + function isAllowed(euint${bits} value, address account) internal view returns (bool) { return Impl.isAllowed(euint${bits}.unwrap(value), account); }`), ); res.push( ` + /** + * @dev Returns whether the account is allowed to use the value. + */ function isAllowed(eaddress value, address account) internal view returns(bool) { return Impl.isAllowed(eaddress.unwrap(value), account); } + /** + * @dev Returns whether the account is allowed to use the value. + */ function isAllowed(ebytes256 value, address account) internal view returns (bool) { return Impl.isAllowed(ebytes256.unwrap(value), account); } + /** + * @dev Returns whether the sender is allowed to use the value. + */ function isSenderAllowed(ebool value) internal view returns (bool) { return Impl.isAllowed(ebool.unwrap(value), msg.sender); } @@ -799,6 +1036,9 @@ function tfheAclMethods(supportedBits: number[]): string { supportedBits.forEach((bits) => res.push( ` + /** + * @dev Returns whether the sender is allowed to use the value. + */ function isSenderAllowed(euint${bits} value) internal view returns (bool) { return Impl.isAllowed(euint${bits}.unwrap(value), msg.sender); } @@ -808,10 +1048,16 @@ function tfheAclMethods(supportedBits: number[]): string { res.push( ` + /** + * @dev Returns whether the sender is allowed to use the value. + */ function isSenderAllowed(eaddress value) internal view returns(bool) { return Impl.isAllowed(eaddress.unwrap(value), msg.sender); } + /** + * @dev Returns whether the sender is allowed to use the value. + */ function isSenderAllowed(ebytes256 value) internal view returns(bool) { return Impl.isAllowed(ebytes256.unwrap(value), msg.sender); } @@ -833,10 +1079,16 @@ function tfheAclMethods(supportedBits: number[]): string { supportedBits.forEach((bits) => res.push( ` + /** + * @dev Allows the use of value for the address account. + */ function allow(euint${bits} value, address account) internal { Impl.allow(euint${bits}.unwrap(value), account); } + /** + * @dev Allows the use of value for this address (address(this)). + */ function allowThis(euint${bits} value) internal { Impl.allow(euint${bits}.unwrap(value), address(this)); } @@ -846,34 +1098,58 @@ function tfheAclMethods(supportedBits: number[]): string { res.push( ` + /** + * @dev Allows the use of value for the address account. + */ function allow(eaddress value, address account) internal { Impl.allow(eaddress.unwrap(value), account); } + /** + * @dev Allows the use of value for this address (address(this)). + */ function allowThis(eaddress value) internal { Impl.allow(eaddress.unwrap(value), address(this)); } + /** + * @dev Allows the use of value for the address account. + */ function allow(ebytes64 value, address account) internal { Impl.allow(ebytes64.unwrap(value), account); } + /** + * @dev Allows the use of value for this address (address(this)). + */ function allowThis(ebytes64 value) internal { Impl.allow(ebytes64.unwrap(value), address(this)); } + /** + * @dev Allows the use of value for the address account. + */ function allow(ebytes128 value, address account) internal { Impl.allow(ebytes128.unwrap(value), account); } + /** + * @dev Allows the use of value for this address (address(this)). + */ function allowThis(ebytes128 value) internal { Impl.allow(ebytes128.unwrap(value), address(this)); } + /** + * @dev Allows the use of value for the address account. + */ function allow(ebytes256 value, address account) internal { Impl.allow(ebytes256.unwrap(value), account); } + /** + * @dev Allows the use of value for this address (address(this)). + */ function allowThis(ebytes256 value) internal { Impl.allow(ebytes256.unwrap(value), address(this)); } @@ -882,6 +1158,9 @@ function tfheAclMethods(supportedBits: number[]): string { res.push( ` + /** + * @dev Allows the use of value by address account for this transaction. + */ function allowTransient(ebool value, address account) internal { Impl.allowTransient(ebool.unwrap(value), account); } @@ -891,6 +1170,9 @@ function tfheAclMethods(supportedBits: number[]): string { supportedBits.forEach((bits) => res.push( ` + /** + * @dev Allows the use of value by address account for this transaction. + */ function allowTransient(euint${bits} value, address account) internal { Impl.allowTransient(euint${bits}.unwrap(value), account); } @@ -900,18 +1182,30 @@ function tfheAclMethods(supportedBits: number[]): string { res.push( ` + /** + * @dev Allows the use of value by address account for this transaction. + */ function allowTransient(eaddress value, address account) internal { Impl.allowTransient(eaddress.unwrap(value), account); } + /** + * @dev Allows the use of value by address account for this transaction. + */ function allowTransient(ebytes64 value, address account) internal { Impl.allowTransient(ebytes64.unwrap(value), account); } + /** + * @dev Allows the use of value by address account for this transaction. + */ function allowTransient(ebytes128 value, address account) internal { Impl.allowTransient(ebytes128.unwrap(value), account); } + /** + * @dev Allows the use of value by address account for this transaction. + */ function allowTransient(ebytes256 value, address account) internal { Impl.allowTransient(ebytes256.unwrap(value), account); } @@ -923,120 +1217,164 @@ function tfheAclMethods(supportedBits: number[]): string { function tfheCustomMethods(): string { let result = ` - // Generates a random encrypted boolean. + /** + * @dev Generates a random encrypted boolean. + */ function randEbool() internal returns (ebool) { return ebool.wrap(Impl.rand(Common.ebool_t)); } - // Generates a random encrypted 4-bit unsigned integer. + /** + * @dev Generates a random encrypted 4-bit unsigned integer. + */ function randEuint4() internal returns (euint4) { return euint4.wrap(Impl.rand(Common.euint4_t)); } - // Generates a random encrypted 4-bit unsigned integer in the [0, upperBound) range. - // The upperBound must be a power of 2. + /** + * @dev Generates a random encrypted 4-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. + */ function randEuint4(uint8 upperBound) internal returns (euint4) { return euint4.wrap(Impl.randBounded(upperBound, Common.euint4_t)); } - // Generates a random encrypted 8-bit unsigned integer. + /** + * @dev Generates a random encrypted 8-bit unsigned integer. + */ function randEuint8() internal returns (euint8) { return euint8.wrap(Impl.rand(Common.euint8_t)); } - // Generates a random encrypted 8-bit unsigned integer in the [0, upperBound) range. - // The upperBound must be a power of 2. + /** + * @dev Generates a random encrypted 8-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. + */ function randEuint8(uint8 upperBound) internal returns (euint8) { return euint8.wrap(Impl.randBounded(upperBound, Common.euint8_t)); } - // Generates a random encrypted 16-bit unsigned integer. + /** + * @dev Generates a random encrypted 16-bit unsigned integer. + */ function randEuint16() internal returns (euint16) { return euint16.wrap(Impl.rand(Common.euint16_t)); } - // Generates a random encrypted 16-bit unsigned integer in the [0, upperBound) range. - // The upperBound must be a power of 2. + /** + * @dev Generates a random encrypted 16-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. + */ function randEuint16(uint16 upperBound) internal returns (euint16) { return euint16.wrap(Impl.randBounded(upperBound, Common.euint16_t)); } - // Generates a random encrypted 32-bit unsigned integer. + /** + * @dev Generates a random encrypted 32-bit unsigned integer. + */ function randEuint32() internal returns (euint32) { return euint32.wrap(Impl.rand(Common.euint32_t)); } - // Generates a random encrypted 32-bit unsigned integer in the [0, upperBound) range. - // The upperBound must be a power of 2. + /** + * @dev Generates a random encrypted 32-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. + */ function randEuint32(uint32 upperBound) internal returns (euint32) { return euint32.wrap(Impl.randBounded(upperBound, Common.euint32_t)); } - // Generates a random encrypted 64-bit unsigned integer. + /** + * @dev Generates a random encrypted 64-bit unsigned integer. + */ function randEuint64() internal returns (euint64) { return euint64.wrap(Impl.rand(Common.euint64_t)); } - // Generates a random encrypted 64-bit unsigned integer in the [0, upperBound) range. - // The upperBound must be a power of 2. + /** + * @dev Generates a random encrypted 64-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. + */ function randEuint64(uint64 upperBound) internal returns (euint64) { return euint64.wrap(Impl.randBounded(upperBound, Common.euint64_t)); } - // Generates a random encrypted 128-bit unsigned integer. + /** + * @dev Generates a random encrypted 128-bit unsigned integer. + */ function randEuint128() internal returns (euint128) { return euint128.wrap(Impl.rand(Common.euint128_t)); } - // Generates a random encrypted 128-bit unsigned integer in the [0, upperBound) range. - // The upperBound must be a power of 2. + /** + * @dev Generates a random encrypted 128-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. + */ function randEuint128(uint128 upperBound) internal returns (euint128) { return euint128.wrap(Impl.randBounded(upperBound, Common.euint128_t)); } - // Generates a random encrypted 256-bit unsigned integer. + /** + * @dev Generates a random encrypted 256-bit unsigned integer. + */ function randEuint256() internal returns (euint256) { return euint256.wrap(Impl.rand(Common.euint256_t)); } - // Generates a random encrypted 256-bit unsigned integer in the [0, upperBound) range. - // The upperBound must be a power of 2. + /** + * @dev Generates a random encrypted 256-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. + */ function randEuint256(uint256 upperBound) internal returns (euint256) { return euint256.wrap(Impl.randBounded(upperBound, Common.euint256_t)); } - // Generates a random encrypted 512-bit unsigned integer. + /** + * @dev Generates a random encrypted 512-bit unsigned integer. + */ function randEbytes64() internal returns (ebytes64) { return ebytes64.wrap(Impl.rand(Common.ebytes64_t)); } - // Generates a random encrypted 1024-bit unsigned integer. + /** + * @dev Generates a random encrypted 1024-bit unsigned integer. + */ function randEbytes128() internal returns (ebytes128) { return ebytes128.wrap(Impl.rand(Common.ebytes128_t)); } - // Generates a random encrypted 2048-bit unsigned integer. + /** + * @dev Generates a random encrypted 2048-bit unsigned integer. + */ function randEbytes256() internal returns (ebytes256) { return ebytes256.wrap(Impl.rand(Common.ebytes256_t)); } - // Convert an inputHandle with corresponding inputProof to an encrypted eaddress. + /** + * @dev Convert an inputHandle with corresponding inputProof to an encrypted eaddress. + */ function asEaddress(einput inputHandle, bytes memory inputProof) internal returns (eaddress) { return eaddress.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint160_t)); } - // Convert a plaintext value to an encrypted address. + /** + * @dev Convert a plaintext value to an encrypted address. + */ function asEaddress(address value) internal returns (eaddress) { return eaddress.wrap(Impl.trivialEncrypt(uint160(value), Common.euint160_t)); } - // Convert the given inputHandle and inputProof to an encrypted ebytes64 value. + /** + * @dev Convert the given inputHandle and inputProof to an encrypted ebytes64 value. + */ function asEbytes64(einput inputHandle, bytes memory inputProof) internal returns (ebytes64) { return ebytes64.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebytes64_t)); } - // Left-pad a bytes array with zeros such that it becomes of length 64. + /** + * @dev Left-pad a bytes array with zeros such that it becomes of length 64. + */ function padToBytes64(bytes memory input) internal pure returns (bytes memory) { uint256 inputLength = input.length; @@ -1056,17 +1394,23 @@ function tfheCustomMethods(): string { return result; } - // Convert a plaintext value - must be a bytes array of size 64 - to an encrypted Bytes64. + /** + * @dev Convert a plaintext value - must be a bytes array of size 64 - to an encrypted Bytes64. + */ function asEbytes64(bytes memory value) internal returns (ebytes64) { return ebytes64.wrap(Impl.trivialEncrypt(value, Common.ebytes64_t)); } - // Convert the given inputHandle and inputProof to an encrypted ebytes128 value. + /** + * @dev Convert the given inputHandle and inputProof to an encrypted ebytes128 value. + */ function asEbytes128(einput inputHandle, bytes memory inputProof) internal returns (ebytes128) { return ebytes128.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebytes128_t)); } - // Left-pad a bytes array with zeros such that it becomes of length 128. + /** + * @dev Left-pad a bytes array with zeros such that it becomes of length 128. + */ function padToBytes128(bytes memory input) internal pure returns (bytes memory) { uint256 inputLength = input.length; @@ -1085,17 +1429,23 @@ function tfheCustomMethods(): string { return result; } - // Convert a plaintext value - must be a bytes array of size 128 - to an encrypted Bytes128. + /** + * @dev Convert a plaintext value - must be a bytes array of size 128 - to an encrypted Bytes128. + */ function asEbytes128(bytes memory value) internal returns (ebytes128) { return ebytes128.wrap(Impl.trivialEncrypt(value, Common.ebytes128_t)); } - // Convert the given inputHandle and inputProof to an encrypted ebytes256 value. + /** + * @dev Convert the given inputHandle and inputProof to an encrypted ebytes256 value. + */ function asEbytes256(einput inputHandle, bytes memory inputProof) internal returns (ebytes256) { return ebytes256.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebytes256_t)); } - // Left-pad a bytes array with zeros such that it becomes of length 256. + /** + * @dev Left-pad a bytes array with zeros such that it becomes of length 256. + */ function padToBytes256(bytes memory input) internal pure returns (bytes memory) { uint256 inputLength = input.length; @@ -1114,32 +1464,44 @@ function tfheCustomMethods(): string { return result; } - // Convert a plaintext value - must be a bytes array of size 256 - to an encrypted Bytes256. + /** + * @dev Convert a plaintext value - must be a bytes array of size 256 - to an encrypted Bytes256. + */ function asEbytes256(bytes memory value) internal returns (ebytes256) { return ebytes256.wrap(Impl.trivialEncrypt(value, Common.ebytes256_t)); } - // Return true if the enrypted address is initialized and false otherwise. + /** + * @dev Returns true if the encrypted address is initialized and false otherwise. + */ function isInitialized(eaddress v) internal pure returns (bool) { return eaddress.unwrap(v) != 0; } - // Return true if the enrypted value is initialized and false otherwise. + /** + * @dev Returns true if the encrypted value is initialized and false otherwise. + */ function isInitialized(ebytes64 v) internal pure returns (bool) { return ebytes64.unwrap(v) != 0; } - // Return true if the enrypted value is initialized and false otherwise. + /** + * @dev Returns true if the encrypted value is initialized and false otherwise. + */ function isInitialized(ebytes128 v) internal pure returns (bool) { return ebytes128.unwrap(v) != 0; } - // Return true if the enrypted value is initialized and false otherwise. + /** + * @dev Returns true if the encrypted value is initialized and false otherwise. + */ function isInitialized(ebytes256 v) internal pure returns (bool) { return ebytes256.unwrap(v) != 0; } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(ebool a, ebool b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbool(false); @@ -1150,7 +1512,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.eq(ebool.unwrap(a), ebool.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(ebool a, ebool b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbool(false); @@ -1161,7 +1525,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.ne(ebool.unwrap(a), ebool.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(ebool a, bool b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbool(false); @@ -1170,7 +1536,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.eq(ebool.unwrap(a), bProc, true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(bool b, ebool a) internal returns (ebool) { if (!isInitialized(a)) { a = asEbool(false); @@ -1179,7 +1547,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.eq(ebool.unwrap(a), bProc, true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(ebool a, bool b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbool(false); @@ -1188,7 +1558,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.ne(ebool.unwrap(a), bProc, true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(bool b, ebool a) internal returns (ebool) { if (!isInitialized(a)) { a = asEbool(false); @@ -1197,7 +1569,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.ne(ebool.unwrap(a), bProc, true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(eaddress a, eaddress b) internal returns (ebool) { if (!isInitialized(a)) { a = asEaddress(address(0)); @@ -1208,7 +1582,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.eq(eaddress.unwrap(a), eaddress.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(eaddress a, eaddress b) internal returns (ebool) { if (!isInitialized(a)) { a = asEaddress(address(0)); @@ -1219,7 +1595,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.ne(eaddress.unwrap(a), eaddress.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(eaddress a, address b) internal returns (ebool) { if (!isInitialized(a)) { a = asEaddress(address(0)); @@ -1228,7 +1606,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.eq(eaddress.unwrap(a), bProc, true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(address b, eaddress a) internal returns (ebool) { if (!isInitialized(a)) { a = asEaddress(address(0)); @@ -1237,7 +1617,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.eq(eaddress.unwrap(a), bProc, true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(eaddress a, address b) internal returns (ebool) { if (!isInitialized(a)) { a = asEaddress(address(0)); @@ -1246,7 +1628,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.ne(eaddress.unwrap(a), bProc, true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(address b, eaddress a) internal returns (ebool) { if (!isInitialized(a)) { a = asEaddress(address(0)); @@ -1255,37 +1639,49 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.ne(eaddress.unwrap(a), bProc, true)); } - // If 'control''s value is 'true', the result has the same value as 'a'. - // If 'control''s value is 'false', the result has the same value as 'b'. + /** + * @dev If 'control''s value is 'true', the result has the same value as 'a'. + * If 'control''s value is 'false', the result has the same value as 'b'. + */ function select(ebool control, ebool a, ebool b) internal returns (ebool) { return ebool.wrap(Impl.select(ebool.unwrap(control), ebool.unwrap(a), ebool.unwrap(b))); } - // If 'control''s value is 'true', the result has the same value as 'a'. - // If 'control''s value is 'false', the result has the same value as 'b'. + /** + * @dev If 'control''s value is 'true', the result has the same value as 'a'. + * If 'control''s value is 'false', the result has the same value as 'b'. + */ function select(ebool control, eaddress a, eaddress b) internal returns (eaddress) { return eaddress.wrap(Impl.select(ebool.unwrap(control), eaddress.unwrap(a), eaddress.unwrap(b))); } - // If 'control''s value is 'true', the result has the same value as 'a'. - // If 'control''s value is 'false', the result has the same value as 'b'. + /** + * @dev If 'control''s value is 'true', the result has the same value as 'a'. + * If 'control''s value is 'false', the result has the same value as 'b'. + */ function select(ebool control, ebytes64 a, ebytes64 b) internal returns (ebytes64) { return ebytes64.wrap(Impl.select(ebool.unwrap(control), ebytes64.unwrap(a), ebytes64.unwrap(b))); } - // If 'control''s value is 'true', the result has the same value as 'a'. - // If 'control''s value is 'false', the result has the same value as 'b'. + /** + * @dev If 'control''s value is 'true', the result has the same value as 'a'. + * If 'control''s value is 'false', the result has the same value as 'b'. + */ function select(ebool control, ebytes128 a, ebytes128 b) internal returns (ebytes128) { return ebytes128.wrap(Impl.select(ebool.unwrap(control), ebytes128.unwrap(a), ebytes128.unwrap(b))); } - - // If 'control''s value is 'true', the result has the same value as 'a'. - // If 'control''s value is 'false', the result has the same value as 'b'. + + /** + * @dev If 'control''s value is 'true', the result has the same value as 'a'. + * If 'control''s value is 'false', the result has the same value as 'b'. + */ function select(ebool control, ebytes256 a, ebytes256 b) internal returns (ebytes256) { return ebytes256.wrap(Impl.select(ebool.unwrap(control), ebytes256.unwrap(a), ebytes256.unwrap(b))); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(ebytes64 a, ebytes64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes64(padToBytes64(hex'')); @@ -1296,7 +1692,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.eq(ebytes64.unwrap(a), ebytes64.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(ebytes64 a, bytes memory b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes64(padToBytes64(hex'')); @@ -1304,7 +1702,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.eq(ebytes64.unwrap(a), b, true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(bytes memory a, ebytes64 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEbytes64(padToBytes64(hex'')); @@ -1312,7 +1712,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.eq(ebytes64.unwrap(b), a, true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(ebytes64 a, ebytes64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes64(padToBytes64(hex'')); @@ -1323,7 +1725,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.ne(ebytes64.unwrap(a), ebytes64.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(ebytes64 a, bytes memory b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes64(padToBytes64(hex'')); @@ -1331,7 +1735,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.ne(ebytes64.unwrap(a), b, true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(bytes memory a, ebytes64 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEbytes64(padToBytes64(hex'')); @@ -1339,7 +1745,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.ne(ebytes64.unwrap(b), a, true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(ebytes128 a, ebytes128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes128(padToBytes128(hex'')); @@ -1350,7 +1758,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.eq(ebytes128.unwrap(a), ebytes128.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(ebytes128 a, bytes memory b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes128(padToBytes128(hex'')); @@ -1358,7 +1768,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.eq(ebytes128.unwrap(a), b, true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(bytes memory a, ebytes128 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEbytes128(padToBytes128(hex'')); @@ -1366,7 +1778,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.eq(ebytes128.unwrap(b), a, true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(ebytes128 a, ebytes128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes128(padToBytes128(hex'')); @@ -1377,7 +1791,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.ne(ebytes128.unwrap(a), ebytes128.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(ebytes128 a, bytes memory b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes128(padToBytes128(hex'')); @@ -1385,7 +1801,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.ne(ebytes128.unwrap(a), b, true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(bytes memory a, ebytes128 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEbytes128(padToBytes128(hex'')); @@ -1393,7 +1811,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.ne(ebytes128.unwrap(b), a, true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(ebytes256 a, ebytes256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes256(padToBytes256(hex'')); @@ -1404,7 +1824,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.eq(ebytes256.unwrap(a), ebytes256.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(ebytes256 a, bytes memory b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes256(padToBytes256(hex'')); @@ -1412,7 +1834,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.eq(ebytes256.unwrap(a), b, true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(bytes memory a, ebytes256 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEbytes256(padToBytes256(hex'')); @@ -1420,7 +1844,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.eq(ebytes256.unwrap(b), a, true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(ebytes256 a, ebytes256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes256(padToBytes256(hex'')); @@ -1431,7 +1857,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.ne(ebytes256.unwrap(a), ebytes256.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(ebytes256 a, bytes memory b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes256(padToBytes256(hex'')); @@ -1439,7 +1867,9 @@ function tfheCustomMethods(): string { return ebool.wrap(Impl.ne(ebytes256.unwrap(a), b, true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(bytes memory a, ebytes256 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEbytes256(padToBytes256(hex'')); @@ -1452,13 +1882,22 @@ function tfheCustomMethods(): string { function implCustomMethods(): string { return ` - // If 'control's value is 'true', the result has the same value as 'ifTrue'. - // If 'control's value is 'false', the result has the same value as 'ifFalse'. + /** + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. + */ function select(uint256 control, uint256 ifTrue, uint256 ifFalse) internal returns (uint256 result) { FHEVMConfigStruct storage $ = getFHEVMConfig(); result = ITFHEExecutor($.TFHEExecutorAddress).fheIfThenElse(control, ifTrue, ifFalse); } + /** + * @notice Verifies the ciphertext (TFHEExecutor) and allows transient (ACL). + * @param inputHandle Input handle. + * @param inputProof Input proof. + * @param toType Input type. + * @return result Result. + */ function verify( bytes32 inputHandle, bytes memory inputProof, @@ -1469,6 +1908,12 @@ function implCustomMethods(): string { IACL($.ACLAddress).allowTransient(result, msg.sender); } + /** + * @notice Performs the casting to a target type. + * @param ciphertext Ciphertext to cast. + * @param toType Target type. + * @return result Result value of the target type. + */ function cast( uint256 ciphertext, uint8 toType @@ -1477,6 +1922,12 @@ function implCustomMethods(): string { result = ITFHEExecutor($.TFHEExecutorAddress).cast(ciphertext, bytes1(toType)); } + /** + * @notice Does trivial encryption. + * @param value Value to encrypt. + * @param toType Target type. + * @return result Result value of the target type. + */ function trivialEncrypt( uint256 value, uint8 toType @@ -1485,6 +1936,12 @@ function implCustomMethods(): string { result = ITFHEExecutor($.TFHEExecutorAddress).trivialEncrypt(value, bytes1(toType)); } + /** + * @notice Does trivial encryption. + * @param value Value to encrypt. + * @param toType Target type. + * @return result Result value of the target type. + */ function trivialEncrypt( bytes memory value, uint8 toType @@ -1493,6 +1950,13 @@ function implCustomMethods(): string { result = ITFHEExecutor($.TFHEExecutorAddress).trivialEncrypt(value, bytes1(toType)); } + /** + * @notice Computes FHEEq operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalar Scalar byte. + * @return result Result. + */ function eq(uint256 lhs, bytes memory rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -1504,6 +1968,13 @@ function implCustomMethods(): string { result = ITFHEExecutor($.TFHEExecutorAddress).fheEq(lhs, rhs, scalarByte); } + /** + * @notice Computes FHENe operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalar Scalar byte. + * @return result Result. + */ function ne(uint256 lhs, bytes memory rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -1525,26 +1996,58 @@ function implCustomMethods(): string { result = ITFHEExecutor($.TFHEExecutorAddress).fheRandBounded(upperBound, bytes1(randType)); } + /** + * @notice Allows the use of handle by address account for this transaction. + * @dev The caller must be allowed to use handle for allowTransient() to succeed. + * If not, allowTransient() reverts. + * The Coprocessor contract can always allowTransient(), contrarily to allow(). + * @param handle Handle. + * @param account Address of the account. + */ function allowTransient(uint256 handle, address account) internal { FHEVMConfigStruct storage $ = getFHEVMConfig(); IACL($.ACLAddress).allowTransient(handle, account); } + + /** + * @notice Allows the use of handle for the address account. + * @dev The caller must be allowed to use handle for allow() to succeed. If not, allow() reverts. + * @param handle Handle. + * @param account Address of the account. + */ function allow(uint256 handle, address account) internal { FHEVMConfigStruct storage $ = getFHEVMConfig(); IACL($.ACLAddress).allow(handle, account); } + /** + * @dev This function removes the transient allowances in the ACL, which could be useful for integration + * with Account Abstraction when bundling several UserOps calling the TFHEExecutorCoprocessor. + */ function cleanTransientStorageACL() internal { FHEVMConfigStruct storage $ = getFHEVMConfig(); IACL($.ACLAddress).cleanTransientStorage(); } + + /** + * @dev This function removes the transient proofs in the InputVerifier, which could be useful for integration + * with Account Abstraction when bundling several UserOps calling the TFHEExecutorCoprocessor. + */ function cleanTransientStorageInputVerifier() internal { FHEVMConfigStruct storage $ = getFHEVMConfig(); IInputVerifier($.InputVerifierAddress).cleanTransientStorage(); } + + /** + * @notice Returns whether the account is allowed to use the handle, either due to + * allowTransient() or allow(). + * @param handle Handle. + * @param account Address of the account. + * @return isAllowed Whether the account can access the handle. + */ function isAllowed(uint256 handle, address account) internal view returns (bool) { FHEVMConfigStruct storage $ = getFHEVMConfig(); return IACL($.ACLAddress).isAllowed(handle, account); From 92b0369358c10aa7a2d703b6fa17d411cd2b8ecd Mon Sep 17 00:00:00 2001 From: PacificYield <173040337+PacificYield@users.noreply.github.com> Date: Thu, 2 Jan 2025 17:09:12 +0100 Subject: [PATCH 2/2] chore: adjusted outputs --- lib/Impl.sol | 419 ++++- lib/TFHE.sol | 4686 ++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 3966 insertions(+), 1139 deletions(-) diff --git a/lib/Impl.sol b/lib/Impl.sol index 6163d97d..f6baa165 100644 --- a/lib/Impl.sol +++ b/lib/Impl.sol @@ -5,7 +5,7 @@ import "./TFHE.sol"; /** * @title FHEVMConfigStruct - * @notice This struct contains all addresses of core contrats which are needed in a typical dApp. + * @notice This struct contains all addresses of core contracts, which are needed in a typical dApp. */ struct FHEVMConfigStruct { address ACLAddress; @@ -19,54 +19,324 @@ struct FHEVMConfigStruct { * @notice This interface contains all functions to conduct FHE operations. */ interface ITFHEExecutor { + /** + * @notice Computes fheAdd operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheAdd(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes fheSub operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheSub(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes fheMul operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheMul(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes fheDiv operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheDiv(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes fheRem operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheRem(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes fheBitAnd operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheBitAnd(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes fheBitOr operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheBitOr(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes fheBitXor operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheBitXor(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes fheShl operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheShl(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes fheShr operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheShr(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes fheRotl operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheRotl(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes fheRotr operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheRotr(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes fheEq operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheEq(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes fheNe operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheNe(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes fheGe operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheGe(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes fheGt operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheGt(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes fheLe operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheLe(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes fheLt operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheLt(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes fheMin operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheMin(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes fheMax operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheMax(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes fheNeg operation. + * @param ct Ct + * @return result Result. + */ function fheNeg(uint256 ct) external returns (uint256 result); + + /** + * @notice Computes fheNot operation. + * @param ct Ct + * @return result Result. + */ function fheNot(uint256 ct) external returns (uint256 result); + /** + * @notice Verifies the ciphertext. + * @param inputHandle Input handle. + * @param callerAddress Address of the caller. + * @param inputProof Input proof. + * @param inputType Input type. + * @return result Result. + */ function verifyCiphertext( bytes32 inputHandle, address callerAddress, bytes memory inputProof, bytes1 inputType ) external returns (uint256 result); + + /** + * @notice Performs the casting to a target type. + * @param ct Value to cast. + * @param toType Target type. + * @return result Result value of the target type. + */ function cast(uint256 ct, bytes1 toType) external returns (uint256 result); + + /** + * @notice Does trivial encryption. + * @param ct Value to encrypt. + * @param toType Target type. + * @return result Result value of the target type. + */ function trivialEncrypt(uint256 ct, bytes1 toType) external returns (uint256 result); + + /** + * @notice Does trivial encryption. + * @param ct Value to encrypt. + * @param toType Target type. + * @return result Result value of the target type. + */ function trivialEncrypt(bytes memory ct, bytes1 toType) external returns (uint256 result); + + /** + * @notice Computes FHEEq operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheEq(uint256 lhs, bytes memory rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes FHENe operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalarByte Scalar byte. + * @return result Result. + */ function fheNe(uint256 lhs, bytes memory rhs, bytes1 scalarByte) external returns (uint256 result); + + /** + * @notice Computes FHEIfThenElse operation. + * @param control Control value. + * @param ifTrue If true. + * @param ifFalse If false. + * @return result Result. + */ function fheIfThenElse(uint256 control, uint256 ifTrue, uint256 ifFalse) external returns (uint256 result); + + /** + * @notice Computes FHERand operation. + * @param randType Type for the random result. + * @return result Result. + */ function fheRand(bytes1 randType) external returns (uint256 result); + + /** + * @notice Computes FHERandBounded operation. + * @param upperBound Upper bound value. + * @param randType Type for the random result. + * @return result Result. + */ function fheRandBounded(uint256 upperBound, bytes1 randType) external returns (uint256 result); } /** - * @title IACL + * @title IACL. * @notice This interface contains all functions that are used to conduct operations * with the ACL contract. */ interface IACL { + /** + * @notice Allows the use of handle by address account for this transaction. + * @dev The caller must be allowed to use handle for allowTransient() to succeed. + * If not, allowTransient() reverts. + * The Coprocessor contract can always allowTransient(), contrarily to allow(). + * @param ciphertext Ciphertext. + * @param account Address of the account. + */ function allowTransient(uint256 ciphertext, address account) external; + + /** + * @notice Allows the use of handle for the address account. + * @dev The caller must be allowed to use handle for allow() to succeed. If not, allow() reverts. + * @param handle Handle. + * @param account Address of the account. + */ function allow(uint256 handle, address account) external; + + /** + * @dev This function removes the transient allowances, which could be useful for integration with + * Account Abstraction when bundling several UserOps calling the TFHEExecutorCoprocessor. + */ function cleanTransientStorage() external; + + /** + * @notice Returns whether the account is allowed to use the handle, either due to + * allowTransient() or allow(). + * @param handle Handle. + * @param account Address of the account. + * @return isAllowed Whether the account can access the handle. + */ function isAllowed(uint256 handle, address account) external view returns (bool); + + /** + * @notice Allows a list of handles to be decrypted. + * @param handlesList List of handles. + */ function allowForDecryption(uint256[] memory handlesList) external; } @@ -75,6 +345,10 @@ interface IACL { * @notice This interface contains the only function required from InputVerifier. */ interface IInputVerifier { + /** + * @dev This function removes the transient allowances, which could be useful for integration with + * Account Abstraction when bundling several UserOps calling the TFHEExecutorCoprocessor. + */ function cleanTransientStorage() external; } @@ -86,12 +360,19 @@ library Impl { /// @dev keccak256(abi.encode(uint256(keccak256("fhevm.storage.FHEVMConfig")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant FHEVMConfigLocation = 0xed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea600; + /** + * @dev Returns the FHEVM config. + */ function getFHEVMConfig() internal pure returns (FHEVMConfigStruct storage $) { assembly { $.slot := FHEVMConfigLocation } } + /** + * @notice Sets the FHEVM addresses. + * @param fhevmConfig FHEVM config struct that contains contract addresses. + */ function setFHEVM(FHEVMConfigStruct memory fhevmConfig) internal { FHEVMConfigStruct storage $ = getFHEVMConfig(); $.ACLAddress = fhevmConfig.ACLAddress; @@ -100,6 +381,9 @@ library Impl { $.InputVerifierAddress = fhevmConfig.InputVerifierAddress; } + /** + * @dev Returns the FHEVM config. + */ function add(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -111,6 +395,9 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheAdd(lhs, rhs, scalarByte); } + /** + * @dev Returns the FHEVM config. + */ function sub(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -122,6 +409,9 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheSub(lhs, rhs, scalarByte); } + /** + * @dev Returns the FHEVM config. + */ function mul(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -133,18 +423,27 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheMul(lhs, rhs, scalarByte); } + /** + * @dev Returns the FHEVM config. + */ function div(uint256 lhs, uint256 rhs) internal returns (uint256 result) { bytes1 scalarByte = 0x01; FHEVMConfigStruct storage $ = getFHEVMConfig(); result = ITFHEExecutor($.TFHEExecutorAddress).fheDiv(lhs, rhs, scalarByte); } + /** + * @dev Returns the FHEVM config. + */ function rem(uint256 lhs, uint256 rhs) internal returns (uint256 result) { bytes1 scalarByte = 0x01; FHEVMConfigStruct storage $ = getFHEVMConfig(); result = ITFHEExecutor($.TFHEExecutorAddress).fheRem(lhs, rhs, scalarByte); } + /** + * @dev Returns the FHEVM config. + */ function and(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -156,6 +455,9 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheBitAnd(lhs, rhs, scalarByte); } + /** + * @dev Returns the FHEVM config. + */ function or(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -167,6 +469,9 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheBitOr(lhs, rhs, scalarByte); } + /** + * @dev Returns the FHEVM config. + */ function xor(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -178,6 +483,9 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheBitXor(lhs, rhs, scalarByte); } + /** + * @dev Returns the FHEVM config. + */ function shl(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -189,6 +497,9 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheShl(lhs, rhs, scalarByte); } + /** + * @dev Returns the FHEVM config. + */ function shr(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -200,6 +511,9 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheShr(lhs, rhs, scalarByte); } + /** + * @dev Returns the FHEVM config. + */ function rotl(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -211,6 +525,9 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheRotl(lhs, rhs, scalarByte); } + /** + * @dev Returns the FHEVM config. + */ function rotr(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -222,6 +539,9 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheRotr(lhs, rhs, scalarByte); } + /** + * @dev Returns the FHEVM config. + */ function eq(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -233,6 +553,9 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheEq(lhs, rhs, scalarByte); } + /** + * @dev Returns the FHEVM config. + */ function ne(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -244,6 +567,9 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheNe(lhs, rhs, scalarByte); } + /** + * @dev Returns the FHEVM config. + */ function ge(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -255,6 +581,9 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheGe(lhs, rhs, scalarByte); } + /** + * @dev Returns the FHEVM config. + */ function gt(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -266,6 +595,9 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheGt(lhs, rhs, scalarByte); } + /** + * @dev Returns the FHEVM config. + */ function le(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -277,6 +609,9 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheLe(lhs, rhs, scalarByte); } + /** + * @dev Returns the FHEVM config. + */ function lt(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -288,6 +623,9 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheLt(lhs, rhs, scalarByte); } + /** + * @dev Returns the FHEVM config. + */ function min(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -299,6 +637,9 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheMin(lhs, rhs, scalarByte); } + /** + * @dev Returns the FHEVM config. + */ function max(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -320,13 +661,22 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheNot(ct); } - // If 'control's value is 'true', the result has the same value as 'ifTrue'. - // If 'control's value is 'false', the result has the same value as 'ifFalse'. + /** + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. + */ function select(uint256 control, uint256 ifTrue, uint256 ifFalse) internal returns (uint256 result) { FHEVMConfigStruct storage $ = getFHEVMConfig(); result = ITFHEExecutor($.TFHEExecutorAddress).fheIfThenElse(control, ifTrue, ifFalse); } + /** + * @notice Verifies the ciphertext (TFHEExecutor) and allows transient (ACL). + * @param inputHandle Input handle. + * @param inputProof Input proof. + * @param toType Input type. + * @return result Result. + */ function verify(bytes32 inputHandle, bytes memory inputProof, uint8 toType) internal returns (uint256 result) { FHEVMConfigStruct storage $ = getFHEVMConfig(); result = ITFHEExecutor($.TFHEExecutorAddress).verifyCiphertext( @@ -338,21 +688,46 @@ library Impl { IACL($.ACLAddress).allowTransient(result, msg.sender); } + /** + * @notice Performs the casting to a target type. + * @param ciphertext Ciphertext to cast. + * @param toType Target type. + * @return result Result value of the target type. + */ function cast(uint256 ciphertext, uint8 toType) internal returns (uint256 result) { FHEVMConfigStruct storage $ = getFHEVMConfig(); result = ITFHEExecutor($.TFHEExecutorAddress).cast(ciphertext, bytes1(toType)); } + /** + * @notice Does trivial encryption. + * @param value Value to encrypt. + * @param toType Target type. + * @return result Result value of the target type. + */ function trivialEncrypt(uint256 value, uint8 toType) internal returns (uint256 result) { FHEVMConfigStruct storage $ = getFHEVMConfig(); result = ITFHEExecutor($.TFHEExecutorAddress).trivialEncrypt(value, bytes1(toType)); } + /** + * @notice Does trivial encryption. + * @param value Value to encrypt. + * @param toType Target type. + * @return result Result value of the target type. + */ function trivialEncrypt(bytes memory value, uint8 toType) internal returns (uint256 result) { FHEVMConfigStruct storage $ = getFHEVMConfig(); result = ITFHEExecutor($.TFHEExecutorAddress).trivialEncrypt(value, bytes1(toType)); } + /** + * @notice Computes FHEEq operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalar Scalar byte. + * @return result Result. + */ function eq(uint256 lhs, bytes memory rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -364,6 +739,13 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheEq(lhs, rhs, scalarByte); } + /** + * @notice Computes FHENe operation. + * @param lhs LHS. + * @param rhs RHS. + * @param scalar Scalar byte. + * @return result Result. + */ function ne(uint256 lhs, bytes memory rhs, bool scalar) internal returns (uint256 result) { bytes1 scalarByte; if (scalar) { @@ -385,26 +767,55 @@ library Impl { result = ITFHEExecutor($.TFHEExecutorAddress).fheRandBounded(upperBound, bytes1(randType)); } + /** + * @notice Allows the use of handle by address account for this transaction. + * @dev The caller must be allowed to use handle for allowTransient() to succeed. + * If not, allowTransient() reverts. + * The Coprocessor contract can always allowTransient(), contrarily to allow(). + * @param handle Handle. + * @param account Address of the account. + */ function allowTransient(uint256 handle, address account) internal { FHEVMConfigStruct storage $ = getFHEVMConfig(); IACL($.ACLAddress).allowTransient(handle, account); } + /** + * @notice Allows the use of handle for the address account. + * @dev The caller must be allowed to use handle for allow() to succeed. If not, allow() reverts. + * @param handle Handle. + * @param account Address of the account. + */ function allow(uint256 handle, address account) internal { FHEVMConfigStruct storage $ = getFHEVMConfig(); IACL($.ACLAddress).allow(handle, account); } + /** + * @dev This function removes the transient allowances in the ACL, which could be useful for integration + * with Account Abstraction when bundling several UserOps calling the TFHEExecutorCoprocessor. + */ function cleanTransientStorageACL() internal { FHEVMConfigStruct storage $ = getFHEVMConfig(); IACL($.ACLAddress).cleanTransientStorage(); } + /** + * @dev This function removes the transient proofs in the InputVerifier, which could be useful for integration + * with Account Abstraction when bundling several UserOps calling the TFHEExecutorCoprocessor. + */ function cleanTransientStorageInputVerifier() internal { FHEVMConfigStruct storage $ = getFHEVMConfig(); IInputVerifier($.InputVerifierAddress).cleanTransientStorage(); } + /** + * @notice Returns whether the account is allowed to use the handle, either due to + * allowTransient() or allow(). + * @param handle Handle. + * @param account Address of the account. + * @return isAllowed Whether the account can access the handle. + */ function isAllowed(uint256 handle, address account) internal view returns (bool) { FHEVMConfigStruct storage $ = getFHEVMConfig(); return IACL($.ACLAddress).isAllowed(handle, account); diff --git a/lib/TFHE.sol b/lib/TFHE.sol index 1f59cc0d..e5ac389f 100644 --- a/lib/TFHE.sol +++ b/lib/TFHE.sol @@ -22,17 +22,37 @@ type einput is bytes32; * @notice This library contains all the values used to communicate types to the run time. */ library Common { + /// @notice Runtime type for encrypted boolean. uint8 internal constant ebool_t = 0; + + /// @notice Runtime type for encrypted uint4. uint8 internal constant euint4_t = 1; + + /// @notice Runtime type for encrypted uint8. uint8 internal constant euint8_t = 2; + + /// @notice Runtime type for encrypted uint16. uint8 internal constant euint16_t = 3; + + /// @notice Runtime type for encrypted uint32. uint8 internal constant euint32_t = 4; + /// @notice Runtime type for encrypted uint64. uint8 internal constant euint64_t = 5; + /// @notice Runtime type for encrypted uint128. uint8 internal constant euint128_t = 6; + /// @notice Runtime type for encrypted addresses. uint8 internal constant euint160_t = 7; + + /// @notice Runtime type for encrypted uint256. uint8 internal constant euint256_t = 8; + + /// @notice Runtime type for encrypted bytes64. uint8 internal constant ebytes64_t = 9; + + /// @notice Runtime type for encrypted bytes128. uint8 internal constant ebytes128_t = 10; + + /// @notice Runtime type for encrypted bytes256. uint8 internal constant ebytes256_t = 11; } @@ -51,51 +71,73 @@ library TFHE { /// @notice Returned if the input's length is greater than 256 bytes. error InputLengthAbove256Bytes(uint256 inputLength); + /** + * @notice Sets the FHEVM addresses. + * @param fhevmConfig FHEVM config struct that contains contract addresses. + */ function setFHEVM(FHEVMConfigStruct memory fhevmConfig) internal { Impl.setFHEVM(fhevmConfig); } - // Return true if the enrypted bool is initialized and false otherwise. + /** + * @dev Returns true if the encrypted integer is initialized and false otherwise. + */ function isInitialized(ebool v) internal pure returns (bool) { return ebool.unwrap(v) != 0; } - // Return true if the enrypted integer is initialized and false otherwise. + /** + * @dev Returns true if the encrypted integer is initialized and false otherwise. + */ function isInitialized(euint4 v) internal pure returns (bool) { return euint4.unwrap(v) != 0; } - // Return true if the enrypted integer is initialized and false otherwise. + /** + * @dev Returns true if the encrypted integer is initialized and false otherwise. + */ function isInitialized(euint8 v) internal pure returns (bool) { return euint8.unwrap(v) != 0; } - // Return true if the enrypted integer is initialized and false otherwise. + /** + * @dev Returns true if the encrypted integer is initialized and false otherwise. + */ function isInitialized(euint16 v) internal pure returns (bool) { return euint16.unwrap(v) != 0; } - // Return true if the enrypted integer is initialized and false otherwise. + /** + * @dev Returns true if the encrypted integer is initialized and false otherwise. + */ function isInitialized(euint32 v) internal pure returns (bool) { return euint32.unwrap(v) != 0; } - // Return true if the enrypted integer is initialized and false otherwise. + /** + * @dev Returns true if the encrypted integer is initialized and false otherwise. + */ function isInitialized(euint64 v) internal pure returns (bool) { return euint64.unwrap(v) != 0; } - // Return true if the enrypted integer is initialized and false otherwise. + /** + * @dev Returns true if the encrypted integer is initialized and false otherwise. + */ function isInitialized(euint128 v) internal pure returns (bool) { return euint128.unwrap(v) != 0; } - // Return true if the enrypted integer is initialized and false otherwise. + /** + * @dev Returns true if the encrypted integer is initialized and false otherwise. + */ function isInitialized(euint256 v) internal pure returns (bool) { return euint256.unwrap(v) != 0; } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint4 a, euint4 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -106,7 +148,9 @@ library TFHE { return euint4.wrap(Impl.add(euint4.unwrap(a), euint4.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint4 a, euint4 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -117,7 +161,9 @@ library TFHE { return euint4.wrap(Impl.sub(euint4.unwrap(a), euint4.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint4 a, euint4 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -128,7 +174,9 @@ library TFHE { return euint4.wrap(Impl.mul(euint4.unwrap(a), euint4.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint4 a, euint4 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -139,7 +187,9 @@ library TFHE { return euint4.wrap(Impl.and(euint4.unwrap(a), euint4.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint4 a, euint4 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -150,7 +200,9 @@ library TFHE { return euint4.wrap(Impl.or(euint4.unwrap(a), euint4.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint4 a, euint4 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -161,7 +213,9 @@ library TFHE { return euint4.wrap(Impl.xor(euint4.unwrap(a), euint4.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint4 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -172,7 +226,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint4.unwrap(a), euint4.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint4 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -183,7 +239,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint4.unwrap(a), euint4.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint4 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -194,7 +252,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint4.unwrap(a), euint4.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint4 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -205,7 +265,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint4.unwrap(a), euint4.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint4 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -216,7 +278,9 @@ library TFHE { return ebool.wrap(Impl.le(euint4.unwrap(a), euint4.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint4 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -227,7 +291,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint4.unwrap(a), euint4.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint4 a, euint4 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -238,7 +304,9 @@ library TFHE { return euint4.wrap(Impl.min(euint4.unwrap(a), euint4.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint4 a, euint4 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -249,7 +317,9 @@ library TFHE { return euint4.wrap(Impl.max(euint4.unwrap(a), euint4.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint4 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint4(0); @@ -260,7 +330,9 @@ library TFHE { return euint8.wrap(Impl.add(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint4 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint4(0); @@ -271,7 +343,9 @@ library TFHE { return euint8.wrap(Impl.sub(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint4 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint4(0); @@ -282,7 +356,9 @@ library TFHE { return euint8.wrap(Impl.mul(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint4 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint4(0); @@ -293,7 +369,9 @@ library TFHE { return euint8.wrap(Impl.and(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint4 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint4(0); @@ -304,7 +382,9 @@ library TFHE { return euint8.wrap(Impl.or(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint4 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint4(0); @@ -315,7 +395,9 @@ library TFHE { return euint8.wrap(Impl.xor(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint4 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -326,7 +408,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint4 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -337,7 +421,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint4 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -348,7 +434,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint4 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -359,7 +447,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint4 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -370,7 +460,9 @@ library TFHE { return ebool.wrap(Impl.le(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint4 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -381,7 +473,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint4 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint4(0); @@ -392,7 +486,9 @@ library TFHE { return euint8.wrap(Impl.min(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint4 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint4(0); @@ -403,7 +499,9 @@ library TFHE { return euint8.wrap(Impl.max(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint4 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint4(0); @@ -414,7 +512,9 @@ library TFHE { return euint16.wrap(Impl.add(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint4 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint4(0); @@ -425,7 +525,9 @@ library TFHE { return euint16.wrap(Impl.sub(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint4 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint4(0); @@ -436,7 +538,9 @@ library TFHE { return euint16.wrap(Impl.mul(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint4 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint4(0); @@ -447,7 +551,9 @@ library TFHE { return euint16.wrap(Impl.and(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint4 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint4(0); @@ -458,7 +564,9 @@ library TFHE { return euint16.wrap(Impl.or(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint4 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint4(0); @@ -469,7 +577,9 @@ library TFHE { return euint16.wrap(Impl.xor(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint4 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -480,7 +590,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint4 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -491,7 +603,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint4 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -502,7 +616,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint4 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -513,7 +629,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint4 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -524,7 +642,9 @@ library TFHE { return ebool.wrap(Impl.le(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint4 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -535,7 +655,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint4 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint4(0); @@ -546,7 +668,9 @@ library TFHE { return euint16.wrap(Impl.min(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint4 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint4(0); @@ -557,7 +681,9 @@ library TFHE { return euint16.wrap(Impl.max(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint4 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint4(0); @@ -568,7 +694,9 @@ library TFHE { return euint32.wrap(Impl.add(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint4 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint4(0); @@ -579,7 +707,9 @@ library TFHE { return euint32.wrap(Impl.sub(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint4 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint4(0); @@ -590,7 +720,9 @@ library TFHE { return euint32.wrap(Impl.mul(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint4 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint4(0); @@ -601,7 +733,9 @@ library TFHE { return euint32.wrap(Impl.and(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint4 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint4(0); @@ -612,7 +746,9 @@ library TFHE { return euint32.wrap(Impl.or(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint4 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint4(0); @@ -623,7 +759,9 @@ library TFHE { return euint32.wrap(Impl.xor(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint4 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -634,7 +772,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint4 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -645,7 +785,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint4 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -656,7 +798,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint4 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -667,7 +811,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint4 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -678,7 +824,9 @@ library TFHE { return ebool.wrap(Impl.le(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint4 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -689,7 +837,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint4 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint4(0); @@ -700,7 +850,9 @@ library TFHE { return euint32.wrap(Impl.min(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint4 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint4(0); @@ -711,7 +863,9 @@ library TFHE { return euint32.wrap(Impl.max(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint4 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint4(0); @@ -722,7 +876,9 @@ library TFHE { return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint4 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint4(0); @@ -733,7 +889,9 @@ library TFHE { return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint4 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint4(0); @@ -744,7 +902,9 @@ library TFHE { return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint4 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint4(0); @@ -755,7 +915,9 @@ library TFHE { return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint4 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint4(0); @@ -766,7 +928,9 @@ library TFHE { return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint4 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint4(0); @@ -777,7 +941,9 @@ library TFHE { return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint4 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -788,7 +954,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint4 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -799,7 +967,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint4 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -810,7 +980,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint4 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -821,7 +993,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint4 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -832,7 +1006,9 @@ library TFHE { return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint4 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -843,7 +1019,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint4 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint4(0); @@ -854,7 +1032,9 @@ library TFHE { return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint4 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint4(0); @@ -865,7 +1045,9 @@ library TFHE { return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint4 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint4(0); @@ -876,7 +1058,9 @@ library TFHE { return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint4 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint4(0); @@ -887,7 +1071,9 @@ library TFHE { return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint4 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint4(0); @@ -898,7 +1084,9 @@ library TFHE { return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint4 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint4(0); @@ -909,7 +1097,9 @@ library TFHE { return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint4 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint4(0); @@ -920,7 +1110,9 @@ library TFHE { return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint4 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint4(0); @@ -931,7 +1123,9 @@ library TFHE { return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint4 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -942,7 +1136,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint4 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -953,7 +1149,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint4 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -964,7 +1162,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint4 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -975,7 +1175,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint4 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -986,7 +1188,9 @@ library TFHE { return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint4 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -997,7 +1201,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint4 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1008,7 +1214,9 @@ library TFHE { return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint4 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1019,7 +1227,9 @@ library TFHE { return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint4 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1030,7 +1240,9 @@ library TFHE { return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint4 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1041,7 +1253,9 @@ library TFHE { return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint4 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1052,7 +1266,9 @@ library TFHE { return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint4 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1063,7 +1279,9 @@ library TFHE { return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint4 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1074,7 +1292,9 @@ library TFHE { return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint4 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1085,7 +1305,9 @@ library TFHE { return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint4 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1096,7 +1318,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint4 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1107,7 +1331,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint4 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1118,7 +1344,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint4 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1129,7 +1357,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint4 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1140,7 +1370,9 @@ library TFHE { return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint4 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1151,7 +1383,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint4 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1162,7 +1396,9 @@ library TFHE { return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint4 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1173,7 +1409,9 @@ library TFHE { return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1181,7 +1419,9 @@ library TFHE { return euint4.wrap(Impl.add(euint4.unwrap(a), uint256(b), true)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { b = asEuint4(0); @@ -1189,7 +1429,9 @@ library TFHE { return euint4.wrap(Impl.add(euint4.unwrap(b), uint256(a), true)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1197,7 +1439,9 @@ library TFHE { return euint4.wrap(Impl.sub(euint4.unwrap(a), uint256(b), true)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(uint8 a, euint4 b) internal returns (euint4) { euint4 aEnc = asEuint4(a); if (!isInitialized(b)) { @@ -1206,7 +1450,9 @@ library TFHE { return euint4.wrap(Impl.sub(euint4.unwrap(aEnc), euint4.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1214,7 +1460,9 @@ library TFHE { return euint4.wrap(Impl.mul(euint4.unwrap(a), uint256(b), true)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { b = asEuint4(0); @@ -1222,7 +1470,9 @@ library TFHE { return euint4.wrap(Impl.mul(euint4.unwrap(b), uint256(a), true)); } - // Evaluate div(a, b) and return the result. + /** + * @dev Evaluates div(a, b) and returns the result. + */ function div(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1230,7 +1480,9 @@ library TFHE { return euint4.wrap(Impl.div(euint4.unwrap(a), uint256(b))); } - // Evaluate rem(a, b) and return the result. + /** + * @dev Evaluates rem(a, b) and returns the result. + */ function rem(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1238,7 +1490,9 @@ library TFHE { return euint4.wrap(Impl.rem(euint4.unwrap(a), uint256(b))); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1246,7 +1500,9 @@ library TFHE { return euint4.wrap(Impl.and(euint4.unwrap(a), uint256(b), true)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { b = asEuint4(0); @@ -1254,7 +1510,9 @@ library TFHE { return euint4.wrap(Impl.and(euint4.unwrap(b), uint256(a), true)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1262,7 +1520,9 @@ library TFHE { return euint4.wrap(Impl.or(euint4.unwrap(a), uint256(b), true)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { b = asEuint4(0); @@ -1270,7 +1530,9 @@ library TFHE { return euint4.wrap(Impl.or(euint4.unwrap(b), uint256(a), true)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1278,7 +1540,9 @@ library TFHE { return euint4.wrap(Impl.xor(euint4.unwrap(a), uint256(b), true)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { b = asEuint4(0); @@ -1286,7 +1550,9 @@ library TFHE { return euint4.wrap(Impl.xor(euint4.unwrap(b), uint256(a), true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint4 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1294,7 +1560,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint4.unwrap(a), uint256(b), true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint4(0); @@ -1302,7 +1570,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint4.unwrap(b), uint256(a), true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint4 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1310,7 +1580,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint4.unwrap(a), uint256(b), true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint4(0); @@ -1318,7 +1590,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint4.unwrap(b), uint256(a), true)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint4 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1326,7 +1600,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint4.unwrap(a), uint256(b), true)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint4(0); @@ -1334,7 +1610,9 @@ library TFHE { return ebool.wrap(Impl.le(euint4.unwrap(b), uint256(a), true)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint4 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1342,7 +1620,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint4.unwrap(a), uint256(b), true)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint4(0); @@ -1350,7 +1630,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint4.unwrap(b), uint256(a), true)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint4 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1358,7 +1640,9 @@ library TFHE { return ebool.wrap(Impl.le(euint4.unwrap(a), uint256(b), true)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint4(0); @@ -1366,7 +1650,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint4.unwrap(b), uint256(a), true)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint4 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1374,7 +1660,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint4.unwrap(a), uint256(b), true)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint4(0); @@ -1382,7 +1670,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint4.unwrap(b), uint256(a), true)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1390,7 +1680,9 @@ library TFHE { return euint4.wrap(Impl.min(euint4.unwrap(a), uint256(b), true)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { b = asEuint4(0); @@ -1398,7 +1690,9 @@ library TFHE { return euint4.wrap(Impl.min(euint4.unwrap(b), uint256(a), true)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -1406,7 +1700,9 @@ library TFHE { return euint4.wrap(Impl.max(euint4.unwrap(a), uint256(b), true)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { b = asEuint4(0); @@ -1414,7 +1710,9 @@ library TFHE { return euint4.wrap(Impl.max(euint4.unwrap(b), uint256(a), true)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint8 a, euint4 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1425,7 +1723,9 @@ library TFHE { return euint8.wrap(Impl.add(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint8 a, euint4 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1436,7 +1736,9 @@ library TFHE { return euint8.wrap(Impl.sub(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint8 a, euint4 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1447,7 +1749,9 @@ library TFHE { return euint8.wrap(Impl.mul(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint8 a, euint4 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1458,7 +1762,9 @@ library TFHE { return euint8.wrap(Impl.and(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint8 a, euint4 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1469,7 +1775,9 @@ library TFHE { return euint8.wrap(Impl.or(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint8 a, euint4 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1480,7 +1788,9 @@ library TFHE { return euint8.wrap(Impl.xor(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1491,7 +1801,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1502,7 +1814,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1513,7 +1827,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1524,7 +1840,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1535,7 +1853,9 @@ library TFHE { return ebool.wrap(Impl.le(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1546,7 +1866,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint8 a, euint4 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1557,7 +1879,9 @@ library TFHE { return euint8.wrap(Impl.min(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint8 a, euint4 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1568,7 +1892,9 @@ library TFHE { return euint8.wrap(Impl.max(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1579,7 +1905,9 @@ library TFHE { return euint8.wrap(Impl.add(euint8.unwrap(a), euint8.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1590,7 +1918,9 @@ library TFHE { return euint8.wrap(Impl.sub(euint8.unwrap(a), euint8.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1601,7 +1931,9 @@ library TFHE { return euint8.wrap(Impl.mul(euint8.unwrap(a), euint8.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1612,7 +1944,9 @@ library TFHE { return euint8.wrap(Impl.and(euint8.unwrap(a), euint8.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1623,7 +1957,9 @@ library TFHE { return euint8.wrap(Impl.or(euint8.unwrap(a), euint8.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1634,7 +1970,9 @@ library TFHE { return euint8.wrap(Impl.xor(euint8.unwrap(a), euint8.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1645,7 +1983,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint8.unwrap(a), euint8.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1656,7 +1996,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint8.unwrap(a), euint8.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1667,7 +2009,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint8.unwrap(a), euint8.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1678,7 +2022,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint8.unwrap(a), euint8.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1689,7 +2035,9 @@ library TFHE { return ebool.wrap(Impl.le(euint8.unwrap(a), euint8.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1700,7 +2048,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint8.unwrap(a), euint8.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1711,7 +2061,9 @@ library TFHE { return euint8.wrap(Impl.min(euint8.unwrap(a), euint8.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1722,7 +2074,9 @@ library TFHE { return euint8.wrap(Impl.max(euint8.unwrap(a), euint8.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1733,7 +2087,9 @@ library TFHE { return euint16.wrap(Impl.add(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1744,7 +2100,9 @@ library TFHE { return euint16.wrap(Impl.sub(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1755,7 +2113,9 @@ library TFHE { return euint16.wrap(Impl.mul(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1766,7 +2126,9 @@ library TFHE { return euint16.wrap(Impl.and(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1777,7 +2139,9 @@ library TFHE { return euint16.wrap(Impl.or(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1788,7 +2152,9 @@ library TFHE { return euint16.wrap(Impl.xor(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint8 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1799,7 +2165,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint8 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1810,7 +2178,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint8 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1821,7 +2191,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint8 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1832,7 +2204,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint8 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1843,7 +2217,9 @@ library TFHE { return ebool.wrap(Impl.le(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint8 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1854,7 +2230,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1865,7 +2243,9 @@ library TFHE { return euint16.wrap(Impl.min(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1876,7 +2256,9 @@ library TFHE { return euint16.wrap(Impl.max(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1887,7 +2269,9 @@ library TFHE { return euint32.wrap(Impl.add(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1898,7 +2282,9 @@ library TFHE { return euint32.wrap(Impl.sub(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1909,7 +2295,9 @@ library TFHE { return euint32.wrap(Impl.mul(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1920,7 +2308,9 @@ library TFHE { return euint32.wrap(Impl.and(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1931,7 +2321,9 @@ library TFHE { return euint32.wrap(Impl.or(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1942,7 +2334,9 @@ library TFHE { return euint32.wrap(Impl.xor(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint8 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1953,7 +2347,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint8 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1964,7 +2360,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint8 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1975,7 +2373,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint8 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1986,7 +2386,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint8 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -1997,7 +2399,9 @@ library TFHE { return ebool.wrap(Impl.le(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint8 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2008,7 +2412,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2019,7 +2425,9 @@ library TFHE { return euint32.wrap(Impl.min(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2030,7 +2438,9 @@ library TFHE { return euint32.wrap(Impl.max(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint8 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2041,7 +2451,9 @@ library TFHE { return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint8 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2052,7 +2464,9 @@ library TFHE { return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint8 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2063,7 +2477,9 @@ library TFHE { return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint8 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2074,7 +2490,9 @@ library TFHE { return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint8 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2085,7 +2503,9 @@ library TFHE { return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint8 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2096,7 +2516,9 @@ library TFHE { return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint8 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2107,7 +2529,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint8 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2118,7 +2542,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint8 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2129,7 +2555,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint8 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2140,7 +2568,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint8 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2151,7 +2581,9 @@ library TFHE { return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint8 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2162,7 +2594,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint8 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2173,7 +2607,9 @@ library TFHE { return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint8 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2184,7 +2620,9 @@ library TFHE { return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint8 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2195,7 +2633,9 @@ library TFHE { return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint8 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2206,7 +2646,9 @@ library TFHE { return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint8 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2217,7 +2659,9 @@ library TFHE { return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint8 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2228,7 +2672,9 @@ library TFHE { return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint8 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2239,7 +2685,9 @@ library TFHE { return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint8 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2250,7 +2698,9 @@ library TFHE { return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint8 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2261,7 +2711,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint8 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2272,7 +2724,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint8 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2283,7 +2737,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint8 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2294,7 +2750,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint8 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2305,7 +2763,9 @@ library TFHE { return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint8 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2316,7 +2776,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint8 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2327,7 +2789,9 @@ library TFHE { return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint8 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2338,7 +2802,9 @@ library TFHE { return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint8 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2349,7 +2815,9 @@ library TFHE { return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint8 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2360,7 +2828,9 @@ library TFHE { return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint8 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2371,7 +2841,9 @@ library TFHE { return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint8 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2382,7 +2854,9 @@ library TFHE { return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint8 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2393,7 +2867,9 @@ library TFHE { return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint8 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2404,7 +2880,9 @@ library TFHE { return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint8 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2415,7 +2893,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint8 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2426,7 +2906,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint8 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2437,7 +2919,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint8 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2448,7 +2932,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint8 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2459,7 +2945,9 @@ library TFHE { return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint8 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2470,7 +2958,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint8 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2481,7 +2971,9 @@ library TFHE { return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint8 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2492,7 +2984,9 @@ library TFHE { return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2500,7 +2994,9 @@ library TFHE { return euint8.wrap(Impl.add(euint8.unwrap(a), uint256(b), true)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { b = asEuint8(0); @@ -2508,7 +3004,9 @@ library TFHE { return euint8.wrap(Impl.add(euint8.unwrap(b), uint256(a), true)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2516,7 +3014,9 @@ library TFHE { return euint8.wrap(Impl.sub(euint8.unwrap(a), uint256(b), true)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(uint8 a, euint8 b) internal returns (euint8) { euint8 aEnc = asEuint8(a); if (!isInitialized(b)) { @@ -2525,7 +3025,9 @@ library TFHE { return euint8.wrap(Impl.sub(euint8.unwrap(aEnc), euint8.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2533,7 +3035,9 @@ library TFHE { return euint8.wrap(Impl.mul(euint8.unwrap(a), uint256(b), true)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { b = asEuint8(0); @@ -2541,7 +3045,9 @@ library TFHE { return euint8.wrap(Impl.mul(euint8.unwrap(b), uint256(a), true)); } - // Evaluate div(a, b) and return the result. + /** + * @dev Evaluates div(a, b) and returns the result. + */ function div(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2549,7 +3055,9 @@ library TFHE { return euint8.wrap(Impl.div(euint8.unwrap(a), uint256(b))); } - // Evaluate rem(a, b) and return the result. + /** + * @dev Evaluates rem(a, b) and returns the result. + */ function rem(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2557,7 +3065,9 @@ library TFHE { return euint8.wrap(Impl.rem(euint8.unwrap(a), uint256(b))); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2565,7 +3075,9 @@ library TFHE { return euint8.wrap(Impl.and(euint8.unwrap(a), uint256(b), true)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { b = asEuint8(0); @@ -2573,7 +3085,9 @@ library TFHE { return euint8.wrap(Impl.and(euint8.unwrap(b), uint256(a), true)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2581,7 +3095,9 @@ library TFHE { return euint8.wrap(Impl.or(euint8.unwrap(a), uint256(b), true)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { b = asEuint8(0); @@ -2589,7 +3105,9 @@ library TFHE { return euint8.wrap(Impl.or(euint8.unwrap(b), uint256(a), true)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2597,7 +3115,9 @@ library TFHE { return euint8.wrap(Impl.xor(euint8.unwrap(a), uint256(b), true)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { b = asEuint8(0); @@ -2605,7 +3125,9 @@ library TFHE { return euint8.wrap(Impl.xor(euint8.unwrap(b), uint256(a), true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint8 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2613,7 +3135,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint8.unwrap(a), uint256(b), true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint8(0); @@ -2621,7 +3145,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint8.unwrap(b), uint256(a), true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint8 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2629,7 +3155,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint8.unwrap(a), uint256(b), true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint8(0); @@ -2637,7 +3165,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint8.unwrap(b), uint256(a), true)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint8 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2645,7 +3175,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint8.unwrap(a), uint256(b), true)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint8(0); @@ -2653,7 +3185,9 @@ library TFHE { return ebool.wrap(Impl.le(euint8.unwrap(b), uint256(a), true)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint8 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2661,7 +3195,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint8.unwrap(a), uint256(b), true)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint8(0); @@ -2669,7 +3205,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint8.unwrap(b), uint256(a), true)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint8 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2677,7 +3215,9 @@ library TFHE { return ebool.wrap(Impl.le(euint8.unwrap(a), uint256(b), true)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint8(0); @@ -2685,7 +3225,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint8.unwrap(b), uint256(a), true)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint8 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2693,7 +3235,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint8.unwrap(a), uint256(b), true)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint8(0); @@ -2701,7 +3245,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint8.unwrap(b), uint256(a), true)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2709,7 +3255,9 @@ library TFHE { return euint8.wrap(Impl.min(euint8.unwrap(a), uint256(b), true)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { b = asEuint8(0); @@ -2717,7 +3265,9 @@ library TFHE { return euint8.wrap(Impl.min(euint8.unwrap(b), uint256(a), true)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -2725,7 +3275,9 @@ library TFHE { return euint8.wrap(Impl.max(euint8.unwrap(a), uint256(b), true)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { b = asEuint8(0); @@ -2733,7 +3285,9 @@ library TFHE { return euint8.wrap(Impl.max(euint8.unwrap(b), uint256(a), true)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint16 a, euint4 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2744,7 +3298,9 @@ library TFHE { return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint16 a, euint4 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2755,7 +3311,9 @@ library TFHE { return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint16 a, euint4 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2766,7 +3324,9 @@ library TFHE { return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint16 a, euint4 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2777,7 +3337,9 @@ library TFHE { return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint16 a, euint4 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2788,7 +3350,9 @@ library TFHE { return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint16 a, euint4 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2799,7 +3363,9 @@ library TFHE { return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint16 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2810,7 +3376,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint16 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2821,7 +3389,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint16 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2832,7 +3402,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint16 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2843,7 +3415,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint16 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2854,7 +3428,9 @@ library TFHE { return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint16 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2865,7 +3441,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint16 a, euint4 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2876,7 +3454,9 @@ library TFHE { return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint16 a, euint4 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2887,7 +3467,9 @@ library TFHE { return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2898,7 +3480,9 @@ library TFHE { return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2909,7 +3493,9 @@ library TFHE { return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2920,7 +3506,9 @@ library TFHE { return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2931,7 +3519,9 @@ library TFHE { return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2942,7 +3532,9 @@ library TFHE { return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2953,7 +3545,9 @@ library TFHE { return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint16 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2964,7 +3558,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint16 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2975,7 +3571,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint16 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2986,7 +3584,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint16 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -2997,7 +3597,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint16 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3008,7 +3610,9 @@ library TFHE { return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint16 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3019,7 +3623,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3030,7 +3636,9 @@ library TFHE { return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3041,7 +3649,9 @@ library TFHE { return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3052,7 +3662,9 @@ library TFHE { return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3063,7 +3675,9 @@ library TFHE { return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3074,7 +3688,9 @@ library TFHE { return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3085,7 +3701,9 @@ library TFHE { return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3096,7 +3714,9 @@ library TFHE { return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3107,7 +3727,9 @@ library TFHE { return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3118,7 +3740,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3129,7 +3753,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3140,7 +3766,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3151,7 +3779,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3162,7 +3792,9 @@ library TFHE { return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3173,7 +3805,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3184,7 +3818,9 @@ library TFHE { return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3195,7 +3831,9 @@ library TFHE { return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint16 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3206,7 +3844,9 @@ library TFHE { return euint32.wrap(Impl.add(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint16 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3217,7 +3857,9 @@ library TFHE { return euint32.wrap(Impl.sub(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint16 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3228,7 +3870,9 @@ library TFHE { return euint32.wrap(Impl.mul(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint16 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3239,7 +3883,9 @@ library TFHE { return euint32.wrap(Impl.and(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint16 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3250,7 +3896,9 @@ library TFHE { return euint32.wrap(Impl.or(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint16 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3261,7 +3909,9 @@ library TFHE { return euint32.wrap(Impl.xor(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint16 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3272,7 +3922,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint16 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3283,7 +3935,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint16 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3294,7 +3948,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint16 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3305,7 +3961,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint16 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3316,7 +3974,9 @@ library TFHE { return ebool.wrap(Impl.le(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint16 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3327,7 +3987,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint16 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3338,7 +4000,9 @@ library TFHE { return euint32.wrap(Impl.min(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint16 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3349,7 +4013,9 @@ library TFHE { return euint32.wrap(Impl.max(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint16 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3360,7 +4026,9 @@ library TFHE { return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint16 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3371,7 +4039,9 @@ library TFHE { return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint16 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3382,7 +4052,9 @@ library TFHE { return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint16 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3393,7 +4065,9 @@ library TFHE { return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint16 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3404,7 +4078,9 @@ library TFHE { return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint16 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3415,7 +4091,9 @@ library TFHE { return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint16 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3426,7 +4104,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint16 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3437,7 +4117,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint16 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3448,7 +4130,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint16 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3459,7 +4143,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint16 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3470,7 +4156,9 @@ library TFHE { return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint16 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3481,7 +4169,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint16 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3492,7 +4182,9 @@ library TFHE { return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint16 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3503,7 +4195,9 @@ library TFHE { return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint16 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3514,7 +4208,9 @@ library TFHE { return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint16 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3525,7 +4221,9 @@ library TFHE { return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint16 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3536,7 +4234,9 @@ library TFHE { return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint16 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3547,7 +4247,9 @@ library TFHE { return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint16 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3558,7 +4260,9 @@ library TFHE { return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint16 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3569,7 +4273,9 @@ library TFHE { return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint16 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3580,7 +4286,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint16 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3591,7 +4299,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint16 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3602,7 +4312,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint16 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3613,7 +4325,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint16 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3624,7 +4338,9 @@ library TFHE { return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint16 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3635,7 +4351,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint16 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3646,7 +4364,9 @@ library TFHE { return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint16 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3657,7 +4377,9 @@ library TFHE { return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint16 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3668,7 +4390,9 @@ library TFHE { return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint16 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3679,7 +4403,9 @@ library TFHE { return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint16 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3690,7 +4416,9 @@ library TFHE { return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint16 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3701,7 +4429,9 @@ library TFHE { return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint16 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3712,7 +4442,9 @@ library TFHE { return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint16 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3723,7 +4455,9 @@ library TFHE { return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint16 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3734,7 +4468,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint16 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3745,7 +4481,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint16 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3756,7 +4494,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint16 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3767,7 +4507,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint16 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3778,7 +4520,9 @@ library TFHE { return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint16 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3789,7 +4533,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint16 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3800,7 +4546,9 @@ library TFHE { return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint16 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3811,7 +4559,9 @@ library TFHE { return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint16 a, uint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3819,7 +4569,9 @@ library TFHE { return euint16.wrap(Impl.add(euint16.unwrap(a), uint256(b), true)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { b = asEuint16(0); @@ -3827,7 +4579,9 @@ library TFHE { return euint16.wrap(Impl.add(euint16.unwrap(b), uint256(a), true)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint16 a, uint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3835,7 +4589,9 @@ library TFHE { return euint16.wrap(Impl.sub(euint16.unwrap(a), uint256(b), true)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(uint16 a, euint16 b) internal returns (euint16) { euint16 aEnc = asEuint16(a); if (!isInitialized(b)) { @@ -3844,7 +4600,9 @@ library TFHE { return euint16.wrap(Impl.sub(euint16.unwrap(aEnc), euint16.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint16 a, uint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3852,7 +4610,9 @@ library TFHE { return euint16.wrap(Impl.mul(euint16.unwrap(a), uint256(b), true)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { b = asEuint16(0); @@ -3860,7 +4620,9 @@ library TFHE { return euint16.wrap(Impl.mul(euint16.unwrap(b), uint256(a), true)); } - // Evaluate div(a, b) and return the result. + /** + * @dev Evaluates div(a, b) and returns the result. + */ function div(euint16 a, uint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3868,7 +4630,9 @@ library TFHE { return euint16.wrap(Impl.div(euint16.unwrap(a), uint256(b))); } - // Evaluate rem(a, b) and return the result. + /** + * @dev Evaluates rem(a, b) and returns the result. + */ function rem(euint16 a, uint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3876,7 +4640,9 @@ library TFHE { return euint16.wrap(Impl.rem(euint16.unwrap(a), uint256(b))); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint16 a, uint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3884,7 +4650,9 @@ library TFHE { return euint16.wrap(Impl.and(euint16.unwrap(a), uint256(b), true)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { b = asEuint16(0); @@ -3892,7 +4660,9 @@ library TFHE { return euint16.wrap(Impl.and(euint16.unwrap(b), uint256(a), true)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint16 a, uint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3900,7 +4670,9 @@ library TFHE { return euint16.wrap(Impl.or(euint16.unwrap(a), uint256(b), true)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { b = asEuint16(0); @@ -3908,7 +4680,9 @@ library TFHE { return euint16.wrap(Impl.or(euint16.unwrap(b), uint256(a), true)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint16 a, uint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3916,7 +4690,9 @@ library TFHE { return euint16.wrap(Impl.xor(euint16.unwrap(a), uint256(b), true)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { b = asEuint16(0); @@ -3924,7 +4700,9 @@ library TFHE { return euint16.wrap(Impl.xor(euint16.unwrap(b), uint256(a), true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint16 a, uint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3932,7 +4710,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint16.unwrap(a), uint256(b), true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint16(0); @@ -3940,7 +4720,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint16.unwrap(b), uint256(a), true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint16 a, uint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3948,7 +4730,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint16.unwrap(a), uint256(b), true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint16(0); @@ -3956,7 +4740,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint16.unwrap(b), uint256(a), true)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint16 a, uint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3964,7 +4750,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint16.unwrap(a), uint256(b), true)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint16(0); @@ -3972,7 +4760,9 @@ library TFHE { return ebool.wrap(Impl.le(euint16.unwrap(b), uint256(a), true)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint16 a, uint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3980,7 +4770,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint16.unwrap(a), uint256(b), true)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint16(0); @@ -3988,7 +4780,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint16.unwrap(b), uint256(a), true)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint16 a, uint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -3996,7 +4790,9 @@ library TFHE { return ebool.wrap(Impl.le(euint16.unwrap(a), uint256(b), true)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint16(0); @@ -4004,7 +4800,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint16.unwrap(b), uint256(a), true)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint16 a, uint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint16(0); @@ -4012,7 +4810,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint16.unwrap(a), uint256(b), true)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint16(0); @@ -4020,7 +4820,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint16.unwrap(b), uint256(a), true)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint16 a, uint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -4028,7 +4830,9 @@ library TFHE { return euint16.wrap(Impl.min(euint16.unwrap(a), uint256(b), true)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { b = asEuint16(0); @@ -4036,7 +4840,9 @@ library TFHE { return euint16.wrap(Impl.min(euint16.unwrap(b), uint256(a), true)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint16 a, uint16 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -4044,7 +4850,9 @@ library TFHE { return euint16.wrap(Impl.max(euint16.unwrap(a), uint256(b), true)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { b = asEuint16(0); @@ -4052,7 +4860,9 @@ library TFHE { return euint16.wrap(Impl.max(euint16.unwrap(b), uint256(a), true)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint32 a, euint4 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4063,7 +4873,9 @@ library TFHE { return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint32 a, euint4 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4074,7 +4886,9 @@ library TFHE { return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint32 a, euint4 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4085,7 +4899,9 @@ library TFHE { return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint32 a, euint4 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4096,7 +4912,9 @@ library TFHE { return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint32 a, euint4 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4107,7 +4925,9 @@ library TFHE { return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint32 a, euint4 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4118,7 +4938,9 @@ library TFHE { return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint32 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4129,7 +4951,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint32 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4140,7 +4964,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint32 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4151,7 +4977,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint32 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4162,7 +4990,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint32 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4173,7 +5003,9 @@ library TFHE { return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint32 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4184,7 +5016,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint32 a, euint4 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4195,7 +5029,9 @@ library TFHE { return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint32 a, euint4 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4206,7 +5042,9 @@ library TFHE { return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4217,7 +5055,9 @@ library TFHE { return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4228,7 +5068,9 @@ library TFHE { return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4239,7 +5081,9 @@ library TFHE { return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4250,7 +5094,9 @@ library TFHE { return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4261,7 +5107,9 @@ library TFHE { return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4272,7 +5120,9 @@ library TFHE { return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint32 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4283,7 +5133,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint32 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4294,7 +5146,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint32 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4305,7 +5159,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint32 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4316,7 +5172,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint32 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4327,7 +5185,9 @@ library TFHE { return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint32 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4338,7 +5198,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4349,7 +5211,9 @@ library TFHE { return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4360,7 +5224,9 @@ library TFHE { return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint32 a, euint16 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4371,7 +5237,9 @@ library TFHE { return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint32 a, euint16 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4382,7 +5250,9 @@ library TFHE { return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint32 a, euint16 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4393,7 +5263,9 @@ library TFHE { return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint32 a, euint16 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4404,7 +5276,9 @@ library TFHE { return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint32 a, euint16 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4415,7 +5289,9 @@ library TFHE { return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint32 a, euint16 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4426,7 +5302,9 @@ library TFHE { return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint32 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4437,7 +5315,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint32 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4448,7 +5328,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint32 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4459,7 +5341,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint32 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4470,7 +5354,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint32 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4481,7 +5367,9 @@ library TFHE { return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint32 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4492,7 +5380,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint32 a, euint16 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4503,7 +5393,9 @@ library TFHE { return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint32 a, euint16 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4514,7 +5406,9 @@ library TFHE { return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4525,7 +5419,9 @@ library TFHE { return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4536,7 +5432,9 @@ library TFHE { return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4547,7 +5445,9 @@ library TFHE { return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4558,7 +5458,9 @@ library TFHE { return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4569,7 +5471,9 @@ library TFHE { return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4580,7 +5484,9 @@ library TFHE { return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4591,7 +5497,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4602,7 +5510,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4613,7 +5523,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4624,7 +5536,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4635,7 +5549,9 @@ library TFHE { return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4646,7 +5562,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4657,7 +5575,9 @@ library TFHE { return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4668,7 +5588,9 @@ library TFHE { return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint32 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4679,7 +5601,9 @@ library TFHE { return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint32 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4690,7 +5614,9 @@ library TFHE { return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint32 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4701,7 +5627,9 @@ library TFHE { return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint32 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4712,7 +5640,9 @@ library TFHE { return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint32 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4723,7 +5653,9 @@ library TFHE { return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint32 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4734,7 +5666,9 @@ library TFHE { return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint32 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4745,7 +5679,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint32 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4756,7 +5692,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint32 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4767,7 +5705,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint32 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4778,7 +5718,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint32 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4789,7 +5731,9 @@ library TFHE { return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint32 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4800,7 +5744,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint32 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4811,7 +5757,9 @@ library TFHE { return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint32 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4822,7 +5770,9 @@ library TFHE { return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint32 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4833,7 +5783,9 @@ library TFHE { return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint32 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4844,7 +5796,9 @@ library TFHE { return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint32 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4855,7 +5809,9 @@ library TFHE { return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint32 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4866,7 +5822,9 @@ library TFHE { return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint32 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4877,7 +5835,9 @@ library TFHE { return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint32 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4888,7 +5848,9 @@ library TFHE { return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint32 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4899,7 +5861,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint32 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4910,7 +5874,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint32 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4921,7 +5887,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint32 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4932,7 +5900,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint32 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4943,7 +5913,9 @@ library TFHE { return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint32 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4954,7 +5926,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint32 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4965,7 +5939,9 @@ library TFHE { return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint32 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4976,7 +5952,9 @@ library TFHE { return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint32 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4987,7 +5965,9 @@ library TFHE { return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint32 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint32(0); @@ -4998,7 +5978,9 @@ library TFHE { return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint32 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5009,7 +5991,9 @@ library TFHE { return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint32 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5020,7 +6004,9 @@ library TFHE { return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint32 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5031,7 +6017,9 @@ library TFHE { return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint32 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5042,7 +6030,9 @@ library TFHE { return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint32 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5053,7 +6043,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint32 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5064,7 +6056,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint32 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5075,7 +6069,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint32 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5086,7 +6082,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint32 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5097,7 +6095,9 @@ library TFHE { return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint32 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5108,7 +6108,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint32 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5119,7 +6121,9 @@ library TFHE { return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint32 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5130,7 +6134,9 @@ library TFHE { return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint32 a, uint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5138,7 +6144,9 @@ library TFHE { return euint32.wrap(Impl.add(euint32.unwrap(a), uint256(b), true)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(uint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(b)) { b = asEuint32(0); @@ -5146,7 +6154,9 @@ library TFHE { return euint32.wrap(Impl.add(euint32.unwrap(b), uint256(a), true)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint32 a, uint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5154,7 +6164,9 @@ library TFHE { return euint32.wrap(Impl.sub(euint32.unwrap(a), uint256(b), true)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(uint32 a, euint32 b) internal returns (euint32) { euint32 aEnc = asEuint32(a); if (!isInitialized(b)) { @@ -5163,7 +6175,9 @@ library TFHE { return euint32.wrap(Impl.sub(euint32.unwrap(aEnc), euint32.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint32 a, uint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5171,7 +6185,9 @@ library TFHE { return euint32.wrap(Impl.mul(euint32.unwrap(a), uint256(b), true)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(uint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(b)) { b = asEuint32(0); @@ -5179,7 +6195,9 @@ library TFHE { return euint32.wrap(Impl.mul(euint32.unwrap(b), uint256(a), true)); } - // Evaluate div(a, b) and return the result. + /** + * @dev Evaluates div(a, b) and returns the result. + */ function div(euint32 a, uint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5187,7 +6205,9 @@ library TFHE { return euint32.wrap(Impl.div(euint32.unwrap(a), uint256(b))); } - // Evaluate rem(a, b) and return the result. + /** + * @dev Evaluates rem(a, b) and returns the result. + */ function rem(euint32 a, uint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5195,7 +6215,9 @@ library TFHE { return euint32.wrap(Impl.rem(euint32.unwrap(a), uint256(b))); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint32 a, uint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5203,7 +6225,9 @@ library TFHE { return euint32.wrap(Impl.and(euint32.unwrap(a), uint256(b), true)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(uint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(b)) { b = asEuint32(0); @@ -5211,7 +6235,9 @@ library TFHE { return euint32.wrap(Impl.and(euint32.unwrap(b), uint256(a), true)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint32 a, uint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5219,7 +6245,9 @@ library TFHE { return euint32.wrap(Impl.or(euint32.unwrap(a), uint256(b), true)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(uint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(b)) { b = asEuint32(0); @@ -5227,7 +6255,9 @@ library TFHE { return euint32.wrap(Impl.or(euint32.unwrap(b), uint256(a), true)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint32 a, uint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5235,7 +6265,9 @@ library TFHE { return euint32.wrap(Impl.xor(euint32.unwrap(a), uint256(b), true)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(uint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(b)) { b = asEuint32(0); @@ -5243,7 +6275,9 @@ library TFHE { return euint32.wrap(Impl.xor(euint32.unwrap(b), uint256(a), true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint32 a, uint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5251,7 +6285,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint32.unwrap(a), uint256(b), true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(uint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint32(0); @@ -5259,7 +6295,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint32.unwrap(b), uint256(a), true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint32 a, uint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5267,7 +6305,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint32.unwrap(a), uint256(b), true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(uint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint32(0); @@ -5275,7 +6315,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint32.unwrap(b), uint256(a), true)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint32 a, uint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5283,7 +6325,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint32.unwrap(a), uint256(b), true)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(uint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint32(0); @@ -5291,7 +6335,9 @@ library TFHE { return ebool.wrap(Impl.le(euint32.unwrap(b), uint256(a), true)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint32 a, uint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5299,7 +6345,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint32.unwrap(a), uint256(b), true)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(uint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint32(0); @@ -5307,7 +6355,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint32.unwrap(b), uint256(a), true)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint32 a, uint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5315,7 +6365,9 @@ library TFHE { return ebool.wrap(Impl.le(euint32.unwrap(a), uint256(b), true)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(uint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint32(0); @@ -5323,7 +6375,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint32.unwrap(b), uint256(a), true)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint32 a, uint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5331,7 +6385,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint32.unwrap(a), uint256(b), true)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(uint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint32(0); @@ -5339,7 +6395,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint32.unwrap(b), uint256(a), true)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint32 a, uint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5347,7 +6405,9 @@ library TFHE { return euint32.wrap(Impl.min(euint32.unwrap(a), uint256(b), true)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(uint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(b)) { b = asEuint32(0); @@ -5355,7 +6415,9 @@ library TFHE { return euint32.wrap(Impl.min(euint32.unwrap(b), uint256(a), true)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint32 a, uint32 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -5363,7 +6425,9 @@ library TFHE { return euint32.wrap(Impl.max(euint32.unwrap(a), uint256(b), true)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(uint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(b)) { b = asEuint32(0); @@ -5371,7 +6435,9 @@ library TFHE { return euint32.wrap(Impl.max(euint32.unwrap(b), uint256(a), true)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint64 a, euint4 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5382,7 +6448,9 @@ library TFHE { return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint64 a, euint4 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5393,7 +6461,9 @@ library TFHE { return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint64 a, euint4 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5404,7 +6474,9 @@ library TFHE { return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint64 a, euint4 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5415,7 +6487,9 @@ library TFHE { return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint64 a, euint4 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5426,7 +6500,9 @@ library TFHE { return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint64 a, euint4 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5437,7 +6513,9 @@ library TFHE { return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint64 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5448,7 +6526,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint64 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5459,7 +6539,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint64 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5470,7 +6552,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint64 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5481,7 +6565,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint64 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5492,7 +6578,9 @@ library TFHE { return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint64 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5503,7 +6591,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint64 a, euint4 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5514,7 +6604,9 @@ library TFHE { return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint64 a, euint4 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5525,7 +6617,9 @@ library TFHE { return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5536,7 +6630,9 @@ library TFHE { return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5547,7 +6643,9 @@ library TFHE { return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5558,7 +6656,9 @@ library TFHE { return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5569,7 +6669,9 @@ library TFHE { return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5580,7 +6682,9 @@ library TFHE { return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5591,7 +6695,9 @@ library TFHE { return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint64 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5602,7 +6708,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint64 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5613,7 +6721,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint64 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5624,7 +6734,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint64 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5635,7 +6747,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint64 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5646,7 +6760,9 @@ library TFHE { return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint64 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5657,7 +6773,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5668,7 +6786,9 @@ library TFHE { return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5679,7 +6799,9 @@ library TFHE { return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint64 a, euint16 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5690,7 +6812,9 @@ library TFHE { return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint64 a, euint16 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5701,7 +6825,9 @@ library TFHE { return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint64 a, euint16 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5712,7 +6838,9 @@ library TFHE { return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint64 a, euint16 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5723,7 +6851,9 @@ library TFHE { return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint64 a, euint16 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5734,7 +6864,9 @@ library TFHE { return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint64 a, euint16 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5745,7 +6877,9 @@ library TFHE { return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint64 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5756,7 +6890,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint64 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5767,7 +6903,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint64 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5778,7 +6916,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint64 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5789,7 +6929,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint64 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5800,7 +6942,9 @@ library TFHE { return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint64 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5811,7 +6955,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint64 a, euint16 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5822,7 +6968,9 @@ library TFHE { return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint64 a, euint16 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5833,7 +6981,9 @@ library TFHE { return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint64 a, euint32 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5844,7 +6994,9 @@ library TFHE { return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint64 a, euint32 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5855,7 +7007,9 @@ library TFHE { return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint64 a, euint32 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5866,7 +7020,9 @@ library TFHE { return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint64 a, euint32 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5877,7 +7033,9 @@ library TFHE { return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint64 a, euint32 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5888,7 +7046,9 @@ library TFHE { return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint64 a, euint32 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5899,7 +7059,9 @@ library TFHE { return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint64 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5910,7 +7072,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint64 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5921,7 +7085,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint64 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5932,7 +7098,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint64 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5943,7 +7111,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint64 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5954,7 +7124,9 @@ library TFHE { return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint64 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5965,7 +7137,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint64 a, euint32 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5976,7 +7150,9 @@ library TFHE { return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint64 a, euint32 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5987,7 +7163,9 @@ library TFHE { return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -5998,7 +7176,9 @@ library TFHE { return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6009,7 +7189,9 @@ library TFHE { return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6020,7 +7202,9 @@ library TFHE { return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6031,7 +7215,9 @@ library TFHE { return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6042,7 +7228,9 @@ library TFHE { return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6053,7 +7241,9 @@ library TFHE { return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6064,7 +7254,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6075,7 +7267,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6086,7 +7280,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6097,7 +7293,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6108,7 +7306,9 @@ library TFHE { return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6119,7 +7319,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6130,7 +7332,9 @@ library TFHE { return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6141,7 +7345,9 @@ library TFHE { return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint64 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6152,7 +7358,9 @@ library TFHE { return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint64 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6163,7 +7371,9 @@ library TFHE { return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint64 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6174,7 +7384,9 @@ library TFHE { return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint64 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6185,7 +7397,9 @@ library TFHE { return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint64 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6196,7 +7410,9 @@ library TFHE { return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint64 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6207,7 +7423,9 @@ library TFHE { return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint64 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6218,7 +7436,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint64 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6229,7 +7449,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint64 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6240,7 +7462,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint64 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6251,7 +7475,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint64 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6262,7 +7488,9 @@ library TFHE { return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint64 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6273,7 +7501,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint64 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6284,7 +7514,9 @@ library TFHE { return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint64 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6295,7 +7527,9 @@ library TFHE { return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint64 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6306,7 +7540,9 @@ library TFHE { return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint64 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6317,7 +7553,9 @@ library TFHE { return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint64 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6328,7 +7566,9 @@ library TFHE { return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint64 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6339,7 +7579,9 @@ library TFHE { return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint64 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6350,7 +7592,9 @@ library TFHE { return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint64 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6361,7 +7605,9 @@ library TFHE { return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint64 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6372,7 +7618,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint64 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6383,7 +7631,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint64 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6394,7 +7644,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint64 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6405,7 +7657,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint64 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6416,7 +7670,9 @@ library TFHE { return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint64 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6427,7 +7683,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint64 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6438,7 +7696,9 @@ library TFHE { return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint64 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6449,7 +7709,9 @@ library TFHE { return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6457,7 +7719,9 @@ library TFHE { return euint64.wrap(Impl.add(euint64.unwrap(a), uint256(b), true)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(uint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(b)) { b = asEuint64(0); @@ -6465,7 +7729,9 @@ library TFHE { return euint64.wrap(Impl.add(euint64.unwrap(b), uint256(a), true)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6473,7 +7739,9 @@ library TFHE { return euint64.wrap(Impl.sub(euint64.unwrap(a), uint256(b), true)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(uint64 a, euint64 b) internal returns (euint64) { euint64 aEnc = asEuint64(a); if (!isInitialized(b)) { @@ -6482,7 +7750,9 @@ library TFHE { return euint64.wrap(Impl.sub(euint64.unwrap(aEnc), euint64.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6490,7 +7760,9 @@ library TFHE { return euint64.wrap(Impl.mul(euint64.unwrap(a), uint256(b), true)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(uint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(b)) { b = asEuint64(0); @@ -6498,7 +7770,9 @@ library TFHE { return euint64.wrap(Impl.mul(euint64.unwrap(b), uint256(a), true)); } - // Evaluate div(a, b) and return the result. + /** + * @dev Evaluates div(a, b) and returns the result. + */ function div(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6506,7 +7780,9 @@ library TFHE { return euint64.wrap(Impl.div(euint64.unwrap(a), uint256(b))); } - // Evaluate rem(a, b) and return the result. + /** + * @dev Evaluates rem(a, b) and returns the result. + */ function rem(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6514,7 +7790,9 @@ library TFHE { return euint64.wrap(Impl.rem(euint64.unwrap(a), uint256(b))); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6522,7 +7800,9 @@ library TFHE { return euint64.wrap(Impl.and(euint64.unwrap(a), uint256(b), true)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(uint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(b)) { b = asEuint64(0); @@ -6530,7 +7810,9 @@ library TFHE { return euint64.wrap(Impl.and(euint64.unwrap(b), uint256(a), true)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6538,7 +7820,9 @@ library TFHE { return euint64.wrap(Impl.or(euint64.unwrap(a), uint256(b), true)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(uint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(b)) { b = asEuint64(0); @@ -6546,7 +7830,9 @@ library TFHE { return euint64.wrap(Impl.or(euint64.unwrap(b), uint256(a), true)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6554,7 +7840,9 @@ library TFHE { return euint64.wrap(Impl.xor(euint64.unwrap(a), uint256(b), true)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(uint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(b)) { b = asEuint64(0); @@ -6562,7 +7850,9 @@ library TFHE { return euint64.wrap(Impl.xor(euint64.unwrap(b), uint256(a), true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint64 a, uint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6570,7 +7860,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint64.unwrap(a), uint256(b), true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(uint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint64(0); @@ -6578,7 +7870,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint64.unwrap(b), uint256(a), true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint64 a, uint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6586,7 +7880,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint64.unwrap(a), uint256(b), true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(uint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint64(0); @@ -6594,7 +7890,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint64.unwrap(b), uint256(a), true)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint64 a, uint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6602,7 +7900,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint64.unwrap(a), uint256(b), true)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(uint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint64(0); @@ -6610,7 +7910,9 @@ library TFHE { return ebool.wrap(Impl.le(euint64.unwrap(b), uint256(a), true)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint64 a, uint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6618,7 +7920,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint64.unwrap(a), uint256(b), true)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(uint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint64(0); @@ -6626,7 +7930,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint64.unwrap(b), uint256(a), true)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint64 a, uint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6634,7 +7940,9 @@ library TFHE { return ebool.wrap(Impl.le(euint64.unwrap(a), uint256(b), true)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(uint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint64(0); @@ -6642,7 +7950,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint64.unwrap(b), uint256(a), true)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint64 a, uint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6650,7 +7960,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint64.unwrap(a), uint256(b), true)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(uint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint64(0); @@ -6658,7 +7970,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint64.unwrap(b), uint256(a), true)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6666,7 +7980,9 @@ library TFHE { return euint64.wrap(Impl.min(euint64.unwrap(a), uint256(b), true)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(uint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(b)) { b = asEuint64(0); @@ -6674,7 +7990,9 @@ library TFHE { return euint64.wrap(Impl.min(euint64.unwrap(b), uint256(a), true)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -6682,7 +8000,9 @@ library TFHE { return euint64.wrap(Impl.max(euint64.unwrap(a), uint256(b), true)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(uint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(b)) { b = asEuint64(0); @@ -6690,7 +8010,9 @@ library TFHE { return euint64.wrap(Impl.max(euint64.unwrap(b), uint256(a), true)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint128 a, euint4 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6701,7 +8023,9 @@ library TFHE { return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint128 a, euint4 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6712,7 +8036,9 @@ library TFHE { return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint128 a, euint4 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6723,7 +8049,9 @@ library TFHE { return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint128 a, euint4 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6734,7 +8062,9 @@ library TFHE { return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint128 a, euint4 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6745,7 +8075,9 @@ library TFHE { return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint128 a, euint4 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6756,7 +8088,9 @@ library TFHE { return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint128 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6767,7 +8101,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint128 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6778,7 +8114,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint128 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6789,7 +8127,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint128 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6800,7 +8140,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint128 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6811,7 +8153,9 @@ library TFHE { return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint128 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6822,7 +8166,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint128 a, euint4 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6833,7 +8179,9 @@ library TFHE { return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint128 a, euint4 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6844,7 +8192,9 @@ library TFHE { return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6855,7 +8205,9 @@ library TFHE { return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6866,7 +8218,9 @@ library TFHE { return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6877,7 +8231,9 @@ library TFHE { return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6888,7 +8244,9 @@ library TFHE { return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6899,7 +8257,9 @@ library TFHE { return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6910,7 +8270,9 @@ library TFHE { return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint128 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6921,7 +8283,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint128 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6932,7 +8296,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint128 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6943,7 +8309,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint128 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6954,7 +8322,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint128 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6965,7 +8335,9 @@ library TFHE { return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint128 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6976,7 +8348,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6987,7 +8361,9 @@ library TFHE { return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -6998,7 +8374,9 @@ library TFHE { return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7009,7 +8387,9 @@ library TFHE { return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7020,7 +8400,9 @@ library TFHE { return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7031,7 +8413,9 @@ library TFHE { return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7042,7 +8426,9 @@ library TFHE { return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7053,7 +8439,9 @@ library TFHE { return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7064,7 +8452,9 @@ library TFHE { return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint128 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7075,7 +8465,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint128 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7086,7 +8478,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint128 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7097,7 +8491,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint128 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7108,7 +8504,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint128 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7119,7 +8517,9 @@ library TFHE { return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint128 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7130,7 +8530,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7141,7 +8543,9 @@ library TFHE { return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7152,7 +8556,9 @@ library TFHE { return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7163,7 +8569,9 @@ library TFHE { return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7174,7 +8582,9 @@ library TFHE { return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7185,7 +8595,9 @@ library TFHE { return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7196,7 +8608,9 @@ library TFHE { return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7207,7 +8621,9 @@ library TFHE { return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7218,7 +8634,9 @@ library TFHE { return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint128 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7229,7 +8647,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint128 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7240,7 +8660,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint128 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7251,7 +8673,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint128 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7262,7 +8686,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint128 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7273,7 +8699,9 @@ library TFHE { return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint128 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7284,7 +8712,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7295,7 +8725,9 @@ library TFHE { return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7306,7 +8738,9 @@ library TFHE { return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint128 a, euint64 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7317,7 +8751,9 @@ library TFHE { return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint128 a, euint64 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7328,7 +8764,9 @@ library TFHE { return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint128 a, euint64 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7339,7 +8777,9 @@ library TFHE { return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint128 a, euint64 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7350,7 +8790,9 @@ library TFHE { return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint128 a, euint64 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7361,7 +8803,9 @@ library TFHE { return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint128 a, euint64 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7372,7 +8816,9 @@ library TFHE { return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint128 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7383,7 +8829,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint128 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7394,7 +8842,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint128 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7405,7 +8855,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint128 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7416,7 +8868,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint128 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7427,7 +8881,9 @@ library TFHE { return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint128 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7438,7 +8894,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint128 a, euint64 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7449,7 +8907,9 @@ library TFHE { return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint128 a, euint64 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7460,7 +8920,9 @@ library TFHE { return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7471,7 +8933,9 @@ library TFHE { return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7482,7 +8946,9 @@ library TFHE { return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7493,7 +8959,9 @@ library TFHE { return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7504,7 +8972,9 @@ library TFHE { return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7515,7 +8985,9 @@ library TFHE { return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7526,7 +8998,9 @@ library TFHE { return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7537,7 +9011,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7548,7 +9024,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7559,7 +9037,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7570,7 +9050,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7581,7 +9063,9 @@ library TFHE { return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7592,7 +9076,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7603,7 +9089,9 @@ library TFHE { return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7614,7 +9102,9 @@ library TFHE { return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint128 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7625,7 +9115,9 @@ library TFHE { return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint128 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7636,7 +9128,9 @@ library TFHE { return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint128 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7647,7 +9141,9 @@ library TFHE { return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint128 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7658,7 +9154,9 @@ library TFHE { return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint128 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7669,7 +9167,9 @@ library TFHE { return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint128 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7680,7 +9180,9 @@ library TFHE { return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint128 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7691,7 +9193,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint128 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7702,7 +9206,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint128 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7713,7 +9219,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint128 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7724,7 +9232,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint128 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7735,7 +9245,9 @@ library TFHE { return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint128 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7746,7 +9258,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint128 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7757,7 +9271,9 @@ library TFHE { return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint128 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7768,7 +9284,9 @@ library TFHE { return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7776,7 +9294,9 @@ library TFHE { return euint128.wrap(Impl.add(euint128.unwrap(a), uint256(b), true)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(uint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(b)) { b = asEuint128(0); @@ -7784,7 +9304,9 @@ library TFHE { return euint128.wrap(Impl.add(euint128.unwrap(b), uint256(a), true)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7792,7 +9314,9 @@ library TFHE { return euint128.wrap(Impl.sub(euint128.unwrap(a), uint256(b), true)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(uint128 a, euint128 b) internal returns (euint128) { euint128 aEnc = asEuint128(a); if (!isInitialized(b)) { @@ -7801,7 +9325,9 @@ library TFHE { return euint128.wrap(Impl.sub(euint128.unwrap(aEnc), euint128.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7809,7 +9335,9 @@ library TFHE { return euint128.wrap(Impl.mul(euint128.unwrap(a), uint256(b), true)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(uint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(b)) { b = asEuint128(0); @@ -7817,7 +9345,9 @@ library TFHE { return euint128.wrap(Impl.mul(euint128.unwrap(b), uint256(a), true)); } - // Evaluate div(a, b) and return the result. + /** + * @dev Evaluates div(a, b) and returns the result. + */ function div(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7825,7 +9355,9 @@ library TFHE { return euint128.wrap(Impl.div(euint128.unwrap(a), uint256(b))); } - // Evaluate rem(a, b) and return the result. + /** + * @dev Evaluates rem(a, b) and returns the result. + */ function rem(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7833,7 +9365,9 @@ library TFHE { return euint128.wrap(Impl.rem(euint128.unwrap(a), uint256(b))); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7841,7 +9375,9 @@ library TFHE { return euint128.wrap(Impl.and(euint128.unwrap(a), uint256(b), true)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(uint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(b)) { b = asEuint128(0); @@ -7849,7 +9385,9 @@ library TFHE { return euint128.wrap(Impl.and(euint128.unwrap(b), uint256(a), true)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7857,7 +9395,9 @@ library TFHE { return euint128.wrap(Impl.or(euint128.unwrap(a), uint256(b), true)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(uint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(b)) { b = asEuint128(0); @@ -7865,7 +9405,9 @@ library TFHE { return euint128.wrap(Impl.or(euint128.unwrap(b), uint256(a), true)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7873,7 +9415,9 @@ library TFHE { return euint128.wrap(Impl.xor(euint128.unwrap(a), uint256(b), true)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(uint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(b)) { b = asEuint128(0); @@ -7881,7 +9425,9 @@ library TFHE { return euint128.wrap(Impl.xor(euint128.unwrap(b), uint256(a), true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint128 a, uint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7889,7 +9435,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint128.unwrap(a), uint256(b), true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(uint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint128(0); @@ -7897,7 +9445,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint128.unwrap(b), uint256(a), true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint128 a, uint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7905,7 +9455,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint128.unwrap(a), uint256(b), true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(uint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint128(0); @@ -7913,7 +9465,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint128.unwrap(b), uint256(a), true)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint128 a, uint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7921,7 +9475,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint128.unwrap(a), uint256(b), true)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(uint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint128(0); @@ -7929,7 +9485,9 @@ library TFHE { return ebool.wrap(Impl.le(euint128.unwrap(b), uint256(a), true)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint128 a, uint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7937,7 +9495,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint128.unwrap(a), uint256(b), true)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(uint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint128(0); @@ -7945,7 +9505,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint128.unwrap(b), uint256(a), true)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint128 a, uint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7953,7 +9515,9 @@ library TFHE { return ebool.wrap(Impl.le(euint128.unwrap(a), uint256(b), true)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(uint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint128(0); @@ -7961,7 +9525,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint128.unwrap(b), uint256(a), true)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint128 a, uint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7969,7 +9535,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint128.unwrap(a), uint256(b), true)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(uint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint128(0); @@ -7977,7 +9545,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint128.unwrap(b), uint256(a), true)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -7985,7 +9555,9 @@ library TFHE { return euint128.wrap(Impl.min(euint128.unwrap(a), uint256(b), true)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(uint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(b)) { b = asEuint128(0); @@ -7993,7 +9565,9 @@ library TFHE { return euint128.wrap(Impl.min(euint128.unwrap(b), uint256(a), true)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -8001,7 +9575,9 @@ library TFHE { return euint128.wrap(Impl.max(euint128.unwrap(a), uint256(b), true)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(uint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(b)) { b = asEuint128(0); @@ -8009,7 +9585,9 @@ library TFHE { return euint128.wrap(Impl.max(euint128.unwrap(b), uint256(a), true)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint256 a, euint4 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8020,7 +9598,9 @@ library TFHE { return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint256 a, euint4 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8031,7 +9611,9 @@ library TFHE { return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint256 a, euint4 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8042,7 +9624,9 @@ library TFHE { return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint256 a, euint4 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8053,7 +9637,9 @@ library TFHE { return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint256 a, euint4 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8064,7 +9650,9 @@ library TFHE { return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint256 a, euint4 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8075,7 +9663,9 @@ library TFHE { return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint256 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8086,7 +9676,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint256 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8097,7 +9689,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint256 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8108,7 +9702,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint256 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8119,7 +9715,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint256 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8130,7 +9728,9 @@ library TFHE { return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint256 a, euint4 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8141,7 +9741,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint256 a, euint4 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8152,7 +9754,9 @@ library TFHE { return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint256 a, euint4 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8163,7 +9767,9 @@ library TFHE { return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8174,7 +9780,9 @@ library TFHE { return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8185,7 +9793,9 @@ library TFHE { return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8196,7 +9806,9 @@ library TFHE { return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8207,7 +9819,9 @@ library TFHE { return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8218,7 +9832,9 @@ library TFHE { return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8229,7 +9845,9 @@ library TFHE { return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint256 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8240,7 +9858,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint256 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8251,7 +9871,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint256 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8262,7 +9884,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint256 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8273,7 +9897,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint256 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8284,7 +9910,9 @@ library TFHE { return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint256 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8295,7 +9923,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8306,7 +9936,9 @@ library TFHE { return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8317,7 +9949,9 @@ library TFHE { return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint256 a, euint16 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8328,7 +9962,9 @@ library TFHE { return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint256 a, euint16 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8339,7 +9975,9 @@ library TFHE { return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint256 a, euint16 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8350,7 +9988,9 @@ library TFHE { return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint256 a, euint16 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8361,7 +10001,9 @@ library TFHE { return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint256 a, euint16 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8372,7 +10014,9 @@ library TFHE { return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint256 a, euint16 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8383,7 +10027,9 @@ library TFHE { return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint256 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8394,7 +10040,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint256 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8405,7 +10053,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint256 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8416,7 +10066,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint256 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8427,7 +10079,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint256 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8438,7 +10092,9 @@ library TFHE { return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint256 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8449,7 +10105,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint256 a, euint16 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8460,7 +10118,9 @@ library TFHE { return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint256 a, euint16 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8471,7 +10131,9 @@ library TFHE { return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint256 a, euint32 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8482,7 +10144,9 @@ library TFHE { return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint256 a, euint32 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8493,7 +10157,9 @@ library TFHE { return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint256 a, euint32 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8504,7 +10170,9 @@ library TFHE { return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint256 a, euint32 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8515,7 +10183,9 @@ library TFHE { return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint256 a, euint32 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8526,7 +10196,9 @@ library TFHE { return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint256 a, euint32 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8537,7 +10209,9 @@ library TFHE { return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint256 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8548,7 +10222,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint256 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8559,7 +10235,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint256 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8570,7 +10248,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint256 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8581,7 +10261,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint256 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8592,7 +10274,9 @@ library TFHE { return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint256 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8603,7 +10287,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint256 a, euint32 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8614,7 +10300,9 @@ library TFHE { return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint256 a, euint32 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8625,7 +10313,9 @@ library TFHE { return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint256 a, euint64 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8636,7 +10326,9 @@ library TFHE { return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint256 a, euint64 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8647,7 +10339,9 @@ library TFHE { return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint256 a, euint64 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8658,7 +10352,9 @@ library TFHE { return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint256 a, euint64 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8669,7 +10365,9 @@ library TFHE { return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint256 a, euint64 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8680,7 +10378,9 @@ library TFHE { return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint256 a, euint64 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8691,7 +10391,9 @@ library TFHE { return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint256 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8702,7 +10404,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint256 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8713,7 +10417,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint256 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8724,7 +10430,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint256 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8735,7 +10443,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint256 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8746,7 +10456,9 @@ library TFHE { return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint256 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8757,7 +10469,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint256 a, euint64 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8768,7 +10482,9 @@ library TFHE { return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint256 a, euint64 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8779,7 +10495,9 @@ library TFHE { return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint256 a, euint128 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8790,7 +10508,9 @@ library TFHE { return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint256 a, euint128 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8801,7 +10521,9 @@ library TFHE { return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint256 a, euint128 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8812,7 +10534,9 @@ library TFHE { return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint256 a, euint128 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8823,7 +10547,9 @@ library TFHE { return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint256 a, euint128 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8834,7 +10560,9 @@ library TFHE { return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint256 a, euint128 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8845,7 +10573,9 @@ library TFHE { return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint256 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8856,7 +10586,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint256 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8867,7 +10599,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint256 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8878,7 +10612,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint256 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8889,7 +10625,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint256 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8900,7 +10638,9 @@ library TFHE { return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint256 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8911,7 +10651,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint256 a, euint128 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8922,7 +10664,9 @@ library TFHE { return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint256 a, euint128 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8933,7 +10677,9 @@ library TFHE { return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8944,7 +10690,9 @@ library TFHE { return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(b), false)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8955,7 +10703,9 @@ library TFHE { return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8966,7 +10716,9 @@ library TFHE { return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8977,7 +10729,9 @@ library TFHE { return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8988,7 +10742,9 @@ library TFHE { return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -8999,7 +10755,9 @@ library TFHE { return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9010,7 +10768,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9021,7 +10781,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(b), false)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9032,7 +10794,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(b), false)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9043,7 +10807,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(b), false)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9054,7 +10820,9 @@ library TFHE { return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(b), false)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9065,7 +10833,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(b), false)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9076,7 +10846,9 @@ library TFHE { return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(b), false)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9087,7 +10859,9 @@ library TFHE { return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(b), false)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(euint256 a, uint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9095,7 +10869,9 @@ library TFHE { return euint256.wrap(Impl.add(euint256.unwrap(a), uint256(b), true)); } - // Evaluate add(a, b) and return the result. + /** + * @dev Evaluates add(a, b) and returns the result. + */ function add(uint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(b)) { b = asEuint256(0); @@ -9103,7 +10879,9 @@ library TFHE { return euint256.wrap(Impl.add(euint256.unwrap(b), uint256(a), true)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(euint256 a, uint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9111,7 +10889,9 @@ library TFHE { return euint256.wrap(Impl.sub(euint256.unwrap(a), uint256(b), true)); } - // Evaluate sub(a, b) and return the result. + /** + * @dev Evaluates sub(a, b) and returns the result. + */ function sub(uint256 a, euint256 b) internal returns (euint256) { euint256 aEnc = asEuint256(a); if (!isInitialized(b)) { @@ -9120,7 +10900,9 @@ library TFHE { return euint256.wrap(Impl.sub(euint256.unwrap(aEnc), euint256.unwrap(b), false)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(euint256 a, uint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9128,7 +10910,9 @@ library TFHE { return euint256.wrap(Impl.mul(euint256.unwrap(a), uint256(b), true)); } - // Evaluate mul(a, b) and return the result. + /** + * @dev Evaluates mul(a, b) and returns the result. + */ function mul(uint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(b)) { b = asEuint256(0); @@ -9136,7 +10920,9 @@ library TFHE { return euint256.wrap(Impl.mul(euint256.unwrap(b), uint256(a), true)); } - // Evaluate div(a, b) and return the result. + /** + * @dev Evaluates div(a, b) and returns the result. + */ function div(euint256 a, uint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9144,7 +10930,9 @@ library TFHE { return euint256.wrap(Impl.div(euint256.unwrap(a), uint256(b))); } - // Evaluate rem(a, b) and return the result. + /** + * @dev Evaluates rem(a, b) and returns the result. + */ function rem(euint256 a, uint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9152,7 +10940,9 @@ library TFHE { return euint256.wrap(Impl.rem(euint256.unwrap(a), uint256(b))); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(euint256 a, uint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9160,7 +10950,9 @@ library TFHE { return euint256.wrap(Impl.and(euint256.unwrap(a), uint256(b), true)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(uint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(b)) { b = asEuint256(0); @@ -9168,7 +10960,9 @@ library TFHE { return euint256.wrap(Impl.and(euint256.unwrap(b), uint256(a), true)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(euint256 a, uint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9176,7 +10970,9 @@ library TFHE { return euint256.wrap(Impl.or(euint256.unwrap(a), uint256(b), true)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(uint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(b)) { b = asEuint256(0); @@ -9184,7 +10980,9 @@ library TFHE { return euint256.wrap(Impl.or(euint256.unwrap(b), uint256(a), true)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(euint256 a, uint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9192,7 +10990,9 @@ library TFHE { return euint256.wrap(Impl.xor(euint256.unwrap(a), uint256(b), true)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(uint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(b)) { b = asEuint256(0); @@ -9200,7 +11000,9 @@ library TFHE { return euint256.wrap(Impl.xor(euint256.unwrap(b), uint256(a), true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(euint256 a, uint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9208,7 +11010,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint256.unwrap(a), uint256(b), true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(uint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint256(0); @@ -9216,7 +11020,9 @@ library TFHE { return ebool.wrap(Impl.eq(euint256.unwrap(b), uint256(a), true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(euint256 a, uint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9224,7 +11030,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint256.unwrap(a), uint256(b), true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(uint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint256(0); @@ -9232,7 +11040,9 @@ library TFHE { return ebool.wrap(Impl.ne(euint256.unwrap(b), uint256(a), true)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(euint256 a, uint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9240,7 +11050,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint256.unwrap(a), uint256(b), true)); } - // Evaluate ge(a, b) and return the result. + /** + * @dev Evaluates ge(a, b) and returns the result. + */ function ge(uint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint256(0); @@ -9248,7 +11060,9 @@ library TFHE { return ebool.wrap(Impl.le(euint256.unwrap(b), uint256(a), true)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(euint256 a, uint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9256,7 +11070,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint256.unwrap(a), uint256(b), true)); } - // Evaluate gt(a, b) and return the result. + /** + * @dev Evaluates gt(a, b) and returns the result. + */ function gt(uint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint256(0); @@ -9264,7 +11080,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint256.unwrap(b), uint256(a), true)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(euint256 a, uint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9272,7 +11090,9 @@ library TFHE { return ebool.wrap(Impl.le(euint256.unwrap(a), uint256(b), true)); } - // Evaluate le(a, b) and return the result. + /** + * @dev Evaluates le(a, b) and returns the result. + */ function le(uint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint256(0); @@ -9280,7 +11100,9 @@ library TFHE { return ebool.wrap(Impl.ge(euint256.unwrap(b), uint256(a), true)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(euint256 a, uint256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9288,7 +11110,9 @@ library TFHE { return ebool.wrap(Impl.lt(euint256.unwrap(a), uint256(b), true)); } - // Evaluate lt(a, b) and return the result. + /** + * @dev Evaluates lt(a, b) and returns the result. + */ function lt(uint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint256(0); @@ -9296,7 +11120,9 @@ library TFHE { return ebool.wrap(Impl.gt(euint256.unwrap(b), uint256(a), true)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(euint256 a, uint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9304,7 +11130,9 @@ library TFHE { return euint256.wrap(Impl.min(euint256.unwrap(a), uint256(b), true)); } - // Evaluate min(a, b) and return the result. + /** + * @dev Evaluates min(a, b) and returns the result. + */ function min(uint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(b)) { b = asEuint256(0); @@ -9312,7 +11140,9 @@ library TFHE { return euint256.wrap(Impl.min(euint256.unwrap(b), uint256(a), true)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(euint256 a, uint256 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9320,7 +11150,9 @@ library TFHE { return euint256.wrap(Impl.max(euint256.unwrap(a), uint256(b), true)); } - // Evaluate max(a, b) and return the result. + /** + * @dev Evaluates max(a, b) and returns the result. + */ function max(uint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(b)) { b = asEuint256(0); @@ -9328,7 +11160,9 @@ library TFHE { return euint256.wrap(Impl.max(euint256.unwrap(b), uint256(a), true)); } - // Evaluate shl(a, b) and return the result. + /** + * @dev Evaluates shl(a, b) and returns the result. + */ function shl(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -9336,7 +11170,9 @@ library TFHE { return euint4.wrap(Impl.shl(euint4.unwrap(a), uint256(b), true)); } - // Evaluate shr(a, b) and return the result. + /** + * @dev Evaluates shr(a, b) and returns the result. + */ function shr(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -9344,7 +11180,9 @@ library TFHE { return euint4.wrap(Impl.shr(euint4.unwrap(a), uint256(b), true)); } - // Evaluate rotl(a, b) and return the result. + /** + * @dev Evaluates rotl(a, b) and returns the result. + */ function rotl(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -9352,7 +11190,9 @@ library TFHE { return euint4.wrap(Impl.rotl(euint4.unwrap(a), uint256(b), true)); } - // Evaluate rotr(a, b) and return the result. + /** + * @dev Evaluates rotr(a, b) and returns the result. + */ function rotr(euint4 a, uint8 b) internal returns (euint4) { if (!isInitialized(a)) { a = asEuint4(0); @@ -9360,7 +11200,9 @@ library TFHE { return euint4.wrap(Impl.rotr(euint4.unwrap(a), uint256(b), true)); } - // Evaluate shl(a, b) and return the result. + /** + * @dev Evaluates shl(a, b) and returns the result. + */ function shl(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -9371,7 +11213,9 @@ library TFHE { return euint8.wrap(Impl.shl(euint8.unwrap(a), euint8.unwrap(b), false)); } - // Evaluate shl(a, b) and return the result. + /** + * @dev Evaluates shl(a, b) and returns the result. + */ function shl(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -9379,7 +11223,9 @@ library TFHE { return euint8.wrap(Impl.shl(euint8.unwrap(a), uint256(b), true)); } - // Evaluate shr(a, b) and return the result. + /** + * @dev Evaluates shr(a, b) and returns the result. + */ function shr(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -9390,7 +11236,9 @@ library TFHE { return euint8.wrap(Impl.shr(euint8.unwrap(a), euint8.unwrap(b), false)); } - // Evaluate shr(a, b) and return the result. + /** + * @dev Evaluates shr(a, b) and returns the result. + */ function shr(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -9398,7 +11246,9 @@ library TFHE { return euint8.wrap(Impl.shr(euint8.unwrap(a), uint256(b), true)); } - // Evaluate rotl(a, b) and return the result. + /** + * @dev Evaluates rotl(a, b) and returns the result. + */ function rotl(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -9409,7 +11259,9 @@ library TFHE { return euint8.wrap(Impl.rotl(euint8.unwrap(a), euint8.unwrap(b), false)); } - // Evaluate rotl(a, b) and return the result. + /** + * @dev Evaluates rotl(a, b) and returns the result. + */ function rotl(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -9417,7 +11269,9 @@ library TFHE { return euint8.wrap(Impl.rotl(euint8.unwrap(a), uint256(b), true)); } - // Evaluate rotr(a, b) and return the result. + /** + * @dev Evaluates rotr(a, b) and returns the result. + */ function rotr(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -9428,7 +11282,9 @@ library TFHE { return euint8.wrap(Impl.rotr(euint8.unwrap(a), euint8.unwrap(b), false)); } - // Evaluate rotr(a, b) and return the result. + /** + * @dev Evaluates rotr(a, b) and returns the result. + */ function rotr(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { a = asEuint8(0); @@ -9436,7 +11292,9 @@ library TFHE { return euint8.wrap(Impl.rotr(euint8.unwrap(a), uint256(b), true)); } - // Evaluate shl(a, b) and return the result. + /** + * @dev Evaluates shl(a, b) and returns the result. + */ function shl(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -9447,7 +11305,9 @@ library TFHE { return euint16.wrap(Impl.shl(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate shl(a, b) and return the result. + /** + * @dev Evaluates shl(a, b) and returns the result. + */ function shl(euint16 a, uint8 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -9455,7 +11315,9 @@ library TFHE { return euint16.wrap(Impl.shl(euint16.unwrap(a), uint256(b), true)); } - // Evaluate shr(a, b) and return the result. + /** + * @dev Evaluates shr(a, b) and returns the result. + */ function shr(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -9466,7 +11328,9 @@ library TFHE { return euint16.wrap(Impl.shr(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate shr(a, b) and return the result. + /** + * @dev Evaluates shr(a, b) and returns the result. + */ function shr(euint16 a, uint8 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -9474,7 +11338,9 @@ library TFHE { return euint16.wrap(Impl.shr(euint16.unwrap(a), uint256(b), true)); } - // Evaluate rotl(a, b) and return the result. + /** + * @dev Evaluates rotl(a, b) and returns the result. + */ function rotl(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -9485,7 +11351,9 @@ library TFHE { return euint16.wrap(Impl.rotl(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate rotl(a, b) and return the result. + /** + * @dev Evaluates rotl(a, b) and returns the result. + */ function rotl(euint16 a, uint8 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -9493,7 +11361,9 @@ library TFHE { return euint16.wrap(Impl.rotl(euint16.unwrap(a), uint256(b), true)); } - // Evaluate rotr(a, b) and return the result. + /** + * @dev Evaluates rotr(a, b) and returns the result. + */ function rotr(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -9504,7 +11374,9 @@ library TFHE { return euint16.wrap(Impl.rotr(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } - // Evaluate rotr(a, b) and return the result. + /** + * @dev Evaluates rotr(a, b) and returns the result. + */ function rotr(euint16 a, uint8 b) internal returns (euint16) { if (!isInitialized(a)) { a = asEuint16(0); @@ -9512,7 +11384,9 @@ library TFHE { return euint16.wrap(Impl.rotr(euint16.unwrap(a), uint256(b), true)); } - // Evaluate shl(a, b) and return the result. + /** + * @dev Evaluates shl(a, b) and returns the result. + */ function shl(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -9523,7 +11397,9 @@ library TFHE { return euint32.wrap(Impl.shl(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate shl(a, b) and return the result. + /** + * @dev Evaluates shl(a, b) and returns the result. + */ function shl(euint32 a, uint8 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -9531,7 +11407,9 @@ library TFHE { return euint32.wrap(Impl.shl(euint32.unwrap(a), uint256(b), true)); } - // Evaluate shr(a, b) and return the result. + /** + * @dev Evaluates shr(a, b) and returns the result. + */ function shr(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -9542,7 +11420,9 @@ library TFHE { return euint32.wrap(Impl.shr(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate shr(a, b) and return the result. + /** + * @dev Evaluates shr(a, b) and returns the result. + */ function shr(euint32 a, uint8 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -9550,7 +11430,9 @@ library TFHE { return euint32.wrap(Impl.shr(euint32.unwrap(a), uint256(b), true)); } - // Evaluate rotl(a, b) and return the result. + /** + * @dev Evaluates rotl(a, b) and returns the result. + */ function rotl(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -9561,7 +11443,9 @@ library TFHE { return euint32.wrap(Impl.rotl(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate rotl(a, b) and return the result. + /** + * @dev Evaluates rotl(a, b) and returns the result. + */ function rotl(euint32 a, uint8 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -9569,7 +11453,9 @@ library TFHE { return euint32.wrap(Impl.rotl(euint32.unwrap(a), uint256(b), true)); } - // Evaluate rotr(a, b) and return the result. + /** + * @dev Evaluates rotr(a, b) and returns the result. + */ function rotr(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -9580,7 +11466,9 @@ library TFHE { return euint32.wrap(Impl.rotr(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } - // Evaluate rotr(a, b) and return the result. + /** + * @dev Evaluates rotr(a, b) and returns the result. + */ function rotr(euint32 a, uint8 b) internal returns (euint32) { if (!isInitialized(a)) { a = asEuint32(0); @@ -9588,7 +11476,9 @@ library TFHE { return euint32.wrap(Impl.rotr(euint32.unwrap(a), uint256(b), true)); } - // Evaluate shl(a, b) and return the result. + /** + * @dev Evaluates shl(a, b) and returns the result. + */ function shl(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -9599,7 +11489,9 @@ library TFHE { return euint64.wrap(Impl.shl(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate shl(a, b) and return the result. + /** + * @dev Evaluates shl(a, b) and returns the result. + */ function shl(euint64 a, uint8 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -9607,7 +11499,9 @@ library TFHE { return euint64.wrap(Impl.shl(euint64.unwrap(a), uint256(b), true)); } - // Evaluate shr(a, b) and return the result. + /** + * @dev Evaluates shr(a, b) and returns the result. + */ function shr(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -9618,7 +11512,9 @@ library TFHE { return euint64.wrap(Impl.shr(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate shr(a, b) and return the result. + /** + * @dev Evaluates shr(a, b) and returns the result. + */ function shr(euint64 a, uint8 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -9626,7 +11522,9 @@ library TFHE { return euint64.wrap(Impl.shr(euint64.unwrap(a), uint256(b), true)); } - // Evaluate rotl(a, b) and return the result. + /** + * @dev Evaluates rotl(a, b) and returns the result. + */ function rotl(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -9637,7 +11535,9 @@ library TFHE { return euint64.wrap(Impl.rotl(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate rotl(a, b) and return the result. + /** + * @dev Evaluates rotl(a, b) and returns the result. + */ function rotl(euint64 a, uint8 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -9645,7 +11545,9 @@ library TFHE { return euint64.wrap(Impl.rotl(euint64.unwrap(a), uint256(b), true)); } - // Evaluate rotr(a, b) and return the result. + /** + * @dev Evaluates rotr(a, b) and returns the result. + */ function rotr(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -9656,7 +11558,9 @@ library TFHE { return euint64.wrap(Impl.rotr(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } - // Evaluate rotr(a, b) and return the result. + /** + * @dev Evaluates rotr(a, b) and returns the result. + */ function rotr(euint64 a, uint8 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); @@ -9664,7 +11568,9 @@ library TFHE { return euint64.wrap(Impl.rotr(euint64.unwrap(a), uint256(b), true)); } - // Evaluate shl(a, b) and return the result. + /** + * @dev Evaluates shl(a, b) and returns the result. + */ function shl(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -9675,7 +11581,9 @@ library TFHE { return euint128.wrap(Impl.shl(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate shl(a, b) and return the result. + /** + * @dev Evaluates shl(a, b) and returns the result. + */ function shl(euint128 a, uint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -9683,7 +11591,9 @@ library TFHE { return euint128.wrap(Impl.shl(euint128.unwrap(a), uint256(b), true)); } - // Evaluate shr(a, b) and return the result. + /** + * @dev Evaluates shr(a, b) and returns the result. + */ function shr(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -9694,7 +11604,9 @@ library TFHE { return euint128.wrap(Impl.shr(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate shr(a, b) and return the result. + /** + * @dev Evaluates shr(a, b) and returns the result. + */ function shr(euint128 a, uint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -9702,7 +11614,9 @@ library TFHE { return euint128.wrap(Impl.shr(euint128.unwrap(a), uint256(b), true)); } - // Evaluate rotl(a, b) and return the result. + /** + * @dev Evaluates rotl(a, b) and returns the result. + */ function rotl(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -9713,7 +11627,9 @@ library TFHE { return euint128.wrap(Impl.rotl(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate rotl(a, b) and return the result. + /** + * @dev Evaluates rotl(a, b) and returns the result. + */ function rotl(euint128 a, uint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -9721,7 +11637,9 @@ library TFHE { return euint128.wrap(Impl.rotl(euint128.unwrap(a), uint256(b), true)); } - // Evaluate rotr(a, b) and return the result. + /** + * @dev Evaluates rotr(a, b) and returns the result. + */ function rotr(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -9732,7 +11650,9 @@ library TFHE { return euint128.wrap(Impl.rotr(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } - // Evaluate rotr(a, b) and return the result. + /** + * @dev Evaluates rotr(a, b) and returns the result. + */ function rotr(euint128 a, uint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); @@ -9740,7 +11660,9 @@ library TFHE { return euint128.wrap(Impl.rotr(euint128.unwrap(a), uint256(b), true)); } - // Evaluate shl(a, b) and return the result. + /** + * @dev Evaluates shl(a, b) and returns the result. + */ function shl(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9751,7 +11673,9 @@ library TFHE { return euint256.wrap(Impl.shl(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate shl(a, b) and return the result. + /** + * @dev Evaluates shl(a, b) and returns the result. + */ function shl(euint256 a, uint8 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9759,7 +11683,9 @@ library TFHE { return euint256.wrap(Impl.shl(euint256.unwrap(a), uint256(b), true)); } - // Evaluate shr(a, b) and return the result. + /** + * @dev Evaluates shr(a, b) and returns the result. + */ function shr(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9770,7 +11696,9 @@ library TFHE { return euint256.wrap(Impl.shr(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate shr(a, b) and return the result. + /** + * @dev Evaluates shr(a, b) and returns the result. + */ function shr(euint256 a, uint8 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9778,7 +11706,9 @@ library TFHE { return euint256.wrap(Impl.shr(euint256.unwrap(a), uint256(b), true)); } - // Evaluate rotl(a, b) and return the result. + /** + * @dev Evaluates rotl(a, b) and returns the result. + */ function rotl(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9789,7 +11719,9 @@ library TFHE { return euint256.wrap(Impl.rotl(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate rotl(a, b) and return the result. + /** + * @dev Evaluates rotl(a, b) and returns the result. + */ function rotl(euint256 a, uint8 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9797,7 +11729,9 @@ library TFHE { return euint256.wrap(Impl.rotl(euint256.unwrap(a), uint256(b), true)); } - // Evaluate rotr(a, b) and return the result. + /** + * @dev Evaluates rotr(a, b) and returns the result. + */ function rotr(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9808,7 +11742,9 @@ library TFHE { return euint256.wrap(Impl.rotr(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } - // Evaluate rotr(a, b) and return the result. + /** + * @dev Evaluates rotr(a, b) and returns the result. + */ function rotr(euint256 a, uint8 b) internal returns (euint256) { if (!isInitialized(a)) { a = asEuint256(0); @@ -9816,127 +11752,177 @@ library TFHE { return euint256.wrap(Impl.rotr(euint256.unwrap(a), uint256(b), true)); } - // If 'control''s value is 'true', the result has the same value as 'a'. - // If 'control''s value is 'false', the result has the same value as 'b'. + /** + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. + */ function select(ebool control, euint4 a, euint4 b) internal returns (euint4) { return euint4.wrap(Impl.select(ebool.unwrap(control), euint4.unwrap(a), euint4.unwrap(b))); } - // If 'control''s value is 'true', the result has the same value as 'a'. - // If 'control''s value is 'false', the result has the same value as 'b'. + /** + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. + */ function select(ebool control, euint8 a, euint8 b) internal returns (euint8) { return euint8.wrap(Impl.select(ebool.unwrap(control), euint8.unwrap(a), euint8.unwrap(b))); } - // If 'control''s value is 'true', the result has the same value as 'a'. - // If 'control''s value is 'false', the result has the same value as 'b'. + /** + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. + */ function select(ebool control, euint16 a, euint16 b) internal returns (euint16) { return euint16.wrap(Impl.select(ebool.unwrap(control), euint16.unwrap(a), euint16.unwrap(b))); } - // If 'control''s value is 'true', the result has the same value as 'a'. - // If 'control''s value is 'false', the result has the same value as 'b'. + /** + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. + */ function select(ebool control, euint32 a, euint32 b) internal returns (euint32) { return euint32.wrap(Impl.select(ebool.unwrap(control), euint32.unwrap(a), euint32.unwrap(b))); } - // If 'control''s value is 'true', the result has the same value as 'a'. - // If 'control''s value is 'false', the result has the same value as 'b'. + /** + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. + */ function select(ebool control, euint64 a, euint64 b) internal returns (euint64) { return euint64.wrap(Impl.select(ebool.unwrap(control), euint64.unwrap(a), euint64.unwrap(b))); } - // If 'control''s value is 'true', the result has the same value as 'a'. - // If 'control''s value is 'false', the result has the same value as 'b'. + /** + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. + */ function select(ebool control, euint128 a, euint128 b) internal returns (euint128) { return euint128.wrap(Impl.select(ebool.unwrap(control), euint128.unwrap(a), euint128.unwrap(b))); } - // If 'control''s value is 'true', the result has the same value as 'a'. - // If 'control''s value is 'false', the result has the same value as 'b'. + /** + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. + */ function select(ebool control, euint256 a, euint256 b) internal returns (euint256) { return euint256.wrap(Impl.select(ebool.unwrap(control), euint256.unwrap(a), euint256.unwrap(b))); } - // Cast an encrypted integer from euint8 to euint4. + /** + * @dev Casts an encrypted integer from euint8 to euint4. + */ function asEuint4(euint8 value) internal returns (euint4) { return euint4.wrap(Impl.cast(euint8.unwrap(value), Common.euint4_t)); } - // Cast an encrypted integer from euint16 to euint4. + /** + * @dev Casts an encrypted integer from euint16 to euint4. + */ function asEuint4(euint16 value) internal returns (euint4) { return euint4.wrap(Impl.cast(euint16.unwrap(value), Common.euint4_t)); } - // Cast an encrypted integer from euint32 to euint4. + /** + * @dev Casts an encrypted integer from euint32 to euint4. + */ function asEuint4(euint32 value) internal returns (euint4) { return euint4.wrap(Impl.cast(euint32.unwrap(value), Common.euint4_t)); } - // Cast an encrypted integer from euint64 to euint4. + /** + * @dev Casts an encrypted integer from euint64 to euint4. + */ function asEuint4(euint64 value) internal returns (euint4) { return euint4.wrap(Impl.cast(euint64.unwrap(value), Common.euint4_t)); } - // Cast an encrypted integer from euint128 to euint4. + /** + * @dev Casts an encrypted integer from euint128 to euint4. + */ function asEuint4(euint128 value) internal returns (euint4) { return euint4.wrap(Impl.cast(euint128.unwrap(value), Common.euint4_t)); } - // Cast an encrypted integer from euint256 to euint4. + /** + * @dev Casts an encrypted integer from euint256 to euint4. + */ function asEuint4(euint256 value) internal returns (euint4) { return euint4.wrap(Impl.cast(euint256.unwrap(value), Common.euint4_t)); } - // Cast an encrypted integer from euint4 to ebool. + /** + * @dev Casts an encrypted integer from euint4 to ebool. + */ function asEbool(euint4 value) internal returns (ebool) { return ne(value, 0); } - // Converts an 'ebool' to an 'euint4'. + /** + * @dev Converts an 'ebool' to an 'euint4'. + */ function asEuint4(ebool b) internal returns (euint4) { return euint4.wrap(Impl.cast(ebool.unwrap(b), Common.euint4_t)); } - // Cast an encrypted integer from euint4 to euint8. + /** + * @dev Casts an encrypted integer from euint4 to euint8. + */ function asEuint8(euint4 value) internal returns (euint8) { return euint8.wrap(Impl.cast(euint4.unwrap(value), Common.euint8_t)); } - // Cast an encrypted integer from euint16 to euint8. + /** + * @dev Casts an encrypted integer from euint16 to euint8. + */ function asEuint8(euint16 value) internal returns (euint8) { return euint8.wrap(Impl.cast(euint16.unwrap(value), Common.euint8_t)); } - // Cast an encrypted integer from euint32 to euint8. + /** + * @dev Casts an encrypted integer from euint32 to euint8. + */ function asEuint8(euint32 value) internal returns (euint8) { return euint8.wrap(Impl.cast(euint32.unwrap(value), Common.euint8_t)); } - // Cast an encrypted integer from euint64 to euint8. + /** + * @dev Casts an encrypted integer from euint64 to euint8. + */ function asEuint8(euint64 value) internal returns (euint8) { return euint8.wrap(Impl.cast(euint64.unwrap(value), Common.euint8_t)); } - // Cast an encrypted integer from euint128 to euint8. + /** + * @dev Casts an encrypted integer from euint128 to euint8. + */ function asEuint8(euint128 value) internal returns (euint8) { return euint8.wrap(Impl.cast(euint128.unwrap(value), Common.euint8_t)); } - // Cast an encrypted integer from euint256 to euint8. + /** + * @dev Casts an encrypted integer from euint256 to euint8. + */ function asEuint8(euint256 value) internal returns (euint8) { return euint8.wrap(Impl.cast(euint256.unwrap(value), Common.euint8_t)); } - // Cast an encrypted integer from euint8 to ebool. + /** + * @dev Casts an encrypted integer from euint8 to ebool. + */ function asEbool(euint8 value) internal returns (ebool) { return ne(value, 0); } - // Convert an inputHandle with corresponding inputProof to an encrypted boolean. + /** + * @dev Converts an inputHandle with corresponding inputProof to an encrypted boolean. + */ function asEbool(einput inputHandle, bytes memory inputProof) internal returns (ebool) { return ebool.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebool_t)); } - // Convert a plaintext value to an encrypted boolean. + /** + * @dev Converts a plaintext value to an encrypted boolean. + */ function asEbool(uint256 value) internal returns (ebool) { return ebool.wrap(Impl.trivialEncrypt(value, Common.ebool_t)); } - // Convert a plaintext boolean to an encrypted boolean. + /** + * @dev Converts a plaintext boolean to an encrypted boolean. + */ function asEbool(bool value) internal returns (ebool) { if (value) { return asEbool(1); @@ -9945,52 +11931,72 @@ library TFHE { } } - // Converts an 'ebool' to an 'euint8'. + /** + * @dev Converts an 'ebool' to an 'euint8'. + */ function asEuint8(ebool value) internal returns (euint8) { return euint8.wrap(Impl.cast(ebool.unwrap(value), Common.euint8_t)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(ebool a, ebool b) internal returns (ebool) { return ebool.wrap(Impl.and(ebool.unwrap(a), ebool.unwrap(b), false)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(ebool a, bool b) internal returns (ebool) { return ebool.wrap(Impl.and(ebool.unwrap(a), b ? 1 : 0, true)); } - // Evaluate and(a, b) and return the result. + /** + * @dev Evaluates and(a, b) and returns the result. + */ function and(bool a, ebool b) internal returns (ebool) { return ebool.wrap(Impl.and(ebool.unwrap(b), a ? 1 : 0, true)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(ebool a, ebool b) internal returns (ebool) { return ebool.wrap(Impl.or(ebool.unwrap(a), ebool.unwrap(b), false)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(ebool a, bool b) internal returns (ebool) { return ebool.wrap(Impl.or(ebool.unwrap(a), b ? 1 : 0, true)); } - // Evaluate or(a, b) and return the result. + /** + * @dev Evaluates or(a, b) and returns the result. + */ function or(bool a, ebool b) internal returns (ebool) { return ebool.wrap(Impl.or(ebool.unwrap(b), a ? 1 : 0, true)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(ebool a, ebool b) internal returns (ebool) { return ebool.wrap(Impl.xor(ebool.unwrap(a), ebool.unwrap(b), false)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(ebool a, bool b) internal returns (ebool) { return ebool.wrap(Impl.xor(ebool.unwrap(a), b ? 1 : 0, true)); } - // Evaluate xor(a, b) and return the result. + /** + * @dev Evaluates xor(a, b) and returns the result. + */ function xor(bool a, ebool b) internal returns (ebool) { return ebool.wrap(Impl.xor(ebool.unwrap(b), a ? 1 : 0, true)); } @@ -9999,202 +12005,282 @@ library TFHE { return ebool.wrap(Impl.not(ebool.unwrap(a))); } - // Cast an encrypted integer from euint4 to euint16. + /** + * @dev Casts an encrypted integer from euint4 to euint16. + */ function asEuint16(euint4 value) internal returns (euint16) { return euint16.wrap(Impl.cast(euint4.unwrap(value), Common.euint16_t)); } - // Cast an encrypted integer from euint8 to euint16. + /** + * @dev Casts an encrypted integer from euint8 to euint16. + */ function asEuint16(euint8 value) internal returns (euint16) { return euint16.wrap(Impl.cast(euint8.unwrap(value), Common.euint16_t)); } - // Cast an encrypted integer from euint32 to euint16. + /** + * @dev Casts an encrypted integer from euint32 to euint16. + */ function asEuint16(euint32 value) internal returns (euint16) { return euint16.wrap(Impl.cast(euint32.unwrap(value), Common.euint16_t)); } - // Cast an encrypted integer from euint64 to euint16. + /** + * @dev Casts an encrypted integer from euint64 to euint16. + */ function asEuint16(euint64 value) internal returns (euint16) { return euint16.wrap(Impl.cast(euint64.unwrap(value), Common.euint16_t)); } - // Cast an encrypted integer from euint128 to euint16. + /** + * @dev Casts an encrypted integer from euint128 to euint16. + */ function asEuint16(euint128 value) internal returns (euint16) { return euint16.wrap(Impl.cast(euint128.unwrap(value), Common.euint16_t)); } - // Cast an encrypted integer from euint256 to euint16. + /** + * @dev Casts an encrypted integer from euint256 to euint16. + */ function asEuint16(euint256 value) internal returns (euint16) { return euint16.wrap(Impl.cast(euint256.unwrap(value), Common.euint16_t)); } - // Cast an encrypted integer from euint16 to ebool. + /** + * @dev Casts an encrypted integer from euint16 to ebool. + */ function asEbool(euint16 value) internal returns (ebool) { return ne(value, 0); } - // Converts an 'ebool' to an 'euint16'. + /** + * @dev Converts an 'ebool' to an 'euint16'. + */ function asEuint16(ebool b) internal returns (euint16) { return euint16.wrap(Impl.cast(ebool.unwrap(b), Common.euint16_t)); } - // Cast an encrypted integer from euint4 to euint32. + /** + * @dev Casts an encrypted integer from euint4 to euint32. + */ function asEuint32(euint4 value) internal returns (euint32) { return euint32.wrap(Impl.cast(euint4.unwrap(value), Common.euint32_t)); } - // Cast an encrypted integer from euint8 to euint32. + /** + * @dev Casts an encrypted integer from euint8 to euint32. + */ function asEuint32(euint8 value) internal returns (euint32) { return euint32.wrap(Impl.cast(euint8.unwrap(value), Common.euint32_t)); } - // Cast an encrypted integer from euint16 to euint32. + /** + * @dev Casts an encrypted integer from euint16 to euint32. + */ function asEuint32(euint16 value) internal returns (euint32) { return euint32.wrap(Impl.cast(euint16.unwrap(value), Common.euint32_t)); } - // Cast an encrypted integer from euint64 to euint32. + /** + * @dev Casts an encrypted integer from euint64 to euint32. + */ function asEuint32(euint64 value) internal returns (euint32) { return euint32.wrap(Impl.cast(euint64.unwrap(value), Common.euint32_t)); } - // Cast an encrypted integer from euint128 to euint32. + /** + * @dev Casts an encrypted integer from euint128 to euint32. + */ function asEuint32(euint128 value) internal returns (euint32) { return euint32.wrap(Impl.cast(euint128.unwrap(value), Common.euint32_t)); } - // Cast an encrypted integer from euint256 to euint32. + /** + * @dev Casts an encrypted integer from euint256 to euint32. + */ function asEuint32(euint256 value) internal returns (euint32) { return euint32.wrap(Impl.cast(euint256.unwrap(value), Common.euint32_t)); } - // Cast an encrypted integer from euint32 to ebool. + /** + * @dev Casts an encrypted integer from euint32 to ebool. + */ function asEbool(euint32 value) internal returns (ebool) { return ne(value, 0); } - // Converts an 'ebool' to an 'euint32'. + /** + * @dev Converts an 'ebool' to an 'euint32'. + */ function asEuint32(ebool b) internal returns (euint32) { return euint32.wrap(Impl.cast(ebool.unwrap(b), Common.euint32_t)); } - // Cast an encrypted integer from euint4 to euint64. + /** + * @dev Casts an encrypted integer from euint4 to euint64. + */ function asEuint64(euint4 value) internal returns (euint64) { return euint64.wrap(Impl.cast(euint4.unwrap(value), Common.euint64_t)); } - // Cast an encrypted integer from euint8 to euint64. + /** + * @dev Casts an encrypted integer from euint8 to euint64. + */ function asEuint64(euint8 value) internal returns (euint64) { return euint64.wrap(Impl.cast(euint8.unwrap(value), Common.euint64_t)); } - // Cast an encrypted integer from euint16 to euint64. + /** + * @dev Casts an encrypted integer from euint16 to euint64. + */ function asEuint64(euint16 value) internal returns (euint64) { return euint64.wrap(Impl.cast(euint16.unwrap(value), Common.euint64_t)); } - // Cast an encrypted integer from euint32 to euint64. + /** + * @dev Casts an encrypted integer from euint32 to euint64. + */ function asEuint64(euint32 value) internal returns (euint64) { return euint64.wrap(Impl.cast(euint32.unwrap(value), Common.euint64_t)); } - // Cast an encrypted integer from euint128 to euint64. + /** + * @dev Casts an encrypted integer from euint128 to euint64. + */ function asEuint64(euint128 value) internal returns (euint64) { return euint64.wrap(Impl.cast(euint128.unwrap(value), Common.euint64_t)); } - // Cast an encrypted integer from euint256 to euint64. + /** + * @dev Casts an encrypted integer from euint256 to euint64. + */ function asEuint64(euint256 value) internal returns (euint64) { return euint64.wrap(Impl.cast(euint256.unwrap(value), Common.euint64_t)); } - // Cast an encrypted integer from euint64 to ebool. + /** + * @dev Casts an encrypted integer from euint64 to ebool. + */ function asEbool(euint64 value) internal returns (ebool) { return ne(value, 0); } - // Converts an 'ebool' to an 'euint64'. + /** + * @dev Converts an 'ebool' to an 'euint64'. + */ function asEuint64(ebool b) internal returns (euint64) { return euint64.wrap(Impl.cast(ebool.unwrap(b), Common.euint64_t)); } - // Cast an encrypted integer from euint4 to euint128. + /** + * @dev Casts an encrypted integer from euint4 to euint128. + */ function asEuint128(euint4 value) internal returns (euint128) { return euint128.wrap(Impl.cast(euint4.unwrap(value), Common.euint128_t)); } - // Cast an encrypted integer from euint8 to euint128. + /** + * @dev Casts an encrypted integer from euint8 to euint128. + */ function asEuint128(euint8 value) internal returns (euint128) { return euint128.wrap(Impl.cast(euint8.unwrap(value), Common.euint128_t)); } - // Cast an encrypted integer from euint16 to euint128. + /** + * @dev Casts an encrypted integer from euint16 to euint128. + */ function asEuint128(euint16 value) internal returns (euint128) { return euint128.wrap(Impl.cast(euint16.unwrap(value), Common.euint128_t)); } - // Cast an encrypted integer from euint32 to euint128. + /** + * @dev Casts an encrypted integer from euint32 to euint128. + */ function asEuint128(euint32 value) internal returns (euint128) { return euint128.wrap(Impl.cast(euint32.unwrap(value), Common.euint128_t)); } - // Cast an encrypted integer from euint64 to euint128. + /** + * @dev Casts an encrypted integer from euint64 to euint128. + */ function asEuint128(euint64 value) internal returns (euint128) { return euint128.wrap(Impl.cast(euint64.unwrap(value), Common.euint128_t)); } - // Cast an encrypted integer from euint256 to euint128. + /** + * @dev Casts an encrypted integer from euint256 to euint128. + */ function asEuint128(euint256 value) internal returns (euint128) { return euint128.wrap(Impl.cast(euint256.unwrap(value), Common.euint128_t)); } - // Cast an encrypted integer from euint128 to ebool. + /** + * @dev Casts an encrypted integer from euint128 to ebool. + */ function asEbool(euint128 value) internal returns (ebool) { return ne(value, 0); } - // Converts an 'ebool' to an 'euint128'. + /** + * @dev Converts an 'ebool' to an 'euint128'. + */ function asEuint128(ebool b) internal returns (euint128) { return euint128.wrap(Impl.cast(ebool.unwrap(b), Common.euint128_t)); } - // Cast an encrypted integer from euint4 to euint256. + /** + * @dev Casts an encrypted integer from euint4 to euint256. + */ function asEuint256(euint4 value) internal returns (euint256) { return euint256.wrap(Impl.cast(euint4.unwrap(value), Common.euint256_t)); } - // Cast an encrypted integer from euint8 to euint256. + /** + * @dev Casts an encrypted integer from euint8 to euint256. + */ function asEuint256(euint8 value) internal returns (euint256) { return euint256.wrap(Impl.cast(euint8.unwrap(value), Common.euint256_t)); } - // Cast an encrypted integer from euint16 to euint256. + /** + * @dev Casts an encrypted integer from euint16 to euint256. + */ function asEuint256(euint16 value) internal returns (euint256) { return euint256.wrap(Impl.cast(euint16.unwrap(value), Common.euint256_t)); } - // Cast an encrypted integer from euint32 to euint256. + /** + * @dev Casts an encrypted integer from euint32 to euint256. + */ function asEuint256(euint32 value) internal returns (euint256) { return euint256.wrap(Impl.cast(euint32.unwrap(value), Common.euint256_t)); } - // Cast an encrypted integer from euint64 to euint256. + /** + * @dev Casts an encrypted integer from euint64 to euint256. + */ function asEuint256(euint64 value) internal returns (euint256) { return euint256.wrap(Impl.cast(euint64.unwrap(value), Common.euint256_t)); } - // Cast an encrypted integer from euint128 to euint256. + /** + * @dev Casts an encrypted integer from euint128 to euint256. + */ function asEuint256(euint128 value) internal returns (euint256) { return euint256.wrap(Impl.cast(euint128.unwrap(value), Common.euint256_t)); } - // Cast an encrypted integer from euint256 to ebool. + /** + * @dev Casts an encrypted integer from euint256 to ebool. + */ function asEbool(euint256 value) internal returns (ebool) { return ne(value, 0); } - // Converts an 'ebool' to an 'euint256'. + /** + * @dev Converts an 'ebool' to an 'euint256'. + */ function asEuint256(ebool b) internal returns (euint256) { return euint256.wrap(Impl.cast(ebool.unwrap(b), Common.euint256_t)); } @@ -10255,189 +12341,261 @@ library TFHE { return euint256.wrap(Impl.not(euint256.unwrap(value))); } - // Convert an inputHandle with corresponding inputProof to an encrypted euint4 integer. + /** + * @dev Convert an inputHandle with corresponding inputProof to an encrypted euint4 integer. + */ function asEuint4(einput inputHandle, bytes memory inputProof) internal returns (euint4) { return euint4.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint4_t)); } - // Convert a plaintext value to an encrypted euint4 integer. + /** + * @dev Convert a plaintext value to an encrypted euint4 integer. + */ function asEuint4(uint256 value) internal returns (euint4) { return euint4.wrap(Impl.trivialEncrypt(value, Common.euint4_t)); } - // Convert an inputHandle with corresponding inputProof to an encrypted euint8 integer. + /** + * @dev Convert an inputHandle with corresponding 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. + /** + * @dev Convert a plaintext value to an encrypted euint8 integer. + */ function asEuint8(uint256 value) internal returns (euint8) { return euint8.wrap(Impl.trivialEncrypt(value, Common.euint8_t)); } - // Convert an inputHandle with corresponding inputProof to an encrypted euint16 integer. + /** + * @dev Convert an inputHandle with corresponding 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. + /** + * @dev Convert a plaintext value to an encrypted euint16 integer. + */ function asEuint16(uint256 value) internal returns (euint16) { return euint16.wrap(Impl.trivialEncrypt(value, Common.euint16_t)); } - // Convert an inputHandle with corresponding inputProof to an encrypted euint32 integer. + /** + * @dev Convert an inputHandle with corresponding 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. + /** + * @dev Convert a plaintext value to an encrypted euint32 integer. + */ function asEuint32(uint256 value) internal returns (euint32) { return euint32.wrap(Impl.trivialEncrypt(value, Common.euint32_t)); } - // Convert an inputHandle with corresponding inputProof to an encrypted euint64 integer. + /** + * @dev Convert an inputHandle with corresponding 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. + /** + * @dev Convert a plaintext value to an encrypted euint64 integer. + */ function asEuint64(uint256 value) internal returns (euint64) { return euint64.wrap(Impl.trivialEncrypt(value, Common.euint64_t)); } - // Convert an inputHandle with corresponding inputProof to an encrypted euint128 integer. + /** + * @dev Convert an inputHandle with corresponding inputProof to an encrypted euint128 integer. + */ function asEuint128(einput inputHandle, bytes memory inputProof) internal returns (euint128) { return euint128.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint128_t)); } - // Convert a plaintext value to an encrypted euint128 integer. + /** + * @dev Convert a plaintext value to an encrypted euint128 integer. + */ function asEuint128(uint256 value) internal returns (euint128) { return euint128.wrap(Impl.trivialEncrypt(value, Common.euint128_t)); } - // Convert an inputHandle with corresponding inputProof to an encrypted euint256 integer. + /** + * @dev Convert an inputHandle with corresponding inputProof to an encrypted euint256 integer. + */ function asEuint256(einput inputHandle, bytes memory inputProof) internal returns (euint256) { return euint256.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint256_t)); } - // Convert a plaintext value to an encrypted euint256 integer. + /** + * @dev Convert a plaintext value to an encrypted euint256 integer. + */ function asEuint256(uint256 value) internal returns (euint256) { return euint256.wrap(Impl.trivialEncrypt(value, Common.euint256_t)); } - // Generates a random encrypted boolean. + /** + * @dev Generates a random encrypted boolean. + */ function randEbool() internal returns (ebool) { return ebool.wrap(Impl.rand(Common.ebool_t)); } - // Generates a random encrypted 4-bit unsigned integer. + /** + * @dev Generates a random encrypted 4-bit unsigned integer. + */ function randEuint4() internal returns (euint4) { return euint4.wrap(Impl.rand(Common.euint4_t)); } - // Generates a random encrypted 4-bit unsigned integer in the [0, upperBound) range. - // The upperBound must be a power of 2. + /** + * @dev Generates a random encrypted 4-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. + */ function randEuint4(uint8 upperBound) internal returns (euint4) { return euint4.wrap(Impl.randBounded(upperBound, Common.euint4_t)); } - // Generates a random encrypted 8-bit unsigned integer. + /** + * @dev Generates a random encrypted 8-bit unsigned integer. + */ function randEuint8() internal returns (euint8) { return euint8.wrap(Impl.rand(Common.euint8_t)); } - // Generates a random encrypted 8-bit unsigned integer in the [0, upperBound) range. - // The upperBound must be a power of 2. + /** + * @dev Generates a random encrypted 8-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. + */ function randEuint8(uint8 upperBound) internal returns (euint8) { return euint8.wrap(Impl.randBounded(upperBound, Common.euint8_t)); } - // Generates a random encrypted 16-bit unsigned integer. + /** + * @dev Generates a random encrypted 16-bit unsigned integer. + */ function randEuint16() internal returns (euint16) { return euint16.wrap(Impl.rand(Common.euint16_t)); } - // Generates a random encrypted 16-bit unsigned integer in the [0, upperBound) range. - // The upperBound must be a power of 2. + /** + * @dev Generates a random encrypted 16-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. + */ function randEuint16(uint16 upperBound) internal returns (euint16) { return euint16.wrap(Impl.randBounded(upperBound, Common.euint16_t)); } - // Generates a random encrypted 32-bit unsigned integer. + /** + * @dev Generates a random encrypted 32-bit unsigned integer. + */ function randEuint32() internal returns (euint32) { return euint32.wrap(Impl.rand(Common.euint32_t)); } - // Generates a random encrypted 32-bit unsigned integer in the [0, upperBound) range. - // The upperBound must be a power of 2. + /** + * @dev Generates a random encrypted 32-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. + */ function randEuint32(uint32 upperBound) internal returns (euint32) { return euint32.wrap(Impl.randBounded(upperBound, Common.euint32_t)); } - // Generates a random encrypted 64-bit unsigned integer. + /** + * @dev Generates a random encrypted 64-bit unsigned integer. + */ function randEuint64() internal returns (euint64) { return euint64.wrap(Impl.rand(Common.euint64_t)); } - // Generates a random encrypted 64-bit unsigned integer in the [0, upperBound) range. - // The upperBound must be a power of 2. + /** + * @dev Generates a random encrypted 64-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. + */ function randEuint64(uint64 upperBound) internal returns (euint64) { return euint64.wrap(Impl.randBounded(upperBound, Common.euint64_t)); } - // Generates a random encrypted 128-bit unsigned integer. + /** + * @dev Generates a random encrypted 128-bit unsigned integer. + */ function randEuint128() internal returns (euint128) { return euint128.wrap(Impl.rand(Common.euint128_t)); } - // Generates a random encrypted 128-bit unsigned integer in the [0, upperBound) range. - // The upperBound must be a power of 2. + /** + * @dev Generates a random encrypted 128-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. + */ function randEuint128(uint128 upperBound) internal returns (euint128) { return euint128.wrap(Impl.randBounded(upperBound, Common.euint128_t)); } - // Generates a random encrypted 256-bit unsigned integer. + /** + * @dev Generates a random encrypted 256-bit unsigned integer. + */ function randEuint256() internal returns (euint256) { return euint256.wrap(Impl.rand(Common.euint256_t)); } - // Generates a random encrypted 256-bit unsigned integer in the [0, upperBound) range. - // The upperBound must be a power of 2. + /** + * @dev Generates a random encrypted 256-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. + */ function randEuint256(uint256 upperBound) internal returns (euint256) { return euint256.wrap(Impl.randBounded(upperBound, Common.euint256_t)); } - // Generates a random encrypted 512-bit unsigned integer. + /** + * @dev Generates a random encrypted 512-bit unsigned integer. + */ function randEbytes64() internal returns (ebytes64) { return ebytes64.wrap(Impl.rand(Common.ebytes64_t)); } - // Generates a random encrypted 1024-bit unsigned integer. + /** + * @dev Generates a random encrypted 1024-bit unsigned integer. + */ function randEbytes128() internal returns (ebytes128) { return ebytes128.wrap(Impl.rand(Common.ebytes128_t)); } - // Generates a random encrypted 2048-bit unsigned integer. + /** + * @dev Generates a random encrypted 2048-bit unsigned integer. + */ function randEbytes256() internal returns (ebytes256) { return ebytes256.wrap(Impl.rand(Common.ebytes256_t)); } - // Convert an inputHandle with corresponding inputProof to an encrypted eaddress. + /** + * @dev Convert an inputHandle with corresponding inputProof to an encrypted eaddress. + */ function asEaddress(einput inputHandle, bytes memory inputProof) internal returns (eaddress) { return eaddress.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint160_t)); } - // Convert a plaintext value to an encrypted address. + /** + * @dev Convert a plaintext value to an encrypted address. + */ function asEaddress(address value) internal returns (eaddress) { return eaddress.wrap(Impl.trivialEncrypt(uint160(value), Common.euint160_t)); } - // Convert the given inputHandle and inputProof to an encrypted ebytes64 value. + /** + * @dev Convert the given inputHandle and inputProof to an encrypted ebytes64 value. + */ function asEbytes64(einput inputHandle, bytes memory inputProof) internal returns (ebytes64) { return ebytes64.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebytes64_t)); } - // Left-pad a bytes array with zeros such that it becomes of length 64. + /** + * @dev Left-pad a bytes array with zeros such that it becomes of length 64. + */ function padToBytes64(bytes memory input) internal pure returns (bytes memory) { uint256 inputLength = input.length; @@ -10457,17 +12615,23 @@ library TFHE { return result; } - // Convert a plaintext value - must be a bytes array of size 64 - to an encrypted Bytes64. + /** + * @dev Convert a plaintext value - must be a bytes array of size 64 - to an encrypted Bytes64. + */ function asEbytes64(bytes memory value) internal returns (ebytes64) { return ebytes64.wrap(Impl.trivialEncrypt(value, Common.ebytes64_t)); } - // Convert the given inputHandle and inputProof to an encrypted ebytes128 value. + /** + * @dev Convert the given inputHandle and inputProof to an encrypted ebytes128 value. + */ function asEbytes128(einput inputHandle, bytes memory inputProof) internal returns (ebytes128) { return ebytes128.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebytes128_t)); } - // Left-pad a bytes array with zeros such that it becomes of length 128. + /** + * @dev Left-pad a bytes array with zeros such that it becomes of length 128. + */ function padToBytes128(bytes memory input) internal pure returns (bytes memory) { uint256 inputLength = input.length; @@ -10486,17 +12650,23 @@ library TFHE { return result; } - // Convert a plaintext value - must be a bytes array of size 128 - to an encrypted Bytes128. + /** + * @dev Convert a plaintext value - must be a bytes array of size 128 - to an encrypted Bytes128. + */ function asEbytes128(bytes memory value) internal returns (ebytes128) { return ebytes128.wrap(Impl.trivialEncrypt(value, Common.ebytes128_t)); } - // Convert the given inputHandle and inputProof to an encrypted ebytes256 value. + /** + * @dev Convert the given inputHandle and inputProof to an encrypted ebytes256 value. + */ function asEbytes256(einput inputHandle, bytes memory inputProof) internal returns (ebytes256) { return ebytes256.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebytes256_t)); } - // Left-pad a bytes array with zeros such that it becomes of length 256. + /** + * @dev Left-pad a bytes array with zeros such that it becomes of length 256. + */ function padToBytes256(bytes memory input) internal pure returns (bytes memory) { uint256 inputLength = input.length; @@ -10515,32 +12685,44 @@ library TFHE { return result; } - // Convert a plaintext value - must be a bytes array of size 256 - to an encrypted Bytes256. + /** + * @dev Convert a plaintext value - must be a bytes array of size 256 - to an encrypted Bytes256. + */ function asEbytes256(bytes memory value) internal returns (ebytes256) { return ebytes256.wrap(Impl.trivialEncrypt(value, Common.ebytes256_t)); } - // Return true if the enrypted address is initialized and false otherwise. + /** + * @dev Returns true if the encrypted address is initialized and false otherwise. + */ function isInitialized(eaddress v) internal pure returns (bool) { return eaddress.unwrap(v) != 0; } - // Return true if the enrypted value is initialized and false otherwise. + /** + * @dev Returns true if the encrypted value is initialized and false otherwise. + */ function isInitialized(ebytes64 v) internal pure returns (bool) { return ebytes64.unwrap(v) != 0; } - // Return true if the enrypted value is initialized and false otherwise. + /** + * @dev Returns true if the encrypted value is initialized and false otherwise. + */ function isInitialized(ebytes128 v) internal pure returns (bool) { return ebytes128.unwrap(v) != 0; } - // Return true if the enrypted value is initialized and false otherwise. + /** + * @dev Returns true if the encrypted value is initialized and false otherwise. + */ function isInitialized(ebytes256 v) internal pure returns (bool) { return ebytes256.unwrap(v) != 0; } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(ebool a, ebool b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbool(false); @@ -10551,7 +12733,9 @@ library TFHE { return ebool.wrap(Impl.eq(ebool.unwrap(a), ebool.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(ebool a, ebool b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbool(false); @@ -10562,7 +12746,9 @@ library TFHE { return ebool.wrap(Impl.ne(ebool.unwrap(a), ebool.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(ebool a, bool b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbool(false); @@ -10571,7 +12757,9 @@ library TFHE { return ebool.wrap(Impl.eq(ebool.unwrap(a), bProc, true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(bool b, ebool a) internal returns (ebool) { if (!isInitialized(a)) { a = asEbool(false); @@ -10580,7 +12768,9 @@ library TFHE { return ebool.wrap(Impl.eq(ebool.unwrap(a), bProc, true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(ebool a, bool b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbool(false); @@ -10589,7 +12779,9 @@ library TFHE { return ebool.wrap(Impl.ne(ebool.unwrap(a), bProc, true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(bool b, ebool a) internal returns (ebool) { if (!isInitialized(a)) { a = asEbool(false); @@ -10598,7 +12790,9 @@ library TFHE { return ebool.wrap(Impl.ne(ebool.unwrap(a), bProc, true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(eaddress a, eaddress b) internal returns (ebool) { if (!isInitialized(a)) { a = asEaddress(address(0)); @@ -10609,7 +12803,9 @@ library TFHE { return ebool.wrap(Impl.eq(eaddress.unwrap(a), eaddress.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(eaddress a, eaddress b) internal returns (ebool) { if (!isInitialized(a)) { a = asEaddress(address(0)); @@ -10620,7 +12816,9 @@ library TFHE { return ebool.wrap(Impl.ne(eaddress.unwrap(a), eaddress.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(eaddress a, address b) internal returns (ebool) { if (!isInitialized(a)) { a = asEaddress(address(0)); @@ -10629,7 +12827,9 @@ library TFHE { return ebool.wrap(Impl.eq(eaddress.unwrap(a), bProc, true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(address b, eaddress a) internal returns (ebool) { if (!isInitialized(a)) { a = asEaddress(address(0)); @@ -10638,7 +12838,9 @@ library TFHE { return ebool.wrap(Impl.eq(eaddress.unwrap(a), bProc, true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(eaddress a, address b) internal returns (ebool) { if (!isInitialized(a)) { a = asEaddress(address(0)); @@ -10647,7 +12849,9 @@ library TFHE { return ebool.wrap(Impl.ne(eaddress.unwrap(a), bProc, true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(address b, eaddress a) internal returns (ebool) { if (!isInitialized(a)) { a = asEaddress(address(0)); @@ -10656,37 +12860,49 @@ library TFHE { return ebool.wrap(Impl.ne(eaddress.unwrap(a), bProc, true)); } - // If 'control''s value is 'true', the result has the same value as 'a'. - // If 'control''s value is 'false', the result has the same value as 'b'. + /** + * @dev If 'control''s value is 'true', the result has the same value as 'a'. + * If 'control''s value is 'false', the result has the same value as 'b'. + */ function select(ebool control, ebool a, ebool b) internal returns (ebool) { return ebool.wrap(Impl.select(ebool.unwrap(control), ebool.unwrap(a), ebool.unwrap(b))); } - // If 'control''s value is 'true', the result has the same value as 'a'. - // If 'control''s value is 'false', the result has the same value as 'b'. + /** + * @dev If 'control''s value is 'true', the result has the same value as 'a'. + * If 'control''s value is 'false', the result has the same value as 'b'. + */ function select(ebool control, eaddress a, eaddress b) internal returns (eaddress) { return eaddress.wrap(Impl.select(ebool.unwrap(control), eaddress.unwrap(a), eaddress.unwrap(b))); } - // If 'control''s value is 'true', the result has the same value as 'a'. - // If 'control''s value is 'false', the result has the same value as 'b'. + /** + * @dev If 'control''s value is 'true', the result has the same value as 'a'. + * If 'control''s value is 'false', the result has the same value as 'b'. + */ function select(ebool control, ebytes64 a, ebytes64 b) internal returns (ebytes64) { return ebytes64.wrap(Impl.select(ebool.unwrap(control), ebytes64.unwrap(a), ebytes64.unwrap(b))); } - // If 'control''s value is 'true', the result has the same value as 'a'. - // If 'control''s value is 'false', the result has the same value as 'b'. + /** + * @dev If 'control''s value is 'true', the result has the same value as 'a'. + * If 'control''s value is 'false', the result has the same value as 'b'. + */ function select(ebool control, ebytes128 a, ebytes128 b) internal returns (ebytes128) { return ebytes128.wrap(Impl.select(ebool.unwrap(control), ebytes128.unwrap(a), ebytes128.unwrap(b))); } - // If 'control''s value is 'true', the result has the same value as 'a'. - // If 'control''s value is 'false', the result has the same value as 'b'. + /** + * @dev If 'control''s value is 'true', the result has the same value as 'a'. + * If 'control''s value is 'false', the result has the same value as 'b'. + */ function select(ebool control, ebytes256 a, ebytes256 b) internal returns (ebytes256) { return ebytes256.wrap(Impl.select(ebool.unwrap(control), ebytes256.unwrap(a), ebytes256.unwrap(b))); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(ebytes64 a, ebytes64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes64(padToBytes64(hex"")); @@ -10697,7 +12913,9 @@ library TFHE { return ebool.wrap(Impl.eq(ebytes64.unwrap(a), ebytes64.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(ebytes64 a, bytes memory b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes64(padToBytes64(hex"")); @@ -10705,7 +12923,9 @@ library TFHE { return ebool.wrap(Impl.eq(ebytes64.unwrap(a), b, true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(bytes memory a, ebytes64 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEbytes64(padToBytes64(hex"")); @@ -10713,7 +12933,9 @@ library TFHE { return ebool.wrap(Impl.eq(ebytes64.unwrap(b), a, true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(ebytes64 a, ebytes64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes64(padToBytes64(hex"")); @@ -10724,7 +12946,9 @@ library TFHE { return ebool.wrap(Impl.ne(ebytes64.unwrap(a), ebytes64.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(ebytes64 a, bytes memory b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes64(padToBytes64(hex"")); @@ -10732,7 +12956,9 @@ library TFHE { return ebool.wrap(Impl.ne(ebytes64.unwrap(a), b, true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(bytes memory a, ebytes64 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEbytes64(padToBytes64(hex"")); @@ -10740,7 +12966,9 @@ library TFHE { return ebool.wrap(Impl.ne(ebytes64.unwrap(b), a, true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(ebytes128 a, ebytes128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes128(padToBytes128(hex"")); @@ -10751,7 +12979,9 @@ library TFHE { return ebool.wrap(Impl.eq(ebytes128.unwrap(a), ebytes128.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(ebytes128 a, bytes memory b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes128(padToBytes128(hex"")); @@ -10759,7 +12989,9 @@ library TFHE { return ebool.wrap(Impl.eq(ebytes128.unwrap(a), b, true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(bytes memory a, ebytes128 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEbytes128(padToBytes128(hex"")); @@ -10767,7 +12999,9 @@ library TFHE { return ebool.wrap(Impl.eq(ebytes128.unwrap(b), a, true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(ebytes128 a, ebytes128 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes128(padToBytes128(hex"")); @@ -10778,7 +13012,9 @@ library TFHE { return ebool.wrap(Impl.ne(ebytes128.unwrap(a), ebytes128.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(ebytes128 a, bytes memory b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes128(padToBytes128(hex"")); @@ -10786,7 +13022,9 @@ library TFHE { return ebool.wrap(Impl.ne(ebytes128.unwrap(a), b, true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(bytes memory a, ebytes128 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEbytes128(padToBytes128(hex"")); @@ -10794,7 +13032,9 @@ library TFHE { return ebool.wrap(Impl.ne(ebytes128.unwrap(b), a, true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(ebytes256 a, ebytes256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes256(padToBytes256(hex"")); @@ -10805,7 +13045,9 @@ library TFHE { return ebool.wrap(Impl.eq(ebytes256.unwrap(a), ebytes256.unwrap(b), false)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(ebytes256 a, bytes memory b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes256(padToBytes256(hex"")); @@ -10813,7 +13055,9 @@ library TFHE { return ebool.wrap(Impl.eq(ebytes256.unwrap(a), b, true)); } - // Evaluate eq(a, b) and return the result. + /** + * @dev Evaluates eq(a, b) and returns the result. + */ function eq(bytes memory a, ebytes256 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEbytes256(padToBytes256(hex"")); @@ -10821,7 +13065,9 @@ library TFHE { return ebool.wrap(Impl.eq(ebytes256.unwrap(b), a, true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(ebytes256 a, ebytes256 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes256(padToBytes256(hex"")); @@ -10832,7 +13078,9 @@ library TFHE { return ebool.wrap(Impl.ne(ebytes256.unwrap(a), ebytes256.unwrap(b), false)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(ebytes256 a, bytes memory b) internal returns (ebool) { if (!isInitialized(a)) { a = asEbytes256(padToBytes256(hex"")); @@ -10840,7 +13088,9 @@ library TFHE { return ebool.wrap(Impl.ne(ebytes256.unwrap(a), b, true)); } - // Evaluate ne(a, b) and return the result. + /** + * @dev Evaluates ne(a, b) and returns the result. + */ function ne(bytes memory a, ebytes256 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEbytes256(padToBytes256(hex"")); @@ -10848,82 +13098,146 @@ library TFHE { return ebool.wrap(Impl.ne(ebytes256.unwrap(b), a, true)); } - // cleans the transient storage of ACL containing all the allowedTransient accounts - // also cleans transient storage of InputVerifier containing cached inputProofs - // to be used for integration with Account Abstraction or when bundling UserOps calling the FHEVMCoprocessor + /** + * @dev This function cleans the transient storage for the ACL (accounts) and the InputVerifier + * (input proofs). + * This could be useful for integration with Account Abstraction when bundling several + * UserOps calling the TFHEExecutorCoprocessor. + */ function cleanTransientStorage() internal { Impl.cleanTransientStorageACL(); Impl.cleanTransientStorageInputVerifier(); } + /** + * @dev Returns whether the account is allowed to use the value. + */ function isAllowed(ebool value, address account) internal view returns (bool) { return Impl.isAllowed(ebool.unwrap(value), account); } + + /** + * @dev Returns whether the account is allowed to use the value. + */ function isAllowed(euint4 value, address account) internal view returns (bool) { return Impl.isAllowed(euint4.unwrap(value), account); } + /** + * @dev Returns whether the account is allowed to use the value. + */ function isAllowed(euint8 value, address account) internal view returns (bool) { return Impl.isAllowed(euint8.unwrap(value), account); } + /** + * @dev Returns whether the account is allowed to use the value. + */ function isAllowed(euint16 value, address account) internal view returns (bool) { return Impl.isAllowed(euint16.unwrap(value), account); } + /** + * @dev Returns whether the account is allowed to use the value. + */ function isAllowed(euint32 value, address account) internal view returns (bool) { return Impl.isAllowed(euint32.unwrap(value), account); } + /** + * @dev Returns whether the account is allowed to use the value. + */ function isAllowed(euint64 value, address account) internal view returns (bool) { return Impl.isAllowed(euint64.unwrap(value), account); } + /** + * @dev Returns whether the account is allowed to use the value. + */ function isAllowed(euint128 value, address account) internal view returns (bool) { return Impl.isAllowed(euint128.unwrap(value), account); } + /** + * @dev Returns whether the account is allowed to use the value. + */ function isAllowed(euint256 value, address account) internal view returns (bool) { return Impl.isAllowed(euint256.unwrap(value), account); } + /** + * @dev Returns whether the account is allowed to use the value. + */ function isAllowed(eaddress value, address account) internal view returns (bool) { return Impl.isAllowed(eaddress.unwrap(value), account); } + /** + * @dev Returns whether the account is allowed to use the value. + */ function isAllowed(ebytes256 value, address account) internal view returns (bool) { return Impl.isAllowed(ebytes256.unwrap(value), account); } + /** + * @dev Returns whether the sender is allowed to use the value. + */ function isSenderAllowed(ebool value) internal view returns (bool) { return Impl.isAllowed(ebool.unwrap(value), msg.sender); } + /** + * @dev Returns whether the sender is allowed to use the value. + */ function isSenderAllowed(euint4 value) internal view returns (bool) { return Impl.isAllowed(euint4.unwrap(value), msg.sender); } + /** + * @dev Returns whether the sender is allowed to use the value. + */ function isSenderAllowed(euint8 value) internal view returns (bool) { return Impl.isAllowed(euint8.unwrap(value), msg.sender); } + /** + * @dev Returns whether the sender is allowed to use the value. + */ function isSenderAllowed(euint16 value) internal view returns (bool) { return Impl.isAllowed(euint16.unwrap(value), msg.sender); } + /** + * @dev Returns whether the sender is allowed to use the value. + */ function isSenderAllowed(euint32 value) internal view returns (bool) { return Impl.isAllowed(euint32.unwrap(value), msg.sender); } + /** + * @dev Returns whether the sender is allowed to use the value. + */ function isSenderAllowed(euint64 value) internal view returns (bool) { return Impl.isAllowed(euint64.unwrap(value), msg.sender); } + /** + * @dev Returns whether the sender is allowed to use the value. + */ function isSenderAllowed(euint128 value) internal view returns (bool) { return Impl.isAllowed(euint128.unwrap(value), msg.sender); } + /** + * @dev Returns whether the sender is allowed to use the value. + */ function isSenderAllowed(euint256 value) internal view returns (bool) { return Impl.isAllowed(euint256.unwrap(value), msg.sender); } + /** + * @dev Returns whether the sender is allowed to use the value. + */ function isSenderAllowed(eaddress value) internal view returns (bool) { return Impl.isAllowed(eaddress.unwrap(value), msg.sender); } + /** + * @dev Returns whether the sender is allowed to use the value. + */ function isSenderAllowed(ebytes256 value) internal view returns (bool) { return Impl.isAllowed(ebytes256.unwrap(value), msg.sender); } @@ -10936,138 +13250,240 @@ library TFHE { Impl.allow(ebool.unwrap(value), address(this)); } + /** + * @dev Allows the use of value for the address account. + */ function allow(euint4 value, address account) internal { Impl.allow(euint4.unwrap(value), account); } + /** + * @dev Allows the use of value for this address (address(this)). + */ function allowThis(euint4 value) internal { Impl.allow(euint4.unwrap(value), address(this)); } + /** + * @dev Allows the use of value for the address account. + */ function allow(euint8 value, address account) internal { Impl.allow(euint8.unwrap(value), account); } + /** + * @dev Allows the use of value for this address (address(this)). + */ function allowThis(euint8 value) internal { Impl.allow(euint8.unwrap(value), address(this)); } + /** + * @dev Allows the use of value for the address account. + */ function allow(euint16 value, address account) internal { Impl.allow(euint16.unwrap(value), account); } + /** + * @dev Allows the use of value for this address (address(this)). + */ function allowThis(euint16 value) internal { Impl.allow(euint16.unwrap(value), address(this)); } + /** + * @dev Allows the use of value for the address account. + */ function allow(euint32 value, address account) internal { Impl.allow(euint32.unwrap(value), account); } + /** + * @dev Allows the use of value for this address (address(this)). + */ function allowThis(euint32 value) internal { Impl.allow(euint32.unwrap(value), address(this)); } + /** + * @dev Allows the use of value for the address account. + */ function allow(euint64 value, address account) internal { Impl.allow(euint64.unwrap(value), account); } + /** + * @dev Allows the use of value for this address (address(this)). + */ function allowThis(euint64 value) internal { Impl.allow(euint64.unwrap(value), address(this)); } + /** + * @dev Allows the use of value for the address account. + */ function allow(euint128 value, address account) internal { Impl.allow(euint128.unwrap(value), account); } + /** + * @dev Allows the use of value for this address (address(this)). + */ function allowThis(euint128 value) internal { Impl.allow(euint128.unwrap(value), address(this)); } + /** + * @dev Allows the use of value for the address account. + */ function allow(euint256 value, address account) internal { Impl.allow(euint256.unwrap(value), account); } + /** + * @dev Allows the use of value for this address (address(this)). + */ function allowThis(euint256 value) internal { Impl.allow(euint256.unwrap(value), address(this)); } + /** + * @dev Allows the use of value for the address account. + */ function allow(eaddress value, address account) internal { Impl.allow(eaddress.unwrap(value), account); } + /** + * @dev Allows the use of value for this address (address(this)). + */ function allowThis(eaddress value) internal { Impl.allow(eaddress.unwrap(value), address(this)); } + /** + * @dev Allows the use of value for the address account. + */ function allow(ebytes64 value, address account) internal { Impl.allow(ebytes64.unwrap(value), account); } + /** + * @dev Allows the use of value for this address (address(this)). + */ function allowThis(ebytes64 value) internal { Impl.allow(ebytes64.unwrap(value), address(this)); } + /** + * @dev Allows the use of value for the address account. + */ function allow(ebytes128 value, address account) internal { Impl.allow(ebytes128.unwrap(value), account); } + /** + * @dev Allows the use of value for this address (address(this)). + */ function allowThis(ebytes128 value) internal { Impl.allow(ebytes128.unwrap(value), address(this)); } + /** + * @dev Allows the use of value for the address account. + */ function allow(ebytes256 value, address account) internal { Impl.allow(ebytes256.unwrap(value), account); } + /** + * @dev Allows the use of value for this address (address(this)). + */ function allowThis(ebytes256 value) internal { Impl.allow(ebytes256.unwrap(value), address(this)); } + /** + * @dev Allows the use of value by address account for this transaction. + */ function allowTransient(ebool value, address account) internal { Impl.allowTransient(ebool.unwrap(value), account); } + /** + * @dev Allows the use of value by address account for this transaction. + */ function allowTransient(euint4 value, address account) internal { Impl.allowTransient(euint4.unwrap(value), account); } + /** + * @dev Allows the use of value by address account for this transaction. + */ function allowTransient(euint8 value, address account) internal { Impl.allowTransient(euint8.unwrap(value), account); } + /** + * @dev Allows the use of value by address account for this transaction. + */ function allowTransient(euint16 value, address account) internal { Impl.allowTransient(euint16.unwrap(value), account); } + /** + * @dev Allows the use of value by address account for this transaction. + */ function allowTransient(euint32 value, address account) internal { Impl.allowTransient(euint32.unwrap(value), account); } + /** + * @dev Allows the use of value by address account for this transaction. + */ function allowTransient(euint64 value, address account) internal { Impl.allowTransient(euint64.unwrap(value), account); } + /** + * @dev Allows the use of value by address account for this transaction. + */ function allowTransient(euint128 value, address account) internal { Impl.allowTransient(euint128.unwrap(value), account); } + /** + * @dev Allows the use of value by address account for this transaction. + */ function allowTransient(euint256 value, address account) internal { Impl.allowTransient(euint256.unwrap(value), account); } + /** + * @dev Allows the use of value by address account for this transaction. + */ function allowTransient(eaddress value, address account) internal { Impl.allowTransient(eaddress.unwrap(value), account); } + /** + * @dev Allows the use of value by address account for this transaction. + */ function allowTransient(ebytes64 value, address account) internal { Impl.allowTransient(ebytes64.unwrap(value), account); } + /** + * @dev Allows the use of value by address account for this transaction. + */ function allowTransient(ebytes128 value, address account) internal { Impl.allowTransient(ebytes128.unwrap(value), account); } + /** + * @dev Allows the use of value by address account for this transaction. + */ function allowTransient(ebytes256 value, address account) internal { Impl.allowTransient(ebytes256.unwrap(value), account); }