From aa2943251f1fdafc4ae9d9cc48b163349f936639 Mon Sep 17 00:00:00 2001
From: yuxizama <157474013+yuxizama@users.noreply.github.com>
Date: Mon, 2 Sep 2024 16:14:23 +0200
Subject: [PATCH 01/51] docs: review and edits
---
.../getting_started/write_contract/hardhat.md | 39 +++++++++++++------
docs/getting_started/write_contract/others.md | 1 +
docs/getting_started/write_contract/remix.md | 13 +++++--
3 files changed, 37 insertions(+), 16 deletions(-)
diff --git a/docs/getting_started/write_contract/hardhat.md b/docs/getting_started/write_contract/hardhat.md
index 2bfbec93..6b092313 100644
--- a/docs/getting_started/write_contract/hardhat.md
+++ b/docs/getting_started/write_contract/hardhat.md
@@ -1,14 +1,21 @@
# Using Hardhat
+This document guides you to start with fhEVM by using our [Hardhat template](https://github.com/zama-ai/fhevm-hardhat-template).
-The best way to start writing smart contracts with fhEVM is to use our [Hardhat template](https://github.com/zama-ai/fhevm-hardhat-template).
-It allows you to start a fhEVM docker image and run your smart contract on it. Read the [README](https://github.com/zama-ai/fhevm-hardhat-template/blob/main/README.md) for more information.
-When developing confidential contracts, we recommend to use first the mocked version of fhEVM for faster testing with `pnpm test:mock` and coverage computation via `pnpm coverage:mock`, this will lead to a better developer experience. However, keep in mind that the mocked fhEVM has some limitations and discrepancies compared to the real fhEVM node, as explained in the warning section at the end of this page.
-It's essential to run tests of the final contract version using the real fhEVM. You can do this by running `pnpm test` before deployment.
+## Using Hardhat with fhEVM
+To start writing smart contracts with fhEVM, we recommend use our [Hardhat template](https://github.com/zama-ai/fhevm-hardhat-template). This template allows you to launch an fhEVM Docker image and run your smart contract on it. For more information, refer to the [README](https://github.com/zama-ai/fhevm-hardhat-template/blob/main/README.md).
+
+When developing confidential contracts, we recommend using the mocked version of fhEVM first for faster testing. You can achieve this by running `pnpm test:mock` for tests and `pnpm coverage:mock` for coverage computation. This approach provides a better developer experience. However, keep in mind that the mocked fhEVM has limitations and discrepancies compared to the real fhEVM node, as detailed in the [limitations](#limitations) section below.
+
+It's essential to test the final contract version with the real fhEVM before deployment. Run `pnpm test` to ensure everything works correctly.
## Mocked mode
-For faster testing iterations, instead of launching all the tests on the local fhEVM node via `pnpm test`or `npx hardhat test` which could last several minutes, you could use instead a mocked version of the fhEVM.
-The same tests should (almost always) pass, as is, without any modification: neither the javascript files neither the solidity files need to be changed between the mocked and the real version. The mocked mode does not actually real encryption for encrypted types and runs the tests on a local hardhat node which is implementing the original EVM (i.e non-fhEVM). Additionally, the mocked mode will let you use all the hardhat related special testing/debugging methods, such as `evm_mine`, `evm_snapshot`, `evm_revert` etc, which are very helpful for testing.
+For faster testing iterations, you can use the mocked version of the fhEVM instead of launching all tests on a local fhEVM node with `pnpm test` or `npx hardhat test`, which can take several minutes.
+
+The same tests should generally pass without modification—no changes to the JavaScript or Solidity files are required when switching between the mocked and real versions.
+
+In mocked mode, actual encryption for encrypted types is not performed. Instead, the tests run on a local Hardhat node that implements the original EVM (non-fhEVM). Additionally, this mode supports all Hardhat-related testing and debugging methods, such as `evm_mine`, `evm_snapshot`, and `evm_revert`, which are highly useful for testing.
+
To run the mocked tests use either:
@@ -23,7 +30,10 @@ npx hardhat test --network hardhat
```
In mocked mode, all tests should pass in few seconds instead of few minutes, allowing a better developer experience.
-Furthermore, getting the coverage of tests is only possible in mocked mode. Just use the following command:
+
+### Coverage in mocked mode
+Coverage computation is only possible in mocked mode. Run the following command to compute coverage:
+
```
pnpm coverage:mock
@@ -35,9 +45,11 @@ Or equivalently:
npx hardhat coverage
```
-Then open the file `coverage/index.html` to see the coverage results. This will increase security by pointing out missing branches not covered yet by the current test suite.
-**Notice :** Due to limitations in the `solidity-coverage` package, the coverage computation in fhEVM does not support tests involving the `evm_snapshot`hardhat testing method, however, this method is still supported when running tests in mocked mode! In case you are using hardhat snapshots, we recommend you to end your test description by the`[skip-on-coverage]` tag. Here is a concrete example for illustration purpose:
+After running the command, open the `coverage/index.html` file to view the results. This helps identify any missing branches not covered by the current test suite, increasing the security of your contracts.
+
+#### Important note
+Due to limitations in the `solidity-coverage` package, coverage computation in fhEVM does not support tests involving the `evm_snapshot` Hardhat testing method. However, this method is still supported when running tests in mocked mode. If you are using Hardhat snapshots, we recommend to end your your test description with the `[skip-on-coverage]` tag to to avoid coverage issues. Here is an example:
```js
import { expect } from 'chai';
@@ -110,12 +122,15 @@ describe('Rand', function () {
});
```
-In the previous snippet, the first test will be run in every case, whether in "real" non-mocked mode (`pnpm test`), testing mocked mode (`pnpm test:mock`) or coverage (mocked) mode (`pnpm coverage:mock`). On the other hand, the second test will be run **only** in testing mocked mode, i.e only when running `pnpm test:mock`, since snapshots only works in that specific case. Actually, the second test will be skipped if run in coverage mode, since its description string ends with `[skip-on-coverage]` and similarly, we avoid the test to fail in non-mocked mode since we check that the network name is `hardhat`.
+In this snippet, the first test will always run, whether in "real" non-mocked mode (`pnpm test`), testing mocked mode (`pnpm test:mock`) or coverage (mocked) mode (`pnpm coverage:mock`). On the other hand, the second test will be run **only** in testing mocked mode(`pnpm test:mock`), because snapshots only works in that specific case.
+Actually, the second test will be skipped if run in coverage mode, since its description string ends with `[skip-on-coverage]` and similarly, we avoid the test to fail in non-mocked mode since we check that the network name is `hardhat`.
+
+### Limitations
-⚠️ **Warning :** Due to intrinsic limitations of the original EVM, the mocked version differ in few corner cases from the real fhEVM, the main difference is the difference in gas prices for the FHE operations. This means that before deploying to production, developers still need to run the tests with the original fhEVM node, as a final check in non-mocked mode, with `pnpm test` or `npx hardhat test`.
+⚠️ **Warning :** Due to intrinsic limitations of the original EVM, the mocked version differ in few corner cases from the real fhEVM, mainly in gas prices for the FHE operations. This means that before deploying to production, developers still need to run the tests with the original fhEVM node, as a final check in non-mocked mode, with `pnpm test` or `npx hardhat test`.
{% hint style="success" %}
**Zama 5-Question Developer Survey**
We want to hear from you! Take 1 minute to share your thoughts and helping us enhance our documentation and libraries. **👉** [**Click here**](https://www.zama.ai/developer-survey) to participate.
-{% endhint %}
+{% endhint %}
\ No newline at end of file
diff --git a/docs/getting_started/write_contract/others.md b/docs/getting_started/write_contract/others.md
index d347b671..3ed2a897 100644
--- a/docs/getting_started/write_contract/others.md
+++ b/docs/getting_started/write_contract/others.md
@@ -1,4 +1,5 @@
# Other development environment
+This document provides guidance on using the fhEVM in other development environments.
## Foundry
diff --git a/docs/getting_started/write_contract/remix.md b/docs/getting_started/write_contract/remix.md
index 49be2cae..5f05a408 100644
--- a/docs/getting_started/write_contract/remix.md
+++ b/docs/getting_started/write_contract/remix.md
@@ -1,8 +1,7 @@
# Using Remix
+This document provides guidance on using the new Zama plugin for the [the official Remix IDE](https://remix.ethereum.org), which replaces the deprecated Remix fork. This allows you to develop and manage contracts directly in Remix by simply loading the fhEVM plugin.
-We have decided to deprecate our Remix fork in favor of a new plugin we are currently developing. This plugin will enable you to develop your contracts directly on [the official Remix IDE](https://remix.ethereum.org) by simply loading the fhEVM plugin.
-
-To use it:
+## Installing the Zama plugin
1. Go to the "Plugin Manager" page
2. Click on "Connect to a Local Plugin"
@@ -12,7 +11,13 @@ To use it:
-After connecting to the Zama Plugin, you should click on the plugin button located on the left of the screen, and then add a Gateway URL to be able to request reencryption of ciphertexts, as shown in the picture below. The default recommended Gateway URL is: `https://gateway.devnet.zama.ai`.
+## Configuring the Zama plugin
+After connecting to the Zama Plugin, follow the steps to configure it:
+
+ 1. Click on the plugin button located on the left of the screen
+ 2. Add a Gateway URL to be able to request reencryption of ciphertexts, as shown in the picture below.
+
+The default recommended Gateway URL is: `https://gateway.devnet.zama.ai`.
From 3f471a9fc720657aa9a2bc8308af65f148fd9798 Mon Sep 17 00:00:00 2001
From: yuxizama <157474013+yuxizama@users.noreply.github.com>
Date: Mon, 2 Sep 2024 16:38:26 +0200
Subject: [PATCH 02/51] docs: review and edits
---
docs/fundamentals/acl.md | 23 ++++++++++++++---------
docs/fundamentals/contracts.md | 5 ++---
docs/fundamentals/decrypt.md | 3 ++-
docs/fundamentals/inputs.md | 16 +++++++++++-----
4 files changed, 29 insertions(+), 18 deletions(-)
diff --git a/docs/fundamentals/acl.md b/docs/fundamentals/acl.md
index 266d9525..8285a190 100644
--- a/docs/fundamentals/acl.md
+++ b/docs/fundamentals/acl.md
@@ -1,15 +1,14 @@
# Access Control List
+This document explains the Access Control List (ACL) system in fhEVM, which defines which addresses have the right to manipulate a ciphertext. By using ACLs, you can prevent unauthorized addresses from accessing ciphertext contents.
## How it works?
-fhEVM includes an Access Control List (ACL) system that allows you to define which addresses have the right to manipulate a ciphertext. This feature prevents any address from accessing the contents of unauthorized ciphertexts.
+You can configure the ACLs in two ways:
-These ACLs can be adjusted in two ways:
+- **Permanent allowance**: `TFHE.allow(ciphertext, address)` allows a ciphertext to be used by a specific address at any time.
+- **Transient allowance**: `TFHE.allowTransient(ciphertext, address)` authorizes access to the ciphertext only for the duration of the transaction.
-- `TFHE.allow(ciphertext, address)` Permanently, on the blockchain. This allows a ciphertext to be used by a specific address at any time.
-- `TFHE.allowTransient(ciphertext, address)` Temporarily. The ciphertext is then authorized only for the duration of the transaction.
-
-Note that you can also use: `TFHE.allowThis(ciphertext)` which is just syntactic sugar instead of `TFHE.allow(ciphertext, address(this))`. This function is commonly used inside a dApp smart contract, in order to authorize the same contract to reuse a new `ciphertext` handle which has just been computed in a future transaction.
+Additionally, you can use `TFHE.allowThis(ciphertext)` as syntactic sugar for `TFHE.allow(ciphertext, address(this))`. This function is commonly used within dApp smart contracts to authorize the same contract to reuse a newly computed ciphertext handle in a future transaction.
Permanent allowance will store the ACL in a dedicated contract, while a temporary allowance will store it in [transient storage](https://eips.ethereum.org/EIPS/eip-1153), allowing developers to save gas. Transient allowance is particularly useful when calling an external function using a ciphertext as a parameter.
@@ -76,12 +75,18 @@ function randomize() {
## Security best practice: isSenderAllowed()
-When a function receives a ciphertext (such as `ebool`, `euint8`, `eaddress`, ...), it needs to verify that the sender also has access to this ciphertext. This is important because otherwise, a contract could send any ciphertext authorized for the contract and potentially exploit the function to retrieve the value.
-For example, an attacker could transfer someone's balance as an encrypted amount. Without `require(TFHE.isSenderAllowed(encryptedAmount))`, an attacker who doesn't have access to this balance could determine the value by transferring the balance between two well-funded accounts.
+When a function receives a ciphertext (such as `ebool`, `euint8`, `eaddress`, ...), it needs to verify that the sender also has access to this ciphertext. This verification is crucial for security.
+
+Without this check, a contract could send any ciphertext authorized for the contract and potentially exploit the function to retrieve the value. For example, an attacker could transfer someone's balance as an encrypted amount.
+
+If the function does not include `require(TFHE.isSenderAllowed(encryptedAmount))`, an attacker who doesn't have access to this balance could determine the value by transferring the balance between two well-funded accounts.
## ACL for reencryption
-If a ciphertext must be reencrypted by a user, then explicit access must be granted to them. If this authorization is not given, the user will be unable to request a reencryption of this ciphertext. Due to the reencryption mechanism, a user signs a public key associated with a specific contract; therefore, the ciphertext also needs to be allowed for the contract.
+If a ciphertext must be reencrypted by a user, then explicit access must be granted to them. If this authorization is not given, the user will be unable to request a reencryption of this ciphertext.
+
+Due to the reencryption mechanism, a user signs a public key associated with a specific contract; therefore, the ciphertext also needs to be allowed for the contract.
+
Let's take, for example, a transfer in an ERC20:
```solidity
diff --git a/docs/fundamentals/contracts.md b/docs/fundamentals/contracts.md
index ff865e03..4a5c7c69 100644
--- a/docs/fundamentals/contracts.md
+++ b/docs/fundamentals/contracts.md
@@ -1,8 +1,7 @@
# Contracts standard library
+This document provides guidance on how to use the standard contracts.
-## Getting Started
-
-### Installation
+## Installation
```bash
# Using npm
diff --git a/docs/fundamentals/decrypt.md b/docs/fundamentals/decrypt.md
index df4d7240..996112a0 100644
--- a/docs/fundamentals/decrypt.md
+++ b/docs/fundamentals/decrypt.md
@@ -1,8 +1,9 @@
# Decrypt and reencrypt
+This document explains how to decrypt and reencrypt data on the blockchain using a Key Management Service (KMS) and the Gateway service. The process ensures secure handling of sensitive data without exposing the blockchain's private key.
## How it's working
-Validators of the blockchain do not own the blockchain's private key. Instead, the private key is owned by a Key Management Service (KMS). If the plaintext value is needed at some point, there are two ways to obtain it. Both methods are handled by a service called the Gateway.
+Validators of the blockchain do not own the blockchain's private key. Instead, the private key is owned by a KMS. If the plaintext value is needed at some point, there are two ways to obtain it. Both methods are handled by a service called the Gateway.
- If the plaintext is needed for some logic in a contract, the Gateway acts as an oracle service: it will listen to decryption request events and return the decrypted value through a callback function.
- If the plaintext is needed by a dApp, the Gateway provides an API to reencrypt a ciphertext with the dApp's public key.
diff --git a/docs/fundamentals/inputs.md b/docs/fundamentals/inputs.md
index dcd3b7b4..abae9a53 100644
--- a/docs/fundamentals/inputs.md
+++ b/docs/fundamentals/inputs.md
@@ -1,9 +1,15 @@
# Encrypted inputs
+This document introduces the concept of encrypted inputs in the fhEVM, explaining how they are used, structured, and validated within smart contracts.
-Inputs are a cornerstone of fhEVM: they allow users to push encrypted data onto the blockchain. To prevent any attacks, a user must provide proof of knowledge of the plaintext value underlying the ciphertext. This prevents the reuse of a ciphertext already stored on the blockchain.
+Inputs are a cornerstone of fhEVM: they allow users to push encrypted data onto the blockchain.
+
+To prevent any attacks, a user must provide proof of knowledge of the plaintext value underlying the ciphertext. This proof ensures that a ciphertext cannot be reused once stored on the blockchain.
All inputs are packed into a single ciphertext in a user-defined order, thereby minimizing the size and time required to create a zero-knowledge proof.
-When a function is called, there are two types of parameters: `einput`, which is the index of the parameter, and `bytes`, which contains the actual ciphertext and zero-knowledge proof.
+
+When a function is called, there are two types of parameters:
+- `einput`: Represents the index of the encrypted parameter.
+- `bytes`: Contains the actual ciphertext and the associated zero-knowledge proof.
For example, if a function requires 3 encrypted parameters, it could be written as follows:
@@ -19,9 +25,9 @@ function myExample(
) {}
```
-### Client Side
+### Client-side implementation
-On client side for the previous function, using [fhevmjs](https://github.com/zama-ai/fhevmjs), the code will be:
+On client side, you can interact with the the previous function using [fhevmjs](https://github.com/zama-ai/fhevmjs). Here's an example:
```javascript
const instance = await createInstance({ networkUrl: "http://localhost:8545" });
@@ -42,7 +48,7 @@ contract.myExample(
### Validate input
-A contract can use an encrypted parameter by calling `TFHE.asEuintXX(param, proof)` (or `TFHE.asEbool` or `TFHE.asEaddress`). This function will transform the input as a valid encrypted type.
+A contract can use an encrypted parameter by calling `TFHE.asEuintXX(param, proof)` (or `TFHE.asEbool` or `TFHE.asEaddress`). This function will transform the input as a valid encrypted type:
```solidity
function transfer(address to, einput encryptedAmount, bytes calldata inputProof) public {
From ea329c22e275c39abcc97a1eb530cbda0ee41fba Mon Sep 17 00:00:00 2001
From: yuxizama <157474013+yuxizama@users.noreply.github.com>
Date: Mon, 2 Sep 2024 18:07:32 +0200
Subject: [PATCH 03/51] docs: review and edits
---
docs/guides/cli.md | 5 ++++-
docs/guides/decrypt.md | 9 ++++++++-
docs/guides/gas.md | 1 +
docs/guides/loop.md | 5 +++--
docs/guides/node.md | 8 ++++++--
docs/guides/pitfalls.md | 3 ++-
docs/guides/reencryption.md | 14 ++++++++------
docs/guides/webapp.md | 7 +++++--
docs/guides/webpack.md | 2 +-
docs/references/fhevmjs.md | 3 ++-
docs/references/functions.md | 2 ++
11 files changed, 42 insertions(+), 17 deletions(-)
diff --git a/docs/guides/cli.md b/docs/guides/cli.md
index 34a3e07f..01f491b2 100644
--- a/docs/guides/cli.md
+++ b/docs/guides/cli.md
@@ -1,6 +1,9 @@
# Use the CLI
-fhevmjs include a Command-Line Interface (CLI) tool. With this handy utility, you can encrypt 8/16/32bits integer with the blockchain's FHE public key.
+This document provides instructions on how to use the Command-Line Interface (CLI) tool included in the `fhevmjs` package for encrypting integers with a blockchain's Fully Homomorphic Encryption (FHE) public key.
+
+`fhevmjs` include a CLI tool. With this handy utility, you can encrypt 8/16/32bits integer with the blockchain's FHE public key.
+
To get started with fhevmjs CLI, first, ensure you have Node.js installed on your system. Next, install the fhevmjs package globally using the '-g' flag, which allows you to access the CLI tool from any directory:
```bash
diff --git a/docs/guides/decrypt.md b/docs/guides/decrypt.md
index 6d3c3153..1830aada 100644
--- a/docs/guides/decrypt.md
+++ b/docs/guides/decrypt.md
@@ -1,5 +1,7 @@
# Decrypt
+This document provides a guide on performing asynchronous decryption using the `GatewayCaller` contract in Solidity, covering the necessary setup, usage, and detailed function explanations.
+## Overview
The decryption operation is asynchronous. To use it, your contract must extend the `GatewayCaller` contract. This will import automatically the `Gateway` solidity library as well. See the following example:
```solidity
@@ -28,9 +30,13 @@ contract TestAsyncDecrypt is GatewayCaller {
return yBool;
}
```
+## `GatewayContract` set up
-Note that a [`GatewayContract`](../../gateway/GatewayContract.sol) contract is already predeployed on the fhEVM testnet, and a default relayer account is added through the specification of the environment variable `PRIVATE_KEY_GATEWAY_RELAYER` in the `.env` file. Relayers are the only accounts authorized to fulfil the decryption requests. However `GatewayContract` would still check the KMS signature during the fulfilment, so we trust the relayer only to forward the request on time, a rogue relayer could not cheat by sending fake decryption results.
+A [`GatewayContract`](../../gateway/GatewayContract.sol) is predeployed on the fhEVM testnet. It uses a default relayer account specified by the `PRIVATE_KEY_GATEWAY_RELAYER` environment variable in the `.env` file.
+Relayers are the only accounts authorized to fulfill decryption requests. However, the `GatewayContract` verifies the KMS signature during fulfillment, ensuring that even if we trust the relayer only to forward the request on time, a malicious relayer could not cheat by sending fake decryption results.
+
+## `Gateway.requestDecryption` function
The interface of the `Gateway.requestDecryption` function from previous snippet is the following:
```solidity
@@ -42,6 +48,7 @@ function requestDecryption(
bool passSignaturesToCaller
) returns(uint256 requestID)
```
+### Parameters
The first argument, `ct`, should be an array of ciphertexts handles which could be of different types, i.e `uint256` values coming from unwrapping handles of type either `ebool`, `euint4`, `euint8`, `euint16`, `euint32`, `euint64` or `eaddress`. `ct` is the list of ciphertexts that are requested to be decrypted. Calling `requestDecryption` will emit an `EventDecryption` on the `GatewayContract` contract which will be detected by a relayer. Then, the relayer will send the corresponding ciphertexts to the KMS for decryption before fulfilling the request.
diff --git a/docs/guides/gas.md b/docs/guides/gas.md
index 2bf4405c..24d5560a 100644
--- a/docs/guides/gas.md
+++ b/docs/guides/gas.md
@@ -1,4 +1,5 @@
# Gas estimation
+This document provides an overview of gas estimation for Fully Homomorphic Encryption (FHE) operations, detailing the gas costs associated with various operations across different data types.
FHE operations are typically more computationally expensive than classical operations due to their inherent complexity. As a reference, here is an approximation of the gas cost associated with each operation.
diff --git a/docs/guides/loop.md b/docs/guides/loop.md
index c78711a3..c18ff7e2 100644
--- a/docs/guides/loop.md
+++ b/docs/guides/loop.md
@@ -1,5 +1,6 @@
# How can I break a loop ?
-
+This document explains how to handle loops when working with Fully Homomorphic Encryption (FHE), specifically when a loop break is based on an encrypted condition.
+## Breaking a loop
❌ In FHE, it is not possible to break a loop based on an encrypted condition. For example, this would not work:
```solidity
@@ -12,7 +13,7 @@ while(TFHE.lt(x, maxValue)){
```
If your code logic requires looping on an encrypted boolean condition, we highly suggest to try to replace it by a finite loop with an appropriate constant maximum number of steps and use `TFHE.select` inside the loop.
-
+## Suggested approach
✅ For example, the previous code could maybe be replaced by the following snippet:
```solidity
diff --git a/docs/guides/node.md b/docs/guides/node.md
index 79570107..d9b96b6d 100644
--- a/docs/guides/node.md
+++ b/docs/guides/node.md
@@ -1,6 +1,8 @@
# Build with Node
+This document provides instructions on how to build with `Node.js` using the `fhevmjs` library.
-First, you need to install the library.
+## Install the library
+First, you need to install the library:
```bash
# Using npm
@@ -15,6 +17,8 @@ pnpm add fhevmjs
`fhevmjs` uses ESM format for web version and commonjs for node version. You need to set the [type to "commonjs" in your package.json](https://nodejs.org/api/packages.html#type) to load the correct version of fhevmjs. If your node project use `"type": "module"`, you can force the loading of the Node version by using `import { createInstance } from 'fhevmjs/node';`
+## Create an instance
+
An instance receives an object containing:
- `chainId` (optional): the chainId of the network
@@ -24,7 +28,7 @@ An instance receives an object containing:
- `gatewayUrl` (optional): the URL of the gateway to retrieve a reencryption
- `coprocessorUrl` (optional): the URL of the coprocessor
-## Create an instance
+
```javascript
const { createInstance } = require("fhevmjs");
diff --git a/docs/guides/pitfalls.md b/docs/guides/pitfalls.md
index 29e562c2..d3bf83ff 100644
--- a/docs/guides/pitfalls.md
+++ b/docs/guides/pitfalls.md
@@ -1,4 +1,5 @@
# Common pitfalls and best practises
+This document provides guidance on common pitfalls to avoid and best practices to follow when working with fhEVM.
## Common pitfalls to avoid
@@ -6,7 +7,7 @@
Never use encrypted types for constant or immutable state variables, even if they should actually stay constants, or else any transaction involving those will fail. This is because ciphertexts should always be stored in the privileged storage of the contract (see paragraph 4.4 of [whitepaper](../../fhevm-whitepaper.pdf)) while constant and immutable variables are just appended to the bytecode of the deployed contract at construction time.
-❌ So, even if `a` and `b` should never change after construction, this code :
+❌ So, even if `a` and `b` should never change after construction, the following example :
```solidity
contract C {
diff --git a/docs/guides/reencryption.md b/docs/guides/reencryption.md
index 92fd681b..a216485c 100644
--- a/docs/guides/reencryption.md
+++ b/docs/guides/reencryption.md
@@ -1,10 +1,12 @@
-# How to get a reencryption
+# How to get a re-encryption
-## How it's working
+This document explains how to perform a re-encryption. The process involves implementing a contract function to retrieve the ciphertext and then using client-side code to re-encrypt the ciphertext.
-The reencryption process involves converting a ciphertext that was encrypted with the FHE blockchain key into one that is encrypted with the NaCl public key generated by the dApp.
-First, your contract needs to implement a view function to return the ciphertext to reencrypt:
+Re-encryption is the process of converting ciphertext encrypted with an FHE blockchain key into ciphertext encrypted with a NaCl public key.
+
+## Retrieve the ciphertext
+To retrieve the ciphertext that needs to be re-encrypted, you must implement a view function in your contract. Here's is an example:
```solidity
import "fhevm/lib/TFHE.sol";
@@ -17,8 +19,8 @@ contract EncryptedERC20 {
...
}
```
-
-Then, you can implement the client side code. This example would run in a browser:
+## Re-encrypt the ciphertext
+Then, you can implement the client-side code to re-encrypt the ciphertext. This step is designed to run in a browser, here is an example:
```javascript
import abi from "./abi.json";
diff --git a/docs/guides/webapp.md b/docs/guides/webapp.md
index 691e03e3..9070b217 100644
--- a/docs/guides/webapp.md
+++ b/docs/guides/webapp.md
@@ -1,4 +1,5 @@
# Build a web application
+This document guides you through building a web application using the fhevmjs library. You can either start with a template or directly integrate the library into your project.
## Using a template
@@ -18,7 +19,8 @@ You can also use [this template](https://github.com/zama-ai/fhevmjs-next-templat
## Using directly the library
-First, you need to install the library.
+### Step 1: Install the library
+Install the `fhevmjs` library to your project:
```bash
# Using npm
@@ -30,6 +32,7 @@ yarn add fhevmjs
# Using pnpm
pnpm add fhevmjs
```
+### Step 2: Initialize your project
`fhevmjs` uses ESM format. You need to set the [type to "module" in your package.json](https://nodejs.org/api/packages.html#type). If your node project use `"type": "commonjs"` or no type, you can force the loading of the web version by using `import { createInstance } from 'fhevmjs/web';`
@@ -42,7 +45,7 @@ const init = async () => {
await initFhevm(); // Load needed WASM
};
```
-
+### Step 3: Create an instance
Once the WASM is loaded, you can now create an instance. An instance receives an object containing:
- `chainId` (optional): the chainId of the network
diff --git a/docs/guides/webpack.md b/docs/guides/webpack.md
index c10ae48a..5a73ee6c 100644
--- a/docs/guides/webpack.md
+++ b/docs/guides/webpack.md
@@ -1,5 +1,5 @@
# Common webpack errors
-
+This document provides solutions for common Webpack errors encountered during the development process. Follow the steps below to resolve each issue.
## "Module not found: Error: Can't resolve 'tfhe_bg.wasm'"
In the codebase, there is a `new URL('tfhe_bg.wasm')` which triggers a resolve by Webpack. If you encounter an issue, you can add a fallback for this file by adding a resolve configuration in your `webpack.config.js`:
diff --git a/docs/references/fhevmjs.md b/docs/references/fhevmjs.md
index e3b4c49e..b75664d9 100644
--- a/docs/references/fhevmjs.md
+++ b/docs/references/fhevmjs.md
@@ -1,6 +1,7 @@
# fhevmjs function specifications
+This document provides an overview of the `fhevmjs` library, detailing its initialization, instance creation, input handling, encryption, and re-encryption processes.
-[fhevmjs](https://github.com/zama-ai/fhevmjs/) is designed to assist in creating encrypted inputs and retrieving reencryption data off-chain through a gateway. The library works with any fhEVM and fhEVM Coprocessors.
+[fhevmjs](https://github.com/zama-ai/fhevmjs/) is designed to assist in creating encrypted inputs and retrieving re-encryption data off-chain through a gateway. The library works with any fhEVM and fhEVM Coprocessors.
## Init (browser)
diff --git a/docs/references/functions.md b/docs/references/functions.md
index cf0c3303..c213f432 100644
--- a/docs/references/functions.md
+++ b/docs/references/functions.md
@@ -1,5 +1,7 @@
# Function specifications
+This document provides an overview of the functions available in the `TFHE` Solidity library.
+
The functions exposed by the `TFHE` Solidity library come in various shapes and sizes in order to facilitate developer experience.
For example, most binary operators (e.g., `add`) can take as input any combination of the supported data types.
From 0511e4d99d539734879d2c8b3730921cce3f71f9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Wed, 25 Sep 2024 14:34:30 +0200
Subject: [PATCH 04/51] chore: update hardhat-upgrades plugin
---
package-lock.json | 50 +++++++++++++++++++++++------------------------
package.json | 2 +-
2 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 40339561..867e1a78 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -22,7 +22,7 @@
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@nomicfoundation/hardhat-verify": "^2.0.10",
"@openzeppelin/contracts-upgradeable": "^5.0.2",
- "@openzeppelin/hardhat-upgrades": "^3.2.1",
+ "@openzeppelin/hardhat-upgrades": "^3.3.0",
"@trivago/prettier-plugin-sort-imports": "^4.0.0",
"@typechain/ethers-v6": "^0.5.0",
"@typechain/hardhat": "^9.1.0",
@@ -90,12 +90,12 @@
}
},
"node_modules/@aws-sdk/types": {
- "version": "3.609.0",
- "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz",
- "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==",
+ "version": "3.654.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.654.0.tgz",
+ "integrity": "sha512-VWvbED3SV+10QJIcmU/PKjsKilsTV16d1I7/on4bvD/jo1qGeMXqLDBSen3ks/tuvXZF/mFc7ZW/W2DiLVtO7A==",
"dev": true,
"dependencies": {
- "@smithy/types": "^3.3.0",
+ "@smithy/types": "^3.4.2",
"tslib": "^2.6.2"
},
"engines": {
@@ -2338,9 +2338,9 @@
}
},
"node_modules/@openzeppelin/defender-sdk-base-client": {
- "version": "1.14.3",
- "resolved": "https://registry.npmjs.org/@openzeppelin/defender-sdk-base-client/-/defender-sdk-base-client-1.14.3.tgz",
- "integrity": "sha512-4yG9E8N1c/ZP2jNR+Ah19wi7SBKpauAV/VcYcm7rg1dltDbzbH/oZnnXJlymT7IfjTPXkKHW8TPsaqz3EjS7tA==",
+ "version": "1.14.4",
+ "resolved": "https://registry.npmjs.org/@openzeppelin/defender-sdk-base-client/-/defender-sdk-base-client-1.14.4.tgz",
+ "integrity": "sha512-tOePVQLKpqfGQ1GMzHvSBNd2psPYd86LDNpvdl5gjD0Y2kW/zNh5qBXy29RraGtk/qc8zs9hzS5pAOh0vhGkGQ==",
"dev": true,
"dependencies": {
"amazon-cognito-identity-js": "^6.3.6",
@@ -2348,36 +2348,36 @@
}
},
"node_modules/@openzeppelin/defender-sdk-deploy-client": {
- "version": "1.14.3",
- "resolved": "https://registry.npmjs.org/@openzeppelin/defender-sdk-deploy-client/-/defender-sdk-deploy-client-1.14.3.tgz",
- "integrity": "sha512-51WIZJz251lndK7uQU4gBE0gBX+2ZNTgf+hemtJUEPCpHtkooBRFFMID3EPGMKXVqf872pU8K3Huu9PyYQu6bw==",
+ "version": "1.14.4",
+ "resolved": "https://registry.npmjs.org/@openzeppelin/defender-sdk-deploy-client/-/defender-sdk-deploy-client-1.14.4.tgz",
+ "integrity": "sha512-+diSoz1zid37LMsY2RDxI+uAsYx9Eryg8Vz+yfvuyd56fXrzjQEln7BBtYQw+2zp9yvyAByOL5XSQdrQga9OBQ==",
"dev": true,
"dependencies": {
- "@openzeppelin/defender-sdk-base-client": "1.14.3",
+ "@openzeppelin/defender-sdk-base-client": "^1.14.4",
"axios": "^1.7.2",
"lodash": "^4.17.21"
}
},
"node_modules/@openzeppelin/defender-sdk-network-client": {
- "version": "1.14.3",
- "resolved": "https://registry.npmjs.org/@openzeppelin/defender-sdk-network-client/-/defender-sdk-network-client-1.14.3.tgz",
- "integrity": "sha512-qrJLs2ubKSwrhP0x4V2QOPhlc1q8TYnkAcvjvk34VXMS8lhY1cpXSGoxnTw3Mi+eCSE1xOzKWISLi1UAOQOJIw==",
+ "version": "1.14.4",
+ "resolved": "https://registry.npmjs.org/@openzeppelin/defender-sdk-network-client/-/defender-sdk-network-client-1.14.4.tgz",
+ "integrity": "sha512-OS0H5b0vgYacJcwkvUFJUaRuyUaXhIRl916W5xLvGia5H6i/qn3dP8MZ7oLcPwKc8jB+ucRytO4H/AHsea0aVA==",
"dev": true,
"dependencies": {
- "@openzeppelin/defender-sdk-base-client": "1.14.3",
+ "@openzeppelin/defender-sdk-base-client": "^1.14.4",
"axios": "^1.7.2",
"lodash": "^4.17.21"
}
},
"node_modules/@openzeppelin/hardhat-upgrades": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/@openzeppelin/hardhat-upgrades/-/hardhat-upgrades-3.2.1.tgz",
- "integrity": "sha512-Zy5M3QhkzwGdpzQmk+xbWdYOGJWjoTvwbBKYLhctu9B91DoprlhDRaZUwCtunwTdynkTDGdVfGr0kIkvycyKjw==",
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/@openzeppelin/hardhat-upgrades/-/hardhat-upgrades-3.3.0.tgz",
+ "integrity": "sha512-0RwCpkBKWViG0nIERk8tV5E71DCtZ6PXgsjoCYg+Bi2IWYgD8Skt4Q8b6QqE7tuWsFCK5yVQIVfCFL99JKMK5A==",
"dev": true,
"dependencies": {
- "@openzeppelin/defender-sdk-base-client": "^1.10.0",
- "@openzeppelin/defender-sdk-deploy-client": "^1.10.0",
- "@openzeppelin/defender-sdk-network-client": "^1.10.0",
+ "@openzeppelin/defender-sdk-base-client": "^1.14.4",
+ "@openzeppelin/defender-sdk-deploy-client": "^1.14.4",
+ "@openzeppelin/defender-sdk-network-client": "^1.14.4",
"@openzeppelin/upgrades-core": "^1.35.0",
"chalk": "^4.1.0",
"debug": "^4.1.1",
@@ -2617,9 +2617,9 @@
}
},
"node_modules/@smithy/types": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/@smithy/types/-/types-3.3.0.tgz",
- "integrity": "sha512-IxvBBCTFDHbVoK7zIxqA1ZOdc4QfM5HM7rGleCuHi7L1wnKv5Pn69xXJQ9hgxH60ZVygH9/JG0jRgtUncE3QUA==",
+ "version": "3.4.2",
+ "resolved": "https://registry.npmjs.org/@smithy/types/-/types-3.4.2.tgz",
+ "integrity": "sha512-tHiFcfcVedVBHpmHUEUHOCCih8iZbIAYn9NvPsNzaPm/237I3imdDdZoOC8c87H5HBAVEa06tTgb+OcSWV9g5w==",
"dev": true,
"dependencies": {
"tslib": "^2.6.2"
diff --git a/package.json b/package.json
index 5ed80b8c..be3cdeff 100644
--- a/package.json
+++ b/package.json
@@ -59,7 +59,7 @@
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@nomicfoundation/hardhat-verify": "^2.0.10",
"@openzeppelin/contracts-upgradeable": "^5.0.2",
- "@openzeppelin/hardhat-upgrades": "^3.2.1",
+ "@openzeppelin/hardhat-upgrades": "^3.3.0",
"@trivago/prettier-plugin-sort-imports": "^4.0.0",
"@typechain/ethers-v6": "^0.5.0",
"@typechain/hardhat": "^9.1.0",
From 02aa2d35795ee9df286f710861ebba8e9ba9305e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Wed, 25 Sep 2024 15:00:33 +0200
Subject: [PATCH 05/51] fix: mocked working when changing .env
---
hardhat.config.ts | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hardhat.config.ts b/hardhat.config.ts
index 40e17667..1887f7f8 100644
--- a/hardhat.config.ts
+++ b/hardhat.config.ts
@@ -86,8 +86,6 @@ task('test', async (taskArgs, hre, runSuper) => {
// Run modified test task
if (hre.network.name === 'hardhat') {
// in fhevm mode all this block is done when launching the node via `pnmp fhevm:start`
- await hre.run('compile:specific', { contract: 'lib' });
- await hre.run('compile:specific', { contract: 'gateway' });
const privKeyDeployer = process.env.PRIVATE_KEY_GATEWAY_DEPLOYER;
await hre.run('task:computePredeployAddress', { privateKey: privKeyDeployer });
await hre.run('task:computeACLAddress');
@@ -95,6 +93,9 @@ task('test', async (taskArgs, hre, runSuper) => {
await hre.run('task:computeKMSVerifierAddress');
await hre.run('task:computeInputVerifierAddress');
await hre.run('task:computeFHEPaymentAddress');
+ await hre.run('compile:specific', { contract: 'lib' });
+ await hre.run('compile:specific', { contract: 'gateway' });
+ await hre.run('compile:specific', { contract: 'payment' });
await hre.run('task:deployACL');
await hre.run('task:deployTFHEExecutor');
await hre.run('task:deployKMSVerifier');
From b5c3234874cc74164b35d1f985005887afc05052 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Fri, 27 Sep 2024 15:42:42 +0200
Subject: [PATCH 06/51] feat: set null FHE gas prices + remove Payment lib
---
codegen/payments.ts | 6 +-
codegen/testgen.ts | 8 +-
examples/BlindAuction.sol | 4 +-
examples/EncryptedERC20.sol | 4 +-
examples/Rand.sol | 4 +-
examples/Reencrypt.sol | 5 +-
examples/TestAsyncDecrypt.sol | 4 +-
examples/tests/TFHEManualTestSuite.sol | 4 +-
examples/tests/TFHETestSuite1.sol | 4 +-
examples/tests/TFHETestSuite2.sol | 4 +-
examples/tests/TFHETestSuite3.sol | 4 +-
examples/tests/TFHETestSuite4.sol | 4 +-
examples/tests/TFHETestSuite5.sol | 4 +-
examples/tests/TFHETestSuite6.sol | 4 +-
lib/FHEPayment.sol | 6 +-
lib/FhevmLib.sol | 13 +
test/encryptedERC20/EncryptedERC20.fixture.ts | 4 +-
test/gatewayDecrypt/testAsyncDecrypt.ts | 18 +-
test/kmsVerifier/kmsVerifier.ts | 8 +-
test/paymentUtils.ts | 4 +-
test/payments/payments.ts | 426 ++++++++++--------
test/rand/Rand.fixture.ts | 4 +-
test/reencryption/reencryption.ts | 4 +-
test/tfheOperations/manual.ts | 4 +-
test/tfheOperations/tfheOperations1.ts | 24 +-
test/tfheOperations/tfheOperations10.ts | 24 +-
test/tfheOperations/tfheOperations11.ts | 24 +-
test/tfheOperations/tfheOperations12.ts | 24 +-
test/tfheOperations/tfheOperations2.ts | 24 +-
test/tfheOperations/tfheOperations3.ts | 24 +-
test/tfheOperations/tfheOperations4.ts | 24 +-
test/tfheOperations/tfheOperations5.ts | 24 +-
test/tfheOperations/tfheOperations6.ts | 24 +-
test/tfheOperations/tfheOperations7.ts | 24 +-
test/tfheOperations/tfheOperations8.ts | 24 +-
test/tfheOperations/tfheOperations9.ts | 24 +-
36 files changed, 346 insertions(+), 496 deletions(-)
create mode 100644 lib/FhevmLib.sol
diff --git a/codegen/payments.ts b/codegen/payments.ts
index 3c76090a..647b5bbd 100644
--- a/codegen/payments.ts
+++ b/codegen/payments.ts
@@ -39,9 +39,9 @@ export function generateFHEPayment(priceData: PriceData): string {
uint256 private constant PATCH_VERSION = 0;
address public constant tfheExecutorAddress = tfheExecutorAdd;
- uint256 private constant FHE_GAS_BLOCKLIMIT = 10_000_000;
- uint256 private constant MIN_FHE_GASPRICE = 10_000_000; // minimum of 0.01 Gwei
- uint256 private constant FHE_GASPRICE_NATIVE_RATIO = 1000; // fhe gas price is set to 0.1% of native gas price (if above minimum)
+ uint256 private constant FHE_GAS_BLOCKLIMIT = 10_000_000; //
+ uint256 private constant MIN_FHE_GASPRICE = 0; // eg: 10_000_000 means a minimum of 0.01 Gwei
+ uint256 private constant FHE_GASPRICE_NATIVE_RATIO = 0; // eg: 1000 means fhe gas price is set to 0.1% of native gas price (if above minimum)
/// @custom:storage-location erc7201:fhevm.storage.FHEPayment
struct FHEPaymentStorage {
diff --git a/codegen/testgen.ts b/codegen/testgen.ts
index 96844d98..088a3fd3 100644
--- a/codegen/testgen.ts
+++ b/codegen/testgen.ts
@@ -81,9 +81,7 @@ async function deployTfheTestFixture${os.shardNumber}(): Promise mapping(spender => allowance)).
mapping(address => mapping(address => euint64)) internal allowances;
- constructor(string memory name_, string memory symbol_) payable Ownable(msg.sender) {
+ constructor(string memory name_, string memory symbol_) Ownable(msg.sender) {
TFHE.setFHEVM(FHEVMConfig.defaultConfig());
- Payment.depositForThis(msg.value);
_name = name_;
_symbol = symbol_;
}
diff --git a/examples/Rand.sol b/examples/Rand.sol
index 183b4f08..d84e62be 100644
--- a/examples/Rand.sol
+++ b/examples/Rand.sol
@@ -3,7 +3,6 @@
pragma solidity ^0.8.24;
import "../lib/TFHE.sol";
-import "../payment/Payment.sol";
contract Rand {
euint8 public value8;
@@ -12,9 +11,8 @@ contract Rand {
euint64 public value64;
euint64 public value64Bounded;
- constructor() payable {
+ constructor() {
TFHE.setFHEVM(FHEVMConfig.defaultConfig());
- Payment.depositForThis(msg.value);
}
function generate8() public {
diff --git a/examples/Reencrypt.sol b/examples/Reencrypt.sol
index 7243e99d..44e7ace3 100644
--- a/examples/Reencrypt.sol
+++ b/examples/Reencrypt.sol
@@ -3,7 +3,6 @@
pragma solidity ^0.8.24;
import "../lib/TFHE.sol";
-import "../payment/Payment.sol";
contract Reencrypt {
ebool public xBool;
@@ -15,11 +14,9 @@ contract Reencrypt {
eaddress public xAddress;
ebytes256 public yBytes256;
- constructor() payable {
+ constructor() {
TFHE.setFHEVM(FHEVMConfig.defaultConfig());
- Payment.depositForThis(msg.value);
-
xBool = TFHE.asEbool(true);
TFHE.allowThis(xBool);
TFHE.allow(xBool, msg.sender);
diff --git a/examples/TestAsyncDecrypt.sol b/examples/TestAsyncDecrypt.sol
index 5c441e13..6d81b9ec 100644
--- a/examples/TestAsyncDecrypt.sol
+++ b/examples/TestAsyncDecrypt.sol
@@ -4,7 +4,6 @@ pragma solidity ^0.8.24;
import "../lib/TFHE.sol";
import "../gateway/GatewayCaller.sol";
-import "../payment/Payment.sol";
contract TestAsyncDecrypt is GatewayCaller {
ebool xBool;
@@ -32,10 +31,9 @@ contract TestAsyncDecrypt is GatewayCaller {
uint256 public latestRequestID;
- constructor() payable {
+ constructor() {
TFHE.setFHEVM(FHEVMConfig.defaultConfig());
Gateway.setGateway(Gateway.defaultGatewayAddress());
- Payment.depositForThis(msg.value);
xBool = TFHE.asEbool(true);
TFHE.allowThis(xBool);
xUint4 = TFHE.asEuint4(4);
diff --git a/examples/tests/TFHEManualTestSuite.sol b/examples/tests/TFHEManualTestSuite.sol
index 20a65b8d..4a7eb45d 100644
--- a/examples/tests/TFHEManualTestSuite.sol
+++ b/examples/tests/TFHEManualTestSuite.sol
@@ -2,7 +2,6 @@
pragma solidity ^0.8.24;
import "../../lib/TFHE.sol";
-import "../../payment/Payment.sol";
contract TFHEManualTestSuite {
ebool public resb;
@@ -13,9 +12,8 @@ contract TFHEManualTestSuite {
euint64 public res64;
eaddress public resAdd;
- constructor() payable {
+ constructor() {
TFHE.setFHEVM(FHEVMConfig.defaultConfig());
- Payment.depositForThis(msg.value);
}
function eqEbytes256(einput inp1, bytes calldata inputProof1, einput inp2, bytes calldata inputProof2) external {
diff --git a/examples/tests/TFHETestSuite1.sol b/examples/tests/TFHETestSuite1.sol
index 7b0269db..9ddd40aa 100644
--- a/examples/tests/TFHETestSuite1.sol
+++ b/examples/tests/TFHETestSuite1.sol
@@ -2,7 +2,6 @@
pragma solidity ^0.8.24;
import "../../lib/TFHE.sol";
-import "../../payment/Payment.sol";
contract TFHETestSuite1 {
ebool public resb;
@@ -12,9 +11,8 @@ contract TFHETestSuite1 {
euint32 public res32;
euint64 public res64;
- constructor() payable {
+ constructor() {
TFHE.setFHEVM(FHEVMConfig.defaultConfig());
- Payment.depositForThis(msg.value);
}
function add_euint4_euint4(einput a, einput b, bytes calldata inputProof) public {
diff --git a/examples/tests/TFHETestSuite2.sol b/examples/tests/TFHETestSuite2.sol
index faa53c1f..715d8caa 100644
--- a/examples/tests/TFHETestSuite2.sol
+++ b/examples/tests/TFHETestSuite2.sol
@@ -2,7 +2,6 @@
pragma solidity ^0.8.24;
import "../../lib/TFHE.sol";
-import "../../payment/Payment.sol";
contract TFHETestSuite2 {
ebool public resb;
@@ -12,9 +11,8 @@ contract TFHETestSuite2 {
euint32 public res32;
euint64 public res64;
- constructor() payable {
+ constructor() {
TFHE.setFHEVM(FHEVMConfig.defaultConfig());
- Payment.depositForThis(msg.value);
}
function eq_euint8_euint4(einput a, einput b, bytes calldata inputProof) public {
diff --git a/examples/tests/TFHETestSuite3.sol b/examples/tests/TFHETestSuite3.sol
index d6f9e182..c3836358 100644
--- a/examples/tests/TFHETestSuite3.sol
+++ b/examples/tests/TFHETestSuite3.sol
@@ -2,7 +2,6 @@
pragma solidity ^0.8.24;
import "../../lib/TFHE.sol";
-import "../../payment/Payment.sol";
contract TFHETestSuite3 {
ebool public resb;
@@ -12,9 +11,8 @@ contract TFHETestSuite3 {
euint32 public res32;
euint64 public res64;
- constructor() payable {
+ constructor() {
TFHE.setFHEVM(FHEVMConfig.defaultConfig());
- Payment.depositForThis(msg.value);
}
function min_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
diff --git a/examples/tests/TFHETestSuite4.sol b/examples/tests/TFHETestSuite4.sol
index b2818a38..9224da21 100644
--- a/examples/tests/TFHETestSuite4.sol
+++ b/examples/tests/TFHETestSuite4.sol
@@ -2,7 +2,6 @@
pragma solidity ^0.8.24;
import "../../lib/TFHE.sol";
-import "../../payment/Payment.sol";
contract TFHETestSuite4 {
ebool public resb;
@@ -12,9 +11,8 @@ contract TFHETestSuite4 {
euint32 public res32;
euint64 public res64;
- constructor() payable {
+ constructor() {
TFHE.setFHEVM(FHEVMConfig.defaultConfig());
- Payment.depositForThis(msg.value);
}
function or_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
diff --git a/examples/tests/TFHETestSuite5.sol b/examples/tests/TFHETestSuite5.sol
index d4d3ec18..e1782ede 100644
--- a/examples/tests/TFHETestSuite5.sol
+++ b/examples/tests/TFHETestSuite5.sol
@@ -2,7 +2,6 @@
pragma solidity ^0.8.24;
import "../../lib/TFHE.sol";
-import "../../payment/Payment.sol";
contract TFHETestSuite5 {
ebool public resb;
@@ -12,9 +11,8 @@ contract TFHETestSuite5 {
euint32 public res32;
euint64 public res64;
- constructor() payable {
+ constructor() {
TFHE.setFHEVM(FHEVMConfig.defaultConfig());
- Payment.depositForThis(msg.value);
}
function le_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
diff --git a/examples/tests/TFHETestSuite6.sol b/examples/tests/TFHETestSuite6.sol
index 31d7b52c..cca9b1eb 100644
--- a/examples/tests/TFHETestSuite6.sol
+++ b/examples/tests/TFHETestSuite6.sol
@@ -2,7 +2,6 @@
pragma solidity ^0.8.24;
import "../../lib/TFHE.sol";
-import "../../payment/Payment.sol";
contract TFHETestSuite6 {
ebool public resb;
@@ -12,9 +11,8 @@ contract TFHETestSuite6 {
euint32 public res32;
euint64 public res64;
- constructor() payable {
+ constructor() {
TFHE.setFHEVM(FHEVMConfig.defaultConfig());
- Payment.depositForThis(msg.value);
}
function shr_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
diff --git a/lib/FHEPayment.sol b/lib/FHEPayment.sol
index d04a969c..1d35dd3a 100644
--- a/lib/FHEPayment.sol
+++ b/lib/FHEPayment.sol
@@ -29,9 +29,9 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
uint256 private constant PATCH_VERSION = 0;
address public constant tfheExecutorAddress = tfheExecutorAdd;
- uint256 private constant FHE_GAS_BLOCKLIMIT = 10_000_000;
- uint256 private constant MIN_FHE_GASPRICE = 10_000_000; // minimum of 0.01 Gwei
- uint256 private constant FHE_GASPRICE_NATIVE_RATIO = 1000; // fhe gas price is set to 0.1% of native gas price (if above minimum)
+ uint256 private constant FHE_GAS_BLOCKLIMIT = 10_000_000; //
+ uint256 private constant MIN_FHE_GASPRICE = 0; // eg: 10_000_000 means a minimum of 0.01 Gwei
+ uint256 private constant FHE_GASPRICE_NATIVE_RATIO = 0; // eg: 1000 means fhe gas price is set to 0.1% of native gas price (if above minimum)
/// @custom:storage-location erc7201:fhevm.storage.FHEPayment
struct FHEPaymentStorage {
diff --git a/lib/FhevmLib.sol b/lib/FhevmLib.sol
new file mode 100644
index 00000000..cef5a5d8
--- /dev/null
+++ b/lib/FhevmLib.sol
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: BSD-3-Clause-Clear
+
+pragma solidity ^0.8.24;
+
+interface FhevmLib {
+ function verifyCiphertext(
+ bytes32 inputHandle,
+ address callerAddress,
+ address contractAddress,
+ bytes memory inputProof,
+ bytes1 inputType
+ ) external pure returns (uint256 result);
+}
diff --git a/test/encryptedERC20/EncryptedERC20.fixture.ts b/test/encryptedERC20/EncryptedERC20.fixture.ts
index b837d04a..401bbd9c 100644
--- a/test/encryptedERC20/EncryptedERC20.fixture.ts
+++ b/test/encryptedERC20/EncryptedERC20.fixture.ts
@@ -7,9 +7,7 @@ export async function deployEncryptedERC20Fixture(): Promise {
const signers = await getSigners();
const contractFactory = await ethers.getContractFactory('EncryptedERC20');
- const contract = await contractFactory.connect(signers.alice).deploy('Naraggara', 'NARA', {
- value: ethers.parseEther('0.001'),
- }); // City of Zama's battle
+ const contract = await contractFactory.connect(signers.alice).deploy('Naraggara', 'NARA'); // City of Zama's battle
await contract.waitForDeployment();
return contract;
diff --git a/test/gatewayDecrypt/testAsyncDecrypt.ts b/test/gatewayDecrypt/testAsyncDecrypt.ts
index 3a4ffad8..bdf29485 100644
--- a/test/gatewayDecrypt/testAsyncDecrypt.ts
+++ b/test/gatewayDecrypt/testAsyncDecrypt.ts
@@ -15,9 +15,7 @@ describe('TestAsyncDecrypt', function () {
// very first request of decryption always fail at the moment due to a gateway bug
// TODO: remove following 8 lines when the gateway bug will be fixed
const contractFactory = await ethers.getContractFactory('TestAsyncDecrypt');
- this.contract = await contractFactory.connect(this.signers.alice).deploy({
- value: ethers.parseEther('0.001'),
- });
+ this.contract = await contractFactory.connect(this.signers.alice).deploy();
await this.contract.waitForDeployment();
this.contractAddress = await this.contract.getAddress();
this.instances = await createInstances(this.signers);
@@ -30,7 +28,7 @@ describe('TestAsyncDecrypt', function () {
beforeEach(async function () {
const contractFactory = await ethers.getContractFactory('TestAsyncDecrypt');
- this.contract = await contractFactory.connect(this.signers.alice).deploy({ value: ethers.parseEther('0.001') });
+ this.contract = await contractFactory.connect(this.signers.alice).deploy();
this.contractAddress = await this.contract.getAddress();
this.instances = await createInstances(this.signers);
});
@@ -89,9 +87,7 @@ describe('TestAsyncDecrypt', function () {
it('test async decrypt bool trustless', async function () {
const contractFactory = await ethers.getContractFactory('TestAsyncDecrypt');
- const contract2 = await contractFactory.connect(this.signers.alice).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract2 = await contractFactory.connect(this.signers.alice).deploy();
const tx2 = await contract2.requestBoolTrustless({ gasLimit: 5_000_000 });
await tx2.wait();
await awaitAllDecryptionResults();
@@ -390,9 +386,7 @@ describe('TestAsyncDecrypt', function () {
it('test async decrypt ebytes256 non-trivial trustless', async function () {
const contractFactory = await ethers.getContractFactory('TestAsyncDecrypt');
- const contract2 = await contractFactory.connect(this.signers.alice).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract2 = await contractFactory.connect(this.signers.alice).deploy();
const inputAlice = this.instances.alice.createEncryptedInput(
await contract2.getAddress(),
this.signers.alice.address,
@@ -412,9 +406,7 @@ describe('TestAsyncDecrypt', function () {
it('test async decrypt mixed with ebytes256 trustless', async function () {
const contractFactory = await ethers.getContractFactory('TestAsyncDecrypt');
- const contract2 = await contractFactory.connect(this.signers.alice).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract2 = await contractFactory.connect(this.signers.alice).deploy();
const inputAlice = this.instances.alice.createEncryptedInput(
await contract2.getAddress(),
this.signers.alice.address,
diff --git a/test/kmsVerifier/kmsVerifier.ts b/test/kmsVerifier/kmsVerifier.ts
index 85c37dae..a2ada6bb 100644
--- a/test/kmsVerifier/kmsVerifier.ts
+++ b/test/kmsVerifier/kmsVerifier.ts
@@ -34,9 +34,7 @@ describe('KMSVerifier', function () {
expect((await kmsVerifier.getSigners()).length).to.equal(2); // one signer has been added
const contractFactory = await ethers.getContractFactory('TestAsyncDecrypt');
- const contract = await contractFactory.connect(this.signers.alice).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(this.signers.alice).deploy();
const tx2 = await contract.requestBool({ gasLimit: 5_000_000 });
await tx2.wait();
await awaitAllDecryptionResults();
@@ -79,9 +77,7 @@ describe('KMSVerifier', function () {
const y4 = await contract.yUint8();
expect(y4).to.equal(42); // even with more than 2 signatures decryption should still succeed
- const contract2 = await contractFactory.connect(this.signers.alice).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract2 = await contractFactory.connect(this.signers.alice).deploy();
const inputAlice = this.instances.alice.createEncryptedInput(
await contract2.getAddress(),
this.signers.alice.address,
diff --git a/test/paymentUtils.ts b/test/paymentUtils.ts
index 26f4f57a..2740c492 100644
--- a/test/paymentUtils.ts
+++ b/test/paymentUtils.ts
@@ -9,5 +9,5 @@ export async function initializeFHEPayment() {
return fhePayment;
}
-export const FHE_GASPRICE_NATIVE_RATIO = 1000n;
-export const MIN_FHE_GASPRICE = 10_000_000n;
+export const FHE_GASPRICE_NATIVE_RATIO = 0n; // 1000n;
+export const MIN_FHE_GASPRICE = 0n; // 10_000_000n;
diff --git a/test/payments/payments.ts b/test/payments/payments.ts
index a7ef4c38..435737f4 100644
--- a/test/payments/payments.ts
+++ b/test/payments/payments.ts
@@ -17,100 +17,118 @@ describe('TestFHEPayment', function () {
});
it('contract which is not funded cannot be used by non-depositor', async function () {
- const contractFactory = await ethers.getContractFactory('EncryptedERC20');
- const contract = await contractFactory.connect(this.signers.alice).deploy('Naraggara', 'NARA', {
- value: ethers.parseEther('0'), // don't fund contract
- });
- await contract.waitForDeployment();
- await expect(contract.mint(1000)).to.be.revertedWithCustomError(this.fhePayment, 'AccountNotEnoughFunded');
+ if (FHE_GASPRICE_NATIVE_RATIO !== 0n || MIN_FHE_GASPRICE !== 0n) {
+ // skip test if FHE gas price is set to 0
+ const contractFactory = await ethers.getContractFactory('EncryptedERC20');
+ const contract = await contractFactory.connect(this.signers.alice).deploy('Naraggara', 'NARA', {
+ value: ethers.parseEther('0'), // don't fund contract
+ });
+ await contract.waitForDeployment();
+ await expect(contract.mint(1000)).to.be.revertedWithCustomError(this.fhePayment, 'AccountNotEnoughFunded');
+ }
});
it('contract with enough deposits burns the correct amount of fheGas', async function () {
- const contractFactory = await ethers.getContractFactory('EncryptedERC20');
- const contract = await contractFactory.connect(this.signers.alice).deploy('Naraggara', 'NARA', {
- value: ethers.parseEther('0.001'),
- });
- const initialDeposit = await this.fhePayment.getAvailableDepositsETH(await contract.getAddress());
- await contract.waitForDeployment();
- const tx = await contract.mint(1000n);
- const rcpt = await tx.wait();
- const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n;
- const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE;
- const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(await contract.getAddress());
- const consumedFheGas = (initialDeposit - remainingDeposit) / effectiveFheGasPrice;
- expect(consumedFheGas).to.equal(188000n + 600n); // scalarFheAdd(euint64) + trivialEncrypt(euint64)
+ if (FHE_GASPRICE_NATIVE_RATIO !== 0n || MIN_FHE_GASPRICE !== 0n) {
+ // skip test if FHE gas price is set to 0
+ const contractFactory = await ethers.getContractFactory('EncryptedERC20');
+ const contract = await contractFactory.connect(this.signers.alice).deploy('Naraggara', 'NARA', {
+ value: ethers.parseEther('0.001'),
+ });
+ const initialDeposit = await this.fhePayment.getAvailableDepositsETH(await contract.getAddress());
+ await contract.waitForDeployment();
+ const tx = await contract.mint(1000n);
+ const rcpt = await tx.wait();
+ const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n;
+ const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE;
+ const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(await contract.getAddress());
+ const consumedFheGas = (initialDeposit - remainingDeposit) / effectiveFheGasPrice;
+ expect(consumedFheGas).to.equal(188000n + 600n); // scalarFheAdd(euint64) + trivialEncrypt(euint64)
+ }
});
it('contract which is not funded can be used by depositor if he whitelisted dApp contract', async function () {
- const contractFactory = await ethers.getContractFactory('EncryptedERC20');
- const contract = await contractFactory.connect(this.signers.alice).deploy('Naraggara', 'NARA', {
- value: ethers.parseEther('0'), // don't fund contract
- });
- await contract.waitForDeployment();
- const tx = await this.fhePayment.depositETH(this.signers.alice, { value: ethers.parseEther('0.001') });
- await tx.wait();
- const initialDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice);
- const txbis = await this.fhePayment.whitelistContract(contract);
- await txbis.wait();
- const tx2 = await contract.mint(1000);
- const rcpt = await tx2.wait();
- const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n;
- const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE;
- const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice);
- const consumedFheGas = (initialDeposit - remainingDeposit) / effectiveFheGasPrice;
- expect(consumedFheGas).to.equal(188000n + 600n); // scalarFheAdd(euint64) + trivialEncrypt(euint64)
+ if (FHE_GASPRICE_NATIVE_RATIO !== 0n || MIN_FHE_GASPRICE !== 0n) {
+ // skip test if FHE gas price is set to 0
+ const contractFactory = await ethers.getContractFactory('EncryptedERC20');
+ const contract = await contractFactory.connect(this.signers.alice).deploy('Naraggara', 'NARA', {
+ value: ethers.parseEther('0'), // don't fund contract
+ });
+ await contract.waitForDeployment();
+ const tx = await this.fhePayment.depositETH(this.signers.alice, { value: ethers.parseEther('0.001') });
+ await tx.wait();
+ const initialDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice);
+ const txbis = await this.fhePayment.whitelistContract(contract);
+ await txbis.wait();
+ const tx2 = await contract.mint(1000);
+ const rcpt = await tx2.wait();
+ const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n;
+ const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE;
+ const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice);
+ const consumedFheGas = (initialDeposit - remainingDeposit) / effectiveFheGasPrice;
+ expect(consumedFheGas).to.equal(188000n + 600n); // scalarFheAdd(euint64) + trivialEncrypt(euint64)
+ }
});
it('contract which is not funded can be used by depositor if he authorized all contracts', async function () {
- const contractFactory = await ethers.getContractFactory('EncryptedERC20');
- const contract = await contractFactory.connect(this.signers.alice).deploy('Naraggara', 'NARA', {
- value: ethers.parseEther('0'), // don't fund contract
- });
- await contract.waitForDeployment();
- const tx = await this.fhePayment.depositETH(this.signers.alice, { value: ethers.parseEther('0.001') });
- await tx.wait();
- const initialDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice);
- const txbis = await this.fhePayment.authorizeAllContracts(contract);
- await txbis.wait();
- const tx2 = await contract.mint(1000);
- const rcpt = await tx2.wait();
- const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n;
- const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE;
- const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice);
- const consumedFheGas = (initialDeposit - remainingDeposit) / effectiveFheGasPrice;
- expect(consumedFheGas).to.equal(188000n + 600n); // scalarFheAdd(euint64) + trivialEncrypt(euint64)
+ if (FHE_GASPRICE_NATIVE_RATIO !== 0n || MIN_FHE_GASPRICE !== 0n) {
+ // skip test if FHE gas price is set to 0
+ const contractFactory = await ethers.getContractFactory('EncryptedERC20');
+ const contract = await contractFactory.connect(this.signers.alice).deploy('Naraggara', 'NARA', {
+ value: ethers.parseEther('0'), // don't fund contract
+ });
+ await contract.waitForDeployment();
+ const tx = await this.fhePayment.depositETH(this.signers.alice, { value: ethers.parseEther('0.001') });
+ await tx.wait();
+ const initialDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice);
+ const txbis = await this.fhePayment.authorizeAllContracts(contract);
+ await txbis.wait();
+ const tx2 = await contract.mint(1000);
+ const rcpt = await tx2.wait();
+ const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n;
+ const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE;
+ const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice);
+ const consumedFheGas = (initialDeposit - remainingDeposit) / effectiveFheGasPrice;
+ expect(consumedFheGas).to.equal(188000n + 600n); // scalarFheAdd(euint64) + trivialEncrypt(euint64)
+ }
});
it('contract which is not funded cannot be used by depositor if he did not authorize all contracts nor whitelisted dapp contract', async function () {
- const contractFactory = await ethers.getContractFactory('EncryptedERC20');
- const contract = await contractFactory.connect(this.signers.alice).deploy('Naraggara', 'NARA', {
- value: ethers.parseEther('0'), // don't fund contract
- });
- await contract.waitForDeployment();
- const tx = await this.fhePayment.depositETH(this.signers.alice, { value: ethers.parseEther('0.001') });
- await tx.wait();
- const initialDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice);
- const txbis = await this.fhePayment.removeAuthorizationAllContracts();
- await txbis.wait();
- await expect(contract.mint(1000)).to.be.revertedWithCustomError(this.fhePayment, 'AccountNotEnoughFunded');
- const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice);
- expect(remainingDeposit).to.equal(initialDeposit);
+ if (FHE_GASPRICE_NATIVE_RATIO !== 0n || MIN_FHE_GASPRICE !== 0n) {
+ // skip test if FHE gas price is set to 0
+ const contractFactory = await ethers.getContractFactory('EncryptedERC20');
+ const contract = await contractFactory.connect(this.signers.alice).deploy('Naraggara', 'NARA', {
+ value: ethers.parseEther('0'), // don't fund contract
+ });
+ await contract.waitForDeployment();
+ const tx = await this.fhePayment.depositETH(this.signers.alice, { value: ethers.parseEther('0.001') });
+ await tx.wait();
+ const initialDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice);
+ const txbis = await this.fhePayment.removeAuthorizationAllContracts();
+ await txbis.wait();
+ await expect(contract.mint(1000)).to.be.revertedWithCustomError(this.fhePayment, 'AccountNotEnoughFunded');
+ const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice);
+ expect(remainingDeposit).to.equal(initialDeposit);
+ }
});
it('tx succeeds if under block fheGas limit', async function () {
- const contractFactory = await ethers.getContractFactory('PaymentLimit');
- const contract = await contractFactory.connect(this.signers.alice).deploy();
- await contract.waitForDeployment();
- const initialDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice);
- const txbis = await this.fhePayment.authorizeAllContracts();
- await txbis.wait();
- const tx2 = await contract.underBlockFHEGasLimit();
- const rcpt = await tx2.wait();
- const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n;
- const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE;
- const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice);
- const consumedFheGas = (initialDeposit - remainingDeposit) / effectiveFheGasPrice;
- expect(consumedFheGas).to.equal(15n * 641000n + 2n * 600n); // 15*FheMul(euint64) + 2*trivialEncrypt(euint64)
+ if (FHE_GASPRICE_NATIVE_RATIO !== 0n || MIN_FHE_GASPRICE !== 0n) {
+ // skip test if FHE gas price is set to 0
+ const contractFactory = await ethers.getContractFactory('PaymentLimit');
+ const contract = await contractFactory.connect(this.signers.alice).deploy();
+ await contract.waitForDeployment();
+ const initialDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice);
+ const txbis = await this.fhePayment.authorizeAllContracts();
+ await txbis.wait();
+ const tx2 = await contract.underBlockFHEGasLimit();
+ const rcpt = await tx2.wait();
+ const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n;
+ const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE;
+ const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice);
+ const consumedFheGas = (initialDeposit - remainingDeposit) / effectiveFheGasPrice;
+ expect(consumedFheGas).to.equal(15n * 641000n + 2n * 600n); // 15*FheMul(euint64) + 2*trivialEncrypt(euint64)
+ }
});
it('tx reverts if above block fheGas limit', async function () {
@@ -121,132 +139,144 @@ describe('TestFHEPayment', function () {
});
it('a smart account becomes spender by calling becomeTransientSpender', async function () {
- const contractFactory = await ethers.getContractFactory('SmartAccount');
- const smartAccount = await contractFactory.connect(this.signers.bob).deploy();
- await smartAccount.waitForDeployment();
- const tx = await this.fhePayment
- .connect(this.signers.bob)
- .depositETH(await smartAccount.getAddress(), { value: ethers.parseEther('0.001') });
- await tx.wait();
-
- const initialDeposit = await this.fhePayment.getAvailableDepositsETH(await smartAccount.getAddress());
-
- const contractFactory2 = await ethers.getContractFactory('PaymentLimit');
- const contract = await contractFactory2.connect(this.signers.alice).deploy();
- await contract.waitForDeployment();
+ if (FHE_GASPRICE_NATIVE_RATIO !== 0n || MIN_FHE_GASPRICE !== 0n) {
+ // skip test if FHE gas price is set to 0
+ const contractFactory = await ethers.getContractFactory('SmartAccount');
+ const smartAccount = await contractFactory.connect(this.signers.bob).deploy();
+ await smartAccount.waitForDeployment();
+ const tx = await this.fhePayment
+ .connect(this.signers.bob)
+ .depositETH(await smartAccount.getAddress(), { value: ethers.parseEther('0.001') });
+ await tx.wait();
+
+ const initialDeposit = await this.fhePayment.getAvailableDepositsETH(await smartAccount.getAddress());
+
+ const contractFactory2 = await ethers.getContractFactory('PaymentLimit');
+ const contract = await contractFactory2.connect(this.signers.alice).deploy();
+ await contract.waitForDeployment();
+
+ const allowTx = [
+ {
+ target: await this.fhePayment.getAddress(),
+ data: this.fhePayment.interface.encodeFunctionData('authorizeAllContracts'),
+ value: 0,
+ },
+ ];
- const allowTx = [
- {
- target: await this.fhePayment.getAddress(),
- data: this.fhePayment.interface.encodeFunctionData('authorizeAllContracts'),
- value: 0,
- },
- ];
-
- const txSmartAllow = await smartAccount.connect(this.signers.bob).executeBatch(allowTx);
- await txSmartAllow.wait();
-
- const FHETx = [
- {
- target: await this.fhePayment.getAddress(),
- data: this.fhePayment.interface.encodeFunctionData('becomeTransientSpender'),
- value: 0,
- },
- {
- target: await contract.getAddress(),
- data: contract.interface.encodeFunctionData('underBlockFHEGasLimit'),
- value: 0,
- },
- ];
-
- // Execute the batched transaction
- const txSmartFHE = await smartAccount.connect(this.signers.bob).executeBatch(FHETx);
-
- const rcpt = await txSmartFHE.wait();
- const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n;
- const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE;
- const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(await smartAccount.getAddress());
- const consumedFheGas = (initialDeposit - remainingDeposit) / effectiveFheGasPrice;
- expect(consumedFheGas).to.equal(15n * 641000n + 2n * 600n); // 15*FheMul(euint64) + 2*trivialEncrypt(euint64)
+ const txSmartAllow = await smartAccount.connect(this.signers.bob).executeBatch(allowTx);
+ await txSmartAllow.wait();
+
+ const FHETx = [
+ {
+ target: await this.fhePayment.getAddress(),
+ data: this.fhePayment.interface.encodeFunctionData('becomeTransientSpender'),
+ value: 0,
+ },
+ {
+ target: await contract.getAddress(),
+ data: contract.interface.encodeFunctionData('underBlockFHEGasLimit'),
+ value: 0,
+ },
+ ];
+
+ // Execute the batched transaction
+ const txSmartFHE = await smartAccount.connect(this.signers.bob).executeBatch(FHETx);
+
+ const rcpt = await txSmartFHE.wait();
+ const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n;
+ const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE;
+ const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(await smartAccount.getAddress());
+ const consumedFheGas = (initialDeposit - remainingDeposit) / effectiveFheGasPrice;
+ expect(consumedFheGas).to.equal(15n * 641000n + 2n * 600n); // 15*FheMul(euint64) + 2*trivialEncrypt(euint64)
+ }
});
it('batching a user-paid tx with a dapp-sponsored tx via a smart account', async function () {
- const contractFactory = await ethers.getContractFactory('SmartAccount');
- const smartAccount = await contractFactory.connect(this.signers.bob).deploy();
- await smartAccount.waitForDeployment();
- const tx = await this.fhePayment
- .connect(this.signers.bob)
- .depositETH(await smartAccount.getAddress(), { value: ethers.parseEther('0.001') });
- await tx.wait();
-
- const contractFactory2 = await ethers.getContractFactory('PaymentLimit');
- const contract = await contractFactory2.connect(this.signers.alice).deploy(); // non-sponsored dApp
- await contract.waitForDeployment();
+ if (FHE_GASPRICE_NATIVE_RATIO !== 0n || MIN_FHE_GASPRICE !== 0n) {
+ // skip test if FHE gas price is set to 0
+ const contractFactory = await ethers.getContractFactory('SmartAccount');
+ const smartAccount = await contractFactory.connect(this.signers.bob).deploy();
+ await smartAccount.waitForDeployment();
+ const tx = await this.fhePayment
+ .connect(this.signers.bob)
+ .depositETH(await smartAccount.getAddress(), { value: ethers.parseEther('0.001') });
+ await tx.wait();
+
+ const contractFactory2 = await ethers.getContractFactory('PaymentLimit');
+ const contract = await contractFactory2.connect(this.signers.alice).deploy(); // non-sponsored dApp
+ await contract.waitForDeployment();
+
+ const contract2 = await contractFactory2
+ .connect(this.signers.alice)
+ .deploy({ value: ethers.parseEther('0.001') }); // sponsored dApp
+ await contract2.waitForDeployment();
+
+ const initialDepositSmartAccount = await this.fhePayment.getAvailableDepositsETH(await smartAccount.getAddress());
+ const initialDepositSponsoredDapp = await this.fhePayment.getAvailableDepositsETH(await contract2.getAddress());
+
+ const allowTx = [
+ {
+ target: await this.fhePayment.getAddress(),
+ data: this.fhePayment.interface.encodeFunctionData('authorizeAllContracts'),
+ value: 0,
+ },
+ ];
+
+ const txSmartAllow = await smartAccount.connect(this.signers.bob).executeBatch(allowTx);
+ await txSmartAllow.wait();
+
+ const FHETx = [
+ {
+ target: await this.fhePayment.getAddress(),
+ data: this.fhePayment.interface.encodeFunctionData('becomeTransientSpender'),
+ value: 0,
+ },
+ {
+ target: await contract.getAddress(),
+ data: contract.interface.encodeFunctionData('wayunderBlockFHEGasLimit'),
+ value: 0,
+ },
+ {
+ target: await this.fhePayment.getAddress(),
+ data: this.fhePayment.interface.encodeFunctionData('stopBeingTransientSpender'),
+ value: 0,
+ },
+ {
+ target: await contract2.getAddress(),
+ data: contract2.interface.encodeFunctionData('wayunderBlockFHEGasLimit'),
+ value: 0,
+ },
+ ];
+
+ // Execute the batched transaction
+ const txSmartFHE = await smartAccount.connect(this.signers.bob).executeBatch(FHETx);
+
+ const rcpt = await txSmartFHE.wait();
+ const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n;
+ const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE;
+ const remainingDepositSmartAccount = await this.fhePayment.getAvailableDepositsETH(
+ await smartAccount.getAddress(),
+ );
+ const remainingDepositSponsoredDapp = await this.fhePayment.getAvailableDepositsETH(await contract2.getAddress());
- const contract2 = await contractFactory2.connect(this.signers.alice).deploy({ value: ethers.parseEther('0.001') }); // sponsored dApp
- await contract2.waitForDeployment();
-
- const initialDepositSmartAccount = await this.fhePayment.getAvailableDepositsETH(await smartAccount.getAddress());
- const initialDepositSponsoredDapp = await this.fhePayment.getAvailableDepositsETH(await contract2.getAddress());
-
- const allowTx = [
- {
- target: await this.fhePayment.getAddress(),
- data: this.fhePayment.interface.encodeFunctionData('authorizeAllContracts'),
- value: 0,
- },
- ];
-
- const txSmartAllow = await smartAccount.connect(this.signers.bob).executeBatch(allowTx);
- await txSmartAllow.wait();
-
- const FHETx = [
- {
- target: await this.fhePayment.getAddress(),
- data: this.fhePayment.interface.encodeFunctionData('becomeTransientSpender'),
- value: 0,
- },
- {
- target: await contract.getAddress(),
- data: contract.interface.encodeFunctionData('wayunderBlockFHEGasLimit'),
- value: 0,
- },
- {
- target: await this.fhePayment.getAddress(),
- data: this.fhePayment.interface.encodeFunctionData('stopBeingTransientSpender'),
- value: 0,
- },
- {
- target: await contract2.getAddress(),
- data: contract2.interface.encodeFunctionData('wayunderBlockFHEGasLimit'),
- value: 0,
- },
- ];
-
- // Execute the batched transaction
- const txSmartFHE = await smartAccount.connect(this.signers.bob).executeBatch(FHETx);
-
- const rcpt = await txSmartFHE.wait();
- const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n;
- const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE;
- const remainingDepositSmartAccount = await this.fhePayment.getAvailableDepositsETH(await smartAccount.getAddress());
- const remainingDepositSponsoredDapp = await this.fhePayment.getAvailableDepositsETH(await contract2.getAddress());
-
- const consumedFheGasSmartAccount =
- (initialDepositSmartAccount - remainingDepositSmartAccount) / effectiveFheGasPrice;
- expect(consumedFheGasSmartAccount).to.equal(3n * 641000n + 2n * 600n); // 3*FheMul(euint64) + 2*trivialEncrypt(euint64)
- const consumedFheGasSponsoredDapp =
- (initialDepositSponsoredDapp - remainingDepositSponsoredDapp) / effectiveFheGasPrice;
- expect(consumedFheGasSponsoredDapp).to.equal(3n * 641000n + 2n * 600n); // 3*FheMul(euint64) + 2*trivialEncrypt(euint64)
+ const consumedFheGasSmartAccount =
+ (initialDepositSmartAccount - remainingDepositSmartAccount) / effectiveFheGasPrice;
+ expect(consumedFheGasSmartAccount).to.equal(3n * 641000n + 2n * 600n); // 3*FheMul(euint64) + 2*trivialEncrypt(euint64)
+ const consumedFheGasSponsoredDapp =
+ (initialDepositSponsoredDapp - remainingDepositSponsoredDapp) / effectiveFheGasPrice;
+ expect(consumedFheGasSponsoredDapp).to.equal(3n * 641000n + 2n * 600n); // 3*FheMul(euint64) + 2*trivialEncrypt(euint64)
+ }
});
it('user can withdraw his unburnt deposited funds', async function () {
- const depositValue = await this.fhePayment.getAvailableDepositsETH(this.signers.alice);
- expect(depositValue).to.be.greaterThan(0);
- const balBobBefore = await ethers.provider.getBalance(this.signers.bob);
- const tx = await this.fhePayment.withdrawETH(depositValue, this.signers.bob);
- await tx.wait();
- const balBobAfter = await ethers.provider.getBalance(this.signers.bob);
- expect(balBobAfter - balBobBefore).to.equal(depositValue);
+ if (FHE_GASPRICE_NATIVE_RATIO !== 0n || MIN_FHE_GASPRICE !== 0n) {
+ const depositValue = await this.fhePayment.getAvailableDepositsETH(this.signers.alice);
+ expect(depositValue).to.be.greaterThan(0);
+ const balBobBefore = await ethers.provider.getBalance(this.signers.bob);
+ const tx = await this.fhePayment.withdrawETH(depositValue, this.signers.bob);
+ await tx.wait();
+ const balBobAfter = await ethers.provider.getBalance(this.signers.bob);
+ expect(balBobAfter - balBobBefore).to.equal(depositValue);
+ }
});
});
diff --git a/test/rand/Rand.fixture.ts b/test/rand/Rand.fixture.ts
index 2276f1af..c4e5e5f6 100644
--- a/test/rand/Rand.fixture.ts
+++ b/test/rand/Rand.fixture.ts
@@ -7,9 +7,7 @@ export async function deployRandFixture(): Promise {
const signers = await getSigners();
const contractFactory = await ethers.getContractFactory('Rand');
- const contract = await contractFactory.connect(signers.alice).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(signers.alice).deploy();
await contract.waitForDeployment();
return contract;
diff --git a/test/reencryption/reencryption.ts b/test/reencryption/reencryption.ts
index 53be9906..4b6ce6a1 100644
--- a/test/reencryption/reencryption.ts
+++ b/test/reencryption/reencryption.ts
@@ -12,9 +12,7 @@ describe('Reencryption', function () {
this.instances = await createInstances(this.signers);
const contractFactory = await ethers.getContractFactory('Reencrypt');
- this.contract = await contractFactory.connect(this.signers.alice).deploy({
- value: ethers.parseEther('0.001'),
- });
+ this.contract = await contractFactory.connect(this.signers.alice).deploy();
this.contractAddress = await this.contract.getAddress();
this.instances = await createInstances(this.signers);
diff --git a/test/tfheOperations/manual.ts b/test/tfheOperations/manual.ts
index c9f37698..d8e751a1 100644
--- a/test/tfheOperations/manual.ts
+++ b/test/tfheOperations/manual.ts
@@ -20,9 +20,7 @@ async function deployTfheManualTestFixture(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHEManualTestSuite');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
diff --git a/test/tfheOperations/tfheOperations1.ts b/test/tfheOperations/tfheOperations1.ts
index 00af7d06..ecd18ae7 100644
--- a/test/tfheOperations/tfheOperations1.ts
+++ b/test/tfheOperations/tfheOperations1.ts
@@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite1');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite2');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite3');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite4');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite5');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite6');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
diff --git a/test/tfheOperations/tfheOperations10.ts b/test/tfheOperations/tfheOperations10.ts
index 8aa89960..963f198c 100644
--- a/test/tfheOperations/tfheOperations10.ts
+++ b/test/tfheOperations/tfheOperations10.ts
@@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite1');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite2');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite3');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite4');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite5');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite6');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
diff --git a/test/tfheOperations/tfheOperations11.ts b/test/tfheOperations/tfheOperations11.ts
index 011aa1f5..e1c19134 100644
--- a/test/tfheOperations/tfheOperations11.ts
+++ b/test/tfheOperations/tfheOperations11.ts
@@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite1');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite2');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite3');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite4');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite5');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite6');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
diff --git a/test/tfheOperations/tfheOperations12.ts b/test/tfheOperations/tfheOperations12.ts
index 5a6292ef..9a753ae6 100644
--- a/test/tfheOperations/tfheOperations12.ts
+++ b/test/tfheOperations/tfheOperations12.ts
@@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite1');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite2');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite3');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite4');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite5');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite6');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
diff --git a/test/tfheOperations/tfheOperations2.ts b/test/tfheOperations/tfheOperations2.ts
index ea6a13fc..6b8b15fe 100644
--- a/test/tfheOperations/tfheOperations2.ts
+++ b/test/tfheOperations/tfheOperations2.ts
@@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite1');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite2');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite3');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite4');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite5');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite6');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
diff --git a/test/tfheOperations/tfheOperations3.ts b/test/tfheOperations/tfheOperations3.ts
index 9baada84..8fd24457 100644
--- a/test/tfheOperations/tfheOperations3.ts
+++ b/test/tfheOperations/tfheOperations3.ts
@@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite1');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite2');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite3');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite4');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite5');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite6');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
diff --git a/test/tfheOperations/tfheOperations4.ts b/test/tfheOperations/tfheOperations4.ts
index eebad653..3380044a 100644
--- a/test/tfheOperations/tfheOperations4.ts
+++ b/test/tfheOperations/tfheOperations4.ts
@@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite1');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite2');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite3');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite4');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite5');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite6');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
diff --git a/test/tfheOperations/tfheOperations5.ts b/test/tfheOperations/tfheOperations5.ts
index 2da996ca..652b9c57 100644
--- a/test/tfheOperations/tfheOperations5.ts
+++ b/test/tfheOperations/tfheOperations5.ts
@@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite1');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite2');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite3');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite4');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite5');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite6');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
diff --git a/test/tfheOperations/tfheOperations6.ts b/test/tfheOperations/tfheOperations6.ts
index ee89b1ce..5f4ec0a2 100644
--- a/test/tfheOperations/tfheOperations6.ts
+++ b/test/tfheOperations/tfheOperations6.ts
@@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite1');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite2');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite3');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite4');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite5');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite6');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
diff --git a/test/tfheOperations/tfheOperations7.ts b/test/tfheOperations/tfheOperations7.ts
index c62830e0..90f485ee 100644
--- a/test/tfheOperations/tfheOperations7.ts
+++ b/test/tfheOperations/tfheOperations7.ts
@@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite1');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite2');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite3');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite4');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite5');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite6');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
diff --git a/test/tfheOperations/tfheOperations8.ts b/test/tfheOperations/tfheOperations8.ts
index f57dac11..261e7412 100644
--- a/test/tfheOperations/tfheOperations8.ts
+++ b/test/tfheOperations/tfheOperations8.ts
@@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite1');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite2');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite3');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite4');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite5');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite6');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
diff --git a/test/tfheOperations/tfheOperations9.ts b/test/tfheOperations/tfheOperations9.ts
index cd37417b..4c9a30bc 100644
--- a/test/tfheOperations/tfheOperations9.ts
+++ b/test/tfheOperations/tfheOperations9.ts
@@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite1');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite2');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite3');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite4');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite5');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
@@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise {
const admin = signers.alice;
const contractFactory = await ethers.getContractFactory('TFHETestSuite6');
- const contract = await contractFactory.connect(admin).deploy({
- value: ethers.parseEther('0.001'),
- });
+ const contract = await contractFactory.connect(admin).deploy();
await contract.waitForDeployment();
return contract;
From 7b24a8c65954ca01d0fb75ecfef0cac0f4496f6c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Fri, 27 Sep 2024 16:07:44 +0200
Subject: [PATCH 07/51] chore: removed useless file
---
codegen/main.ts | 1 -
codegen/payments.ts | 2 +-
lib/FHEPayment.sol | 2 +-
lib/FhevmLib.sol | 13 -------------
4 files changed, 2 insertions(+), 16 deletions(-)
delete mode 100644 lib/FhevmLib.sol
diff --git a/codegen/main.ts b/codegen/main.ts
index 236c7179..241c6445 100644
--- a/codegen/main.ts
+++ b/codegen/main.ts
@@ -16,7 +16,6 @@ function generateAllFiles() {
const ovShards = testgen.splitOverloadsToShards(overloads);
writeFileSync('lib/Impl.sol', t.implSol(context, operators));
writeFileSync('lib/TFHE.sol', tfheSolSource);
- writeFileSync('lib/FhevmLib.sol', t.fhevmLibSol(operators));
writeFileSync('lib/FHEPayment.sol', generateFHEPayment(operatorsPrices));
writeFileSync('payment/Payment.sol', t.paymentSol());
mkdirSync('examples/tests', { recursive: true });
diff --git a/codegen/payments.ts b/codegen/payments.ts
index 647b5bbd..de8e96e9 100644
--- a/codegen/payments.ts
+++ b/codegen/payments.ts
@@ -39,7 +39,7 @@ export function generateFHEPayment(priceData: PriceData): string {
uint256 private constant PATCH_VERSION = 0;
address public constant tfheExecutorAddress = tfheExecutorAdd;
- uint256 private constant FHE_GAS_BLOCKLIMIT = 10_000_000; //
+ uint256 private constant FHE_GAS_BLOCKLIMIT = 10_000_000;
uint256 private constant MIN_FHE_GASPRICE = 0; // eg: 10_000_000 means a minimum of 0.01 Gwei
uint256 private constant FHE_GASPRICE_NATIVE_RATIO = 0; // eg: 1000 means fhe gas price is set to 0.1% of native gas price (if above minimum)
diff --git a/lib/FHEPayment.sol b/lib/FHEPayment.sol
index 1d35dd3a..d0e6d3dc 100644
--- a/lib/FHEPayment.sol
+++ b/lib/FHEPayment.sol
@@ -29,7 +29,7 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
uint256 private constant PATCH_VERSION = 0;
address public constant tfheExecutorAddress = tfheExecutorAdd;
- uint256 private constant FHE_GAS_BLOCKLIMIT = 10_000_000; //
+ uint256 private constant FHE_GAS_BLOCKLIMIT = 10_000_000;
uint256 private constant MIN_FHE_GASPRICE = 0; // eg: 10_000_000 means a minimum of 0.01 Gwei
uint256 private constant FHE_GASPRICE_NATIVE_RATIO = 0; // eg: 1000 means fhe gas price is set to 0.1% of native gas price (if above minimum)
diff --git a/lib/FhevmLib.sol b/lib/FhevmLib.sol
deleted file mode 100644
index cef5a5d8..00000000
--- a/lib/FhevmLib.sol
+++ /dev/null
@@ -1,13 +0,0 @@
-// SPDX-License-Identifier: BSD-3-Clause-Clear
-
-pragma solidity ^0.8.24;
-
-interface FhevmLib {
- function verifyCiphertext(
- bytes32 inputHandle,
- address callerAddress,
- address contractAddress,
- bytes memory inputProof,
- bytes1 inputType
- ) external pure returns (uint256 result);
-}
From b8e90c529ce6cb3a45d32229c20d6ee650deb03f Mon Sep 17 00:00:00 2001
From: Aurora Poppyseed <30662672+poppyseedDev@users.noreply.github.com>
Date: Tue, 1 Oct 2024 18:42:38 +0900
Subject: [PATCH 08/51] Update decrypt.md - typo
Related to PR #542
---
docs/guides/decrypt.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/guides/decrypt.md b/docs/guides/decrypt.md
index 6d3c3153..04bbdc41 100644
--- a/docs/guides/decrypt.md
+++ b/docs/guides/decrypt.md
@@ -95,7 +95,7 @@ function addParamsEUint32(uint256 requestID, euint32 _euint32) internal;
function addParamsEUint64(uint256 requestID, euint64 _euint64) internal;
-function addParamsEAddress(uint256 requestID, address _eaddress) internal;
+function addParamsEAddress(uint256 requestID, eaddress _eaddress) internal;
function addParamsAddress(uint256 requestID, address _address) internal;
From d9aea381bb5d2333ae8e6aec689b30f240cee37e Mon Sep 17 00:00:00 2001
From: Aurora Poppyseed
Date: Tue, 1 Oct 2024 18:42:51 +0800
Subject: [PATCH 09/51] added issue templates for bug report fhevm, fhevmjs,
docs, custom report, unclear docs and feature request
---
.github/ISSUE_TEMPLATE/bug_report_fhevm.md | 54 +++++++++++++++++++
.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md | 47 ++++++++++++++++
.github/ISSUE_TEMPLATE/custom.md | 9 ++++
.github/ISSUE_TEMPLATE/docs_bug_report.md | 33 ++++++++++++
.github/ISSUE_TEMPLATE/docs_unclear_report.md | 42 +++++++++++++++
.github/ISSUE_TEMPLATE/feature-request.md | 16 ++++++
docs/fundamentals/types/README.md | 4 +-
7 files changed, 203 insertions(+), 2 deletions(-)
create mode 100644 .github/ISSUE_TEMPLATE/bug_report_fhevm.md
create mode 100644 .github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
create mode 100644 .github/ISSUE_TEMPLATE/custom.md
create mode 100644 .github/ISSUE_TEMPLATE/docs_bug_report.md
create mode 100644 .github/ISSUE_TEMPLATE/docs_unclear_report.md
create mode 100644 .github/ISSUE_TEMPLATE/feature-request.md
diff --git a/.github/ISSUE_TEMPLATE/bug_report_fhevm.md b/.github/ISSUE_TEMPLATE/bug_report_fhevm.md
new file mode 100644
index 00000000..74f5aced
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report_fhevm.md
@@ -0,0 +1,54 @@
+---
+name: Smart Contracts Bug Report
+about: Use this template to report issues encountered with confidential smart contracts on the FHEVM.
+title: '[BUG] - [Brief Description of Issue]'
+labels: bug
+assignees: ''
+---
+
+### **Description**
+Provide a clear and detailed description of the bug. Specify which part of the contract (e.g., encryption, decryption, state updates, branching logic) is malfunctioning and any observed anomalies in the contract’s behavior.
+
+### **Steps to Reproduce**
+Please include a step-by-step guide to replicate the issue:
+
+1. **Smart Contract Version**: Specify the version or branch being tested (e.g., v0.0.0, latest Devnet branch).
+2. **Setup**: Outline the environment configuration (e.g., Docker node, Devnet connection, Mocked mode).
+3. **Contract Deployment**: Provide details of the deployed contract, including key initial state values and encryption parameters.
+4. **Action Sequence**: Describe the specific transactions or function calls leading to the error.
+5. **Observed Behavior**: Highlight any transaction failures, unexpected decryption results, or anomalous state changes.
+
+### **Expected Behavior**
+Describe what you expected to happen (e.g., successful decryption of the input, valid output from the encrypted function, no gas estimation errors).
+
+### **Screenshots / Logs**
+Include screenshots, relevant logs, or traces if available, particularly for encrypted computations or gateway interactions.
+
+### **Smart Contract Code Snippet (Optional)**
+If applicable, provide a minimal reproducible example of the smart contract code highlighting the part where the issue occurs:
+
+```solidity
+// Example
+contract Counter {
+ uint32 value;
+ function increment() public {
+ value += 1;
+ }
+
+ function currentValue() public view returns (uint32) {
+ return value;
+ }
+}
+```
+
+### **Environment Information**
+Fill in the relevant environment details where the issue was observed:
+
+- **Operating System**: [e.g., Ubuntu 20.04, Windows 10]
+- **Browser**: [e.g., Chrome v90, Safari v14]
+- **FHEVM Version**: [e.g., v1.0.0]
+- **Tooling**: [Hardhat, Remix, FHEVM CLI]
+- **Devnet / Local Node Configuration**:
+ - Chain ID: [e.g., 9000]
+ - RPC URL: [e.g., `https://devnet.zama.ai`]
+ - Faucet Usage: [Yes/No]
diff --git a/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md b/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
new file mode 100644
index 00000000..2898ef83
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
@@ -0,0 +1,47 @@
+---
+name: `fhevmjs` Bug report
+about: Use this template to report issues encountered while using the `fhevmjs` library for interacting with fhEVM smart contracts.
+title: '[BUG]'
+labels: bug
+assignees: ''
+---
+
+### **Description**
+Provide a clear and detailed description of the issue encountered. Include relevant context such as the operation that failed (e.g., encryption, decryption, reencryption, proof verification), error messages, and unexpected outputs.
+
+### **Steps to Reproduce**
+Please list all the necessary steps to reproduce the issue:
+
+1. **Environment Setup**: Specify how `fhEVMjs` is configured (e.g., Node.js, browser-based application, frontend framework like React/Vue).
+2. **Library Version**: State the exact `fhEVMjs` version (e.g., `v0.2.1`, `main` branch).
+3. **Smart Contract Interaction**: If applicable, provide the exact method calls and arguments used in the interaction:
+ ```javascript
+ const encryptedBalance = await instance.balanceOf(userAddress);
+ ```
+4. **Observed Behavior**: Describe any anomalies, errors, or exceptions that were thrown. Provide stack traces if available.
+
+### **Expected Behavior**
+A clear and concise description of the expected behavior (e.g., successful encryption of parameters, correct reencryption result, accurate balance retrieval).
+
+### **Screenshots / Logs**
+If applicable, provide screenshots or logs that capture the issue, particularly during encryption, reencryption, or smart contract interactions. Include any console errors, warnings, or unexpected outputs.
+
+### **Environment Information**
+Fill in the relevant environment details where the issue was observed:
+
+- **Browser**: [e.g., Chrome v90, Firefox v88]
+- **Node.js Version**: [e.g., `v14.17.0`]
+- **`fhEVMjs` Version**: [e.g., `v0.2.1`]
+- **Package Manager**: [npm, yarn, pnpm]
+- **Network Configuration**:
+ - **Chain ID**: [e.g., `9000`]
+ - **RPC URL**: [e.g., `https://devnet.zama.ai`]
+ - **Gateway URL**: [e.g., `https://gateway.devnet.zama.ai`]
+
+### **Steps Taken to Debug**
+Outline any steps you’ve taken to troubleshoot the issue (e.g., using mocked mode, enabling verbose logging, testing with a different environment or network).
+
+### **Resources / References**
+If applicable, include links to any related documentation or reference materials that may help us understand the context:
+
+By including these details, we can ensure a faster and more accurate resolution for your issue. Thank you for helping improve `fhEVMjs`!
diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md
new file mode 100644
index 00000000..769ff493
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/custom.md
@@ -0,0 +1,9 @@
+---
+name: Custom issue template
+about: Describe this issue template's purpose here.
+title: ''
+labels: ''
+assignees: ''
+---
+
+_Make a detailed description of your issue_
diff --git a/.github/ISSUE_TEMPLATE/docs_bug_report.md b/.github/ISSUE_TEMPLATE/docs_bug_report.md
new file mode 100644
index 00000000..da7af7e5
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/docs_bug_report.md
@@ -0,0 +1,33 @@
+---
+name: Documentation Bug Report
+about: Use this template to report issues, inconsistencies, or inaccuracies in our documentation.
+title: '[DOCS-BUG]'
+labels: bug documentation
+assignees: ''
+---
+
+### **Page Link**
+Please provide a link to the page where the issue is located:
+**URL**: '[https://docs.zama.ai/fhevm/___](https://docs.zama.ai/fhevm/___)'
+
+### **Description**
+Provide a clear and detailed description of the bug. Include any inconsistencies, typos, broken links, or missing information. For example:
+
+- Inaccurate technical explanations or missing prerequisites.
+- Deprecated code snippets or outdated references.
+- Formatting issues or broken links.
+
+### **Suggested Fix / Expected Behavior**
+(Optional) Describe what you expected the documentation to include or suggest the correct information. For example, provide a corrected code snippet, explanation, or a link to the correct resource.
+
+### **Screenshots / Logs**
+If applicable, provide screenshots, code snippets, or logs that clearly show the issue. Use annotations to highlight specific parts of the documentation that need attention.
+
+### **Impact Level**
+Choose the impact of the bug on the documentation quality and user experience:
+
+- **Critical**: Major error that could lead to incorrect implementation or misunderstanding.
+- **Moderate**: Somewhat misleading information, but unlikely to cause implementation issues.
+- **Minor**: Minor typo or aesthetic issue with no functional impact.
+
+By including these details, we can ensure a faster and more accurate resolution for your issue. Thank you for helping improve `fhEVM docs`!
diff --git a/.github/ISSUE_TEMPLATE/docs_unclear_report.md b/.github/ISSUE_TEMPLATE/docs_unclear_report.md
new file mode 100644
index 00000000..987f69c8
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/docs_unclear_report.md
@@ -0,0 +1,42 @@
+---
+name: Unclear Documentation Report
+about: Use this template to report sections of our documentation that are unclear, confusing, or require further explanation.
+title: '[DOCS-UNCLEAR]'
+labels: documentation
+assignees: ''
+---
+
+### **Page Link**
+Provide a link to the documentation page where the unclear content is located:
+**URL**: '[https://docs.zama.ai/fhevm/___](https://docs.zama.ai/fhevm/___)'
+
+### **Description of the Issue**
+Describe in detail what part of the documentation is unclear. For example:
+
+- Is there a lack of explanation for certain technical terms or concepts?
+- Are there missing examples for a complex function or feature?
+- Does the documentation assume prior knowledge that hasn't been introduced?
+
+### **What Would You Like Clarified?**
+Provide details on what you expected to understand better or where more explanation is needed. Include questions such as:
+
+- “Can you provide an example of this function in use?”
+- “What are the expected inputs and outputs for this operation?”
+- “Could you add a section explaining how this feature integrates with other components?”
+
+### **Suggestions for Improvement**
+(Optional) If you have suggestions for how the documentation can be made clearer, provide them here. For example:
+
+- “Adding a diagram would help clarify this process.”
+- “Please include code snippets showing both successful and unsuccessful cases.”
+- “Include a glossary for the FHE-specific terms used in this section.”
+
+### **Additional Context / Resources**
+(Optional) Add any other context or examples that may help clarify the issue. This might include:
+
+- Links to external resources that present the topic clearly.
+- Comparisons to similar documentation from other libraries or platforms.
+- Screenshots with annotations showing specific points of confusion.
+
+### **Screenshots / Logs**
+If applicable, provide screenshots or logs to help us understand what part of the documentation caused confusion.
diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md
new file mode 100644
index 00000000..278c16e0
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature-request.md
@@ -0,0 +1,16 @@
+---
+name: General feature request for FHEVM
+about: Suggest an idea for this project
+title: ''
+labels: enhancement
+assignees: ''
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Additional context**
+Add any other context or screenshots about the feature request here.
\ No newline at end of file
diff --git a/docs/fundamentals/types/README.md b/docs/fundamentals/types/README.md
index 00871b65..a7fd062d 100644
--- a/docs/fundamentals/types/README.md
+++ b/docs/fundamentals/types/README.md
@@ -50,9 +50,9 @@ ebool valueBool = TFHE.asEbool(value32);
```
## Contracting state variables
-When using encrypted types for state variables, you cannot use the `immutable` or `constant` keywords. This is because the compiler attempts to resolve the value of T`FHE.asEuintXX(yy)` during compilation, which is not feasible because `asEuintXX()` calls a precompiled contract.
+When using encrypted types for state variables, you cannot use the `immutable` or `constant` keywords. This is because the compiler attempts to resolve the value of `TFHE.asEuintXX(yy)` during compilation, which is not feasible because `asEuintXX()` calls a precompiled contract.
-To handle this, do not declare your encrypted state variables as `immutabl`e or `constant`. Instead, use the following methods to set your variables:
+To handle this, do not declare your encrypted state variables as `immutable` or `constant`. Instead, use the following methods to set your variables:
```solidity
From 228709a8a3cde0e9399f5f5b23df71396b1d4e70 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Tue, 1 Oct 2024 18:21:32 +0200
Subject: [PATCH 10/51] feat: moved input KMS sig checking in KMSVerifier
chore: refactored transient storage cleanup
chore: fixed input verifier revert message
---
gateway/GatewayContract.sol | 7 ++-
gateway/IKMSVerifier.sol | 2 +-
gateway/lib/Gateway.sol | 8 +++-
lib/InputVerifier.sol | 64 ++-----------------------
lib/KMSVerifier.sol | 82 +++++++++++++++++++++++++++------
test/fhevmjsMocked.ts | 6 +--
test/kmsVerifier/kmsVerifier.ts | 2 +-
7 files changed, 89 insertions(+), 82 deletions(-)
diff --git a/gateway/GatewayContract.sol b/gateway/GatewayContract.sol
index feea6014..485fc8e7 100644
--- a/gateway/GatewayContract.sol
+++ b/gateway/GatewayContract.sol
@@ -178,7 +178,12 @@ contract GatewayContract is UUPSUpgradeable, Ownable2StepUpgradeable {
) external payable virtual onlyRelayer {
GatewayContractStorage storage $ = _getGatewayContractStorage();
require(
- kmsVerifier.verifySignatures(aclAddress, $.decryptionRequests[requestID].cts, decryptedCts, signatures),
+ kmsVerifier.verifyDecryptionEIP712KMSSignatures(
+ aclAddress,
+ $.decryptionRequests[requestID].cts,
+ decryptedCts,
+ signatures
+ ),
"KMS signature verification failed"
);
require(!$.isFulfilled[requestID], "Request is already fulfilled");
diff --git a/gateway/IKMSVerifier.sol b/gateway/IKMSVerifier.sol
index ef2d1798..ad4f9048 100644
--- a/gateway/IKMSVerifier.sol
+++ b/gateway/IKMSVerifier.sol
@@ -3,7 +3,7 @@
pragma solidity ^0.8.24;
interface IKMSVerifier {
- function verifySignatures(
+ function verifyDecryptionEIP712KMSSignatures(
address aclAddress,
uint256[] memory handlesList,
bytes memory decryptedResult,
diff --git a/gateway/lib/Gateway.sol b/gateway/lib/Gateway.sol
index 2ccc1232..738db915 100644
--- a/gateway/lib/Gateway.sol
+++ b/gateway/lib/Gateway.sol
@@ -107,7 +107,13 @@ library Gateway {
calldatacopy(add(decryptedResult, 0x20), start, length) // Copy the relevant part of calldata to decryptedResult memory
}
FHEVMConfig.FHEVMConfigStruct storage $ = Impl.getFHEVMConfig();
- return IKMSVerifier($.KMSVerifierAddress).verifySignatures(aclAdd, handlesList, decryptedResult, signatures);
+ return
+ IKMSVerifier($.KMSVerifierAddress).verifyDecryptionEIP712KMSSignatures(
+ aclAdd,
+ handlesList,
+ decryptedResult,
+ signatures
+ );
}
function getSignedDataLength(uint256[] memory handlesList) private pure returns (uint256) {
diff --git a/lib/InputVerifier.sol b/lib/InputVerifier.sol
index fc402cf5..58b5efe2 100644
--- a/lib/InputVerifier.sol
+++ b/lib/InputVerifier.sol
@@ -26,13 +26,6 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad
address contractAddress;
}
- struct CiphertextVerificationForKMS {
- address aclAddress;
- bytes32 hashOfCiphertext;
- address userAddress;
- address contractAddress;
- }
-
/// @notice Handle version
uint8 public constant HANDLE_VERSION = 0;
@@ -44,10 +37,6 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad
bytes32 private constant CIPHERTEXTVERIFICATION_COPRO_TYPE_HASH =
keccak256(bytes(CIPHERTEXTVERIFICATION_COPRO_TYPE));
- string public constant CIPHERTEXTVERIFICATION_KMS_TYPE =
- "CiphertextVerificationForKMS(address aclAddress,bytes32 hashOfCiphertext,address userAddress,address contractAddress)";
- bytes32 private constant CIPHERTEXTVERIFICATION_KMS_TYPE_HASH = keccak256(bytes(CIPHERTEXTVERIFICATION_KMS_TYPE));
-
/// @notice Name of the contract
string private constant CONTRACT_NAME = "InputVerifier";
@@ -62,10 +51,6 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad
return CIPHERTEXTVERIFICATION_COPRO_TYPE;
}
- function get_CIPHERTEXTVERIFICATION_KMS_TYPE() public view virtual returns (string memory) {
- return CIPHERTEXTVERIFICATION_KMS_TYPE;
- }
-
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
@@ -166,12 +151,13 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad
signaturesKMS[j][i] = inputProof[99 + 32 * numHandles + 65 * j + i];
}
}
- CiphertextVerificationForKMS memory cvKMS;
+ KMSVerifier.CiphertextVerificationForKMS memory cvKMS;
cvKMS.aclAddress = context.aclAddress;
cvKMS.hashOfCiphertext = hashCT;
cvKMS.userAddress = context.userAddress;
cvKMS.contractAddress = context.contractAddress;
- verifyEIP712KMS(cvKMS, signaturesKMS);
+ bool kmsCheck = kmsVerifier.verifyInputEIP712KMSSignatures(cvKMS, signaturesKMS);
+ require(kmsCheck, "Not enough unique KMS input signatures");
}
cacheProof(cacheKey);
require(result == listHandles[indexHandle], "Wrong inputHandle");
@@ -193,33 +179,6 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad
require(signer == coprocessorAddress, "Coprocessor address mismatch");
}
- function verifyEIP712KMS(CiphertextVerificationForKMS memory cv, bytes[] memory signatures) internal virtual {
- uint256 numSignatures = signatures.length;
- require(numSignatures > 0, "No KMS signature provided");
- bytes32 digest = hashCiphertextVerificationForKMS(cv);
- uint256 threshold = kmsVerifier.getThreshold();
- require(numSignatures >= threshold, "At least threshold number of KMS signatures required");
- address[] memory recoveredSigners = new address[](numSignatures);
- uint256 uniqueValidCount;
- for (uint256 i; i < numSignatures; i++) {
- address signerRecovered = ECDSA.recover(digest, signatures[i]);
- require(kmsVerifier.isSigner(signerRecovered), "Recovered address is not one of KMS signers");
- if (!tload(signerRecovered)) {
- recoveredSigners[uniqueValidCount] = signerRecovered;
- uniqueValidCount++;
- tstore(signerRecovered, 1);
- }
- if (uniqueValidCount >= threshold) {
- for (uint256 j = 0; i < uniqueValidCount; i++) {
- /// @note : clearing transient storage for composability
- tstore(recoveredSigners[j], 0);
- }
- return;
- }
- }
- require(false, "Not enough unique KMS input signatures"); // if this line is reached, it means inputProof did not contain enough unique KMS signers signatures, so we revert
- }
-
function tstore(address location, uint256 value) internal virtual {
assembly {
tstore(location, value)
@@ -250,23 +209,6 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad
);
}
- function hashCiphertextVerificationForKMS(
- CiphertextVerificationForKMS memory CVkms
- ) internal view virtual returns (bytes32) {
- return
- _hashTypedDataV4(
- keccak256(
- abi.encode(
- CIPHERTEXTVERIFICATION_KMS_TYPE_HASH,
- CVkms.aclAddress,
- CVkms.hashOfCiphertext,
- CVkms.userAddress,
- CVkms.contractAddress
- )
- )
- );
- }
-
/// @notice recovers the signer's address from a `signature` and a `message` digest
/// @dev Utilizes ECDSA for actual address recovery
/// @param message The hash of the message that was signed
diff --git a/lib/KMSVerifier.sol b/lib/KMSVerifier.sol
index 8654a3d0..f8e46baa 100644
--- a/lib/KMSVerifier.sol
+++ b/lib/KMSVerifier.sol
@@ -19,10 +19,21 @@ contract KMSVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgradea
bytes decryptedResult;
}
+ struct CiphertextVerificationForKMS {
+ address aclAddress;
+ bytes32 hashOfCiphertext;
+ address userAddress;
+ address contractAddress;
+ }
+
string private constant DECRYPTIONRESULT_TYPE =
"DecryptionResult(address aclAddress,uint256[] handlesList,bytes decryptedResult)";
bytes32 private constant DECRYPTIONRESULT_TYPE_HASH = keccak256(bytes(DECRYPTIONRESULT_TYPE));
+ string public constant CIPHERTEXTVERIFICATION_KMS_TYPE =
+ "CiphertextVerificationForKMS(address aclAddress,bytes32 hashOfCiphertext,address userAddress,address contractAddress)";
+ bytes32 private constant CIPHERTEXTVERIFICATION_KMS_TYPE_HASH = keccak256(bytes(CIPHERTEXTVERIFICATION_KMS_TYPE));
+
/// @notice Name of the contract
string private constant CONTRACT_NAME = "KMSVerifier";
@@ -69,6 +80,10 @@ contract KMSVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgradea
return DECRYPTIONRESULT_TYPE;
}
+ function get_CIPHERTEXTVERIFICATION_KMS_TYPE() public view virtual returns (string memory) {
+ return CIPHERTEXTVERIFICATION_KMS_TYPE;
+ }
+
/// @notice Emitted when a signer is added
/// @param signer The address of the signer that was added
event SignerAdded(address indexed signer);
@@ -121,6 +136,23 @@ contract KMSVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgradea
);
}
+ function hashCiphertextVerificationForKMS(
+ CiphertextVerificationForKMS memory CVkms
+ ) internal view virtual returns (bytes32) {
+ return
+ _hashTypedDataV4(
+ keccak256(
+ abi.encode(
+ CIPHERTEXTVERIFICATION_KMS_TYPE_HASH,
+ CVkms.aclAddress,
+ CVkms.hashOfCiphertext,
+ CVkms.userAddress,
+ CVkms.contractAddress
+ )
+ )
+ );
+ }
+
/// @notice Removes an existing signer
/// @dev Only the owner can remove a signer
/// @param signer The address to be removed from signers
@@ -159,7 +191,7 @@ contract KMSVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgradea
/// @param decryptedResult A bytes array representing the abi-encoding of all requested decrypted values
/// @param signatures An array of signatures to verify
/// @return true if enough provided signatures are valid, false otherwise
- function verifySignatures(
+ function verifyDecryptionEIP712KMSSignatures(
address aclAddress,
uint256[] memory handlesList,
bytes memory decryptedResult,
@@ -169,39 +201,50 @@ contract KMSVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgradea
decRes.aclAddress = aclAddress;
decRes.handlesList = handlesList;
decRes.decryptedResult = decryptedResult;
- bytes32 message = hashDecryptionResult(decRes);
- return verifySignaturesDigest(message, signatures);
+ bytes32 digest = hashDecryptionResult(decRes);
+ return verifySignaturesDigest(digest, signatures);
+ }
+
+ /// @notice Verifies multiple signatures for a given CiphertextVerificationForKMS (user inputs)
+ /// @dev Calls verifySignaturesDigest internally;
+ /// @param cv The CiphertextVerificationForKMS struct for encrypted user inputs
+ /// @param signatures An array of signatures to verify
+ /// @return true if enough provided signatures are valid, false otherwise
+ function verifyInputEIP712KMSSignatures(
+ CiphertextVerificationForKMS memory cv,
+ bytes[] memory signatures
+ ) public virtual returns (bool) {
+ bytes32 digest = hashCiphertextVerificationForKMS(cv);
+ return verifySignaturesDigest(digest, signatures);
}
/// @notice Verifies multiple signatures for a given message at a certain threshold
/// @dev Calls verifySignature internally;
- /// @param message The hash of the message that was signed by all signers
+ /// @param digest The hash of the message that was signed by all signers
/// @param signatures An array of signatures to verify
/// @return true if enough provided signatures are valid, false otherwise
- function verifySignaturesDigest(bytes32 message, bytes[] memory signatures) internal virtual returns (bool) {
+ function verifySignaturesDigest(bytes32 digest, bytes[] memory signatures) internal virtual returns (bool) {
uint256 numSignatures = signatures.length;
require(numSignatures > 0, "KmsVerifier: no signatures provided");
- KMSVerifierStorage storage $ = _getKMSVerifierStorage();
- require(numSignatures >= $.threshold, "KmsVerifier: at least threshold number of signatures required");
+ uint256 threshold = getThreshold();
+ require(numSignatures >= threshold, "KmsVerifier: at least threshold number of signatures required");
address[] memory recoveredSigners = new address[](numSignatures);
uint256 uniqueValidCount;
for (uint256 i = 0; i < numSignatures; i++) {
- address signerRecovered = recoverSigner(message, signatures[i]);
- if ($.isSigner[signerRecovered]) {
+ address signerRecovered = recoverSigner(digest, signatures[i]);
+ if (isSigner(signerRecovered)) {
if (!tload(signerRecovered)) {
recoveredSigners[uniqueValidCount] = signerRecovered;
uniqueValidCount++;
tstore(signerRecovered, 1);
}
}
- if (uniqueValidCount >= $.threshold) {
- for (uint256 j = 0; i < uniqueValidCount; i++) {
- /// @note : clearing transient storage for composability
- tstore(recoveredSigners[j], 0);
- }
+ if (uniqueValidCount >= threshold) {
+ cleanTransientStorage(recoveredSigners, uniqueValidCount);
return true;
}
}
+ cleanTransientStorage(recoveredSigners, uniqueValidCount);
return false;
}
@@ -225,6 +268,17 @@ contract KMSVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgradea
}
}
+ /// @notice Cleans transient storage
+ /// @dev Important to keep composability in the context of account abstraction
+ /// @param keys An array of keys to cleanup from transient storage
+ /// @param maxIndex The biggest index to take into account from the array - assumed to be less or equal to keys.length
+ function cleanTransientStorage(address[] memory keys, uint256 maxIndex) internal virtual {
+ for (uint256 j = 0; j < maxIndex; j++) {
+ /// @note : clearing transient storage for composability
+ tstore(keys[j], 0);
+ }
+ }
+
/// @notice Getter for the name and version of the contract
/// @return string representing the name and the version of the contract
function getVersion() external pure virtual returns (string memory) {
diff --git a/test/fhevmjsMocked.ts b/test/fhevmjsMocked.ts
index 27644bc5..64928448 100644
--- a/test/fhevmjsMocked.ts
+++ b/test/fhevmjsMocked.ts
@@ -435,15 +435,15 @@ async function kmsSign(
contractAddress: string,
signer: Wallet,
): Promise {
- const inputAdd = dotenv.parse(fs.readFileSync('lib/.env.inputverifier')).INPUT_VERIFIER_CONTRACT_ADDRESS;
+ const kmsVerifierAdd = dotenv.parse(fs.readFileSync('lib/.env.kmsverifier')).KMS_VERIFIER_CONTRACT_ADDRESS;
const chainId = hre.__SOLIDITY_COVERAGE_RUNNING ? 31337 : network.config.chainId;
const aclAdd = dotenv.parse(fs.readFileSync('lib/.env.acl')).ACL_CONTRACT_ADDRESS;
const domain = {
- name: 'InputVerifier',
+ name: 'KMSVerifier',
version: '1',
chainId: chainId,
- verifyingContract: inputAdd,
+ verifyingContract: kmsVerifierAdd,
};
const types = {
diff --git a/test/kmsVerifier/kmsVerifier.ts b/test/kmsVerifier/kmsVerifier.ts
index a2ada6bb..1739c106 100644
--- a/test/kmsVerifier/kmsVerifier.ts
+++ b/test/kmsVerifier/kmsVerifier.ts
@@ -90,7 +90,7 @@ describe('KMSVerifier', function () {
contract2.requestMixedBytes256Trustless(encryptedAmount2.handles[0], encryptedAmount2.inputProof, {
gasLimit: 5_000_000,
}),
- ).to.revertedWith('At least threshold number of KMS signatures required'); // this should fail because in this case the InputVerifier received only one KMS signature (instead of at least 2);
+ ).to.revertedWith('KmsVerifier: at least threshold number of signatures required'); // this should fail because in this case the InputVerifier received only one KMS signature (instead of at least 2);
const cheatInputProof = encryptedAmount2.inputProof + encryptedAmount2.inputProof.slice(-130); // trying to cheat by repeating the first kms signer signature
const cheat = cheatInputProof.slice(0, 5) + '2' + cheatInputProof.slice(6);
From 9c26ac32bf94ce5c24b0be59eb8d60507530409d Mon Sep 17 00:00:00 2001
From: Aurora Poppyseed
Date: Thu, 3 Oct 2024 12:45:17 +0800
Subject: [PATCH 11/51] minimal changes
---
.github/ISSUE_TEMPLATE/bug_report_fhevm.md | 2 +-
.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md | 4 ++--
.github/ISSUE_TEMPLATE/custom.md | 9 ---------
.github/ISSUE_TEMPLATE/docs_bug_report.md | 4 ++--
.github/ISSUE_TEMPLATE/docs_unclear_report.md | 2 +-
docs/fundamentals/types/README.md | 4 ++--
6 files changed, 8 insertions(+), 17 deletions(-)
delete mode 100644 .github/ISSUE_TEMPLATE/custom.md
diff --git a/.github/ISSUE_TEMPLATE/bug_report_fhevm.md b/.github/ISSUE_TEMPLATE/bug_report_fhevm.md
index 74f5aced..54fab2e5 100644
--- a/.github/ISSUE_TEMPLATE/bug_report_fhevm.md
+++ b/.github/ISSUE_TEMPLATE/bug_report_fhevm.md
@@ -1,7 +1,7 @@
---
name: Smart Contracts Bug Report
about: Use this template to report issues encountered with confidential smart contracts on the FHEVM.
-title: '[BUG] - [Brief Description of Issue]'
+title: ''
labels: bug
assignees: ''
---
diff --git a/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md b/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
index 2898ef83..dd570d87 100644
--- a/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
+++ b/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
@@ -1,8 +1,8 @@
---
name: `fhevmjs` Bug report
about: Use this template to report issues encountered while using the `fhevmjs` library for interacting with fhEVM smart contracts.
-title: '[BUG]'
-labels: bug
+title: ''
+labels: bug, fhevmjs
assignees: ''
---
diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md
deleted file mode 100644
index 769ff493..00000000
--- a/.github/ISSUE_TEMPLATE/custom.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-name: Custom issue template
-about: Describe this issue template's purpose here.
-title: ''
-labels: ''
-assignees: ''
----
-
-_Make a detailed description of your issue_
diff --git a/.github/ISSUE_TEMPLATE/docs_bug_report.md b/.github/ISSUE_TEMPLATE/docs_bug_report.md
index da7af7e5..7f94ed89 100644
--- a/.github/ISSUE_TEMPLATE/docs_bug_report.md
+++ b/.github/ISSUE_TEMPLATE/docs_bug_report.md
@@ -1,8 +1,8 @@
---
name: Documentation Bug Report
about: Use this template to report issues, inconsistencies, or inaccuracies in our documentation.
-title: '[DOCS-BUG]'
-labels: bug documentation
+title: ''
+labels: bug, documentation
assignees: ''
---
diff --git a/.github/ISSUE_TEMPLATE/docs_unclear_report.md b/.github/ISSUE_TEMPLATE/docs_unclear_report.md
index 987f69c8..81e6429b 100644
--- a/.github/ISSUE_TEMPLATE/docs_unclear_report.md
+++ b/.github/ISSUE_TEMPLATE/docs_unclear_report.md
@@ -1,7 +1,7 @@
---
name: Unclear Documentation Report
about: Use this template to report sections of our documentation that are unclear, confusing, or require further explanation.
-title: '[DOCS-UNCLEAR]'
+title: ''
labels: documentation
assignees: ''
---
diff --git a/docs/fundamentals/types/README.md b/docs/fundamentals/types/README.md
index a7fd062d..00871b65 100644
--- a/docs/fundamentals/types/README.md
+++ b/docs/fundamentals/types/README.md
@@ -50,9 +50,9 @@ ebool valueBool = TFHE.asEbool(value32);
```
## Contracting state variables
-When using encrypted types for state variables, you cannot use the `immutable` or `constant` keywords. This is because the compiler attempts to resolve the value of `TFHE.asEuintXX(yy)` during compilation, which is not feasible because `asEuintXX()` calls a precompiled contract.
+When using encrypted types for state variables, you cannot use the `immutable` or `constant` keywords. This is because the compiler attempts to resolve the value of T`FHE.asEuintXX(yy)` during compilation, which is not feasible because `asEuintXX()` calls a precompiled contract.
-To handle this, do not declare your encrypted state variables as `immutable` or `constant`. Instead, use the following methods to set your variables:
+To handle this, do not declare your encrypted state variables as `immutabl`e or `constant`. Instead, use the following methods to set your variables:
```solidity
From e04a0eeb21047f03e19ed603bfb7a47f65a9a96a Mon Sep 17 00:00:00 2001
From: Aurora Poppyseed
Date: Thu, 3 Oct 2024 13:15:21 +0800
Subject: [PATCH 12/51] shortening how the issue is displayed
---
.github/ISSUE_TEMPLATE/bug_report_fhevm.md | 20 ++++-----
.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md | 30 +++++++-------
.github/ISSUE_TEMPLATE/docs_bug_report.md | 32 ++++++++++-----
.github/ISSUE_TEMPLATE/docs_unclear_report.md | 41 +++++++++++--------
4 files changed, 69 insertions(+), 54 deletions(-)
diff --git a/.github/ISSUE_TEMPLATE/bug_report_fhevm.md b/.github/ISSUE_TEMPLATE/bug_report_fhevm.md
index 54fab2e5..348cb0a0 100644
--- a/.github/ISSUE_TEMPLATE/bug_report_fhevm.md
+++ b/.github/ISSUE_TEMPLATE/bug_report_fhevm.md
@@ -7,16 +7,7 @@ assignees: ''
---
### **Description**
-Provide a clear and detailed description of the bug. Specify which part of the contract (e.g., encryption, decryption, state updates, branching logic) is malfunctioning and any observed anomalies in the contract’s behavior.
-
-### **Steps to Reproduce**
-Please include a step-by-step guide to replicate the issue:
-
-1. **Smart Contract Version**: Specify the version or branch being tested (e.g., v0.0.0, latest Devnet branch).
-2. **Setup**: Outline the environment configuration (e.g., Docker node, Devnet connection, Mocked mode).
-3. **Contract Deployment**: Provide details of the deployed contract, including key initial state values and encryption parameters.
-4. **Action Sequence**: Describe the specific transactions or function calls leading to the error.
-5. **Observed Behavior**: Highlight any transaction failures, unexpected decryption results, or anomalous state changes.
+Provide a clear and detailed description of the bug.
### **Expected Behavior**
Describe what you expected to happen (e.g., successful decryption of the input, valid output from the encrypted function, no gas estimation errors).
@@ -24,9 +15,13 @@ Describe what you expected to happen (e.g., successful decryption of the input,
### **Screenshots / Logs**
Include screenshots, relevant logs, or traces if available, particularly for encrypted computations or gateway interactions.
-### **Smart Contract Code Snippet (Optional)**
+### **Smart Contract Code Snippet**
If applicable, provide a minimal reproducible example of the smart contract code highlighting the part where the issue occurs:
+
+Example
+
+
```solidity
// Example
contract Counter {
@@ -40,6 +35,9 @@ contract Counter {
}
}
```
+
+
+
### **Environment Information**
Fill in the relevant environment details where the issue was observed:
diff --git a/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md b/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
index dd570d87..e0f7e0a0 100644
--- a/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
+++ b/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
@@ -7,29 +7,18 @@ assignees: ''
---
### **Description**
-Provide a clear and detailed description of the issue encountered. Include relevant context such as the operation that failed (e.g., encryption, decryption, reencryption, proof verification), error messages, and unexpected outputs.
-
-### **Steps to Reproduce**
-Please list all the necessary steps to reproduce the issue:
-
-1. **Environment Setup**: Specify how `fhEVMjs` is configured (e.g., Node.js, browser-based application, frontend framework like React/Vue).
-2. **Library Version**: State the exact `fhEVMjs` version (e.g., `v0.2.1`, `main` branch).
-3. **Smart Contract Interaction**: If applicable, provide the exact method calls and arguments used in the interaction:
- ```javascript
- const encryptedBalance = await instance.balanceOf(userAddress);
- ```
-4. **Observed Behavior**: Describe any anomalies, errors, or exceptions that were thrown. Provide stack traces if available.
+Provide a clear and detailed description of the issue encountered.
### **Expected Behavior**
A clear and concise description of the expected behavior (e.g., successful encryption of parameters, correct reencryption result, accurate balance retrieval).
### **Screenshots / Logs**
-If applicable, provide screenshots or logs that capture the issue, particularly during encryption, reencryption, or smart contract interactions. Include any console errors, warnings, or unexpected outputs.
+If applicable, provide screenshots or logs that capture the issue. Include any console errors, warnings, or unexpected outputs.
### **Environment Information**
Fill in the relevant environment details where the issue was observed:
-- **Browser**: [e.g., Chrome v90, Firefox v88]
+- **Browser**: [e.g., Chrome v90, Firefox v88]
- **Node.js Version**: [e.g., `v14.17.0`]
- **`fhEVMjs` Version**: [e.g., `v0.2.1`]
- **Package Manager**: [npm, yarn, pnpm]
@@ -44,4 +33,15 @@ Outline any steps you’ve taken to troubleshoot the issue (e.g., using mocked m
### **Resources / References**
If applicable, include links to any related documentation or reference materials that may help us understand the context:
-By including these details, we can ensure a faster and more accurate resolution for your issue. Thank you for helping improve `fhEVMjs`!
+Logs or output
+
+
+```console
+```
+
+
+
+
+---
+
+By including these details, we can ensure a faster and more accurate resolution for your issue. Thank you for helping improve `fhevmjs`!
diff --git a/.github/ISSUE_TEMPLATE/docs_bug_report.md b/.github/ISSUE_TEMPLATE/docs_bug_report.md
index 7f94ed89..c68273f4 100644
--- a/.github/ISSUE_TEMPLATE/docs_bug_report.md
+++ b/.github/ISSUE_TEMPLATE/docs_bug_report.md
@@ -11,23 +11,35 @@ Please provide a link to the page where the issue is located:
**URL**: '[https://docs.zama.ai/fhevm/___](https://docs.zama.ai/fhevm/___)'
### **Description**
-Provide a clear and detailed description of the bug. Include any inconsistencies, typos, broken links, or missing information. For example:
+Provide a clear and detailed description of the bug. Include any inconsistencies, typos, broken links, or missing information.
+
+
+For example:
+
+
Inaccurate technical explanations or missing prerequisites.
+ Deprecated code snippets or outdated references.
+ Formatting issues or broken links.
+
+
-- Inaccurate technical explanations or missing prerequisites.
-- Deprecated code snippets or outdated references.
-- Formatting issues or broken links.
### **Suggested Fix / Expected Behavior**
-(Optional) Describe what you expected the documentation to include or suggest the correct information. For example, provide a corrected code snippet, explanation, or a link to the correct resource.
+Describe what you expected the documentation to include or suggest the correct information. For example, provide a corrected code snippet, explanation, or a link to the correct resource.
### **Screenshots / Logs**
-If applicable, provide screenshots, code snippets, or logs that clearly show the issue. Use annotations to highlight specific parts of the documentation that need attention.
+If applicable, provide screenshots, code snippets, or logs that clearly show the issue.
### **Impact Level**
-Choose the impact of the bug on the documentation quality and user experience:
+Choose the impact of the bug on the documentation quality and user experience:
-- **Critical**: Major error that could lead to incorrect implementation or misunderstanding.
-- **Moderate**: Somewhat misleading information, but unlikely to cause implementation issues.
-- **Minor**: Minor typo or aesthetic issue with no functional impact.
+[Critical, Moderate, Minor]
+
+
Critical : Major error that could lead to incorrect implementation or misunderstanding.
+Moderate : Somewhat misleading information, but unlikely to cause implementation issues.
+Minor : Minor typo or aesthetic issue with no functional impact.
+
+
+
+---
By including these details, we can ensure a faster and more accurate resolution for your issue. Thank you for helping improve `fhEVM docs`!
diff --git a/.github/ISSUE_TEMPLATE/docs_unclear_report.md b/.github/ISSUE_TEMPLATE/docs_unclear_report.md
index 81e6429b..d8c2819c 100644
--- a/.github/ISSUE_TEMPLATE/docs_unclear_report.md
+++ b/.github/ISSUE_TEMPLATE/docs_unclear_report.md
@@ -11,32 +11,37 @@ Provide a link to the documentation page where the unclear content is located:
**URL**: '[https://docs.zama.ai/fhevm/___](https://docs.zama.ai/fhevm/___)'
### **Description of the Issue**
-Describe in detail what part of the documentation is unclear. For example:
+Describe in detail what part of the documentation is unclear.
-- Is there a lack of explanation for certain technical terms or concepts?
-- Are there missing examples for a complex function or feature?
-- Does the documentation assume prior knowledge that hasn't been introduced?
+For example:
+
+
Is there a lack of explanation for certain technical terms or concepts?
+ Are there missing examples for a complex function or feature?
+ Does the documentation assume prior knowledge that hasn't been introduced?
+
+
### **What Would You Like Clarified?**
-Provide details on what you expected to understand better or where more explanation is needed. Include questions such as:
+Provide details on what you expected to understand better or where more explanation is needed.
-- “Can you provide an example of this function in use?”
-- “What are the expected inputs and outputs for this operation?”
-- “Could you add a section explaining how this feature integrates with other components?”
+Include questions such as:
+
+
“Can you provide an example of this function in use?”
+ "What are the expected inputs and outputs for this operation?”
+ “Could you add a section explaining how this feature integrates with other components?”
+
+
### **Suggestions for Improvement**
(Optional) If you have suggestions for how the documentation can be made clearer, provide them here. For example:
-- “Adding a diagram would help clarify this process.”
-- “Please include code snippets showing both successful and unsuccessful cases.”
-- “Include a glossary for the FHE-specific terms used in this section.”
-
-### **Additional Context / Resources**
-(Optional) Add any other context or examples that may help clarify the issue. This might include:
-
-- Links to external resources that present the topic clearly.
-- Comparisons to similar documentation from other libraries or platforms.
-- Screenshots with annotations showing specific points of confusion.
+Include questions such as:
+
+
“Adding a diagram would help clarify this process.”
+ “Please include code snippets showing both successful and unsuccessful cases.”
+ “Include a glossary for the FHE-specific terms used in this section.”
+
+
### **Screenshots / Logs**
If applicable, provide screenshots or logs to help us understand what part of the documentation caused confusion.
From b737b6dc7e121411a295c16322f07da76aad9389 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Thu, 3 Oct 2024 12:17:16 +0200
Subject: [PATCH 13/51] feat: use dynamic lists in fhevmjsMocked
---
test/fhevmjsMocked.ts | 122 +++++++++++++++---------
test/fhevmjsTest/fhevmjsTest.ts | 79 +++++++++++++++
test/gatewayDecrypt/testAsyncDecrypt.ts | 14 +--
test/kmsVerifier/kmsVerifier.ts | 4 +-
test/reencryption/reencryption.ts | 4 +-
test/tfheOperations/manual.ts | 18 ++--
test/utils.ts | 15 ++-
7 files changed, 189 insertions(+), 67 deletions(-)
create mode 100644 test/fhevmjsTest/fhevmjsTest.ts
diff --git a/test/fhevmjsMocked.ts b/test/fhevmjsMocked.ts
index 64928448..5d90384a 100644
--- a/test/fhevmjsMocked.ts
+++ b/test/fhevmjsMocked.ts
@@ -1,4 +1,4 @@
-import { toBigIntLE } from 'bigint-buffer';
+import { toBigIntBE } from 'bigint-buffer';
import { toBufferBE } from 'bigint-buffer';
import crypto from 'crypto';
import dotenv from 'dotenv';
@@ -30,12 +30,14 @@ enum Types {
ebytes256,
}
+const sum = (arr: number[]) => arr.reduce((acc, val) => acc + val, 0);
+
function bytesToBigInt(byteArray: Uint8Array): bigint {
if (!byteArray || byteArray?.length === 0) {
return BigInt(0);
}
const buffer = Buffer.from(byteArray);
- const result = toBigIntLE(buffer);
+ const result = toBigIntBE(buffer);
return result;
}
@@ -50,37 +52,52 @@ function createUintToUint8ArrayFunction(numBits: number) {
let byteBuffer;
let totalBuffer;
- const padBuffer = numBytes <= 20 ? Buffer.alloc(20 - numBytes) : Buffer.alloc(0); // to fit it in an E160List
switch (numBits) {
- case 1:
+ case 2: // ebool takes 2 bits
byteBuffer = Buffer.from([Types.ebool]);
- totalBuffer = Buffer.concat([byteBuffer, combinedBuffer, padBuffer]);
+ totalBuffer = Buffer.concat([byteBuffer, combinedBuffer]);
break;
case 4:
byteBuffer = Buffer.from([Types.euint4]);
- totalBuffer = Buffer.concat([byteBuffer, combinedBuffer, padBuffer]);
+ totalBuffer = Buffer.concat([byteBuffer, combinedBuffer]);
break;
case 8:
byteBuffer = Buffer.from([Types.euint8]);
- totalBuffer = Buffer.concat([byteBuffer, combinedBuffer, padBuffer]);
+ totalBuffer = Buffer.concat([byteBuffer, combinedBuffer]);
break;
case 16:
byteBuffer = Buffer.from([Types.euint16]);
- totalBuffer = Buffer.concat([byteBuffer, combinedBuffer, padBuffer]);
+ totalBuffer = Buffer.concat([byteBuffer, combinedBuffer]);
break;
case 32:
byteBuffer = Buffer.from([Types.euint32]);
- totalBuffer = Buffer.concat([byteBuffer, combinedBuffer, padBuffer]);
+ totalBuffer = Buffer.concat([byteBuffer, combinedBuffer]);
break;
case 64:
byteBuffer = Buffer.from([Types.euint64]);
- totalBuffer = Buffer.concat([byteBuffer, combinedBuffer, padBuffer]);
+ totalBuffer = Buffer.concat([byteBuffer, combinedBuffer]);
+ break;
+ case 128:
+ byteBuffer = Buffer.from([Types.euint128]);
+ totalBuffer = Buffer.concat([byteBuffer, combinedBuffer]);
break;
case 160:
byteBuffer = Buffer.from([Types.eaddress]);
totalBuffer = Buffer.concat([byteBuffer, combinedBuffer]);
break;
+ case 256:
+ byteBuffer = Buffer.from([Types.euint256]);
+ totalBuffer = Buffer.concat([byteBuffer, combinedBuffer]);
+ break;
+ case 512:
+ byteBuffer = Buffer.from([Types.ebytes64]);
+ totalBuffer = Buffer.concat([byteBuffer, combinedBuffer]);
+ break;
+ case 1024:
+ byteBuffer = Buffer.from([Types.ebytes128]);
+ totalBuffer = Buffer.concat([byteBuffer, combinedBuffer]);
+ break;
case 2048:
byteBuffer = Buffer.from([Types.ebytes256]);
totalBuffer = Buffer.concat([byteBuffer, combinedBuffer]);
@@ -153,43 +170,57 @@ export const createEncryptedInputMocked = (contractAddress: string, userAddress:
if ((typeof value !== 'bigint' || typeof value !== 'number') && Number(value) > 1)
throw new Error('The value must be 1 or 0.');
values.push(BigInt(value));
- bits.push(1);
+ bits.push(2); // ebool takes 2 bits instead of one: only exception in TFHE-rs
+ if (sum(bits) > 2048) throw Error('Packing more than 2048 bits in a single input ciphertext is unsupported');
+ if (bits.length > 256) throw Error('Packing more than 256 variables in a single input ciphertext is unsupported');
return this;
},
add4(value: number | bigint) {
checkEncryptedValue(value, 4);
values.push(BigInt(value));
bits.push(4);
+ if (sum(bits) > 2048) throw Error('Packing more than 2048 bits in a single input ciphertext is unsupported');
+ if (bits.length > 256) throw Error('Packing more than 256 variables in a single input ciphertext is unsupported');
return this;
},
add8(value: number | bigint) {
checkEncryptedValue(value, 8);
values.push(BigInt(value));
bits.push(8);
+ if (sum(bits) > 2048) throw Error('Packing more than 2048 bits in a single input ciphertext is unsupported');
+ if (bits.length > 256) throw Error('Packing more than 256 variables in a single input ciphertext is unsupported');
return this;
},
add16(value: number | bigint) {
checkEncryptedValue(value, 16);
values.push(BigInt(value));
bits.push(16);
+ if (sum(bits) > 2048) throw Error('Packing more than 2048 bits in a single input ciphertext is unsupported');
+ if (bits.length > 256) throw Error('Packing more than 256 variables in a single input ciphertext is unsupported');
return this;
},
add32(value: number | bigint) {
checkEncryptedValue(value, 32);
values.push(BigInt(value));
bits.push(32);
+ if (sum(bits) > 2048) throw Error('Packing more than 2048 bits in a single input ciphertext is unsupported');
+ if (bits.length > 256) throw Error('Packing more than 256 variables in a single input ciphertext is unsupported');
return this;
},
add64(value: number | bigint) {
checkEncryptedValue(value, 64);
values.push(BigInt(value));
bits.push(64);
+ if (sum(bits) > 2048) throw Error('Packing more than 2048 bits in a single input ciphertext is unsupported');
+ if (bits.length > 256) throw Error('Packing more than 256 variables in a single input ciphertext is unsupported');
return this;
},
add128(value: number | bigint) {
checkEncryptedValue(value, 128);
values.push(BigInt(value));
bits.push(128);
+ if (sum(bits) > 2048) throw Error('Packing more than 2048 bits in a single input ciphertext is unsupported');
+ if (bits.length > 256) throw Error('Packing more than 256 variables in a single input ciphertext is unsupported');
return this;
},
addAddress(value: string) {
@@ -198,13 +229,46 @@ export const createEncryptedInputMocked = (contractAddress: string, userAddress:
}
values.push(BigInt(value));
bits.push(160);
+ if (sum(bits) > 2048) throw Error('Packing more than 2048 bits in a single input ciphertext is unsupported');
+ if (bits.length > 256) throw Error('Packing more than 256 variables in a single input ciphertext is unsupported');
+ return this;
+ },
+ add256(value: number | bigint) {
+ checkEncryptedValue(value, 256);
+ values.push(BigInt(value));
+ bits.push(256);
+ if (sum(bits) > 2048) throw Error('Packing more than 2048 bits in a single input ciphertext is unsupported');
+ if (bits.length > 256) throw Error('Packing more than 256 variables in a single input ciphertext is unsupported');
+ return this;
+ },
+ addBytes64(value: Uint8Array) {
+ if (value.length !== 64) throw Error('Uncorrect length of input Uint8Array, should be 64 for an ebytes64');
+ const bigIntValue = bytesToBigInt(value);
+ checkEncryptedValue(bigIntValue, 512);
+ values.push(bigIntValue);
+ bits.push(512);
+ if (sum(bits) > 2048) throw Error('Packing more than 2048 bits in a single input ciphertext is unsupported');
+ if (bits.length > 256) throw Error('Packing more than 256 variables in a single input ciphertext is unsupported');
+ return this;
+ },
+ addBytes128(value: Uint8Array) {
+ if (value.length !== 128) throw Error('Uncorrect length of input Uint8Array, should be 128 for an ebytes128');
+ const bigIntValue = bytesToBigInt(value);
+ checkEncryptedValue(bigIntValue, 1024);
+ values.push(bigIntValue);
+ bits.push(1024);
+ if (sum(bits) > 2048) throw Error('Packing more than 2048 bits in a single input ciphertext is unsupported');
+ if (bits.length > 256) throw Error('Packing more than 256 variables in a single input ciphertext is unsupported');
return this;
},
addBytes256(value: Uint8Array) {
+ if (value.length !== 256) throw Error('Uncorrect length of input Uint8Array, should be 256 for an ebytes256');
const bigIntValue = bytesToBigInt(value);
checkEncryptedValue(bigIntValue, 2048);
values.push(bigIntValue);
bits.push(2048);
+ if (sum(bits) > 2048) throw Error('Packing more than 2048 bits in a single input ciphertext is unsupported');
+ if (bits.length > 256) throw Error('Packing more than 256 variables in a single input ciphertext is unsupported');
return this;
},
getValues() {
@@ -219,22 +283,11 @@ export const createEncryptedInputMocked = (contractAddress: string, userAddress:
return this;
},
async encrypt() {
- const listType = getListType(bits);
-
let encrypted = Buffer.alloc(0);
- switch (listType) {
- case 160: {
- bits.map((v, i) => {
- encrypted = Buffer.concat([encrypted, createUintToUint8ArrayFunction(v)(values[i])]);
- });
- break;
- }
- case 2048: {
- encrypted = createUintToUint8ArrayFunction(2048)(values[0]);
- break;
- }
- }
+ bits.map((v, i) => {
+ encrypted = Buffer.concat([encrypted, createUintToUint8ArrayFunction(v)(values[i])]);
+ });
const encryptedArray = new Uint8Array(encrypted);
const hash = new Keccak(256).update(Buffer.from(encryptedArray)).digest();
@@ -301,7 +354,7 @@ const checkEncryptedValue = (value: number | bigint, bits: number) => {
};
export const ENCRYPTION_TYPES = {
- 1: 0,
+ 2: 0, // ebool takes 2 bits
4: 1,
8: 2,
16: 3,
@@ -315,23 +368,6 @@ export const ENCRYPTION_TYPES = {
2048: 11,
};
-const getListType = (bits: (keyof typeof ENCRYPTION_TYPES)[]) => {
- // We limit to 12 items because for now we are using FheUint160List
- if (bits.length > 12) {
- throw new Error("You can't pack more than 12 values.");
- }
-
- if (bits.reduce((total, v) => total + v, 0) > 2048) {
- throw new Error('Too many bits in provided values. Maximum is 2048.');
- }
-
- if (bits.some((v) => v === 2048)) {
- return 2048;
- } else {
- return 160;
- }
-};
-
async function computeInputSignatureCopro(
hash: string,
handlesList: bigint[],
diff --git a/test/fhevmjsTest/fhevmjsTest.ts b/test/fhevmjsTest/fhevmjsTest.ts
new file mode 100644
index 00000000..cfb76cb2
--- /dev/null
+++ b/test/fhevmjsTest/fhevmjsTest.ts
@@ -0,0 +1,79 @@
+import { expect } from 'chai';
+
+import { createInstances } from '../instance';
+import { getSigners, initSigners } from '../signers';
+import { bigIntToBytes64, bigIntToBytes128, bigIntToBytes256 } from '../utils';
+
+describe('Testing fhevmjs/fhevmjsMocked', function () {
+ before(async function () {
+ await initSigners(1);
+ this.signers = await getSigners();
+ this.contractAddress = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2';
+ this.instances = await createInstances(this.signers);
+ });
+
+ it('should be able to pack up to 256 ebools', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
+ for (let i = 0; i < 256; i++) {
+ input.addBool(false);
+ }
+ await input.encrypt();
+ });
+
+ it('should be unable to pack more than 256 ebools', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
+ for (let i = 0; i < 256; i++) {
+ input.addBool(true);
+ }
+ expect(() => input.addBool(false)).to.throw(
+ 'Packing more than 256 variables in a single input ciphertext is unsupported',
+ );
+ });
+
+ it('should be able to pack up to 32 euint64s', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
+ for (let i = 0; i < 32; i++) {
+ input.add64(1024n);
+ }
+ await input.encrypt();
+ });
+
+ it('should be unable to pack more than 32 euint64s', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
+ for (let i = 0; i < 32; i++) {
+ input.add64(37n);
+ }
+ expect(() => input.add64(1n)).to.throw('Packing more than 2048 bits in a single input ciphertext is unsupported');
+ });
+
+ it('should be able to pack up to 2 euint128s', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
+ for (let i = 0; i < 2; i++) {
+ input.addBytes128(bigIntToBytes128(797979n));
+ }
+ await input.encrypt();
+ });
+
+ it('should be unable to pack more than 2 euint128s', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
+ for (let i = 0; i < 2; i++) {
+ input.addBytes128(bigIntToBytes128(797979n));
+ }
+ expect(() => input.addBool(false)).to.throw(
+ 'Packing more than 2048 bits in a single input ciphertext is unsupported',
+ );
+ });
+
+ it('should be able to pack up to 2048 bits but not more', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
+ input.addBytes128(bigIntToBytes128(797979n));
+ input.addBytes64(bigIntToBytes64(797979n));
+ input.add256(6887n);
+ input.add128(6887n);
+ input.add64(6887n);
+ input.add64(6887n);
+ expect(() => input.addBool(false)).to.throw(
+ 'Packing more than 2048 bits in a single input ciphertext is unsupported',
+ );
+ });
+});
diff --git a/test/gatewayDecrypt/testAsyncDecrypt.ts b/test/gatewayDecrypt/testAsyncDecrypt.ts
index bdf29485..a490bd83 100644
--- a/test/gatewayDecrypt/testAsyncDecrypt.ts
+++ b/test/gatewayDecrypt/testAsyncDecrypt.ts
@@ -4,7 +4,7 @@ import { ethers, network } from 'hardhat';
import { asyncDecrypt, awaitAllDecryptionResults } from '../asyncDecrypt';
import { createInstances } from '../instance';
import { getSigners, initSigners } from '../signers';
-import { bigIntToBytes, waitNBlocks } from '../utils';
+import { bigIntToBytes256, waitNBlocks } from '../utils';
describe('TestAsyncDecrypt', function () {
before(async function () {
@@ -324,7 +324,7 @@ describe('TestAsyncDecrypt', function () {
it('test async decrypt ebytes256 non-trivial', async function () {
const inputAlice = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
- inputAlice.addBytes256(bigIntToBytes(18446744073709550022n));
+ inputAlice.addBytes256(bigIntToBytes256(18446744073709550022n));
const encryptedAmount = await inputAlice.encrypt();
const tx = await this.contract.requestEbytes256NonTrivial(encryptedAmount.handles[0], encryptedAmount.inputProof, {
gasLimit: 5_000_000,
@@ -339,7 +339,7 @@ describe('TestAsyncDecrypt', function () {
if (network.name === 'hardhat') {
this.snapshotId = await ethers.provider.send('evm_snapshot');
const inputAlice = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
- inputAlice.addBytes256(bigIntToBytes(18446744073709550022n));
+ inputAlice.addBytes256(bigIntToBytes256(18446744073709550022n));
const encryptedAmount = await inputAlice.encrypt();
const tx = await this.contract.requestEbytes256NonTrivial(
encryptedAmount.handles[0],
@@ -353,7 +353,7 @@ describe('TestAsyncDecrypt', function () {
await ethers.provider.send('evm_revert', [this.snapshotId]);
const inputAlice2 = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
- inputAlice2.addBytes256(bigIntToBytes(424242n));
+ inputAlice2.addBytes256(bigIntToBytes256(424242n));
const encryptedAmount2 = await inputAlice2.encrypt();
const tx2 = await this.contract.requestEbytes256NonTrivial(
encryptedAmount2.handles[0],
@@ -369,7 +369,7 @@ describe('TestAsyncDecrypt', function () {
it('test async decrypt mixed with ebytes256', async function () {
const inputAlice = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
- inputAlice.addBytes256(bigIntToBytes(18446744073709550032n));
+ inputAlice.addBytes256(bigIntToBytes256(18446744073709550032n));
const encryptedAmount = await inputAlice.encrypt();
const tx = await this.contract.requestMixedBytes256(encryptedAmount.handles[0], encryptedAmount.inputProof, {
gasLimit: 5_000_000,
@@ -391,7 +391,7 @@ describe('TestAsyncDecrypt', function () {
await contract2.getAddress(),
this.signers.alice.address,
);
- inputAlice.addBytes256(bigIntToBytes(18446744073709550022n));
+ inputAlice.addBytes256(bigIntToBytes256(18446744073709550022n));
const encryptedAmount = await inputAlice.encrypt();
const tx = await contract2.requestEbytes256NonTrivialTrustless(
encryptedAmount.handles[0],
@@ -411,7 +411,7 @@ describe('TestAsyncDecrypt', function () {
await contract2.getAddress(),
this.signers.alice.address,
);
- inputAlice.addBytes256(bigIntToBytes(18446744073709550032n));
+ inputAlice.addBytes256(bigIntToBytes256(18446744073709550032n));
const encryptedAmount = await inputAlice.encrypt();
const tx = await contract2.requestMixedBytes256Trustless(encryptedAmount.handles[0], encryptedAmount.inputProof, {
gasLimit: 5_000_000,
diff --git a/test/kmsVerifier/kmsVerifier.ts b/test/kmsVerifier/kmsVerifier.ts
index 1739c106..0f25cf4c 100644
--- a/test/kmsVerifier/kmsVerifier.ts
+++ b/test/kmsVerifier/kmsVerifier.ts
@@ -6,7 +6,7 @@ import { ethers } from 'hardhat';
import { asyncDecrypt, awaitAllDecryptionResults } from '../asyncDecrypt';
import { createInstances } from '../instance';
import { getSigners, initSigners } from '../signers';
-import { bigIntToBytes } from '../utils';
+import { bigIntToBytes256 } from '../utils';
describe('KMSVerifier', function () {
before(async function () {
@@ -82,7 +82,7 @@ describe('KMSVerifier', function () {
await contract2.getAddress(),
this.signers.alice.address,
);
- inputAlice.addBytes256(bigIntToBytes(18446744073709550032n));
+ inputAlice.addBytes256(bigIntToBytes256(18446744073709550032n));
process.env.NUM_KMS_SIGNERS = '1';
const encryptedAmount2 = await inputAlice.encrypt();
diff --git a/test/reencryption/reencryption.ts b/test/reencryption/reencryption.ts
index 4b6ce6a1..476d7fcb 100644
--- a/test/reencryption/reencryption.ts
+++ b/test/reencryption/reencryption.ts
@@ -3,7 +3,7 @@ import { ethers, network } from 'hardhat';
import { createInstances } from '../instance';
import { getSigners, initSigners } from '../signers';
-import { bigIntToBytes } from '../utils';
+import { bigIntToBytes256 } from '../utils';
describe('Reencryption', function () {
before(async function () {
@@ -18,7 +18,7 @@ describe('Reencryption', function () {
const inputAlice = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
inputAlice.addBytes256(
- bigIntToBytes(184467440737095500228978978978978970980978908978978907890778907089780970897890n),
+ bigIntToBytes256(184467440737095500228978978978978970980978908978978907890778907089780970897890n),
);
const encryptedAmount = await inputAlice.encrypt();
const tx = await this.contract.setEBytes256(encryptedAmount.handles[0], encryptedAmount.inputProof, {
diff --git a/test/tfheOperations/manual.ts b/test/tfheOperations/manual.ts
index d8e751a1..ae0fe362 100644
--- a/test/tfheOperations/manual.ts
+++ b/test/tfheOperations/manual.ts
@@ -13,7 +13,7 @@ import {
decryptBool,
} from '../instance';
import { getSigners, initSigners } from '../signers';
-import { bigIntToBytes } from '../utils';
+import { bigIntToBytes256 } from '../utils';
async function deployTfheManualTestFixture(): Promise {
const signers = await getSigners();
@@ -406,11 +406,11 @@ describe('TFHE manual operations', function () {
it('eq ebytes256,ebytes256 true', async function () {
const inputAliceA = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
- inputAliceA.addBytes256(bigIntToBytes(18446744073709550022n));
+ inputAliceA.addBytes256(bigIntToBytes256(18446744073709550022n));
const encryptedAmountA = await inputAliceA.encrypt();
const inputAliceB = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
- inputAliceB.addBytes256(bigIntToBytes(18446744073709550022n));
+ inputAliceB.addBytes256(bigIntToBytes256(18446744073709550022n));
const encryptedAmountB = await inputAliceB.encrypt();
const tx = await this.contract.eqEbytes256(
@@ -428,11 +428,11 @@ describe('TFHE manual operations', function () {
it('eq ebytes256,ebytes256 false', async function () {
const inputAliceA = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
- inputAliceA.addBytes256(bigIntToBytes(18446744073709550022n));
+ inputAliceA.addBytes256(bigIntToBytes256(18446744073709550022n));
const encryptedAmountA = await inputAliceA.encrypt();
const inputAliceB = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
- inputAliceB.addBytes256(bigIntToBytes(18446744073709550021n));
+ inputAliceB.addBytes256(bigIntToBytes256(18446744073709550021n));
const encryptedAmountB = await inputAliceB.encrypt();
const tx = await this.contract.eqEbytes256(
@@ -450,11 +450,11 @@ describe('TFHE manual operations', function () {
it('ne ebytes256,ebytes256 true', async function () {
const inputAliceA = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
- inputAliceA.addBytes256(bigIntToBytes(18446744073709550022n));
+ inputAliceA.addBytes256(bigIntToBytes256(18446744073709550022n));
const encryptedAmountA = await inputAliceA.encrypt();
const inputAliceB = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
- inputAliceB.addBytes256(bigIntToBytes(18446744073709550021n));
+ inputAliceB.addBytes256(bigIntToBytes256(18446744073709550021n));
const encryptedAmountB = await inputAliceB.encrypt();
const tx = await this.contract.neEbytes256(
@@ -472,11 +472,11 @@ describe('TFHE manual operations', function () {
it('ne ebytes256,ebytes256 false', async function () {
const inputAliceA = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
- inputAliceA.addBytes256(bigIntToBytes(184467440184467440184467440184467440n));
+ inputAliceA.addBytes256(bigIntToBytes256(184467440184467440184467440184467440n));
const encryptedAmountA = await inputAliceA.encrypt();
const inputAliceB = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
- inputAliceB.addBytes256(bigIntToBytes(184467440184467440184467440184467440n));
+ inputAliceB.addBytes256(bigIntToBytes256(184467440184467440184467440184467440n));
const encryptedAmountB = await inputAliceB.encrypt();
const tx = await this.contract.neEbytes256(
diff --git a/test/utils.ts b/test/utils.ts
index d8506442..a3f30234 100644
--- a/test/utils.ts
+++ b/test/utils.ts
@@ -1,4 +1,4 @@
-import { toBufferLE } from 'bigint-buffer';
+import { toBufferBE } from 'bigint-buffer';
import { ContractMethodArgs, Typed } from 'ethers';
import { ethers, network } from 'hardhat';
@@ -98,7 +98,14 @@ export const mineNBlocks = async (n: number) => {
}
};
-export const bigIntToBytes = (value: bigint) => {
- const byteArrayLength = Math.ceil(value.toString(2).length / 8);
- return new Uint8Array(toBufferLE(value, byteArrayLength));
+export const bigIntToBytes64 = (value: bigint) => {
+ return new Uint8Array(toBufferBE(value, 64));
+};
+
+export const bigIntToBytes128 = (value: bigint) => {
+ return new Uint8Array(toBufferBE(value, 128));
+};
+
+export const bigIntToBytes256 = (value: bigint) => {
+ return new Uint8Array(toBufferBE(value, 256));
};
From e69a44f090514d4ee7c58f8a5f3878ec8e2eb8dd Mon Sep 17 00:00:00 2001
From: Aurora Poppyseed
Date: Thu, 3 Oct 2024 20:38:38 +0800
Subject: [PATCH 14/51] prettier
---
.github/ISSUE_TEMPLATE/bug_report_fhevm.md | 56 ++++++++++---------
.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md | 35 +++++++-----
.github/ISSUE_TEMPLATE/docs_bug_report.md | 23 ++++----
.github/ISSUE_TEMPLATE/docs_unclear_report.md | 23 +++++---
.github/ISSUE_TEMPLATE/feature-request.md | 6 +-
5 files changed, 81 insertions(+), 62 deletions(-)
diff --git a/.github/ISSUE_TEMPLATE/bug_report_fhevm.md b/.github/ISSUE_TEMPLATE/bug_report_fhevm.md
index 348cb0a0..fc807f6a 100644
--- a/.github/ISSUE_TEMPLATE/bug_report_fhevm.md
+++ b/.github/ISSUE_TEMPLATE/bug_report_fhevm.md
@@ -1,23 +1,26 @@
---
-name: Smart Contracts Bug Report
-about: Use this template to report issues encountered with confidential smart contracts on the FHEVM.
-title: ''
-labels: bug
-assignees: ''
+name: Smart Contracts Bug Report
+about: Use this template to report issues encountered with confidential smart contracts on the FHEVM.
+title: ""
+labels: bug
+assignees: ""
---
-### **Description**
+### **Description**
+
Provide a clear and detailed description of the bug.
-### **Expected Behavior**
+### **Expected Behavior**
+
Describe what you expected to happen (e.g., successful decryption of the input, valid output from the encrypted function, no gas estimation errors).
-### **Screenshots / Logs**
+### **Screenshots / Logs**
+
Include screenshots, relevant logs, or traces if available, particularly for encrypted computations or gateway interactions.
-### **Smart Contract Code Snippet**
-If applicable, provide a minimal reproducible example of the smart contract code highlighting the part where the issue occurs:
+### **Smart Contract Code Snippet**
+If applicable, provide a minimal reproducible example of the smart contract code highlighting the part where the issue occurs:
Example
@@ -25,28 +28,29 @@ If applicable, provide a minimal reproducible example of the smart contract code
```solidity
// Example
contract Counter {
- uint32 value;
- function increment() public {
- value += 1;
- }
-
- function currentValue() public view returns (uint32) {
- return value;
- }
+ uint32 value;
+ function increment() public {
+ value += 1;
+ }
+
+ function currentValue() public view returns (uint32) {
+ return value;
+ }
}
```
+
+### **Environment Information**
-### **Environment Information**
Fill in the relevant environment details where the issue was observed:
-- **Operating System**: [e.g., Ubuntu 20.04, Windows 10]
-- **Browser**: [e.g., Chrome v90, Safari v14]
-- **FHEVM Version**: [e.g., v1.0.0]
-- **Tooling**: [Hardhat, Remix, FHEVM CLI]
-- **Devnet / Local Node Configuration**:
- - Chain ID: [e.g., 9000]
- - RPC URL: [e.g., `https://devnet.zama.ai`]
+- **Operating System**: [e.g., Ubuntu 20.04, Windows 10]
+- **Browser**: [e.g., Chrome v90, Safari v14]
+- **FHEVM Version**: [e.g., v1.0.0]
+- **Tooling**: [Hardhat, Remix, FHEVM CLI]
+- **Devnet / Local Node Configuration**:
+ - Chain ID: [e.g., 9000]
+ - RPC URL: [e.g., `https://devnet.zama.ai`]
- Faucet Usage: [Yes/No]
diff --git a/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md b/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
index e0f7e0a0..dc2dff46 100644
--- a/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
+++ b/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
@@ -6,37 +6,44 @@ labels: bug, fhevmjs
assignees: ''
---
-### **Description**
+### **Description**
+
Provide a clear and detailed description of the issue encountered.
-### **Expected Behavior**
+### **Expected Behavior**
+
A clear and concise description of the expected behavior (e.g., successful encryption of parameters, correct reencryption result, accurate balance retrieval).
-### **Screenshots / Logs**
+### **Screenshots / Logs**
+
If applicable, provide screenshots or logs that capture the issue. Include any console errors, warnings, or unexpected outputs.
-### **Environment Information**
+### **Environment Information**
+
Fill in the relevant environment details where the issue was observed:
- **Browser**: [e.g., Chrome v90, Firefox v88]
-- **Node.js Version**: [e.g., `v14.17.0`]
-- **`fhEVMjs` Version**: [e.g., `v0.2.1`]
-- **Package Manager**: [npm, yarn, pnpm]
-- **Network Configuration**:
- - **Chain ID**: [e.g., `9000`]
- - **RPC URL**: [e.g., `https://devnet.zama.ai`]
- - **Gateway URL**: [e.g., `https://gateway.devnet.zama.ai`]
-
-### **Steps Taken to Debug**
+- **Node.js Version**: [e.g., `v14.17.0`]
+- **`fhEVMjs` Version**: [e.g., `v0.2.1`]
+- **Package Manager**: [npm, yarn, pnpm]
+- **Network Configuration**:
+ - **Chain ID**: [e.g., `9000`]
+ - **RPC URL**: [e.g., `https://devnet.zama.ai`]
+ - **Gateway URL**: [e.g., `https://gateway.devnet.zama.ai`]
+
+### **Steps Taken to Debug**
+
Outline any steps you’ve taken to troubleshoot the issue (e.g., using mocked mode, enabling verbose logging, testing with a different environment or network).
-### **Resources / References**
+### **Resources / References**
+
If applicable, include links to any related documentation or reference materials that may help us understand the context:
Logs or output
```console
+
```
diff --git a/.github/ISSUE_TEMPLATE/docs_bug_report.md b/.github/ISSUE_TEMPLATE/docs_bug_report.md
index c68273f4..d7b9f7f7 100644
--- a/.github/ISSUE_TEMPLATE/docs_bug_report.md
+++ b/.github/ISSUE_TEMPLATE/docs_bug_report.md
@@ -1,18 +1,19 @@
---
name: Documentation Bug Report
about: Use this template to report issues, inconsistencies, or inaccuracies in our documentation.
-title: ''
+title: ""
labels: bug, documentation
-assignees: ''
+assignees: ""
---
-### **Page Link**
+### **Page Link**
+
Please provide a link to the page where the issue is located:
-**URL**: '[https://docs.zama.ai/fhevm/___](https://docs.zama.ai/fhevm/___)'
+**URL**: '[https://docs.zama.ai/fhevm/\_\_\_](https://docs.zama.ai/fhevm/___)'
-### **Description**
-Provide a clear and detailed description of the bug. Include any inconsistencies, typos, broken links, or missing information.
+### **Description**
+Provide a clear and detailed description of the bug. Include any inconsistencies, typos, broken links, or missing information.
For example:
@@ -22,15 +23,17 @@ Provide a clear and detailed description of the bug. Include any inconsistencies
+### **Suggested Fix / Expected Behavior**
-### **Suggested Fix / Expected Behavior**
Describe what you expected the documentation to include or suggest the correct information. For example, provide a corrected code snippet, explanation, or a link to the correct resource.
-### **Screenshots / Logs**
+### **Screenshots / Logs**
+
If applicable, provide screenshots, code snippets, or logs that clearly show the issue.
-### **Impact Level**
-Choose the impact of the bug on the documentation quality and user experience:
+### **Impact Level**
+
+Choose the impact of the bug on the documentation quality and user experience:
[Critical, Moderate, Minor]
diff --git a/.github/ISSUE_TEMPLATE/docs_unclear_report.md b/.github/ISSUE_TEMPLATE/docs_unclear_report.md
index d8c2819c..646561d2 100644
--- a/.github/ISSUE_TEMPLATE/docs_unclear_report.md
+++ b/.github/ISSUE_TEMPLATE/docs_unclear_report.md
@@ -1,16 +1,18 @@
---
name: Unclear Documentation Report
about: Use this template to report sections of our documentation that are unclear, confusing, or require further explanation.
-title: ''
+title: ""
labels: documentation
-assignees: ''
+assignees: ""
---
-### **Page Link**
+### **Page Link**
+
Provide a link to the documentation page where the unclear content is located:
-**URL**: '[https://docs.zama.ai/fhevm/___](https://docs.zama.ai/fhevm/___)'
+**URL**: '[https://docs.zama.ai/fhevm/\_\_\_](https://docs.zama.ai/fhevm/___)'
+
+### **Description of the Issue**
-### **Description of the Issue**
Describe in detail what part of the documentation is unclear.
For example:
@@ -21,8 +23,9 @@ Describe in detail what part of the documentation is unclear.
-### **What Would You Like Clarified?**
-Provide details on what you expected to understand better or where more explanation is needed.
+### **What Would You Like Clarified?**
+
+Provide details on what you expected to understand better or where more explanation is needed.
Include questions such as:
@@ -32,7 +35,8 @@ Provide details on what you expected to understand better or where more explanat
-### **Suggestions for Improvement**
+### **Suggestions for Improvement**
+
(Optional) If you have suggestions for how the documentation can be made clearer, provide them here. For example:
Include questions such as:
@@ -43,5 +47,6 @@ Provide details on what you expected to understand better or where more explanat
-### **Screenshots / Logs**
+### **Screenshots / Logs**
+
If applicable, provide screenshots or logs to help us understand what part of the documentation caused confusion.
diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md
index 278c16e0..07196dda 100644
--- a/.github/ISSUE_TEMPLATE/feature-request.md
+++ b/.github/ISSUE_TEMPLATE/feature-request.md
@@ -1,9 +1,9 @@
---
name: General feature request for FHEVM
about: Suggest an idea for this project
-title: ''
+title: ""
labels: enhancement
-assignees: ''
+assignees: ""
---
**Is your feature request related to a problem? Please describe.**
@@ -13,4 +13,4 @@ A clear and concise description of what the problem is. Ex. I'm always frustrate
A clear and concise description of what you want to happen.
**Additional context**
-Add any other context or screenshots about the feature request here.
\ No newline at end of file
+Add any other context or screenshots about the feature request here.
From 02482facfde9f6afa7ce897d7de958089a7bf16e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Thu, 3 Oct 2024 16:55:38 +0200
Subject: [PATCH 15/51] feat: native InputVerifier
feat: finalized InputVerifier for native version
chore: fixed native test
chore: fixed index
chore: removed hardhat console import
---
.env.example | 1 +
hardhat.config.ts | 6 +
lib/InputVerifier.sol | 15 +-
lib/InputVerifier.sol.coprocessor | 227 ++++++++++++++++++++++++++++++
lib/InputVerifier.sol.native | 175 ++++++++---------------
lib/KMSVerifier.sol | 11 +-
test/fhevmjsMocked.ts | 55 +++++---
test/kmsVerifier/kmsVerifier.ts | 18 +--
8 files changed, 348 insertions(+), 160 deletions(-)
create mode 100644 lib/InputVerifier.sol.coprocessor
diff --git a/.env.example b/.env.example
index 80c75c8d..45ca2b1e 100644
--- a/.env.example
+++ b/.env.example
@@ -9,6 +9,7 @@ export PRIVATE_KEY_KMS_SIGNER_1="e5b998ce1e664718772fa35e8d02b2b6a267a03a8ecadab
export PRIVATE_KEY_KMS_SIGNER_2="dca817bfe824b12c92d61e56056b956617da156bcd730379cb9203c822c9ba8e"
export PRIVATE_KEY_KMS_SIGNER_3="7ac1a2886ca07b3b7393ea5ff3613bb94d72129e2c7cbedc807eb55ff971394c"
export PRIVATE_KEY_COPROCESSOR_ACCOUNT="7ec8ada6642fc4ccfb7729bc29c17cf8d21b61abd5642d1db992c0b8672ab901"
+export IS_COPROCESSOR="true"
# Block explorer API keys
export ARBISCAN_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
diff --git a/hardhat.config.ts b/hardhat.config.ts
index 1887f7f8..588f20a2 100644
--- a/hardhat.config.ts
+++ b/hardhat.config.ts
@@ -1,6 +1,7 @@
import '@nomicfoundation/hardhat-toolbox';
import '@openzeppelin/hardhat-upgrades';
import dotenv from 'dotenv';
+import { promises as fs } from 'fs';
import 'hardhat-deploy';
import 'hardhat-ignore-warnings';
import type { HardhatUserConfig, extendProvider } from 'hardhat/config';
@@ -93,6 +94,11 @@ task('test', async (taskArgs, hre, runSuper) => {
await hre.run('task:computeKMSVerifierAddress');
await hre.run('task:computeInputVerifierAddress');
await hre.run('task:computeFHEPaymentAddress');
+ if (process.env.IS_COPROCESSOR === 'true') {
+ await fs.copyFile('lib/InputVerifier.sol.coprocessor', 'lib/InputVerifier.sol');
+ } else {
+ await fs.copyFile('lib/InputVerifier.sol.native', 'lib/InputVerifier.sol');
+ }
await hre.run('compile:specific', { contract: 'lib' });
await hre.run('compile:specific', { contract: 'gateway' });
await hre.run('compile:specific', { contract: 'payment' });
diff --git a/lib/InputVerifier.sol b/lib/InputVerifier.sol
index 58b5efe2..1ebdbcb4 100644
--- a/lib/InputVerifier.sol
+++ b/lib/InputVerifier.sol
@@ -102,7 +102,8 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad
uint256 indexHandle = (result & 0x0000000000000000000000000000000000000000000000000000000000ff0000) >> 16;
if (!isProofCached) {
- // inputHandle is keccak256(bundleCiphertext)[0:29]+index+type+version
+ // bundleCiphertext is compressedPackedCT+ZKPOK
+ // inputHandle is keccak256(keccak256(bundleCiphertext)+index)[0:29]+index+type+version
// and inputProof is len(list_handles) + numSignersKMS + hashCT + list_handles + signatureCopro + signatureKMSSigners (1+1+32+NUM_HANDLES*32+65+65*numSignersKMS)
uint256 inputProofLen = inputProof.length;
@@ -179,18 +180,6 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad
require(signer == coprocessorAddress, "Coprocessor address mismatch");
}
- function tstore(address location, uint256 value) internal virtual {
- assembly {
- tstore(location, value)
- }
- }
-
- function tload(address location) internal view virtual returns (bool value) {
- assembly {
- value := tload(location)
- }
- }
-
function hashCiphertextVerificationForCopro(
CiphertextVerificationForCopro memory CVcopro
) internal view virtual returns (bytes32) {
diff --git a/lib/InputVerifier.sol.coprocessor b/lib/InputVerifier.sol.coprocessor
new file mode 100644
index 00000000..1ebdbcb4
--- /dev/null
+++ b/lib/InputVerifier.sol.coprocessor
@@ -0,0 +1,227 @@
+// SPDX-License-Identifier: BSD-3-Clause-Clear
+pragma solidity ^0.8.24;
+
+import "./KMSVerifier.sol";
+import "./TFHEExecutor.sol";
+import "./KMSVerifierAddress.sol";
+import "./CoprocessorAddress.sol";
+
+// Importing OpenZeppelin contracts for cryptographic signature verification and access control.
+import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
+import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
+import "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol";
+import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
+import "@openzeppelin/contracts/utils/Strings.sol";
+
+/// @title InputVerifier for signature verification of users encrypted inputs
+/// @notice This version is only for the Coprocessor version of fhEVM
+/// @notice This contract is called by the TFHEExecutor inside verifyCiphertext function, and calls the KMSVerifier to fetch KMS signers addresses
+/// @dev The contract uses OpenZeppelin's EIP712Upgradeable for cryptographic operations
+contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgradeable {
+ struct CiphertextVerificationForCopro {
+ address aclAddress;
+ bytes32 hashOfCiphertext;
+ uint256[] handlesList;
+ address userAddress;
+ address contractAddress;
+ }
+
+ /// @notice Handle version
+ uint8 public constant HANDLE_VERSION = 0;
+
+ address constant coprocessorAddress = coprocessorAdd;
+
+ KMSVerifier public constant kmsVerifier = KMSVerifier(kmsVerifierAdd);
+ string public constant CIPHERTEXTVERIFICATION_COPRO_TYPE =
+ "CiphertextVerificationForCopro(address aclAddress,bytes32 hashOfCiphertext,uint256[] handlesList,address userAddress,address contractAddress)";
+ bytes32 private constant CIPHERTEXTVERIFICATION_COPRO_TYPE_HASH =
+ keccak256(bytes(CIPHERTEXTVERIFICATION_COPRO_TYPE));
+
+ /// @notice Name of the contract
+ string private constant CONTRACT_NAME = "InputVerifier";
+
+ /// @notice Version of the contract
+ uint256 private constant MAJOR_VERSION = 0;
+ uint256 private constant MINOR_VERSION = 1;
+ uint256 private constant PATCH_VERSION = 0;
+
+ function _authorizeUpgrade(address _newImplementation) internal virtual override onlyOwner {}
+
+ function get_CIPHERTEXTVERIFICATION_COPRO_TYPE() public view virtual returns (string memory) {
+ return CIPHERTEXTVERIFICATION_COPRO_TYPE;
+ }
+
+ /// @custom:oz-upgrades-unsafe-allow constructor
+ constructor() {
+ _disableInitializers();
+ }
+
+ /// @notice Initializes the contract setting `initialOwner` as the initial owner
+ function initialize(address initialOwner) external initializer {
+ __Ownable_init(initialOwner);
+ __EIP712_init(CONTRACT_NAME, "1");
+ }
+
+ function typeOf(uint256 handle) internal pure virtual returns (uint8) {
+ uint8 typeCt = uint8(handle >> 8);
+ return typeCt;
+ }
+
+ function checkProofCache(
+ bytes memory inputProof,
+ address userAddress,
+ address contractAddress,
+ address aclAddress
+ ) internal view virtual returns (bool, bytes32) {
+ bool isProofCached;
+ bytes32 key = keccak256(abi.encodePacked(contractAddress, aclAddress, userAddress, inputProof));
+ assembly {
+ isProofCached := tload(key)
+ }
+ return (isProofCached, key);
+ }
+
+ function cacheProof(bytes32 proofKey) internal virtual {
+ assembly {
+ tstore(proofKey, 1)
+ }
+ }
+
+ function verifyCiphertext(
+ TFHEExecutor.ContextUserInputs memory context,
+ bytes32 inputHandle,
+ bytes memory inputProof
+ ) external virtual returns (uint256) {
+ (bool isProofCached, bytes32 cacheKey) = checkProofCache(
+ inputProof,
+ context.userAddress,
+ context.contractAddress,
+ context.aclAddress
+ );
+ uint256 result = uint256(inputHandle);
+ uint256 indexHandle = (result & 0x0000000000000000000000000000000000000000000000000000000000ff0000) >> 16;
+
+ if (!isProofCached) {
+ // bundleCiphertext is compressedPackedCT+ZKPOK
+ // inputHandle is keccak256(keccak256(bundleCiphertext)+index)[0:29]+index+type+version
+ // and inputProof is len(list_handles) + numSignersKMS + hashCT + list_handles + signatureCopro + signatureKMSSigners (1+1+32+NUM_HANDLES*32+65+65*numSignersKMS)
+
+ uint256 inputProofLen = inputProof.length;
+ require(inputProofLen > 0, "Empty inputProof");
+ uint256 numHandles = uint256(uint8(inputProof[0]));
+ uint256 numSignersKMS = uint256(uint8(inputProof[1]));
+
+ require(numHandles > indexHandle, "Invalid index"); // @note: this checks in particular that the list is non-empty
+ require(inputProofLen == 99 + 32 * numHandles + 65 * numSignersKMS, "Error deserializing inputProof");
+
+ bytes32 hashCT;
+ assembly {
+ hashCT := mload(add(inputProof, 34))
+ }
+
+ // deseralize handle and check they are from correct version
+ uint256[] memory listHandles = new uint256[](numHandles);
+ for (uint256 i = 0; i < numHandles; i++) {
+ uint256 element;
+ assembly {
+ element := mload(add(inputProof, add(66, mul(i, 32))))
+ }
+ // check all handles are from correct version
+ require(uint8(element) == HANDLE_VERSION, "Wrong handle version");
+ listHandles[i] = element;
+ }
+
+ {
+ bytes memory signatureCoproc = new bytes(65);
+ for (uint256 i = 0; i < 65; i++) {
+ signatureCoproc[i] = inputProof[34 + 32 * numHandles + i];
+ }
+ CiphertextVerificationForCopro memory cvCopro;
+ cvCopro.aclAddress = context.aclAddress;
+ cvCopro.hashOfCiphertext = hashCT;
+ cvCopro.handlesList = listHandles;
+ cvCopro.userAddress = context.userAddress;
+ cvCopro.contractAddress = context.contractAddress;
+ verifyEIP712Copro(cvCopro, signatureCoproc);
+ }
+ {
+ bytes[] memory signaturesKMS = new bytes[](numSignersKMS);
+ for (uint256 j = 0; j < numSignersKMS; j++) {
+ signaturesKMS[j] = new bytes(65);
+ for (uint256 i = 0; i < 65; i++) {
+ signaturesKMS[j][i] = inputProof[99 + 32 * numHandles + 65 * j + i];
+ }
+ }
+ KMSVerifier.CiphertextVerificationForKMS memory cvKMS;
+ cvKMS.aclAddress = context.aclAddress;
+ cvKMS.hashOfCiphertext = hashCT;
+ cvKMS.userAddress = context.userAddress;
+ cvKMS.contractAddress = context.contractAddress;
+ bool kmsCheck = kmsVerifier.verifyInputEIP712KMSSignatures(cvKMS, signaturesKMS);
+ require(kmsCheck, "Not enough unique KMS input signatures");
+ }
+ cacheProof(cacheKey);
+ require(result == listHandles[indexHandle], "Wrong inputHandle");
+ } else {
+ uint8 numHandles = uint8(inputProof[0]); // @note: we know inputProof is non-empty since it has been previously cached
+ require(numHandles > indexHandle, "Invalid index");
+ uint256 element;
+ for (uint256 j = 0; j < 32; j++) {
+ element |= uint256(uint8(inputProof[34 + indexHandle * 32 + j])) << (8 * (31 - j));
+ }
+ require(element == result, "Wrong inputHandle");
+ }
+ return result;
+ }
+
+ function verifyEIP712Copro(CiphertextVerificationForCopro memory cv, bytes memory signature) internal view virtual {
+ bytes32 digest = hashCiphertextVerificationForCopro(cv);
+ address signer = ECDSA.recover(digest, signature);
+ require(signer == coprocessorAddress, "Coprocessor address mismatch");
+ }
+
+ function hashCiphertextVerificationForCopro(
+ CiphertextVerificationForCopro memory CVcopro
+ ) internal view virtual returns (bytes32) {
+ return
+ _hashTypedDataV4(
+ keccak256(
+ abi.encode(
+ CIPHERTEXTVERIFICATION_COPRO_TYPE_HASH,
+ CVcopro.aclAddress,
+ CVcopro.hashOfCiphertext,
+ keccak256(abi.encodePacked(CVcopro.handlesList)),
+ CVcopro.userAddress,
+ CVcopro.contractAddress
+ )
+ )
+ );
+ }
+
+ /// @notice recovers the signer's address from a `signature` and a `message` digest
+ /// @dev Utilizes ECDSA for actual address recovery
+ /// @param message The hash of the message that was signed
+ /// @param signature The signature to verify
+ /// @return signer The address that supposedly signed the message
+ function recoverSigner(bytes32 message, bytes memory signature) internal pure virtual returns (address) {
+ address signerRecovered = ECDSA.recover(message, signature);
+ return signerRecovered;
+ }
+
+ /// @notice Getter for the name and version of the contract
+ /// @return string representing the name and the version of the contract
+ function getVersion() external pure virtual returns (string memory) {
+ return
+ string(
+ abi.encodePacked(
+ CONTRACT_NAME,
+ " v",
+ Strings.toString(MAJOR_VERSION),
+ ".",
+ Strings.toString(MINOR_VERSION),
+ ".",
+ Strings.toString(PATCH_VERSION)
+ )
+ );
+ }
+}
diff --git a/lib/InputVerifier.sol.native b/lib/InputVerifier.sol.native
index b9cb9fb1..d1e708c6 100644
--- a/lib/InputVerifier.sol.native
+++ b/lib/InputVerifier.sol.native
@@ -2,12 +2,13 @@
pragma solidity ^0.8.24;
import "./KMSVerifier.sol";
+import "./TFHEExecutor.sol";
import "./KMSVerifierAddress.sol";
+import "./CoprocessorAddress.sol";
// Importing OpenZeppelin contracts for cryptographic signature verification and access control.
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
-import "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
@@ -15,23 +16,12 @@ import "@openzeppelin/contracts/utils/Strings.sol";
/// @notice This version is only for the Native version of fhEVM
/// @notice This contract is called by the TFHEExecutor inside verifyCiphertext function, and calls the KMSVerifier to fetch KMS signers addresses
/// @dev The contract uses OpenZeppelin's EIP712Upgradeable for cryptographic operations
-contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgradeable {
- struct CiphertextVerificationForKMS {
- address aclAddress;
- bytes32 hashOfCiphertext;
- address userAddress;
- address contractAddress;
- }
-
+contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable {
/// @notice Handle version
uint8 public constant HANDLE_VERSION = 0;
KMSVerifier public constant kmsVerifier = KMSVerifier(kmsVerifierAdd);
- string public constant CIPHERTEXTVERIFICATION_KMS_TYPE =
- "CiphertextVerificationForKMS(address aclAddress,bytes32 hashOfCiphertext,address userAddress,address contractAddress)";
- bytes32 private constant CIPHERTEXTVERIFICATION_KMS_TYPE_HASH = keccak256(bytes(CIPHERTEXTVERIFICATION_KMS_TYPE));
-
/// @notice Name of the contract
string private constant CONTRACT_NAME = "InputVerifier";
@@ -42,10 +32,6 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad
function _authorizeUpgrade(address _newImplementation) internal virtual override onlyOwner {}
- function get_CIPHERTEXTVERIFICATION_KMS_TYPE() public view virtual returns (string memory) {
- return CIPHERTEXTVERIFICATION_KMS_TYPE;
- }
-
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
@@ -54,7 +40,6 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad
/// @notice Initializes the contract setting `initialOwner` as the initial owner
function initialize(address initialOwner) external initializer {
__Ownable_init(initialOwner);
- __EIP712_init(CONTRACT_NAME, "1");
}
function typeOf(uint256 handle) internal pure virtual returns (uint8) {
@@ -83,22 +68,23 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad
}
function verifyCiphertext(
- address aclAddress,
+ TFHEExecutor.ContextUserInputs memory context,
bytes32 inputHandle,
- address userAddress,
- address contractAddress,
- bytes memory inputProof,
- bytes1 inputType
+ bytes memory inputProof
) external virtual returns (uint256) {
- (bool isProofCached, bytes32 cacheKey) = checkProofCache(inputProof, userAddress, contractAddress, aclAddress);
+ (bool isProofCached, bytes32 cacheKey) = checkProofCache(
+ inputProof,
+ context.userAddress,
+ context.contractAddress,
+ context.aclAddress
+ );
uint256 result = uint256(inputHandle);
uint256 indexHandle = (result & 0x0000000000000000000000000000000000000000000000000000000000ff0000) >> 16;
if (!isProofCached) {
- // inputHandle is keccak256(bundleCiphertext)[0:29]+index+type+version
- // and inputProof is len(list_handles) + numSignersKMS + hashCT + list_handles + signatureKMSSigners (1+1+32+NUM_HANDLES*32+65*numSignersKMS)
- uint8 typeCt = typeOf(result);
- require(uint8(inputType) == typeCt, "Wrong type");
+ // bundleCiphertext is compressedPackedCT+ZKPOK
+ // inputHandle is keccak256(keccak256(bundleCiphertext)+index)[0:29]+index+type+version
+ // and inputProof is len(list_handles) + numSignersKMS + list_handles + signatureKMSSigners + bundleCiphertext (1+1+NUM_HANDLES*32+65*numSignersKMS+bundleCiphertext.length)
uint256 inputProofLen = inputProof.length;
require(inputProofLen > 0, "Empty inputProof");
@@ -106,119 +92,74 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad
uint256 numSignersKMS = uint256(uint8(inputProof[1]));
require(numHandles > indexHandle, "Invalid index"); // @note: this checks in particular that the list is non-empty
- require(inputProofLen == 34 + 32 * numHandles + 65 * numSignersKMS, "Error deserializing inputProof");
+ // @note: on native if an invalid indexHandle above the "real" numHandles is passed, it will be mapped to a trivialEncrypt(0) by backend
+
+ require(inputProofLen > 2 + 32 * numHandles + 65 * numSignersKMS, "Error deserializing inputProof");
bytes32 hashCT;
- assembly {
- hashCT := mload(add(inputProof, 34))
+ {
+ uint256 prefixLength = 2 + 32 * numHandles + 65 * numSignersKMS;
+ uint256 bundleCiphertextLength = inputProofLen - prefixLength;
+ bytes memory bundleCiphertext = new bytes(bundleCiphertextLength);
+ for (uint256 i = 0; i < bundleCiphertextLength; i++) {
+ bundleCiphertext[i] = inputProof[prefixLength + i];
+ }
+ hashCT = keccak256(bundleCiphertext);
}
- // deseralize handle and check they are from correct version
- uint256[] memory listHandles = new uint256[](numHandles);
+ {
+ bytes[] memory signaturesKMS = new bytes[](numSignersKMS);
+ for (uint256 j = 0; j < numSignersKMS; j++) {
+ signaturesKMS[j] = new bytes(65);
+ for (uint256 i = 0; i < 65; i++) {
+ signaturesKMS[j][i] = inputProof[2 + 32 * numHandles + 65 * j + i];
+ }
+ }
+ KMSVerifier.CiphertextVerificationForKMS memory cvKMS;
+ cvKMS.aclAddress = context.aclAddress;
+ cvKMS.hashOfCiphertext = hashCT;
+ cvKMS.userAddress = context.userAddress;
+ cvKMS.contractAddress = context.contractAddress;
+ bool kmsCheck = kmsVerifier.verifyInputEIP712KMSSignatures(cvKMS, signaturesKMS);
+ require(kmsCheck, "Not enough unique KMS input signatures");
+ }
+
+ // deseralize handle and check they are from correct version and correct values (handles are recomputed onchain in native case)
for (uint256 i = 0; i < numHandles; i++) {
uint256 element;
- for (uint256 j = 0; j < 32; j++) {
- element |= uint256(uint8(inputProof[34 + i * 32 + j])) << (8 * (31 - j));
+ assembly {
+ element := mload(add(inputProof, add(34, mul(i, 32))))
}
// check all handles are from correct version
require(uint8(element) == HANDLE_VERSION, "Wrong handle version");
- listHandles[i] = element;
- }
-
- bytes[] memory signaturesKMS = new bytes[](numSignersKMS);
- for (uint256 j = 0; j < numSignersKMS; j++) {
- signaturesKMS[j] = new bytes(65);
- for (uint256 i = 0; i < 65; i++) {
- signaturesKMS[j][i] = inputProof[34 + 32 * numHandles + 65 * j + i];
+ uint256 indexElement = (element & 0x0000000000000000000000000000000000000000000000000000000000ff0000) >>
+ 16;
+ require(indexElement == i, "Wrong index for serialized handle");
+
+ uint256 recomputedHandle = uint256(keccak256(abi.encodePacked(hashCT, uint8(i))));
+ require(
+ (recomputedHandle & 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000) ==
+ (element & 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000),
+ "Wrong handle in inputProof"
+ ); // @note only the before last byte corresponding to type, ie element[30] could not be checked, i.e on native type is malleable, this means it will be casted accordingly by the backend (or trivialEncrypt(0) if index is invalid)
+ if (i == indexHandle) {
+ require(result == element, "Wrong inputHandle");
}
}
- CiphertextVerificationForKMS memory cvKMS;
- cvKMS.aclAddress = aclAddress;
- cvKMS.hashOfCiphertext = hashCT;
- cvKMS.userAddress = userAddress;
- cvKMS.contractAddress = contractAddress;
- verifyEIP712KMS(cvKMS, signaturesKMS);
cacheProof(cacheKey);
- require(result == listHandles[indexHandle], "Wrong inputHandle");
} else {
uint8 numHandles = uint8(inputProof[0]); // @note: we know inputProof is non-empty since it has been previously cached
require(numHandles > indexHandle, "Invalid index");
uint256 element;
for (uint256 j = 0; j < 32; j++) {
- element |= uint256(uint8(inputProof[34 + indexHandle * 32 + j])) << (8 * (31 - j));
+ element |= uint256(uint8(inputProof[2 + indexHandle * 32 + j])) << (8 * (31 - j));
}
require(element == result, "Wrong inputHandle");
}
return result;
}
- function verifyEIP712KMS(CiphertextVerificationForKMS memory cv, bytes[] memory signatures) internal virtual {
- uint256 numSignatures = signatures.length;
- require(numSignatures > 0, "No KMS signature provided");
- bytes32 digest = hashCiphertextVerificationForKMS(cv);
- uint256 threshold = kmsVerifier.getThreshold();
- require(numSignatures >= threshold, "At least threshold number of KMS signatures required");
- address[] memory recoveredSigners = new address[](numSignatures);
- uint256 uniqueValidCount;
- for (uint256 i; i < numSignatures; i++) {
- address signerRecovered = ECDSA.recover(digest, signatures[i]);
- require(kmsVerifier.isSigner(signerRecovered), "Recovered address is not one of KMS signers");
- if (!tload(signerRecovered)) {
- recoveredSigners[uniqueValidCount] = signerRecovered;
- uniqueValidCount++;
- tstore(signerRecovered, 1);
- }
- if (uniqueValidCount >= threshold) {
- for (uint256 j = 0; i < uniqueValidCount; i++) {
- /// @note : clearing transient storage for composability
- tstore(recoveredSigners[j], 0);
- }
- return;
- }
- }
- require(false, "Not enough unique KMS input signatures"); // if this line is reached, it means inputProof did not contain enough unique KMS signers signatures, so we revert
- }
-
- function tstore(address location, uint256 value) internal virtual {
- assembly {
- tstore(location, value)
- }
- }
-
- function tload(address location) internal view virtual returns (bool value) {
- assembly {
- value := tload(location)
- }
- }
-
- function hashCiphertextVerificationForKMS(
- CiphertextVerificationForKMS memory CVkms
- ) internal view virtual returns (bytes32) {
- return
- _hashTypedDataV4(
- keccak256(
- abi.encode(
- CIPHERTEXTVERIFICATION_KMS_TYPE_HASH,
- CVkms.aclAddress,
- CVkms.hashOfCiphertext,
- CVkms.userAddress,
- CVkms.contractAddress
- )
- )
- );
- }
-
- /// @notice recovers the signer's address from a `signature` and a `message` digest
- /// @dev Utilizes ECDSA for actual address recovery
- /// @param message The hash of the message that was signed
- /// @param signature The signature to verify
- /// @return signer The address that supposedly signed the message
- function recoverSigner(bytes32 message, bytes memory signature) internal pure virtual returns (address) {
- address signerRecovered = ECDSA.recover(message, signature);
- return signerRecovered;
- }
-
/// @notice Getter for the name and version of the contract
/// @return string representing the name and the version of the contract
function getVersion() external pure virtual returns (string memory) {
diff --git a/lib/KMSVerifier.sol b/lib/KMSVerifier.sol
index f8e46baa..6ea689e8 100644
--- a/lib/KMSVerifier.sol
+++ b/lib/KMSVerifier.sol
@@ -232,12 +232,11 @@ contract KMSVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgradea
uint256 uniqueValidCount;
for (uint256 i = 0; i < numSignatures; i++) {
address signerRecovered = recoverSigner(digest, signatures[i]);
- if (isSigner(signerRecovered)) {
- if (!tload(signerRecovered)) {
- recoveredSigners[uniqueValidCount] = signerRecovered;
- uniqueValidCount++;
- tstore(signerRecovered, 1);
- }
+ require(isSigner(signerRecovered), "KmsVerifier: Invalid KMS signer");
+ if (!tload(signerRecovered)) {
+ recoveredSigners[uniqueValidCount] = signerRecovered;
+ uniqueValidCount++;
+ tstore(signerRecovered, 1);
}
if (uniqueValidCount >= threshold) {
cleanTransientStorage(recoveredSigners, uniqueValidCount);
diff --git a/test/fhevmjsMocked.ts b/test/fhevmjsMocked.ts
index 5d90384a..9b1932f3 100644
--- a/test/fhevmjsMocked.ts
+++ b/test/fhevmjsMocked.ts
@@ -302,24 +302,47 @@ export const createEncryptedInputMocked = (contractAddress: string, userAddress:
dataInput.set([i, ENCRYPTION_TYPES[v], 0], 29);
return dataInput;
});
- let inputProof = '0x' + numberToHex(handles.length); // numSignersKMS + hashCT + list_handles + signatureCopro + signatureKMSSigners (1+1+32+NUM_HANDLES*32+65+65*numSignersKMS)
+ let inputProof = '0x' + numberToHex(handles.length); // for coprocessor : numHandles + numSignersKMS + hashCT + list_handles + signatureCopro + signatureKMSSigners (total len : 1+1+32+NUM_HANDLES*32+65+65*numSignersKMS)
+ // for native : numHandles + numSignersKMS + list_handles + signatureKMSSigners + bundleCiphertext (total len : 1+1+NUM_HANDLES*32+65*numSignersKMS+bundleCiphertext.length)
const numSigners = +process.env.NUM_KMS_SIGNERS!;
inputProof += numberToHex(numSigners);
- inputProof += hash.toString('hex');
- const listHandlesStr = handles.map((i) => uint8ArrayToHexString(i));
- listHandlesStr.map((handle) => (inputProof += handle));
- const listHandles = listHandlesStr.map((i) => BigInt('0x' + i));
- const sigCoproc = await computeInputSignatureCopro(
- '0x' + hash.toString('hex'),
- listHandles,
- userAddress,
- contractAddress,
- );
- inputProof += sigCoproc.slice(2);
-
- const signaturesKMS = await computeInputSignaturesKMS('0x' + hash.toString('hex'), userAddress, contractAddress);
- signaturesKMS.map((sigKMS) => (inputProof += sigKMS.slice(2)));
- listHandlesStr.map((handle, i) => insertSQL('0x' + handle, values[i]));
+ if (process.env.IS_COPROCESSOR === 'true') {
+ // coprocessor
+ inputProof += hash.toString('hex');
+
+ const listHandlesStr = handles.map((i) => uint8ArrayToHexString(i));
+ listHandlesStr.map((handle) => (inputProof += handle));
+ const listHandles = listHandlesStr.map((i) => BigInt('0x' + i));
+ const sigCoproc = await computeInputSignatureCopro(
+ '0x' + hash.toString('hex'),
+ listHandles,
+ userAddress,
+ contractAddress,
+ );
+ inputProof += sigCoproc.slice(2);
+
+ const signaturesKMS = await computeInputSignaturesKMS(
+ '0x' + hash.toString('hex'),
+ userAddress,
+ contractAddress,
+ );
+ signaturesKMS.map((sigKMS) => (inputProof += sigKMS.slice(2)));
+ listHandlesStr.map((handle, i) => insertSQL('0x' + handle, values[i]));
+ } else {
+ // native
+ const listHandlesStr = handles.map((i) => uint8ArrayToHexString(i));
+ listHandlesStr.map((handle) => (inputProof += handle));
+ const signaturesKMS = await computeInputSignaturesKMS(
+ '0x' + hash.toString('hex'),
+ userAddress,
+ contractAddress,
+ );
+ signaturesKMS.map((sigKMS) => (inputProof += sigKMS.slice(2)));
+ listHandlesStr.map((handle, i) => insertSQL('0x' + handle, values[i]));
+
+ inputProof += encrypted.toString('hex');
+ }
+
return {
handles,
inputProof,
diff --git a/test/kmsVerifier/kmsVerifier.ts b/test/kmsVerifier/kmsVerifier.ts
index 0f25cf4c..38edf33c 100644
--- a/test/kmsVerifier/kmsVerifier.ts
+++ b/test/kmsVerifier/kmsVerifier.ts
@@ -92,14 +92,16 @@ describe('KMSVerifier', function () {
}),
).to.revertedWith('KmsVerifier: at least threshold number of signatures required'); // this should fail because in this case the InputVerifier received only one KMS signature (instead of at least 2);
- const cheatInputProof = encryptedAmount2.inputProof + encryptedAmount2.inputProof.slice(-130); // trying to cheat by repeating the first kms signer signature
- const cheat = cheatInputProof.slice(0, 5) + '2' + cheatInputProof.slice(6);
- await expect(
- contract2.requestMixedBytes256Trustless(encryptedAmount2.handles[0], cheat, {
- gasLimit: 5_000_000,
- }),
- ).to.revertedWith('Not enough unique KMS input signatures'); // this should fail because in this case the InputVerifier received only one KMS signature (instead of at least 2)
-
+ if (process.env.IS_COPROCESSOR === 'true') {
+ // different format of inputProof for native
+ const cheatInputProof = encryptedAmount2.inputProof + encryptedAmount2.inputProof.slice(-130); // trying to cheat by repeating the first kms signer signature
+ const cheat = cheatInputProof.slice(0, 5) + '2' + cheatInputProof.slice(6);
+ await expect(
+ contract2.requestMixedBytes256Trustless(encryptedAmount2.handles[0], cheat, {
+ gasLimit: 5_000_000,
+ }),
+ ).to.revertedWith('Not enough unique KMS input signatures'); // this should fail because in this case the InputVerifier received only one KMS signature (instead of at least 2)
+ }
process.env.NUM_KMS_SIGNERS = '4';
const encryptedAmount = await inputAlice.encrypt();
const tx6bis = await contract2.requestMixedBytes256Trustless(
From 0943a0895c2cdbbbc49c6742ab53ad79137649ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Fri, 4 Oct 2024 15:04:18 +0200
Subject: [PATCH 16/51] feat: use fhevm deployer private key for deployment
chore: cleanup README
feat: add option to pass addresses for kms signers instead of private keys
chore: typo and cleanup in sh script
---
.env.example | 13 +-
README.md | 17 --
examples/{ => legacy}/Governor/Comp.sol | 2 +-
.../{ => legacy}/Governor/GovernorZama.sol | 2 +-
examples/{ => legacy}/Governor/SafeMath.sol | 0
examples/{ => legacy}/Governor/Timelock.sol | 0
.../{ => legacy}/Identity/CompliantERC20.sol | 4 +-
examples/{ => legacy}/Identity/ERC20Rules.sol | 2 +-
.../Identity/IdentityRegistry.sol | 2 +-
hardhat.config.ts | 33 ++-
launch-fhevm.sh | 53 ++--
lib/.env.acl | 2 +-
lib/.env.exec | 2 +-
lib/.env.fhepayment | 2 +-
lib/.env.inputverifier | 2 +-
lib/.env.kmsverifier | 2 +-
lib/ACLAddress.sol | 2 +-
lib/FHEPaymentAddress.sol | 2 +-
lib/InputVerifierAddress.sol | 2 +-
lib/KMSVerifierAddress.sol | 2 +-
lib/TFHEExecutorAddress.sol | 2 +-
package.json | 9 +-
setup-local-fhevm.sh | 20 --
tasks/mint.ts | 8 +
tasks/taskDeploy.ts | 220 +++++++-------
tasks/taskGatewayRelayer.ts | 30 +-
tasks/taskIdentity.ts | 166 -----------
tasks/taskTFHE.ts | 270 +++++++++---------
tasks/utils.ts | 42 ---
test/kmsVerifier/kmsVerifier.ts | 2 +-
test/upgrades/upgrades.ts | 2 +-
31 files changed, 362 insertions(+), 555 deletions(-)
rename examples/{ => legacy}/Governor/Comp.sol (99%)
rename examples/{ => legacy}/Governor/GovernorZama.sol (99%)
rename examples/{ => legacy}/Governor/SafeMath.sol (100%)
rename examples/{ => legacy}/Governor/Timelock.sol (100%)
rename examples/{ => legacy}/Identity/CompliantERC20.sol (95%)
rename examples/{ => legacy}/Identity/ERC20Rules.sol (99%)
rename examples/{ => legacy}/Identity/IdentityRegistry.sol (99%)
delete mode 100755 setup-local-fhevm.sh
delete mode 100644 tasks/taskIdentity.ts
delete mode 100644 tasks/utils.ts
diff --git a/.env.example b/.env.example
index 45ca2b1e..2121c713 100644
--- a/.env.example
+++ b/.env.example
@@ -1,13 +1,18 @@
export INFURA_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
export MNEMONIC="adapt mosquito move limb mobile illegal tree voyage juice mosquito burger raise father hope layer"
+export PRIVATE_KEY_FHEVM_DEPLOYER="0c66d8cde71d2faa29d0cb6e3a567d31279b6eace67b0a9d9ba869c119843a5e"
export PRIVATE_KEY_GATEWAY_DEPLOYER="717fd99986df414889fd8b51069d4f90a50af72e542c58ee065f5883779099c6"
export PRIVATE_KEY_GATEWAY_OWNER="717fd99986df414889fd8b51069d4f90a50af72e542c58ee065f5883779099c6"
export PRIVATE_KEY_GATEWAY_RELAYER="7ec931411ad75a7c201469a385d6f18a325d4923f9f213bd882bbea87e160b67"
export NUM_KMS_SIGNERS="1"
-export PRIVATE_KEY_KMS_SIGNER_0="26698d458a21b843aa1ddbd5c5b098821ddf4218bb52498c4aad3a84849275bb"
-export PRIVATE_KEY_KMS_SIGNER_1="e5b998ce1e664718772fa35e8d02b2b6a267a03a8ecadab15de5b125da7fa82b"
-export PRIVATE_KEY_KMS_SIGNER_2="dca817bfe824b12c92d61e56056b956617da156bcd730379cb9203c822c9ba8e"
-export PRIVATE_KEY_KMS_SIGNER_3="7ac1a2886ca07b3b7393ea5ff3613bb94d72129e2c7cbedc807eb55ff971394c"
+export PRIVATE_KEY_KMS_SIGNER_0="388b7680e4e1afa06efbfd45cdd1fe39f3c6af381df6555a19661f283b97de91"
+export PRIVATE_KEY_KMS_SIGNER_1="bbaed91514fa4b7c86aa4f73becbabcf4bce0ae130240f0d6ac3f87e06812440"
+export PRIVATE_KEY_KMS_SIGNER_2="1bfa3e2233b0103ad67954a728b246c528916791f7fab4894ff361e3937b47e1"
+export PRIVATE_KEY_KMS_SIGNER_3="7a604eed8cf4a43277d192aa0c7894d368577a4021e52bf45420f256e34c7dd7"
+export ADDRESS_KMS_SIGNER_0="0x0971C80fF03B428fD2094dd5354600ab103201C5"
+export ADDRESS_KMS_SIGNER_1="0xB68deCb047B5e6Cc82280502A7E2318c6b3E5eC6"
+export ADDRESS_KMS_SIGNER_2="0xfe0fB0BCceb872ee7a6ef6c455e6E127Aef55DD7"
+export ADDRESS_KMS_SIGNER_3="0x2dac5193bE0AB0eD8871399E6Ae61EAe6cc8cAE1"
export PRIVATE_KEY_COPROCESSOR_ACCOUNT="7ec8ada6642fc4ccfb7729bc29c17cf8d21b61abd5642d1db992c0b8672ab901"
export IS_COPROCESSOR="true"
diff --git a/README.md b/README.md
index cfa037f3..3979f927 100644
--- a/README.md
+++ b/README.md
@@ -253,23 +253,6 @@ npm run fhevm:start
npm run fhevm:stop
```
-##### Faucet
-
-For development purposes, we provide a ready to use wallet. In order to use
-it, prepare the .env file that contains the mnemonic.
-
-```bash
-cp .env.example .env
-```
-
-This allows the developer to use a few accounts, each account can get coins:
-
-```bash
-npm run fhevm:faucet:alice
-npm run fhevm:faucet:bob
-npm run fhevm:faucet:carol
-```
-
##### Run test
```bash
diff --git a/examples/Governor/Comp.sol b/examples/legacy/Governor/Comp.sol
similarity index 99%
rename from examples/Governor/Comp.sol
rename to examples/legacy/Governor/Comp.sol
index 69398611..fe14e7c6 100644
--- a/examples/Governor/Comp.sol
+++ b/examples/legacy/Governor/Comp.sol
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.8.24;
-import "../../lib/TFHE.sol";
+import "../../../lib/TFHE.sol";
contract Comp {
/// @notice EIP-20 token name for this token
diff --git a/examples/Governor/GovernorZama.sol b/examples/legacy/Governor/GovernorZama.sol
similarity index 99%
rename from examples/Governor/GovernorZama.sol
rename to examples/legacy/Governor/GovernorZama.sol
index 1df13ed8..b4ed0936 100644
--- a/examples/Governor/GovernorZama.sol
+++ b/examples/legacy/Governor/GovernorZama.sol
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.8.24;
-import "../../lib/TFHE.sol";
+import "../../../lib/TFHE.sol";
contract GovernorZama {
/// @notice The name of this contract
diff --git a/examples/Governor/SafeMath.sol b/examples/legacy/Governor/SafeMath.sol
similarity index 100%
rename from examples/Governor/SafeMath.sol
rename to examples/legacy/Governor/SafeMath.sol
diff --git a/examples/Governor/Timelock.sol b/examples/legacy/Governor/Timelock.sol
similarity index 100%
rename from examples/Governor/Timelock.sol
rename to examples/legacy/Governor/Timelock.sol
diff --git a/examples/Identity/CompliantERC20.sol b/examples/legacy/Identity/CompliantERC20.sol
similarity index 95%
rename from examples/Identity/CompliantERC20.sol
rename to examples/legacy/Identity/CompliantERC20.sol
index e9430a33..8ed53ee9 100644
--- a/examples/Identity/CompliantERC20.sol
+++ b/examples/legacy/Identity/CompliantERC20.sol
@@ -2,8 +2,8 @@
pragma solidity ^0.8.24;
-import "../../lib/TFHE.sol";
-import "../EncryptedERC20.sol";
+import "../../../lib/TFHE.sol";
+import "../../EncryptedERC20.sol";
import "./ERC20Rules.sol";
import "./IdentityRegistry.sol";
diff --git a/examples/Identity/ERC20Rules.sol b/examples/legacy/Identity/ERC20Rules.sol
similarity index 99%
rename from examples/Identity/ERC20Rules.sol
rename to examples/legacy/Identity/ERC20Rules.sol
index 6dd04a49..cb394c24 100644
--- a/examples/Identity/ERC20Rules.sol
+++ b/examples/legacy/Identity/ERC20Rules.sol
@@ -2,7 +2,7 @@
pragma solidity ^0.8.24;
-import "../../lib/TFHE.sol";
+import "../../../lib/TFHE.sol";
import "./IdentityRegistry.sol";
interface ICompliantERC20 {
diff --git a/examples/Identity/IdentityRegistry.sol b/examples/legacy/Identity/IdentityRegistry.sol
similarity index 99%
rename from examples/Identity/IdentityRegistry.sol
rename to examples/legacy/Identity/IdentityRegistry.sol
index d8b2b9b5..656d84fa 100644
--- a/examples/Identity/IdentityRegistry.sol
+++ b/examples/legacy/Identity/IdentityRegistry.sol
@@ -6,7 +6,7 @@ import "@openzeppelin/contracts/access/Ownable2Step.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
-import "../../lib/TFHE.sol";
+import "../../../lib/TFHE.sol";
contract IdentityRegistry is Ownable2Step {
uint constant MAX_IDENTIFIERS_LENGTH = 20;
diff --git a/hardhat.config.ts b/hardhat.config.ts
index 588f20a2..a90f1dbd 100644
--- a/hardhat.config.ts
+++ b/hardhat.config.ts
@@ -16,7 +16,6 @@ import './tasks/getEthereumAddress';
import './tasks/mint';
import './tasks/taskDeploy';
import './tasks/taskGatewayRelayer';
-import './tasks/taskIdentity';
import './tasks/taskTFHE';
extendProvider(async (provider, config, network) => {
@@ -87,13 +86,14 @@ task('test', async (taskArgs, hre, runSuper) => {
// Run modified test task
if (hre.network.name === 'hardhat') {
// in fhevm mode all this block is done when launching the node via `pnmp fhevm:start`
- const privKeyDeployer = process.env.PRIVATE_KEY_GATEWAY_DEPLOYER;
- await hre.run('task:computePredeployAddress', { privateKey: privKeyDeployer });
- await hre.run('task:computeACLAddress');
- await hre.run('task:computeTFHEExecutorAddress');
- await hre.run('task:computeKMSVerifierAddress');
- await hre.run('task:computeInputVerifierAddress');
- await hre.run('task:computeFHEPaymentAddress');
+ const privKeyGatewayDeployer = process.env.PRIVATE_KEY_GATEWAY_DEPLOYER;
+ const privKeyFhevmDeployer = process.env.PRIVATE_KEY_FHEVM_DEPLOYER;
+ await hre.run('task:computeGatewayAddress', { privateKey: privKeyGatewayDeployer });
+ await hre.run('task:computeACLAddress', { privateKey: privKeyFhevmDeployer });
+ await hre.run('task:computeTFHEExecutorAddress', { privateKey: privKeyFhevmDeployer });
+ await hre.run('task:computeKMSVerifierAddress', { privateKey: privKeyFhevmDeployer });
+ await hre.run('task:computeInputVerifierAddress', { privateKey: privKeyFhevmDeployer });
+ await hre.run('task:computeFHEPaymentAddress', { privateKey: privKeyFhevmDeployer });
if (process.env.IS_COPROCESSOR === 'true') {
await fs.copyFile('lib/InputVerifier.sol.coprocessor', 'lib/InputVerifier.sol');
} else {
@@ -102,12 +102,17 @@ task('test', async (taskArgs, hre, runSuper) => {
await hre.run('compile:specific', { contract: 'lib' });
await hre.run('compile:specific', { contract: 'gateway' });
await hre.run('compile:specific', { contract: 'payment' });
- await hre.run('task:deployACL');
- await hre.run('task:deployTFHEExecutor');
- await hre.run('task:deployKMSVerifier');
- await hre.run('task:deployInputVerifier');
- await hre.run('task:deployFHEPayment');
- await hre.run('task:addSigners', { numSigners: +process.env.NUM_KMS_SIGNERS! });
+ await hre.run('task:faucetToPrivate', { privateKey: privKeyFhevmDeployer });
+ await hre.run('task:deployACL', { privateKey: privKeyFhevmDeployer });
+ await hre.run('task:deployTFHEExecutor', { privateKey: privKeyFhevmDeployer });
+ await hre.run('task:deployKMSVerifier', { privateKey: privKeyFhevmDeployer });
+ await hre.run('task:deployInputVerifier', { privateKey: privKeyFhevmDeployer });
+ await hre.run('task:deployFHEPayment', { privateKey: privKeyFhevmDeployer });
+ await hre.run('task:addSigners', {
+ numSigners: +process.env.NUM_KMS_SIGNERS!,
+ privateKey: privKeyFhevmDeployer,
+ useAddress: false,
+ });
await hre.run('task:launchFhevm', { skipGetCoin: false });
}
await hre.run('compile:specific', { contract: 'examples' });
diff --git a/launch-fhevm.sh b/launch-fhevm.sh
index dc0c1403..847b0958 100755
--- a/launch-fhevm.sh
+++ b/launch-fhevm.sh
@@ -1,33 +1,34 @@
#!/bin/bash
+npx hardhat clean
PRIVATE_KEY_GATEWAY_DEPLOYER=$(grep PRIVATE_KEY_GATEWAY_DEPLOYER .env | cut -d '"' -f 2)
-
-npx hardhat task:computePredeployAddress --private-key "$PRIVATE_KEY_GATEWAY_DEPLOYER"
-
-PRIVATE_KEY_GATEWAY_RELAYER=$(grep PRIVATE_KEY_GATEWAY_RELAYER .env | cut -d '"' -f 2)
-
-GATEWAY_CONTRACT_PREDEPLOY_ADDRESS=$(grep GATEWAY_CONTRACT_PREDEPLOY_ADDRESS gateway/.env.gateway | cut -d '=' -f2)
-
-TFHE_EXECUTOR_CONTRACT_ADDRESS=$(grep TFHE_EXECUTOR_CONTRACT_ADDRESS lib/.env.exec | cut -d '=' -f2)
-
-docker run -d -i -p 8545:8545 --rm --name fhevm \
- -e PRIVATE_KEY_ORACLE_RELAYER="$PRIVATE_KEY_ORACLE_RELAYER" \
- -e ORACLE_CONTRACT_PREDEPLOY_ADDRESS="$ORACLE_CONTRACT_PREDEPLOY_ADDRESS" \
- -e TFHE_EXECUTOR_CONTRACT_ADDRESS="$TFHE_EXECUTOR_CONTRACT_ADDRESS" \
- ghcr.io/zama-ai/ethermint-dev-node:v0.5.0-1
-
-sleep 10
-
-npx hardhat task:computeACLAddress
-npx hardhat task:computeTFHEExecutorAddress
-npx hardhat task:computeKMSVerifierAddress
-npx hardhat task:deployACL
-npx hardhat task:deployTFHEExecutor
-npx hardhat task:deployKMSVerifier
-
+PRIVATE_KEY_FHEVM_DEPLOYER=$(grep PRIVATE_KEY_FHEVM_DEPLOYER .env | cut -d '"' -f 2)
+NUM_KMS_SIGNERS=$(grep NUM_KMS_SIGNERS .env | cut -d '"' -f 2)
+IS_COPROCESSOR=$(grep IS_COPROCESSOR .env | cut -d '"' -f 2)
+
+npx hardhat task:computeGatewayAddress --private-key "$PRIVATE_KEY_GATEWAY_DEPLOYER"
+npx hardhat task:computeACLAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
+npx hardhat task:computeTFHEExecutorAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
+npx hardhat task:computeKMSVerifierAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
+npx hardhat task:computeInputVerifierAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
+npx hardhat task:computeFHEPaymentAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
+
+# [ADD DOCKER-COMPOSE COMMAND HERE] // Geth node, Gateway service, KMS service etc should be launched here, using previously precomputed addresses
+
+if [ "$IS_COPROCESSOR" = "true" ]; then
+ cp lib/InputVerifier.sol.coprocessor lib/InputVerifier.sol
+else
+ cp lib/InputVerifier.sol.native lib/InputVerifier.sol
+fi
npx hardhat compile:specific --contract lib
npx hardhat compile:specific --contract gateway
-npx hardhat task:launchFhevm
+npx hardhat task:deployACL --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
+npx hardhat task:deployTFHEExecutor --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
+npx hardhat task:deployKMSVerifier --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
+npx hardhat task:deployInputVerifier --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
+npx hardhat task:deployFHEPayment --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
+
+npx hardhat task:addSigners --num-signers $NUM_KMS_SIGNERS --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --useAddress true
-docker attach fhevm
+npx hardhat task:launchFhevm --skip-get-coin true
\ No newline at end of file
diff --git a/lib/.env.acl b/lib/.env.acl
index adc70118..83c07ff7 100644
--- a/lib/.env.acl
+++ b/lib/.env.acl
@@ -1 +1 @@
-ACL_CONTRACT_ADDRESS=0x05fD9B5EFE0a996095f42Ed7e77c390810CF660c
+ACL_CONTRACT_ADDRESS=0x339EcE85B9E11a3A3AA557582784a15d7F82AAf2
diff --git a/lib/.env.exec b/lib/.env.exec
index b0bb5d23..adba3fce 100644
--- a/lib/.env.exec
+++ b/lib/.env.exec
@@ -1 +1 @@
-TFHE_EXECUTOR_CONTRACT_ADDRESS=0xcCAe95fF1d11656358E782570dF0418F59fA40e1
+TFHE_EXECUTOR_CONTRACT_ADDRESS=0x596E6682c72946AF006B27C131793F2b62527A4b
diff --git a/lib/.env.fhepayment b/lib/.env.fhepayment
index faf1f126..2a38d176 100644
--- a/lib/.env.fhepayment
+++ b/lib/.env.fhepayment
@@ -1 +1 @@
-FHE_PAYMENT_CONTRACT_ADDRESS=0x222ea0147FF597Ff1935B2a55afeDC404425203d
+FHE_PAYMENT_CONTRACT_ADDRESS=0x6d5A11aC509C707c00bc3A0a113ACcC26c532547
diff --git a/lib/.env.inputverifier b/lib/.env.inputverifier
index f95b2da3..b628bb02 100644
--- a/lib/.env.inputverifier
+++ b/lib/.env.inputverifier
@@ -1 +1 @@
-INPUT_VERIFIER_CONTRACT_ADDRESS=0x52054F36036811ca418be59e41Fc6DD1b9e4F4c8
+INPUT_VERIFIER_CONTRACT_ADDRESS=0x69dE3158643e738a0724418b21a35FAA20CBb1c5
diff --git a/lib/.env.kmsverifier b/lib/.env.kmsverifier
index 23871484..d5db2185 100644
--- a/lib/.env.kmsverifier
+++ b/lib/.env.kmsverifier
@@ -1 +1 @@
-KMS_VERIFIER_CONTRACT_ADDRESS=0x857Ca72A957920Fa0FB138602995839866Bd4005
+KMS_VERIFIER_CONTRACT_ADDRESS=0x208De73316E44722e16f6dDFF40881A3e4F86104
diff --git a/lib/ACLAddress.sol b/lib/ACLAddress.sol
index 2052f317..06488813 100644
--- a/lib/ACLAddress.sol
+++ b/lib/ACLAddress.sol
@@ -2,4 +2,4 @@
pragma solidity ^0.8.24;
-address constant aclAdd = 0x05fD9B5EFE0a996095f42Ed7e77c390810CF660c;
+address constant aclAdd = 0x339EcE85B9E11a3A3AA557582784a15d7F82AAf2;
diff --git a/lib/FHEPaymentAddress.sol b/lib/FHEPaymentAddress.sol
index 4a9c735f..8b0e4358 100644
--- a/lib/FHEPaymentAddress.sol
+++ b/lib/FHEPaymentAddress.sol
@@ -2,4 +2,4 @@
pragma solidity ^0.8.24;
-address constant fhePaymentAdd = 0x222ea0147FF597Ff1935B2a55afeDC404425203d;
+address constant fhePaymentAdd = 0x6d5A11aC509C707c00bc3A0a113ACcC26c532547;
diff --git a/lib/InputVerifierAddress.sol b/lib/InputVerifierAddress.sol
index 4c3f4cc2..6dfb7606 100644
--- a/lib/InputVerifierAddress.sol
+++ b/lib/InputVerifierAddress.sol
@@ -2,4 +2,4 @@
pragma solidity ^0.8.24;
-address constant inputVerifierAdd = 0x52054F36036811ca418be59e41Fc6DD1b9e4F4c8;
+address constant inputVerifierAdd = 0x69dE3158643e738a0724418b21a35FAA20CBb1c5;
diff --git a/lib/KMSVerifierAddress.sol b/lib/KMSVerifierAddress.sol
index 34443a5e..e9293d6b 100644
--- a/lib/KMSVerifierAddress.sol
+++ b/lib/KMSVerifierAddress.sol
@@ -2,4 +2,4 @@
pragma solidity ^0.8.24;
-address constant kmsVerifierAdd = 0x857Ca72A957920Fa0FB138602995839866Bd4005;
+address constant kmsVerifierAdd = 0x208De73316E44722e16f6dDFF40881A3e4F86104;
diff --git a/lib/TFHEExecutorAddress.sol b/lib/TFHEExecutorAddress.sol
index 64d75675..f13f3da8 100644
--- a/lib/TFHEExecutorAddress.sol
+++ b/lib/TFHEExecutorAddress.sol
@@ -2,4 +2,4 @@
pragma solidity ^0.8.24;
-address constant tfheExecutorAdd = 0xcCAe95fF1d11656358E782570dF0418F59fA40e1;
+address constant tfheExecutorAdd = 0x596E6682c72946AF006B27C131793F2b62527A4b;
diff --git a/package.json b/package.json
index be3cdeff..ead155f0 100644
--- a/package.json
+++ b/package.json
@@ -26,19 +26,12 @@
"codegen": "npx ts-node codegen/main.ts && npm run prettier",
"codegen:overloads": "npx ts-node codegen/generateOverloads.ts",
"task:getEthereumAddress": "hardhat task:getEthereumAddress",
- "task:deployIdentity": "hardhat task:deployIdentity",
"task:deployGateway": "hardhat task:deployGateway",
"task:addRelayer": "hardhat task:addRelayer",
"task:removeRelayer": "hardhat task:removeRelayer",
"fhevm:start": " ./launch-fhevm.sh",
"fhevm:stop": "docker rm -f fhevm",
- "fhevm:restart": "fhevm:stop && fhevm:start",
- "fhevm:faucet": "npm run fhevm:faucet:alice && sleep 5 && npm run fhevm:faucet:bob && sleep 5 && npm run fhevm:faucet:carol && sleep 5 && npm run fhevm:faucet:dave && sleep 5 && npm run fhevm:faucet:eve",
- "fhevm:faucet:alice": "docker exec -i fhevm faucet $(npx hardhat task:getEthereumAddressAlice)",
- "fhevm:faucet:bob": "docker exec -i fhevm faucet $(npx hardhat task:getEthereumAddressBob)",
- "fhevm:faucet:carol": "docker exec -i fhevm faucet $(npx hardhat task:getEthereumAddressCarol)",
- "fhevm:faucet:dave": "docker exec -i fhevm faucet $(npx hardhat task:getEthereumAddressDave)",
- "fhevm:faucet:eve": "docker exec -i fhevm faucet $(npx hardhat task:getEthereumAddressEve)"
+ "fhevm:restart": "fhevm:stop && fhevm:start"
},
"repository": {
"type": "git",
diff --git a/setup-local-fhevm.sh b/setup-local-fhevm.sh
deleted file mode 100755
index f568a3d2..00000000
--- a/setup-local-fhevm.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-# Assumes the following:
-# 1. A local and **fresh** fhEVM node is already running.
-# 2. All test addresses are funded (e.g. via the fund_test_addresses.sh script).
-npx hardhat clean
-npx hardhat compile:specific --contract lib
-npx hardhat compile:specific --contract gateway
-
-PRIVATE_KEY_GATEWAY_DEPLOYER=$(grep PRIVATE_KEY_GATEWAY_DEPLOYER .env | cut -d '"' -f 2)
-npx hardhat task:computePredeployAddress --private-key "$PRIVATE_KEY_GATEWAY_DEPLOYER"
-
-npx hardhat task:computeACLAddress
-npx hardhat task:computeTFHEExecutorAddress
-npx hardhat task:computeKMSVerifierAddress
-npx hardhat task:deployACL
-npx hardhat task:deployTFHEExecutor
-npx hardhat task:deployKMSVerifier
-
-npx hardhat task:launchFhevm --skip-get-coin true
diff --git a/tasks/mint.ts b/tasks/mint.ts
index a8c68dcd..862376c6 100644
--- a/tasks/mint.ts
+++ b/tasks/mint.ts
@@ -1,6 +1,14 @@
import { task } from 'hardhat/config';
import type { TaskArguments } from 'hardhat/types';
+task('task:deployERC20').setAction(async function (taskArguments: TaskArguments, { ethers }) {
+ const signers = await ethers.getSigners();
+ const erc20Factory = await ethers.getContractFactory('EncryptedERC20');
+ const encryptedERC20 = await erc20Factory.connect(signers[0]).deploy('Naraggara', 'NARA');
+ await encryptedERC20.waitForDeployment();
+ console.log('EncryptedERC20 deployed to: ', await encryptedERC20.getAddress());
+});
+
task('task:mint')
.addParam('mint', 'Tokens to mint')
.setAction(async function (taskArguments: TaskArguments, hre) {
diff --git a/tasks/taskDeploy.ts b/tasks/taskDeploy.ts
index 771e7854..9365f400 100644
--- a/tasks/taskDeploy.ts
+++ b/tasks/taskDeploy.ts
@@ -1,17 +1,8 @@
-import chalk from 'chalk';
import dotenv from 'dotenv';
import fs from 'fs';
import { task } from 'hardhat/config';
import type { TaskArguments } from 'hardhat/types';
-task('task:deployERC20').setAction(async function (taskArguments: TaskArguments, { ethers }) {
- const signers = await ethers.getSigners();
- const erc20Factory = await ethers.getContractFactory('EncryptedERC20');
- const encryptedERC20 = await erc20Factory.connect(signers[0]).deploy('Naraggara', 'NARA');
- await encryptedERC20.waitForDeployment();
- console.log('EncryptedERC20 deployed to: ', await encryptedERC20.getAddress());
-});
-
task('task:deployGateway')
.addParam('privateKey', 'The deployer private key')
.addParam('ownerAddress', 'The owner address')
@@ -33,109 +24,120 @@ task('task:deployGateway')
console.log('GatewayContract was deployed at address: ', GatewayContractAddress);
});
-task('task:deployIdentity').setAction(async function (taskArguments: TaskArguments, { ethers }) {
- const signers = await ethers.getSigners();
-
- const identityRegistryFactory = await ethers.getContractFactory('IdentityRegistry');
- const identityRegistry = await identityRegistryFactory.connect(signers[0]).deploy();
-
- const erc20RulesFactory = await ethers.getContractFactory('ERC20Rules');
- const erc20Rules = await erc20RulesFactory.connect(signers[0]).deploy();
- await identityRegistry.waitForDeployment();
- await erc20Rules.waitForDeployment();
-
- const compliantERC20Factory = await ethers.getContractFactory('CompliantERC20');
- const compliantERC20 = await compliantERC20Factory
- .connect(signers[0])
- .deploy(await identityRegistry.getAddress(), await erc20Rules.getAddress(), 'CompliantToken', 'CTOK');
- await compliantERC20.waitForDeployment();
-
- const registryAddress = await identityRegistry.getAddress();
- const erc20Address = await compliantERC20.getAddress();
- console.log(chalk.bold('Available methods:'));
- console.log(`npx hardhat task:identity:initRegistry --registry ${registryAddress}`);
- console.log(`npx hardhat task:identity:grantAccess --registry ${registryAddress} --erc20 ${erc20Address}`);
- console.log(`npx hardhat task:identity:mint --erc20 ${erc20Address}`);
- console.log(`npx hardhat task:identity:transfer --erc20 ${erc20Address} --from carol --to dave --amount 2000`);
- console.log(`npx hardhat task:identity:balanceOf --erc20 ${erc20Address} --user alice`);
-});
-
-task('task:deployACL').setAction(async function (taskArguments: TaskArguments, { ethers, upgrades }) {
- const deployer = (await ethers.getSigners())[9];
- const factory = await ethers.getContractFactory('ACL', deployer);
- const acl = await upgrades.deployProxy(factory, [deployer.address], { initializer: 'initialize', kind: 'uups' });
- await acl.waitForDeployment();
- const address = await acl.getAddress();
- const envConfigAcl = dotenv.parse(fs.readFileSync('lib/.env.acl'));
- if (address !== envConfigAcl.ACL_CONTRACT_ADDRESS) {
- throw new Error(`The nonce of the deployer account is not correct. Please relaunch a clean instance of the fhEVM`);
- }
- console.log('ACL was deployed at address:', address);
-});
+task('task:deployACL')
+ .addParam('privateKey', 'The deployer private key')
+ .setAction(async function (taskArguments: TaskArguments, { ethers, upgrades }) {
+ const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
+ const factory = await ethers.getContractFactory('ACL', deployer);
+ const acl = await upgrades.deployProxy(factory, [deployer.address], { initializer: 'initialize', kind: 'uups' });
+ await acl.waitForDeployment();
+ const address = await acl.getAddress();
+ const envConfigAcl = dotenv.parse(fs.readFileSync('lib/.env.acl'));
+ if (address !== envConfigAcl.ACL_CONTRACT_ADDRESS) {
+ throw new Error(
+ `The nonce of the deployer account is not correct. Please relaunch a clean instance of the fhEVM`,
+ );
+ }
+ console.log('ACL was deployed at address:', address);
+ });
-task('task:deployTFHEExecutor').setAction(async function (taskArguments: TaskArguments, { ethers, upgrades }) {
- const deployer = (await ethers.getSigners())[9];
- const factory = await ethers.getContractFactory('TFHEExecutor', deployer);
- const exec = await upgrades.deployProxy(factory, [deployer.address], { initializer: 'initialize', kind: 'uups' });
- await exec.waitForDeployment();
- const address = await exec.getAddress();
- const envConfig = dotenv.parse(fs.readFileSync('lib/.env.exec'));
- if (address !== envConfig.TFHE_EXECUTOR_CONTRACT_ADDRESS) {
- throw new Error(`The nonce of the deployer account is not correct. Please relaunch a clean instance of the fhEVM`);
- }
- console.log('TFHEExecutor was deployed at address:', address);
-});
+task('task:deployTFHEExecutor')
+ .addParam('privateKey', 'The deployer private key')
+ .setAction(async function (taskArguments: TaskArguments, { ethers, upgrades }) {
+ const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
+ const factory = await ethers.getContractFactory('TFHEExecutor', deployer);
+ const exec = await upgrades.deployProxy(factory, [deployer.address], { initializer: 'initialize', kind: 'uups' });
+ await exec.waitForDeployment();
+ const address = await exec.getAddress();
+ const envConfig = dotenv.parse(fs.readFileSync('lib/.env.exec'));
+ if (address !== envConfig.TFHE_EXECUTOR_CONTRACT_ADDRESS) {
+ throw new Error(
+ `The nonce of the deployer account is not correct. Please relaunch a clean instance of the fhEVM`,
+ );
+ }
+ console.log('TFHEExecutor was deployed at address:', address);
+ });
-task('task:deployKMSVerifier').setAction(async function (taskArguments: TaskArguments, { ethers, upgrades }) {
- const deployer = (await ethers.getSigners())[9];
- const factory = await ethers.getContractFactory('KMSVerifier', deployer);
- const kms = await upgrades.deployProxy(factory, [deployer.address], { initializer: 'initialize', kind: 'uups' });
- await kms.waitForDeployment();
- const address = await kms.getAddress();
- const envConfig = dotenv.parse(fs.readFileSync('lib/.env.kmsverifier'));
- if (address !== envConfig.KMS_VERIFIER_CONTRACT_ADDRESS) {
- throw new Error(`The nonce of the deployer account is not correct. Please relaunch a clean instance of the fhEVM`);
- }
- console.log('KMSVerifier was deployed at address:', address);
-});
+task('task:deployKMSVerifier')
+ .addParam('privateKey', 'The deployer private key')
+ .setAction(async function (taskArguments: TaskArguments, { ethers, upgrades }) {
+ const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
+ const factory = await ethers.getContractFactory('KMSVerifier', deployer);
+ const kms = await upgrades.deployProxy(factory, [deployer.address], { initializer: 'initialize', kind: 'uups' });
+ await kms.waitForDeployment();
+ const address = await kms.getAddress();
+ const envConfig = dotenv.parse(fs.readFileSync('lib/.env.kmsverifier'));
+ if (address !== envConfig.KMS_VERIFIER_CONTRACT_ADDRESS) {
+ throw new Error(
+ `The nonce of the deployer account is not correct. Please relaunch a clean instance of the fhEVM`,
+ );
+ }
+ console.log('KMSVerifier was deployed at address:', address);
+ });
-task('task:deployInputVerifier').setAction(async function (taskArguments: TaskArguments, { ethers, upgrades }) {
- const deployer = (await ethers.getSigners())[9];
- const factory = await ethers.getContractFactory('InputVerifier', deployer);
- const kms = await upgrades.deployProxy(factory, [deployer.address], { initializer: 'initialize', kind: 'uups' });
- await kms.waitForDeployment();
- const address = await kms.getAddress();
- const envConfig = dotenv.parse(fs.readFileSync('lib/.env.inputverifier'));
- if (address !== envConfig.INPUT_VERIFIER_CONTRACT_ADDRESS) {
- throw new Error(`The nonce of the deployer account is not correct. Please relaunch a clean instance of the fhEVM`);
- }
- console.log('InputVerifier was deployed at address:', address);
-});
+task('task:deployInputVerifier')
+ .addParam('privateKey', 'The deployer private key')
+ .setAction(async function (taskArguments: TaskArguments, { ethers, upgrades }) {
+ const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
+ const factory = await ethers.getContractFactory('InputVerifier', deployer);
+ const kms = await upgrades.deployProxy(factory, [deployer.address], { initializer: 'initialize', kind: 'uups' });
+ await kms.waitForDeployment();
+ const address = await kms.getAddress();
+ const envConfig = dotenv.parse(fs.readFileSync('lib/.env.inputverifier'));
+ if (address !== envConfig.INPUT_VERIFIER_CONTRACT_ADDRESS) {
+ throw new Error(
+ `The nonce of the deployer account is not correct. Please relaunch a clean instance of the fhEVM`,
+ );
+ }
+ console.log('InputVerifier was deployed at address:', address);
+ });
-task('task:deployFHEPayment').setAction(async function (taskArguments: TaskArguments, { ethers, upgrades }) {
- const deployer = (await ethers.getSigners())[9];
- const factory = await ethers.getContractFactory('FHEPayment', deployer);
- const payment = await upgrades.deployProxy(factory, [deployer.address], { initializer: 'initialize', kind: 'uups' });
- await payment.waitForDeployment();
- const address = await payment.getAddress();
- const envConfig = dotenv.parse(fs.readFileSync('lib/.env.fhepayment'));
- if (address !== envConfig.FHE_PAYMENT_CONTRACT_ADDRESS) {
- throw new Error(`The nonce of the deployer account is not correct. Please relaunch a clean instance of the fhEVM`);
- }
- console.log('FHEPayment was deployed at address:', address);
-});
+task('task:deployFHEPayment')
+ .addParam('privateKey', 'The deployer private key')
+ .setAction(async function (taskArguments: TaskArguments, { ethers, upgrades }) {
+ const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
+ const factory = await ethers.getContractFactory('FHEPayment', deployer);
+ const payment = await upgrades.deployProxy(factory, [deployer.address], {
+ initializer: 'initialize',
+ kind: 'uups',
+ });
+ await payment.waitForDeployment();
+ const address = await payment.getAddress();
+ const envConfig = dotenv.parse(fs.readFileSync('lib/.env.fhepayment'));
+ if (address !== envConfig.FHE_PAYMENT_CONTRACT_ADDRESS) {
+ throw new Error(
+ `The nonce of the deployer account is not correct. Please relaunch a clean instance of the fhEVM`,
+ );
+ }
+ console.log('FHEPayment was deployed at address:', address);
+ });
-task('task:addSigners').setAction(async function (taskArguments: TaskArguments, { ethers }) {
- const deployer = (await ethers.getSigners())[9];
- const factory = await ethers.getContractFactory('KMSVerifier', deployer);
- const kmsAdd = dotenv.parse(fs.readFileSync('lib/.env.kmsverifier')).KMS_VERIFIER_CONTRACT_ADDRESS;
- const kmsVerifier = await factory.attach(kmsAdd);
+task('task:addSigners')
+ .addParam('privateKey', 'The deployer private key')
+ .addOptionalParam(
+ 'useAddress',
+ 'Use addresses instead of private keys env variables for kms signers',
+ false,
+ types.boolean,
+ )
+ .setAction(async function (taskArguments: TaskArguments, { ethers }) {
+ const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
+ const factory = await ethers.getContractFactory('KMSVerifier', deployer);
+ const kmsAdd = dotenv.parse(fs.readFileSync('lib/.env.kmsverifier')).KMS_VERIFIER_CONTRACT_ADDRESS;
+ const kmsVerifier = await factory.attach(kmsAdd);
- for (let idx = 0; idx < taskArguments.numSigners; idx++) {
- const privKeySigner = process.env[`PRIVATE_KEY_KMS_SIGNER_${idx}`];
- const kmsSigner = new ethers.Wallet(privKeySigner).connect(ethers.provider);
- const tx = await kmsVerifier.addSigner(kmsSigner.address);
- await tx.wait();
- console.log(`KMS signer no${idx} (${kmsSigner.address}) was added to KMSVerifier contract`);
- }
-});
+ for (let idx = 0; idx < taskArguments.numSigners; idx++) {
+ if (!taskArguments.useAddress) {
+ const privKeySigner = process.env[`PRIVATE_KEY_KMS_SIGNER_${idx}`];
+ const kmsSigner = new ethers.Wallet(privKeySigner).connect(ethers.provider);
+ const tx = await kmsVerifier.addSigner(kmsSigner.address);
+ await tx.wait();
+ console.log(`KMS signer no${idx} (${kmsSigner.address}) was added to KMSVerifier contract`);
+ } else {
+ const kmsSignerAddress = process.env[`ADDRESS_KMS_SIGNER_${idx}`];
+ const tx = await kmsVerifier.addSigner(kmsSignerAddress);
+ await tx.wait();
+ console.log(`KMS signer no${idx} (${kmsSignerAddress}) was added to KMSVerifier contract`);
+ }
+ }
+ });
diff --git a/tasks/taskGatewayRelayer.ts b/tasks/taskGatewayRelayer.ts
index 945024f3..476efbd4 100644
--- a/tasks/taskGatewayRelayer.ts
+++ b/tasks/taskGatewayRelayer.ts
@@ -15,7 +15,7 @@ const getCoin = async (address: string) => {
if (res.raw_log.match('account sequence mismatch')) await getCoin(address);
};
-task('task:computePredeployAddress')
+task('task:computeGatewayAddress')
.addParam('privateKey', 'The deployer private key')
.setAction(async function (taskArguments: TaskArguments, { ethers }) {
const deployerAddress = new ethers.Wallet(taskArguments.privateKey).address;
@@ -136,3 +136,31 @@ task('task:getBalances').setAction(async function (taskArgs, hre) {
console.log(await hre.ethers.provider.getBalance(ownerAddress));
console.log(await hre.ethers.provider.getBalance(relayerAddress));
});
+
+task('task:faucetToPrivate')
+ .addParam('privateKey', 'The receiver private key')
+ .setAction(async function (taskArgs, hre) {
+ const receiverAddress = new hre.ethers.Wallet(taskArgs.privateKey).address;
+
+ if (hre.network.name === 'hardhat') {
+ const bal = '0x1000000000000000000000000000000000000000';
+ await hre.network.provider.send('hardhat_setBalance', [receiverAddress, bal]);
+ } else {
+ await getCoin(receiverAddress);
+ await new Promise((res) => setTimeout(res, 5000)); // wait 5 seconds
+ }
+ });
+
+task('task:faucetToAddress')
+ .addParam('address', 'The receiver address')
+ .setAction(async function (taskArgs, hre) {
+ const receiverAddress = taskArgs.address;
+
+ if (hre.network.name === 'hardhat') {
+ const bal = '0x1000000000000000000000000000000000000000';
+ await hre.network.provider.send('hardhat_setBalance', [receiverAddress, bal]);
+ } else {
+ await getCoin(receiverAddress);
+ await new Promise((res) => setTimeout(res, 5000)); // wait 5 seconds
+ }
+ });
diff --git a/tasks/taskIdentity.ts b/tasks/taskIdentity.ts
deleted file mode 100644
index 3e57ed74..00000000
--- a/tasks/taskIdentity.ts
+++ /dev/null
@@ -1,166 +0,0 @@
-import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers';
-import chalk from 'chalk';
-import { task } from 'hardhat/config';
-import type { TaskArguments } from 'hardhat/types';
-
-import { createInstance } from './utils';
-
-const getSigners = (eSigners: SignerWithAddress[]) => ({
- alice: eSigners[0],
- bob: eSigners[1],
- carol: eSigners[2],
- dave: eSigners[3],
-});
-
-task('task:identity:initRegistry')
- .addParam('registry', 'Registry contract address')
- .setAction(async function (taskArguments: TaskArguments, { ethers }) {
- const contractAddress = taskArguments.registry;
-
- const signers = await ethers.getSigners();
- const contract = (await ethers.getContractAt('IdentityRegistry', contractAddress)).connect(signers[0]) as any;
- console.log(chalk.bold('Step 1: Adding registrar'));
- console.log(chalk.italic('eg: registry.addRegistrar(wallet, id)'));
- try {
- const addRegistrarTx = await contract.addRegistrar(signers[1], 1);
- await addRegistrarTx.wait();
- console.log("=> Bob is a registrar with registrar id '1'");
- } catch (e) {
- console.log('=> Bob is already a registrar');
- }
-
- console.log('---');
- console.log(chalk.bold('Step 2: Adding decentralized id for 4 users (Alice, Bob, Carol and Dave)'));
- console.log(chalk.italic('eg: registry.addDid(wallet)'));
- try {
- const tx1 = await contract.connect(signers[1]).addDid(signers[0]);
- const tx2 = await contract.connect(signers[1]).addDid(signers[1]);
- const tx3 = await contract.connect(signers[1]).addDid(signers[2]);
- const tx4 = await contract.connect(signers[1]).addDid(signers[3]);
- await Promise.all([tx1.wait(), tx2.wait(), tx3.wait(), tx4.wait()]);
- console.log('=> Did added for Alice, Bob, Carol and Dave');
- } catch (e) {
- console.log('=> Did was already added');
- }
-
- console.log('---');
-
- console.log(chalk.bold('Step 3: Adding country identifiers'));
- console.log(chalk.italic("eg: registry.setIdentifier(wallet, 'country', Enc(1))"));
- const instance = await createInstance(contractAddress, signers[0], ethers);
-
- const country1 = instance.encrypt64(1);
- const country2 = instance.encrypt64(2);
-
- const tx1Identifier = await contract.connect(signers[1]).setIdentifier(signers[0], 'country', country1);
- const tx2Identifier = await contract.connect(signers[1]).setIdentifier(signers[1], 'country', country1);
- const tx3Identifier = await contract.connect(signers[1]).setIdentifier(signers[2], 'country', country1);
- const tx4Identifier = await contract.connect(signers[1]).setIdentifier(signers[3], 'country', country2);
- await Promise.all([tx1Identifier.wait(), tx2Identifier.wait(), tx3Identifier.wait(), tx4Identifier.wait()]);
- console.log("=> Alice, Bob and Carol are from country '1'");
- console.log("=> Dave is from country '2'");
- });
-
-task('task:identity:grantAccess')
- .addParam('registry', 'Registry contract address')
- .addParam('erc20', 'ERC20 contract address')
- .setAction(async function (taskArguments: TaskArguments, { ethers }) {
- const registryAddress = taskArguments.registry;
- const erc20Address = taskArguments.erc20;
-
- const signers = await ethers.getSigners();
- const registry = (await ethers.getContractAt('IdentityRegistry', registryAddress)) as any;
- const erc20 = await ethers.getContractAt('CompliantERC20', erc20Address);
-
- console.log(chalk.bold('Step 1: Getting list of identifiers from ERC20 contract'));
- console.log(chalk.italic('eg: erc20.identifiers()'));
- const identifiers = [...(await erc20.identifiers())];
- console.log('=> List of identifiers needed:', identifiers);
-
- console.log('---');
-
- console.log(chalk.bold('Step 2: Grant access to the ERC20 contract to these identifiers'));
- console.log(chalk.italic("eg: erc20.grantAccess(erc20Address, ['country', 'blacklist'])"));
- const txs = await Promise.all([
- registry.connect(signers[0]).grantAccess(erc20Address, identifiers),
- registry.connect(signers[1]).grantAccess(erc20Address, identifiers),
- registry.connect(signers[2]).grantAccess(erc20Address, identifiers),
- registry.connect(signers[3]).grantAccess(erc20Address, identifiers),
- ]);
- await Promise.all(txs.map((tx) => tx.wait()));
- console.log('=> Access granted to the ERC20 contract for all users.');
- });
-
-task('task:identity:mint')
- .addParam('erc20', 'ERC20 contract address')
- .setAction(async function (taskArguments: TaskArguments, { ethers }) {
- const erc20Address = taskArguments.erc20;
-
- const signers = await ethers.getSigners();
- const erc20 = await ethers.getContractAt('CompliantERC20', erc20Address);
-
- const instance = await createInstance(erc20Address, signers[0], ethers);
-
- console.log(chalk.bold('Step 1: Alice mints 100 000 tokens on the compliant contract'));
- console.log(chalk.italic('eg: erc20.mint(Enc(100000))'));
- const transaction = await erc20.mint(100000);
- await transaction.wait();
- console.log('=> 10000 tokens have been minted');
-
- console.log('---');
-
- console.log(chalk.bold('Step 2: Alice transfers some tokens'));
- console.log(chalk.italic('eg: erc20.transfer(wallet, Enc(20000))'));
- const amount20k = instance.encrypt64(20000);
- const amount10k = instance.encrypt64(10000);
-
- const txT1 = await erc20['transfer(address,bytes)'](signers[2], amount20k);
- const txT2 = await erc20['transfer(address,bytes)'](signers[3], amount10k);
- await Promise.all([txT1.wait(), txT2.wait()]);
- console.log('=> Carol received 20000 tokens');
- console.log('=> Dave received 10000 tokens');
- });
-
-task('task:identity:transfer')
- .addParam('erc20', 'ERC20 contract address')
- .addParam('from', 'From wallet')
- .addParam('to', 'To wallet')
- .addParam('amount', 'Amount')
- .setAction(async function (taskArguments: TaskArguments, { ethers }) {
- const eSigners = await ethers.getSigners();
- const signers = getSigners(eSigners);
- const erc20Address = taskArguments.erc20;
- const from = taskArguments.from as keyof typeof signers;
- const to = taskArguments.to as keyof typeof signers;
- const amount = taskArguments.amount;
-
- const erc20 = (await ethers.getContractAt('CompliantERC20', erc20Address)) as any;
-
- const instance = await createInstance(erc20Address, signers[from], ethers);
-
- console.log(chalk.bold(`Sending ${amount} from ${from} to ${to}`));
- console.log(chalk.italic(`eg: erc20.transfer(to, Enc(${amount}))`));
- const encryptedAmount = instance.encrypt64(+amount);
- const transaction = await erc20.connect(signers[from])['transfer(address,bytes)'](signers[to], encryptedAmount);
- await transaction.wait();
- console.log(`=> ${amount} tokens have been transferred from ${from} to ${to}`);
- });
-
-task('task:identity:balanceOf')
- .addParam('erc20', 'ERC20 contract address')
- .addParam('user', 'User wallet')
- .setAction(async function (taskArguments: TaskArguments, { ethers }) {
- const eSigners = await ethers.getSigners();
- const signers = getSigners(eSigners);
- const erc20Address = taskArguments.erc20;
- const user = taskArguments.user as keyof typeof signers;
-
- const erc20 = (await ethers.getContractAt('CompliantERC20', erc20Address)) as any;
-
- const instance = await createInstance(erc20Address, signers[user], ethers);
-
- const token = instance.getPublicKey(erc20Address)!;
-
- const balance = await erc20.connect(signers[user]).balanceOf(signers[user], token.publicKey, token.signature);
- console.log(`=> ${chalk.bold('Balance')}: ${instance.decrypt(erc20Address, balance)} tokens`);
- });
diff --git a/tasks/taskTFHE.ts b/tasks/taskTFHE.ts
index 8d672f06..f82dc80a 100644
--- a/tasks/taskTFHE.ts
+++ b/tasks/taskTFHE.ts
@@ -3,171 +3,181 @@ import { task } from 'hardhat/config';
import type { TaskArguments } from 'hardhat/types';
import path from 'path';
-task('task:computeACLAddress').setAction(async function (taskArguments: TaskArguments, { ethers }) {
- const deployer = (await ethers.getSigners())[9].address;
- const aclAddress = ethers.getCreateAddress({
- from: deployer,
- nonce: 1, // using nonce of 1 for the ACL contract (0 for original implementation, +1 for proxy)
- });
- const envFilePath = path.join(__dirname, '../lib/.env.acl');
- const content = `ACL_CONTRACT_ADDRESS=${aclAddress}\n`;
- try {
- fs.writeFileSync(envFilePath, content, { flag: 'w' });
- console.log(`ACL address ${aclAddress} written successfully!`);
- } catch (err) {
- console.error('Failed to write ACL address:', err);
- }
-
- const solidityTemplate = `// SPDX-License-Identifier: BSD-3-Clause-Clear
+task('task:computeACLAddress')
+ .addParam('privateKey', 'The deployer private key')
+ .setAction(async function (taskArguments: TaskArguments, { ethers }) {
+ const deployer = new ethers.Wallet(taskArguments.privateKey).address;
+ const aclAddress = ethers.getCreateAddress({
+ from: deployer,
+ nonce: 1, // using nonce of 1 for the ACL contract (0 for original implementation, +1 for proxy)
+ });
+ const envFilePath = path.join(__dirname, '../lib/.env.acl');
+ const content = `ACL_CONTRACT_ADDRESS=${aclAddress}\n`;
+ try {
+ fs.writeFileSync(envFilePath, content, { flag: 'w' });
+ console.log(`ACL address ${aclAddress} written successfully!`);
+ } catch (err) {
+ console.error('Failed to write ACL address:', err);
+ }
+
+ const solidityTemplate = `// SPDX-License-Identifier: BSD-3-Clause-Clear
pragma solidity ^0.8.24;
address constant aclAdd = ${aclAddress};\n`;
- try {
- fs.writeFileSync('./lib/ACLAddress.sol', solidityTemplate, { encoding: 'utf8', flag: 'w' });
- console.log('./lib/ACLAddress.sol file generated successfully!');
- } catch (error) {
- console.error('Failed to write ./lib/ACLAddress.sol', error);
- }
-});
-
-task('task:computeTFHEExecutorAddress').setAction(async function (taskArguments: TaskArguments, { ethers }) {
- const deployer = (await ethers.getSigners())[9].address;
- const execAddress = ethers.getCreateAddress({
- from: deployer,
- nonce: 3, // using nonce of 3 for the TFHEExecutor contract (2 for original implementation, +1 for proxy)
+ try {
+ fs.writeFileSync('./lib/ACLAddress.sol', solidityTemplate, { encoding: 'utf8', flag: 'w' });
+ console.log('./lib/ACLAddress.sol file generated successfully!');
+ } catch (error) {
+ console.error('Failed to write ./lib/ACLAddress.sol', error);
+ }
});
- const envFilePath = path.join(__dirname, '../lib/.env.exec');
- const content = `TFHE_EXECUTOR_CONTRACT_ADDRESS=${execAddress}\n`;
- try {
- fs.writeFileSync(envFilePath, content, { flag: 'w' });
- console.log(`TFHEExecutor address ${execAddress} written successfully!`);
- } catch (err) {
- console.error('Failed to write TFHEExecutor address:', err);
- }
- const solidityTemplateCoprocessor = `// SPDX-License-Identifier: BSD-3-Clause-Clear
+task('task:computeTFHEExecutorAddress')
+ .addParam('privateKey', 'The deployer private key')
+ .setAction(async function (taskArguments: TaskArguments, { ethers }) {
+ const deployer = new ethers.Wallet(taskArguments.privateKey).address;
+ const execAddress = ethers.getCreateAddress({
+ from: deployer,
+ nonce: 3, // using nonce of 3 for the TFHEExecutor contract (2 for original implementation, +1 for proxy)
+ });
+ const envFilePath = path.join(__dirname, '../lib/.env.exec');
+ const content = `TFHE_EXECUTOR_CONTRACT_ADDRESS=${execAddress}\n`;
+ try {
+ fs.writeFileSync(envFilePath, content, { flag: 'w' });
+ console.log(`TFHEExecutor address ${execAddress} written successfully!`);
+ } catch (err) {
+ console.error('Failed to write TFHEExecutor address:', err);
+ }
+
+ const solidityTemplateCoprocessor = `// SPDX-License-Identifier: BSD-3-Clause-Clear
pragma solidity ^0.8.24;
address constant tfheExecutorAdd = ${execAddress};\n`;
- try {
- fs.writeFileSync('./lib/TFHEExecutorAddress.sol', solidityTemplateCoprocessor, { encoding: 'utf8', flag: 'w' });
- console.log('./lib/TFHEExecutorAddress.sol file generated successfully!');
- } catch (error) {
- console.error('Failed to write ./lib/TFHEExecutorAddress.sol', error);
- }
-});
-
-task('task:computeKMSVerifierAddress').setAction(async function (taskArguments: TaskArguments, { ethers }) {
- const deployer = (await ethers.getSigners())[9].address;
- const kmsVerfierAddress = ethers.getCreateAddress({
- from: deployer,
- nonce: 5, // using nonce of 5 for the KMSVerifier contract (4 for original implementation, +1 for proxy)
+ try {
+ fs.writeFileSync('./lib/TFHEExecutorAddress.sol', solidityTemplateCoprocessor, { encoding: 'utf8', flag: 'w' });
+ console.log('./lib/TFHEExecutorAddress.sol file generated successfully!');
+ } catch (error) {
+ console.error('Failed to write ./lib/TFHEExecutorAddress.sol', error);
+ }
});
- const envFilePath = path.join(__dirname, '../lib/.env.kmsverifier');
- const content = `KMS_VERIFIER_CONTRACT_ADDRESS=${kmsVerfierAddress}\n`;
- try {
- fs.writeFileSync(envFilePath, content, { flag: 'w' });
- console.log(`KMSVerifier address ${kmsVerfierAddress} written successfully!`);
- } catch (err) {
- console.error('Failed to write KMSVerifier address:', err);
- }
- const solidityTemplate = `// SPDX-License-Identifier: BSD-3-Clause-Clear
+task('task:computeKMSVerifierAddress')
+ .addParam('privateKey', 'The deployer private key')
+ .setAction(async function (taskArguments: TaskArguments, { ethers }) {
+ const deployer = new ethers.Wallet(taskArguments.privateKey).address;
+ const kmsVerfierAddress = ethers.getCreateAddress({
+ from: deployer,
+ nonce: 5, // using nonce of 5 for the KMSVerifier contract (4 for original implementation, +1 for proxy)
+ });
+ const envFilePath = path.join(__dirname, '../lib/.env.kmsverifier');
+ const content = `KMS_VERIFIER_CONTRACT_ADDRESS=${kmsVerfierAddress}\n`;
+ try {
+ fs.writeFileSync(envFilePath, content, { flag: 'w' });
+ console.log(`KMSVerifier address ${kmsVerfierAddress} written successfully!`);
+ } catch (err) {
+ console.error('Failed to write KMSVerifier address:', err);
+ }
+
+ const solidityTemplate = `// SPDX-License-Identifier: BSD-3-Clause-Clear
pragma solidity ^0.8.24;
address constant kmsVerifierAdd = ${kmsVerfierAddress};\n`;
- try {
- fs.writeFileSync('./lib/KMSVerifierAddress.sol', solidityTemplate, { encoding: 'utf8', flag: 'w' });
- console.log('./lib/KMSVerifierAddress.sol file generated successfully!');
- } catch (error) {
- console.error('Failed to write ./lib/KMSVerifierAddress.sol', error);
- }
-});
-
-task('task:computeInputVerifierAddress').setAction(async function (taskArguments: TaskArguments, { ethers }) {
- // this script also compute the coprocessor address from its private key
- const deployer = (await ethers.getSigners())[9].address;
- const inputVerfierAddress = ethers.getCreateAddress({
- from: deployer,
- nonce: 7, // using nonce of 7 for the InputVerifier contract (6 for original implementation, +1 for proxy)
+ try {
+ fs.writeFileSync('./lib/KMSVerifierAddress.sol', solidityTemplate, { encoding: 'utf8', flag: 'w' });
+ console.log('./lib/KMSVerifierAddress.sol file generated successfully!');
+ } catch (error) {
+ console.error('Failed to write ./lib/KMSVerifierAddress.sol', error);
+ }
});
- const envFilePath = path.join(__dirname, '../lib/.env.inputverifier');
- const content = `INPUT_VERIFIER_CONTRACT_ADDRESS=${inputVerfierAddress}\n`;
- try {
- fs.writeFileSync(envFilePath, content, { flag: 'w' });
- console.log(`InputVerifier address ${inputVerfierAddress} written successfully!`);
- } catch (err) {
- console.error('Failed to write InputVerifier address:', err);
- }
- const solidityTemplate = `// SPDX-License-Identifier: BSD-3-Clause-Clear
+task('task:computeInputVerifierAddress')
+ .addParam('privateKey', 'The deployer private key')
+ .setAction(async function (taskArguments: TaskArguments, { ethers }) {
+ // this script also compute the coprocessor address from its private key
+ const deployer = new ethers.Wallet(taskArguments.privateKey).address;
+ const inputVerfierAddress = ethers.getCreateAddress({
+ from: deployer,
+ nonce: 7, // using nonce of 7 for the InputVerifier contract (6 for original implementation, +1 for proxy)
+ });
+ const envFilePath = path.join(__dirname, '../lib/.env.inputverifier');
+ const content = `INPUT_VERIFIER_CONTRACT_ADDRESS=${inputVerfierAddress}\n`;
+ try {
+ fs.writeFileSync(envFilePath, content, { flag: 'w' });
+ console.log(`InputVerifier address ${inputVerfierAddress} written successfully!`);
+ } catch (err) {
+ console.error('Failed to write InputVerifier address:', err);
+ }
+
+ const solidityTemplate = `// SPDX-License-Identifier: BSD-3-Clause-Clear
pragma solidity ^0.8.24;
address constant inputVerifierAdd = ${inputVerfierAddress};\n`;
- try {
- fs.writeFileSync('./lib/InputVerifierAddress.sol', solidityTemplate, { encoding: 'utf8', flag: 'w' });
- console.log('./lib/InputVerifierAddress.sol file generated successfully!');
- } catch (error) {
- console.error('Failed to write ./lib/InputVerifierAddress.sol', error);
- }
-
- const coprocAddress = new ethers.Wallet(process.env.PRIVATE_KEY_COPROCESSOR_ACCOUNT!).address;
- const envFilePath2 = path.join(__dirname, '../lib/.env.coprocessor');
- const content2 = `COPROCESSOR_ADDRESS=${coprocAddress}\n`;
- try {
- fs.writeFileSync(envFilePath2, content2, { flag: 'w' });
- console.log(`Coprocessor address ${coprocAddress} written successfully!`);
- } catch (err) {
- console.error('Failed to write InputVerifier address:', err);
- }
-
- const solidityTemplate2 = `// SPDX-License-Identifier: BSD-3-Clause-Clear
+ try {
+ fs.writeFileSync('./lib/InputVerifierAddress.sol', solidityTemplate, { encoding: 'utf8', flag: 'w' });
+ console.log('./lib/InputVerifierAddress.sol file generated successfully!');
+ } catch (error) {
+ console.error('Failed to write ./lib/InputVerifierAddress.sol', error);
+ }
+
+ const coprocAddress = new ethers.Wallet(process.env.PRIVATE_KEY_COPROCESSOR_ACCOUNT!).address;
+ const envFilePath2 = path.join(__dirname, '../lib/.env.coprocessor');
+ const content2 = `COPROCESSOR_ADDRESS=${coprocAddress}\n`;
+ try {
+ fs.writeFileSync(envFilePath2, content2, { flag: 'w' });
+ console.log(`Coprocessor address ${coprocAddress} written successfully!`);
+ } catch (err) {
+ console.error('Failed to write InputVerifier address:', err);
+ }
+
+ const solidityTemplate2 = `// SPDX-License-Identifier: BSD-3-Clause-Clear
pragma solidity ^0.8.24;
address constant coprocessorAdd = ${coprocAddress};\n`;
- try {
- fs.writeFileSync('./lib/CoprocessorAddress.sol', solidityTemplate2, { encoding: 'utf8', flag: 'w' });
- console.log('./lib/CoprocessorAddress.sol file generated successfully!');
- } catch (error) {
- console.error('Failed to write ./lib/CoprocessorAddress.sol', error);
- }
-});
-
-task('task:computeFHEPaymentAddress').setAction(async function (taskArguments: TaskArguments, { ethers }) {
- const deployer = (await ethers.getSigners())[9].address;
- const fhePaymentAddress = ethers.getCreateAddress({
- from: deployer,
- nonce: 9, // using nonce of 9 for the FHEPayment contract (8 for original implementation, +1 for proxy)
+ try {
+ fs.writeFileSync('./lib/CoprocessorAddress.sol', solidityTemplate2, { encoding: 'utf8', flag: 'w' });
+ console.log('./lib/CoprocessorAddress.sol file generated successfully!');
+ } catch (error) {
+ console.error('Failed to write ./lib/CoprocessorAddress.sol', error);
+ }
});
- const envFilePath = path.join(__dirname, '../lib/.env.fhepayment');
- const content = `FHE_PAYMENT_CONTRACT_ADDRESS=${fhePaymentAddress}\n`;
- try {
- fs.writeFileSync(envFilePath, content, { flag: 'w' });
- console.log(`FHEPayment address ${fhePaymentAddress} written successfully!`);
- } catch (err) {
- console.error('Failed to write FHEPayment address:', err);
- }
- const solidityTemplate = `// SPDX-License-Identifier: BSD-3-Clause-Clear
+task('task:computeFHEPaymentAddress')
+ .addParam('privateKey', 'The deployer private key')
+ .setAction(async function (taskArguments: TaskArguments, { ethers }) {
+ const deployer = new ethers.Wallet(taskArguments.privateKey).address;
+ const fhePaymentAddress = ethers.getCreateAddress({
+ from: deployer,
+ nonce: 9, // using nonce of 9 for the FHEPayment contract (8 for original implementation, +1 for proxy)
+ });
+ const envFilePath = path.join(__dirname, '../lib/.env.fhepayment');
+ const content = `FHE_PAYMENT_CONTRACT_ADDRESS=${fhePaymentAddress}\n`;
+ try {
+ fs.writeFileSync(envFilePath, content, { flag: 'w' });
+ console.log(`FHEPayment address ${fhePaymentAddress} written successfully!`);
+ } catch (err) {
+ console.error('Failed to write FHEPayment address:', err);
+ }
+
+ const solidityTemplate = `// SPDX-License-Identifier: BSD-3-Clause-Clear
pragma solidity ^0.8.24;
address constant fhePaymentAdd = ${fhePaymentAddress};\n`;
- try {
- fs.writeFileSync('./lib/FHEPaymentAddress.sol', solidityTemplate, { encoding: 'utf8', flag: 'w' });
- console.log('./lib/FHEPaymentAddress.sol file generated successfully!');
- } catch (error) {
- console.error('Failed to write ./lib/FHEPaymentAddress.sol', error);
- }
-});
+ try {
+ fs.writeFileSync('./lib/FHEPaymentAddress.sol', solidityTemplate, { encoding: 'utf8', flag: 'w' });
+ console.log('./lib/FHEPaymentAddress.sol file generated successfully!');
+ } catch (error) {
+ console.error('Failed to write ./lib/FHEPaymentAddress.sol', error);
+ }
+ });
diff --git a/tasks/utils.ts b/tasks/utils.ts
deleted file mode 100644
index 1a8bacf4..00000000
--- a/tasks/utils.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import { Signer } from 'ethers';
-import fhevmjs, { FhevmInstance, getPublicKeyCallParams } from 'fhevmjs';
-import { ethers as hethers } from 'hardhat';
-
-let publicKey: string | undefined;
-let chainId: number;
-
-export const createInstance = async (contractAddress: string, account: Signer, ethers: typeof hethers) => {
- // 1. Get chain id
- const provider = ethers.provider;
-
- const network = await provider.getNetwork();
- chainId = +network.chainId.toString(); // Need to be a number
- try {
- // Get blockchain public key
- const ret = await provider.call(getPublicKeyCallParams());
- const decoded = ethers.AbiCoder.defaultAbiCoder().decode(['bytes'], ret);
- publicKey = decoded[0];
- } catch (e) {
- publicKey = undefined;
- }
-
- const instance = await fhevmjs.createInstance({ chainId, publicKey });
-
- await generatePublicKey(contractAddress, account, instance);
-
- return instance;
-};
-
-const generatePublicKey = async (contractAddress: string, signer: Signer, instance: FhevmInstance) => {
- // Generate token to decrypt
- const generatedToken = instance.generatePublicKey({
- verifyingContract: contractAddress,
- });
- // Sign the public key
- const signature = await signer.signTypedData(
- generatedToken.eip712.domain,
- { Reencrypt: generatedToken.eip712.types.Reencrypt }, // Need to remove EIP712Domain from types
- generatedToken.eip712.message,
- );
- instance.setSignature(contractAddress, signature);
-};
diff --git a/test/kmsVerifier/kmsVerifier.ts b/test/kmsVerifier/kmsVerifier.ts
index 38edf33c..b4bba0be 100644
--- a/test/kmsVerifier/kmsVerifier.ts
+++ b/test/kmsVerifier/kmsVerifier.ts
@@ -22,7 +22,7 @@ describe('KMSVerifier', function () {
// to avoid messing up other tests if used on the real node, in parallel testing
const origKMSAdd = dotenv.parse(fs.readFileSync('lib/.env.kmsverifier')).KMS_VERIFIER_CONTRACT_ADDRESS;
- const deployer = (await ethers.getSigners())[9];
+ const deployer = new ethers.Wallet(process.env.PRIVATE_KEY_FHEVM_DEPLOYER!).connect(ethers.provider);
const kmsVerifier = await this.kmsFactory.attach(origKMSAdd);
expect(await kmsVerifier.getVersion()).to.equal('KMSVerifier v0.1.0');
diff --git a/test/upgrades/upgrades.ts b/test/upgrades/upgrades.ts
index 48fdd23c..59034f47 100644
--- a/test/upgrades/upgrades.ts
+++ b/test/upgrades/upgrades.ts
@@ -92,7 +92,7 @@ describe('Upgrades', function () {
it('original owner upgrades the original ACL and transfer ownership', async function () {
const origACLAdd = dotenv.parse(fs.readFileSync('lib/.env.acl')).ACL_CONTRACT_ADDRESS;
- const deployer = (await ethers.getSigners())[9];
+ const deployer = new ethers.Wallet(process.env.PRIVATE_KEY_FHEVM_DEPLOYER!).connect(ethers.provider);
const acl = await this.aclFactory.attach(origACLAdd, deployer);
expect(await acl.getVersion()).to.equal('ACL v0.1.0');
const newaclFactoryUpgraded = await ethers.getContractFactory('ACLUpgradedExample', deployer);
From 11a3350decdc9d10ada656d3dbd8942636363245 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Mon, 7 Oct 2024 11:09:37 +0200
Subject: [PATCH 17/51] docs: removed obsolete links
---
README.md | 2 --
docs/tutorials/see-all-tutorials.md | 2 --
2 files changed, 4 deletions(-)
diff --git a/README.md b/README.md
index 3979f927..d670ebe4 100644
--- a/README.md
+++ b/README.md
@@ -156,9 +156,7 @@ _More examples are available [here](https://github.com/zama-ai/fhevm/tree/main/e
#### Others
-- [Governor DAO](https://github.com/zama-ai/fhevm/tree/main/examples/Governor): A DAO smart contract that facilitates governance decisions through encrypted voting.
- [Blind auction](https://github.com/zama-ai/fhevm/blob/main/examples/BlindAuction.sol): A smart contract for conducting blind auctions where bids are encrypted and the winning bid remains private.
-- [Decentralized ID](https://github.com/zama-ai/fhevm/tree/main/examples/Identity): A blockchain-based identity management system using smart contracts to store and manage encrypted personal data.
_If you have built awesome projects using fhEVM, please let us know and we will be happy to showcase them here!_
diff --git a/docs/tutorials/see-all-tutorials.md b/docs/tutorials/see-all-tutorials.md
index 1eef3ac6..2ba0764f 100644
--- a/docs/tutorials/see-all-tutorials.md
+++ b/docs/tutorials/see-all-tutorials.md
@@ -9,9 +9,7 @@
### Code examples in GitHub
- [ERC-20](https://github.com/zama-ai/fhevm/blob/main/examples/EncryptedERC20.sol): A variation of the standard ERC20 smart contract that incorporates encrypted balances, providing additional privacy for token holders. -
-- [Governor DAO](https://github.com/zama-ai/fhevm/tree/main/examples/Governor): A DAO smart contract that facilitates governance decisions through encrypted voting
- [Blind Auction](https://github.com/zama-ai/fhevm/blob/main/examples/BlindAuction.sol): A smart contract for conducting blind auctions where bids are encrypted and the winning bid remains private.
-- [Decentralized ID](https://github.com/zama-ai/fhevm/tree/main/examples/Identity): A blockchain-based identity management system using smart contracts to store and manage encrypted personal data.
### Blog tutorials:
From be852a3b5f05b7337eec92ecdd039b899a76abbb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Mon, 7 Oct 2024 11:30:35 +0200
Subject: [PATCH 18/51] chore: removed file copying need for InputVerifier
deployment
---
hardhat.config.ts | 6 -
launch-fhevm.sh | 5 -
...fier.sol => InputVerifier.coprocessor.sol} | 0
...er.sol.native => InputVerifier.native.sol} | 0
lib/InputVerifier.sol.coprocessor | 227 ------------------
lib/TFHEExecutor.sol | 11 +-
tasks/taskDeploy.ts | 7 +-
7 files changed, 15 insertions(+), 241 deletions(-)
rename lib/{InputVerifier.sol => InputVerifier.coprocessor.sol} (100%)
rename lib/{InputVerifier.sol.native => InputVerifier.native.sol} (100%)
delete mode 100644 lib/InputVerifier.sol.coprocessor
diff --git a/hardhat.config.ts b/hardhat.config.ts
index a90f1dbd..c812c27d 100644
--- a/hardhat.config.ts
+++ b/hardhat.config.ts
@@ -1,7 +1,6 @@
import '@nomicfoundation/hardhat-toolbox';
import '@openzeppelin/hardhat-upgrades';
import dotenv from 'dotenv';
-import { promises as fs } from 'fs';
import 'hardhat-deploy';
import 'hardhat-ignore-warnings';
import type { HardhatUserConfig, extendProvider } from 'hardhat/config';
@@ -94,11 +93,6 @@ task('test', async (taskArgs, hre, runSuper) => {
await hre.run('task:computeKMSVerifierAddress', { privateKey: privKeyFhevmDeployer });
await hre.run('task:computeInputVerifierAddress', { privateKey: privKeyFhevmDeployer });
await hre.run('task:computeFHEPaymentAddress', { privateKey: privKeyFhevmDeployer });
- if (process.env.IS_COPROCESSOR === 'true') {
- await fs.copyFile('lib/InputVerifier.sol.coprocessor', 'lib/InputVerifier.sol');
- } else {
- await fs.copyFile('lib/InputVerifier.sol.native', 'lib/InputVerifier.sol');
- }
await hre.run('compile:specific', { contract: 'lib' });
await hre.run('compile:specific', { contract: 'gateway' });
await hre.run('compile:specific', { contract: 'payment' });
diff --git a/launch-fhevm.sh b/launch-fhevm.sh
index 847b0958..4050fec0 100755
--- a/launch-fhevm.sh
+++ b/launch-fhevm.sh
@@ -15,11 +15,6 @@ npx hardhat task:computeFHEPaymentAddress --private-key "$PRIVATE_KEY_FHEVM_DEPL
# [ADD DOCKER-COMPOSE COMMAND HERE] // Geth node, Gateway service, KMS service etc should be launched here, using previously precomputed addresses
-if [ "$IS_COPROCESSOR" = "true" ]; then
- cp lib/InputVerifier.sol.coprocessor lib/InputVerifier.sol
-else
- cp lib/InputVerifier.sol.native lib/InputVerifier.sol
-fi
npx hardhat compile:specific --contract lib
npx hardhat compile:specific --contract gateway
diff --git a/lib/InputVerifier.sol b/lib/InputVerifier.coprocessor.sol
similarity index 100%
rename from lib/InputVerifier.sol
rename to lib/InputVerifier.coprocessor.sol
diff --git a/lib/InputVerifier.sol.native b/lib/InputVerifier.native.sol
similarity index 100%
rename from lib/InputVerifier.sol.native
rename to lib/InputVerifier.native.sol
diff --git a/lib/InputVerifier.sol.coprocessor b/lib/InputVerifier.sol.coprocessor
deleted file mode 100644
index 1ebdbcb4..00000000
--- a/lib/InputVerifier.sol.coprocessor
+++ /dev/null
@@ -1,227 +0,0 @@
-// SPDX-License-Identifier: BSD-3-Clause-Clear
-pragma solidity ^0.8.24;
-
-import "./KMSVerifier.sol";
-import "./TFHEExecutor.sol";
-import "./KMSVerifierAddress.sol";
-import "./CoprocessorAddress.sol";
-
-// Importing OpenZeppelin contracts for cryptographic signature verification and access control.
-import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
-import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
-import "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol";
-import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
-import "@openzeppelin/contracts/utils/Strings.sol";
-
-/// @title InputVerifier for signature verification of users encrypted inputs
-/// @notice This version is only for the Coprocessor version of fhEVM
-/// @notice This contract is called by the TFHEExecutor inside verifyCiphertext function, and calls the KMSVerifier to fetch KMS signers addresses
-/// @dev The contract uses OpenZeppelin's EIP712Upgradeable for cryptographic operations
-contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgradeable {
- struct CiphertextVerificationForCopro {
- address aclAddress;
- bytes32 hashOfCiphertext;
- uint256[] handlesList;
- address userAddress;
- address contractAddress;
- }
-
- /// @notice Handle version
- uint8 public constant HANDLE_VERSION = 0;
-
- address constant coprocessorAddress = coprocessorAdd;
-
- KMSVerifier public constant kmsVerifier = KMSVerifier(kmsVerifierAdd);
- string public constant CIPHERTEXTVERIFICATION_COPRO_TYPE =
- "CiphertextVerificationForCopro(address aclAddress,bytes32 hashOfCiphertext,uint256[] handlesList,address userAddress,address contractAddress)";
- bytes32 private constant CIPHERTEXTVERIFICATION_COPRO_TYPE_HASH =
- keccak256(bytes(CIPHERTEXTVERIFICATION_COPRO_TYPE));
-
- /// @notice Name of the contract
- string private constant CONTRACT_NAME = "InputVerifier";
-
- /// @notice Version of the contract
- uint256 private constant MAJOR_VERSION = 0;
- uint256 private constant MINOR_VERSION = 1;
- uint256 private constant PATCH_VERSION = 0;
-
- function _authorizeUpgrade(address _newImplementation) internal virtual override onlyOwner {}
-
- function get_CIPHERTEXTVERIFICATION_COPRO_TYPE() public view virtual returns (string memory) {
- return CIPHERTEXTVERIFICATION_COPRO_TYPE;
- }
-
- /// @custom:oz-upgrades-unsafe-allow constructor
- constructor() {
- _disableInitializers();
- }
-
- /// @notice Initializes the contract setting `initialOwner` as the initial owner
- function initialize(address initialOwner) external initializer {
- __Ownable_init(initialOwner);
- __EIP712_init(CONTRACT_NAME, "1");
- }
-
- function typeOf(uint256 handle) internal pure virtual returns (uint8) {
- uint8 typeCt = uint8(handle >> 8);
- return typeCt;
- }
-
- function checkProofCache(
- bytes memory inputProof,
- address userAddress,
- address contractAddress,
- address aclAddress
- ) internal view virtual returns (bool, bytes32) {
- bool isProofCached;
- bytes32 key = keccak256(abi.encodePacked(contractAddress, aclAddress, userAddress, inputProof));
- assembly {
- isProofCached := tload(key)
- }
- return (isProofCached, key);
- }
-
- function cacheProof(bytes32 proofKey) internal virtual {
- assembly {
- tstore(proofKey, 1)
- }
- }
-
- function verifyCiphertext(
- TFHEExecutor.ContextUserInputs memory context,
- bytes32 inputHandle,
- bytes memory inputProof
- ) external virtual returns (uint256) {
- (bool isProofCached, bytes32 cacheKey) = checkProofCache(
- inputProof,
- context.userAddress,
- context.contractAddress,
- context.aclAddress
- );
- uint256 result = uint256(inputHandle);
- uint256 indexHandle = (result & 0x0000000000000000000000000000000000000000000000000000000000ff0000) >> 16;
-
- if (!isProofCached) {
- // bundleCiphertext is compressedPackedCT+ZKPOK
- // inputHandle is keccak256(keccak256(bundleCiphertext)+index)[0:29]+index+type+version
- // and inputProof is len(list_handles) + numSignersKMS + hashCT + list_handles + signatureCopro + signatureKMSSigners (1+1+32+NUM_HANDLES*32+65+65*numSignersKMS)
-
- uint256 inputProofLen = inputProof.length;
- require(inputProofLen > 0, "Empty inputProof");
- uint256 numHandles = uint256(uint8(inputProof[0]));
- uint256 numSignersKMS = uint256(uint8(inputProof[1]));
-
- require(numHandles > indexHandle, "Invalid index"); // @note: this checks in particular that the list is non-empty
- require(inputProofLen == 99 + 32 * numHandles + 65 * numSignersKMS, "Error deserializing inputProof");
-
- bytes32 hashCT;
- assembly {
- hashCT := mload(add(inputProof, 34))
- }
-
- // deseralize handle and check they are from correct version
- uint256[] memory listHandles = new uint256[](numHandles);
- for (uint256 i = 0; i < numHandles; i++) {
- uint256 element;
- assembly {
- element := mload(add(inputProof, add(66, mul(i, 32))))
- }
- // check all handles are from correct version
- require(uint8(element) == HANDLE_VERSION, "Wrong handle version");
- listHandles[i] = element;
- }
-
- {
- bytes memory signatureCoproc = new bytes(65);
- for (uint256 i = 0; i < 65; i++) {
- signatureCoproc[i] = inputProof[34 + 32 * numHandles + i];
- }
- CiphertextVerificationForCopro memory cvCopro;
- cvCopro.aclAddress = context.aclAddress;
- cvCopro.hashOfCiphertext = hashCT;
- cvCopro.handlesList = listHandles;
- cvCopro.userAddress = context.userAddress;
- cvCopro.contractAddress = context.contractAddress;
- verifyEIP712Copro(cvCopro, signatureCoproc);
- }
- {
- bytes[] memory signaturesKMS = new bytes[](numSignersKMS);
- for (uint256 j = 0; j < numSignersKMS; j++) {
- signaturesKMS[j] = new bytes(65);
- for (uint256 i = 0; i < 65; i++) {
- signaturesKMS[j][i] = inputProof[99 + 32 * numHandles + 65 * j + i];
- }
- }
- KMSVerifier.CiphertextVerificationForKMS memory cvKMS;
- cvKMS.aclAddress = context.aclAddress;
- cvKMS.hashOfCiphertext = hashCT;
- cvKMS.userAddress = context.userAddress;
- cvKMS.contractAddress = context.contractAddress;
- bool kmsCheck = kmsVerifier.verifyInputEIP712KMSSignatures(cvKMS, signaturesKMS);
- require(kmsCheck, "Not enough unique KMS input signatures");
- }
- cacheProof(cacheKey);
- require(result == listHandles[indexHandle], "Wrong inputHandle");
- } else {
- uint8 numHandles = uint8(inputProof[0]); // @note: we know inputProof is non-empty since it has been previously cached
- require(numHandles > indexHandle, "Invalid index");
- uint256 element;
- for (uint256 j = 0; j < 32; j++) {
- element |= uint256(uint8(inputProof[34 + indexHandle * 32 + j])) << (8 * (31 - j));
- }
- require(element == result, "Wrong inputHandle");
- }
- return result;
- }
-
- function verifyEIP712Copro(CiphertextVerificationForCopro memory cv, bytes memory signature) internal view virtual {
- bytes32 digest = hashCiphertextVerificationForCopro(cv);
- address signer = ECDSA.recover(digest, signature);
- require(signer == coprocessorAddress, "Coprocessor address mismatch");
- }
-
- function hashCiphertextVerificationForCopro(
- CiphertextVerificationForCopro memory CVcopro
- ) internal view virtual returns (bytes32) {
- return
- _hashTypedDataV4(
- keccak256(
- abi.encode(
- CIPHERTEXTVERIFICATION_COPRO_TYPE_HASH,
- CVcopro.aclAddress,
- CVcopro.hashOfCiphertext,
- keccak256(abi.encodePacked(CVcopro.handlesList)),
- CVcopro.userAddress,
- CVcopro.contractAddress
- )
- )
- );
- }
-
- /// @notice recovers the signer's address from a `signature` and a `message` digest
- /// @dev Utilizes ECDSA for actual address recovery
- /// @param message The hash of the message that was signed
- /// @param signature The signature to verify
- /// @return signer The address that supposedly signed the message
- function recoverSigner(bytes32 message, bytes memory signature) internal pure virtual returns (address) {
- address signerRecovered = ECDSA.recover(message, signature);
- return signerRecovered;
- }
-
- /// @notice Getter for the name and version of the contract
- /// @return string representing the name and the version of the contract
- function getVersion() external pure virtual returns (string memory) {
- return
- string(
- abi.encodePacked(
- CONTRACT_NAME,
- " v",
- Strings.toString(MAJOR_VERSION),
- ".",
- Strings.toString(MINOR_VERSION),
- ".",
- Strings.toString(PATCH_VERSION)
- )
- );
- }
-}
diff --git a/lib/TFHEExecutor.sol b/lib/TFHEExecutor.sol
index a2ee0463..8936f3ce 100644
--- a/lib/TFHEExecutor.sol
+++ b/lib/TFHEExecutor.sol
@@ -4,7 +4,6 @@ pragma solidity ^0.8.24;
import "./ACL.sol";
import "./FHEPayment.sol";
-import "./InputVerifier.sol";
import "./ACLAddress.sol";
import "./FHEPaymentAddress.sol";
import "./InputVerifierAddress.sol";
@@ -12,6 +11,14 @@ import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
+interface IInputVerifier {
+ function verifyCiphertext(
+ TFHEExecutor.ContextUserInputs memory context,
+ bytes32 inputHandle,
+ bytes memory inputProof
+ ) external returns (uint256);
+}
+
contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
/// @notice Handle version
uint8 public constant HANDLE_VERSION = 0;
@@ -26,7 +33,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
ACL private constant acl = ACL(aclAdd);
FHEPayment private constant fhePayment = FHEPayment(fhePaymentAdd);
- InputVerifier private constant inputVerifier = InputVerifier(inputVerifierAdd);
+ IInputVerifier private constant inputVerifier = IInputVerifier(inputVerifierAdd);
/// @custom:storage-location erc7201:fhevm.storage.TFHEExecutor
struct TFHEExecutorStorage {
diff --git a/tasks/taskDeploy.ts b/tasks/taskDeploy.ts
index 9365f400..0483fe1b 100644
--- a/tasks/taskDeploy.ts
+++ b/tasks/taskDeploy.ts
@@ -79,7 +79,12 @@ task('task:deployInputVerifier')
.addParam('privateKey', 'The deployer private key')
.setAction(async function (taskArguments: TaskArguments, { ethers, upgrades }) {
const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
- const factory = await ethers.getContractFactory('InputVerifier', deployer);
+ let factory;
+ if (process.env.IS_COPROCESSOR === 'true') {
+ factory = await ethers.getContractFactory('lib/InputVerifier.coprocessor.sol:InputVerifier', deployer);
+ } else {
+ factory = await ethers.getContractFactory('lib/InputVerifier.native.sol:InputVerifier', deployer);
+ }
const kms = await upgrades.deployProxy(factory, [deployer.address], { initializer: 'initialize', kind: 'uups' });
await kms.waitForDeployment();
const address = await kms.getAddress();
From cbc92cac5b07c693b7ffdd932d02b085ecdf9571 Mon Sep 17 00:00:00 2001
From: Aurora Poppyseed <30662672+poppyseedDev@users.noreply.github.com>
Date: Mon, 7 Oct 2024 18:30:56 +0900
Subject: [PATCH 19/51] Update docs/fundamentals/contracts.md
---
docs/fundamentals/contracts.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/fundamentals/contracts.md b/docs/fundamentals/contracts.md
index 4a5c7c69..c35d63c4 100644
--- a/docs/fundamentals/contracts.md
+++ b/docs/fundamentals/contracts.md
@@ -1,5 +1,5 @@
# Contracts standard library
-This document provides guidance on how to use the standard contracts.
+This document provides guidance on how to use the contracts standard library.
## Installation
From 87dddebf6452854d1fa348deed35bc2397e7e5e2 Mon Sep 17 00:00:00 2001
From: Aurora Poppyseed <30662672+poppyseedDev@users.noreply.github.com>
Date: Mon, 7 Oct 2024 18:31:30 +0900
Subject: [PATCH 20/51] Update docs/fundamentals/acl.md
---
docs/fundamentals/acl.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/fundamentals/acl.md b/docs/fundamentals/acl.md
index 8285a190..c4b61415 100644
--- a/docs/fundamentals/acl.md
+++ b/docs/fundamentals/acl.md
@@ -1,5 +1,6 @@
# Access Control List
-This document explains the Access Control List (ACL) system in fhEVM, which defines which addresses have the right to manipulate a ciphertext. By using ACLs, you can prevent unauthorized addresses from accessing ciphertext contents.
+This document explains how to prevent unauthorized addresses from accessing the contents of unauthorized ciphertexts.
+This is enabled by the Access Control List (ACL) system in fhEVM, which defines which addresses have the right to manipulate the ciphertext.
## How it works?
From d0a3ef6a026a21b3c36494adae1f3ca661598c7c Mon Sep 17 00:00:00 2001
From: Aurora Poppyseed <30662672+poppyseedDev@users.noreply.github.com>
Date: Mon, 7 Oct 2024 18:33:07 +0900
Subject: [PATCH 21/51] Update docs/fundamentals/decrypt.md
---
docs/fundamentals/decrypt.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/fundamentals/decrypt.md b/docs/fundamentals/decrypt.md
index 996112a0..4d9cbc44 100644
--- a/docs/fundamentals/decrypt.md
+++ b/docs/fundamentals/decrypt.md
@@ -1,5 +1,5 @@
# Decrypt and reencrypt
-This document explains how to decrypt and reencrypt data on the blockchain using a Key Management Service (KMS) and the Gateway service. The process ensures secure handling of sensitive data without exposing the blockchain's private key.
+This document explains how the decryption and re-encryption process work using the Key Management Service (KMS) and the Gateway.
## How it's working
From 77509fcc13477cad0f39cad656245b824a42c309 Mon Sep 17 00:00:00 2001
From: Aurora Poppyseed
Date: Mon, 7 Oct 2024 11:38:48 +0200
Subject: [PATCH 22/51] docs: prettified
---
docs/fundamentals/acl.md | 5 +++--
docs/fundamentals/contracts.md | 1 +
docs/fundamentals/decrypt.md | 1 +
docs/fundamentals/inputs.md | 6 ++++--
4 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/docs/fundamentals/acl.md b/docs/fundamentals/acl.md
index c4b61415..0fa2d73e 100644
--- a/docs/fundamentals/acl.md
+++ b/docs/fundamentals/acl.md
@@ -1,4 +1,5 @@
# Access Control List
+
This document explains how to prevent unauthorized addresses from accessing the contents of unauthorized ciphertexts.
This is enabled by the Access Control List (ACL) system in fhEVM, which defines which addresses have the right to manipulate the ciphertext.
@@ -78,13 +79,13 @@ function randomize() {
When a function receives a ciphertext (such as `ebool`, `euint8`, `eaddress`, ...), it needs to verify that the sender also has access to this ciphertext. This verification is crucial for security.
-Without this check, a contract could send any ciphertext authorized for the contract and potentially exploit the function to retrieve the value. For example, an attacker could transfer someone's balance as an encrypted amount.
+Without this check, a contract could send any ciphertext authorized for the contract and potentially exploit the function to retrieve the value. For example, an attacker could transfer someone's balance as an encrypted amount.
If the function does not include `require(TFHE.isSenderAllowed(encryptedAmount))`, an attacker who doesn't have access to this balance could determine the value by transferring the balance between two well-funded accounts.
## ACL for reencryption
-If a ciphertext must be reencrypted by a user, then explicit access must be granted to them. If this authorization is not given, the user will be unable to request a reencryption of this ciphertext.
+If a ciphertext must be reencrypted by a user, then explicit access must be granted to them. If this authorization is not given, the user will be unable to request a reencryption of this ciphertext.
Due to the reencryption mechanism, a user signs a public key associated with a specific contract; therefore, the ciphertext also needs to be allowed for the contract.
diff --git a/docs/fundamentals/contracts.md b/docs/fundamentals/contracts.md
index c35d63c4..37f93228 100644
--- a/docs/fundamentals/contracts.md
+++ b/docs/fundamentals/contracts.md
@@ -1,4 +1,5 @@
# Contracts standard library
+
This document provides guidance on how to use the contracts standard library.
## Installation
diff --git a/docs/fundamentals/decrypt.md b/docs/fundamentals/decrypt.md
index 4d9cbc44..dfb1dd36 100644
--- a/docs/fundamentals/decrypt.md
+++ b/docs/fundamentals/decrypt.md
@@ -1,4 +1,5 @@
# Decrypt and reencrypt
+
This document explains how the decryption and re-encryption process work using the Key Management Service (KMS) and the Gateway.
## How it's working
diff --git a/docs/fundamentals/inputs.md b/docs/fundamentals/inputs.md
index abae9a53..e24fa7d0 100644
--- a/docs/fundamentals/inputs.md
+++ b/docs/fundamentals/inputs.md
@@ -1,13 +1,15 @@
# Encrypted inputs
+
This document introduces the concept of encrypted inputs in the fhEVM, explaining how they are used, structured, and validated within smart contracts.
-Inputs are a cornerstone of fhEVM: they allow users to push encrypted data onto the blockchain.
+Inputs are a cornerstone of fhEVM: they allow users to push encrypted data onto the blockchain.
To prevent any attacks, a user must provide proof of knowledge of the plaintext value underlying the ciphertext. This proof ensures that a ciphertext cannot be reused once stored on the blockchain.
All inputs are packed into a single ciphertext in a user-defined order, thereby minimizing the size and time required to create a zero-knowledge proof.
-When a function is called, there are two types of parameters:
+When a function is called, there are two types of parameters:
+
- `einput`: Represents the index of the encrypted parameter.
- `bytes`: Contains the actual ciphertext and the associated zero-knowledge proof.
From a5251114277b997a3b9d15c1dc7b0f3a063c10d9 Mon Sep 17 00:00:00 2001
From: Aurora Poppyseed
Date: Mon, 7 Oct 2024 12:04:53 +0200
Subject: [PATCH 23/51] docs: dead links removed
---
docs/tutorials/see-all-tutorials.md | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/docs/tutorials/see-all-tutorials.md b/docs/tutorials/see-all-tutorials.md
index 1eef3ac6..b10d8c3a 100644
--- a/docs/tutorials/see-all-tutorials.md
+++ b/docs/tutorials/see-all-tutorials.md
@@ -9,9 +9,11 @@
### Code examples in GitHub
- [ERC-20](https://github.com/zama-ai/fhevm/blob/main/examples/EncryptedERC20.sol): A variation of the standard ERC20 smart contract that incorporates encrypted balances, providing additional privacy for token holders. -
-- [Governor DAO](https://github.com/zama-ai/fhevm/tree/main/examples/Governor): A DAO smart contract that facilitates governance decisions through encrypted voting
- [Blind Auction](https://github.com/zama-ai/fhevm/blob/main/examples/BlindAuction.sol): A smart contract for conducting blind auctions where bids are encrypted and the winning bid remains private.
-- [Decentralized ID](https://github.com/zama-ai/fhevm/tree/main/examples/Identity): A blockchain-based identity management system using smart contracts to store and manage encrypted personal data.
+
+#### Legacy
+- [Governor DAO](https://github.com/zama-ai/fhevm/tree/main/examples/legacy/Governor): A DAO smart contract that facilitates governance decisions through encrypted voting
+- [Decentralized ID](https://github.com/zama-ai/fhevm/tree/main/examples/legacy/Identity): A blockchain-based identity management system using smart contracts to store and manage encrypted personal data.
### Blog tutorials:
From 31fc5cca1a436c4937d1e8f9624aacc011f1e50f Mon Sep 17 00:00:00 2001
From: Aurora Poppyseed
Date: Mon, 7 Oct 2024 12:06:52 +0200
Subject: [PATCH 24/51] docs: prettified
---
docs/tutorials/see-all-tutorials.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/tutorials/see-all-tutorials.md b/docs/tutorials/see-all-tutorials.md
index b10d8c3a..d6f58116 100644
--- a/docs/tutorials/see-all-tutorials.md
+++ b/docs/tutorials/see-all-tutorials.md
@@ -12,6 +12,7 @@
- [Blind Auction](https://github.com/zama-ai/fhevm/blob/main/examples/BlindAuction.sol): A smart contract for conducting blind auctions where bids are encrypted and the winning bid remains private.
#### Legacy
+
- [Governor DAO](https://github.com/zama-ai/fhevm/tree/main/examples/legacy/Governor): A DAO smart contract that facilitates governance decisions through encrypted voting
- [Decentralized ID](https://github.com/zama-ai/fhevm/tree/main/examples/legacy/Identity): A blockchain-based identity management system using smart contracts to store and manage encrypted personal data.
From f1030b679350243f136d6419b3607769dd3e2e76 Mon Sep 17 00:00:00 2001
From: Aurora Poppyseed
Date: Mon, 7 Oct 2024 12:09:35 +0200
Subject: [PATCH 25/51] docs: dead links removed
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 3979f927..277e035d 100644
--- a/README.md
+++ b/README.md
@@ -156,9 +156,9 @@ _More examples are available [here](https://github.com/zama-ai/fhevm/tree/main/e
#### Others
-- [Governor DAO](https://github.com/zama-ai/fhevm/tree/main/examples/Governor): A DAO smart contract that facilitates governance decisions through encrypted voting.
+- [Governor DAO](https://github.com/zama-ai/fhevm/tree/main/examples/legacy/Governor): A DAO smart contract that facilitates governance decisions through encrypted voting.
- [Blind auction](https://github.com/zama-ai/fhevm/blob/main/examples/BlindAuction.sol): A smart contract for conducting blind auctions where bids are encrypted and the winning bid remains private.
-- [Decentralized ID](https://github.com/zama-ai/fhevm/tree/main/examples/Identity): A blockchain-based identity management system using smart contracts to store and manage encrypted personal data.
+- [Decentralized ID](https://github.com/zama-ai/fhevm/tree/main/examples/legacy/Identity): A blockchain-based identity management system using smart contracts to store and manage encrypted personal data.
_If you have built awesome projects using fhEVM, please let us know and we will be happy to showcase them here!_
From 525d498179d3e0b14e4720b00fc4d7417cf6a5c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Mon, 7 Oct 2024 12:43:32 +0200
Subject: [PATCH 26/51] feat: useAddress optional parameters for deployment,
gateway deployer is owner
---
.env.example | 16 +---------------
.env.example.deployment | 10 ++++++++++
docs/guides/decrypt.md | 2 +-
hardhat.config.ts | 10 +++++-----
launch-fhevm.sh | 6 +++---
tasks/taskDeploy.ts | 4 ++--
tasks/taskGatewayRelayer.ts | 31 ++++++++++++++-----------------
tasks/taskTFHE.ts | 16 +++++++++++++---
8 files changed, 49 insertions(+), 46 deletions(-)
create mode 100644 .env.example.deployment
diff --git a/.env.example b/.env.example
index 2121c713..4a93f29e 100644
--- a/.env.example
+++ b/.env.example
@@ -1,25 +1,11 @@
-export INFURA_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
export MNEMONIC="adapt mosquito move limb mobile illegal tree voyage juice mosquito burger raise father hope layer"
export PRIVATE_KEY_FHEVM_DEPLOYER="0c66d8cde71d2faa29d0cb6e3a567d31279b6eace67b0a9d9ba869c119843a5e"
export PRIVATE_KEY_GATEWAY_DEPLOYER="717fd99986df414889fd8b51069d4f90a50af72e542c58ee065f5883779099c6"
-export PRIVATE_KEY_GATEWAY_OWNER="717fd99986df414889fd8b51069d4f90a50af72e542c58ee065f5883779099c6"
export PRIVATE_KEY_GATEWAY_RELAYER="7ec931411ad75a7c201469a385d6f18a325d4923f9f213bd882bbea87e160b67"
export NUM_KMS_SIGNERS="1"
export PRIVATE_KEY_KMS_SIGNER_0="388b7680e4e1afa06efbfd45cdd1fe39f3c6af381df6555a19661f283b97de91"
export PRIVATE_KEY_KMS_SIGNER_1="bbaed91514fa4b7c86aa4f73becbabcf4bce0ae130240f0d6ac3f87e06812440"
export PRIVATE_KEY_KMS_SIGNER_2="1bfa3e2233b0103ad67954a728b246c528916791f7fab4894ff361e3937b47e1"
export PRIVATE_KEY_KMS_SIGNER_3="7a604eed8cf4a43277d192aa0c7894d368577a4021e52bf45420f256e34c7dd7"
-export ADDRESS_KMS_SIGNER_0="0x0971C80fF03B428fD2094dd5354600ab103201C5"
-export ADDRESS_KMS_SIGNER_1="0xB68deCb047B5e6Cc82280502A7E2318c6b3E5eC6"
-export ADDRESS_KMS_SIGNER_2="0xfe0fB0BCceb872ee7a6ef6c455e6E127Aef55DD7"
-export ADDRESS_KMS_SIGNER_3="0x2dac5193bE0AB0eD8871399E6Ae61EAe6cc8cAE1"
export PRIVATE_KEY_COPROCESSOR_ACCOUNT="7ec8ada6642fc4ccfb7729bc29c17cf8d21b61abd5642d1db992c0b8672ab901"
-export IS_COPROCESSOR="true"
-
-# Block explorer API keys
-export ARBISCAN_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
-export BSCSCAN_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
-export ETHERSCAN_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
-export OPTIMISM_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
-export POLYGONSCAN_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
-export SNOWTRACE_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
+export IS_COPROCESSOR="true"
\ No newline at end of file
diff --git a/.env.example.deployment b/.env.example.deployment
new file mode 100644
index 00000000..bfa69a83
--- /dev/null
+++ b/.env.example.deployment
@@ -0,0 +1,10 @@
+export PRIVATE_KEY_FHEVM_DEPLOYER="0c66d8cde71d2faa29d0cb6e3a567d31279b6eace67b0a9d9ba869c119843a5e"
+export PRIVATE_KEY_GATEWAY_DEPLOYER="717fd99986df414889fd8b51069d4f90a50af72e542c58ee065f5883779099c6"
+export ADDRESS_GATEWAY_RELAYER="0x97F272ccfef4026A1F3f0e0E879d514627B84E69"
+export NUM_KMS_SIGNERS="4"
+export ADDRESS_KMS_SIGNER_0="0x0971C80fF03B428fD2094dd5354600ab103201C5"
+export ADDRESS_KMS_SIGNER_1="0xB68deCb047B5e6Cc82280502A7E2318c6b3E5eC6"
+export ADDRESS_KMS_SIGNER_2="0xfe0fB0BCceb872ee7a6ef6c455e6E127Aef55DD7"
+export ADDRESS_KMS_SIGNER_3="0x2dac5193bE0AB0eD8871399E6Ae61EAe6cc8cAE1"
+export ADDRESS_COPROCESSOR="0xc9990FEfE0c27D31D0C2aa36196b085c0c4d456c"
+export IS_COPROCESSOR="true"
\ No newline at end of file
diff --git a/docs/guides/decrypt.md b/docs/guides/decrypt.md
index 04bbdc41..784d818d 100644
--- a/docs/guides/decrypt.md
+++ b/docs/guides/decrypt.md
@@ -29,7 +29,7 @@ contract TestAsyncDecrypt is GatewayCaller {
}
```
-Note that a [`GatewayContract`](../../gateway/GatewayContract.sol) contract is already predeployed on the fhEVM testnet, and a default relayer account is added through the specification of the environment variable `PRIVATE_KEY_GATEWAY_RELAYER` in the `.env` file. Relayers are the only accounts authorized to fulfil the decryption requests. However `GatewayContract` would still check the KMS signature during the fulfilment, so we trust the relayer only to forward the request on time, a rogue relayer could not cheat by sending fake decryption results.
+Note that a [`GatewayContract`](../../gateway/GatewayContract.sol) contract is already predeployed on the fhEVM testnet, and a default relayer account is added through the specification of the environment variable `PRIVATE_KEY_GATEWAY_RELAYER` or `ADDRESS_GATEWAY_RELAYER` in the `.env` file. Relayers are the only accounts authorized to fulfil the decryption requests. However `GatewayContract` would still check the KMS signature during the fulfilment, so we trust the relayer only to forward the request on time, a rogue relayer could not cheat by sending fake decryption results.
The interface of the `Gateway.requestDecryption` function from previous snippet is the following:
diff --git a/hardhat.config.ts b/hardhat.config.ts
index c812c27d..f6004614 100644
--- a/hardhat.config.ts
+++ b/hardhat.config.ts
@@ -35,9 +35,9 @@ const dotenvConfigPath: string = process.env.DOTENV_CONFIG_PATH || './.env';
dotenv.config({ path: resolve(__dirname, dotenvConfigPath) });
// Ensure that we have all the environment variables we need.
-const mnemonic: string | undefined = process.env.MNEMONIC;
+let mnemonic: string | undefined = process.env.MNEMONIC;
if (!mnemonic) {
- throw new Error('Please set your MNEMONIC in a .env file');
+ mnemonic = 'adapt mosquito move limb mobile illegal tree voyage juice mosquito burger raise father hope layer'; // default mnemonic in case it is undefined (needed to avoid panicking when deploying on real network)
}
const chainIds = {
@@ -91,7 +91,7 @@ task('test', async (taskArgs, hre, runSuper) => {
await hre.run('task:computeACLAddress', { privateKey: privKeyFhevmDeployer });
await hre.run('task:computeTFHEExecutorAddress', { privateKey: privKeyFhevmDeployer });
await hre.run('task:computeKMSVerifierAddress', { privateKey: privKeyFhevmDeployer });
- await hre.run('task:computeInputVerifierAddress', { privateKey: privKeyFhevmDeployer });
+ await hre.run('task:computeInputVerifierAddress', { privateKey: privKeyFhevmDeployer, useAddress: false });
await hre.run('task:computeFHEPaymentAddress', { privateKey: privKeyFhevmDeployer });
await hre.run('compile:specific', { contract: 'lib' });
await hre.run('compile:specific', { contract: 'gateway' });
@@ -103,11 +103,11 @@ task('test', async (taskArgs, hre, runSuper) => {
await hre.run('task:deployInputVerifier', { privateKey: privKeyFhevmDeployer });
await hre.run('task:deployFHEPayment', { privateKey: privKeyFhevmDeployer });
await hre.run('task:addSigners', {
- numSigners: +process.env.NUM_KMS_SIGNERS!,
+ numSigners: process.env.NUM_KMS_SIGNERS!,
privateKey: privKeyFhevmDeployer,
useAddress: false,
});
- await hre.run('task:launchFhevm', { skipGetCoin: false });
+ await hre.run('task:launchFhevm', { skipGetCoin: false, useAddress: false });
}
await hre.run('compile:specific', { contract: 'examples' });
await runSuper();
diff --git a/launch-fhevm.sh b/launch-fhevm.sh
index 4050fec0..9be75e38 100755
--- a/launch-fhevm.sh
+++ b/launch-fhevm.sh
@@ -10,7 +10,7 @@ npx hardhat task:computeGatewayAddress --private-key "$PRIVATE_KEY_GATEWAY_DEPLO
npx hardhat task:computeACLAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
npx hardhat task:computeTFHEExecutorAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
npx hardhat task:computeKMSVerifierAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
-npx hardhat task:computeInputVerifierAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
+npx hardhat task:computeInputVerifierAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --use-address true
npx hardhat task:computeFHEPaymentAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
# [ADD DOCKER-COMPOSE COMMAND HERE] // Geth node, Gateway service, KMS service etc should be launched here, using previously precomputed addresses
@@ -24,6 +24,6 @@ npx hardhat task:deployKMSVerifier --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
npx hardhat task:deployInputVerifier --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
npx hardhat task:deployFHEPayment --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
-npx hardhat task:addSigners --num-signers $NUM_KMS_SIGNERS --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --useAddress true
+npx hardhat task:addSigners --num-signers $NUM_KMS_SIGNERS --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --use-address true
-npx hardhat task:launchFhevm --skip-get-coin true
\ No newline at end of file
+npx hardhat task:launchFhevm --skip-get-coin true --use-address true
\ No newline at end of file
diff --git a/tasks/taskDeploy.ts b/tasks/taskDeploy.ts
index 0483fe1b..4d0568c6 100644
--- a/tasks/taskDeploy.ts
+++ b/tasks/taskDeploy.ts
@@ -1,6 +1,6 @@
import dotenv from 'dotenv';
import fs from 'fs';
-import { task } from 'hardhat/config';
+import { task, types } from 'hardhat/config';
import type { TaskArguments } from 'hardhat/types';
task('task:deployGateway')
@@ -119,6 +119,7 @@ task('task:deployFHEPayment')
task('task:addSigners')
.addParam('privateKey', 'The deployer private key')
+ .addParam('numSigners', 'Number of KMS signers to add')
.addOptionalParam(
'useAddress',
'Use addresses instead of private keys env variables for kms signers',
@@ -130,7 +131,6 @@ task('task:addSigners')
const factory = await ethers.getContractFactory('KMSVerifier', deployer);
const kmsAdd = dotenv.parse(fs.readFileSync('lib/.env.kmsverifier')).KMS_VERIFIER_CONTRACT_ADDRESS;
const kmsVerifier = await factory.attach(kmsAdd);
-
for (let idx = 0; idx < taskArguments.numSigners; idx++) {
if (!taskArguments.useAddress) {
const privKeySigner = process.env[`PRIVATE_KEY_KMS_SIGNER_${idx}`];
diff --git a/tasks/taskGatewayRelayer.ts b/tasks/taskGatewayRelayer.ts
index 476efbd4..a2da8d2b 100644
--- a/tasks/taskGatewayRelayer.ts
+++ b/tasks/taskGatewayRelayer.ts
@@ -89,37 +89,37 @@ task('task:removeRelayer')
task('task:launchFhevm')
.addOptionalParam('skipGetCoin', 'Skip calling getCoin()', false, types.boolean)
+ .addOptionalParam('useAddress', 'Use address instead of privte key for the Gateway Relayer', false, types.boolean)
.setAction(async function (taskArgs, hre) {
const privKeyDeployer = process.env.PRIVATE_KEY_GATEWAY_DEPLOYER;
- const privKeyOwner = process.env.PRIVATE_KEY_GATEWAY_OWNER;
- const privKeyRelayer = process.env.PRIVATE_KEY_GATEWAY_RELAYER;
const deployerAddress = new hre.ethers.Wallet(privKeyDeployer!).address;
- const ownerAddress = new hre.ethers.Wallet(privKeyOwner!).address;
- const relayerAddress = new hre.ethers.Wallet(privKeyRelayer!).address;
+ let relayerAddress;
+ if (!taskArgs.useAddress) {
+ const privKeyRelayer = process.env.PRIVATE_KEY_GATEWAY_RELAYER;
+ relayerAddress = new hre.ethers.Wallet(privKeyRelayer!).address;
+ } else {
+ relayerAddress = process.env.ADDRESS_GATEWAY_RELAYER;
+ }
if (!taskArgs.skipGetCoin) {
if (hre.network.name === 'hardhat') {
const bal = '0x1000000000000000000000000000000000000000';
const p1 = hre.network.provider.send('hardhat_setBalance', [deployerAddress, bal]);
- const p2 = hre.network.provider.send('hardhat_setBalance', [ownerAddress, bal]);
- const p3 = hre.network.provider.send('hardhat_setBalance', [relayerAddress, bal]);
- await Promise.all([p1, p2, p3]);
+ const p2 = hre.network.provider.send('hardhat_setBalance', [relayerAddress, bal]);
+ await Promise.all([p1, p2]);
} else {
const p1 = getCoin(deployerAddress);
- const p2 = getCoin(ownerAddress);
- const p3 = getCoin(relayerAddress);
- await Promise.all([p1, p2, p3]);
+ const p2 = getCoin(relayerAddress);
+ await Promise.all([p1, p2]);
await new Promise((res) => setTimeout(res, 5000)); // wait 5 seconds
}
}
- console.log(`privateKey ${privKeyDeployer}`);
- console.log(`ownerAddress ${ownerAddress}`);
- await hre.run('task:deployGateway', { privateKey: privKeyDeployer, ownerAddress: ownerAddress });
+ await hre.run('task:deployGateway', { privateKey: privKeyDeployer, ownerAddress: deployerAddress });
const parsedEnv = dotenv.parse(fs.readFileSync('gateway/.env.gateway'));
const gatewayContractAddress = parsedEnv.GATEWAY_CONTRACT_PREDEPLOY_ADDRESS;
await hre.run('task:addRelayer', {
- privateKey: privKeyOwner,
+ privateKey: privKeyDeployer,
gatewayAddress: gatewayContractAddress,
relayerAddress: relayerAddress,
});
@@ -127,13 +127,10 @@ task('task:launchFhevm')
task('task:getBalances').setAction(async function (taskArgs, hre) {
const privKeyDeployer = process.env.PRIVATE_KEY_GATEWAY_DEPLOYER;
- const privKeyOwner = process.env.PRIVATE_KEY_GATEWAY_OWNER;
const privKeyRelayer = process.env.PRIVATE_KEY_GATEWAY_RELAYER;
const deployerAddress = new hre.ethers.Wallet(privKeyDeployer!).address;
- const ownerAddress = new hre.ethers.Wallet(privKeyOwner!).address;
const relayerAddress = new hre.ethers.Wallet(privKeyRelayer!).address;
console.log(await hre.ethers.provider.getBalance(deployerAddress));
- console.log(await hre.ethers.provider.getBalance(ownerAddress));
console.log(await hre.ethers.provider.getBalance(relayerAddress));
});
diff --git a/tasks/taskTFHE.ts b/tasks/taskTFHE.ts
index f82dc80a..28332012 100644
--- a/tasks/taskTFHE.ts
+++ b/tasks/taskTFHE.ts
@@ -1,5 +1,5 @@
import fs from 'fs';
-import { task } from 'hardhat/config';
+import { task, types } from 'hardhat/config';
import type { TaskArguments } from 'hardhat/types';
import path from 'path';
@@ -98,6 +98,12 @@ address constant kmsVerifierAdd = ${kmsVerfierAddress};\n`;
task('task:computeInputVerifierAddress')
.addParam('privateKey', 'The deployer private key')
+ .addOptionalParam(
+ 'useAddress',
+ 'Use addresses instead of private key env variable for coprocessor',
+ false,
+ types.boolean,
+ )
.setAction(async function (taskArguments: TaskArguments, { ethers }) {
// this script also compute the coprocessor address from its private key
const deployer = new ethers.Wallet(taskArguments.privateKey).address;
@@ -126,8 +132,12 @@ address constant inputVerifierAdd = ${inputVerfierAddress};\n`;
} catch (error) {
console.error('Failed to write ./lib/InputVerifierAddress.sol', error);
}
-
- const coprocAddress = new ethers.Wallet(process.env.PRIVATE_KEY_COPROCESSOR_ACCOUNT!).address;
+ let coprocAddress;
+ if (!taskArguments.useAddress) {
+ coprocAddress = new ethers.Wallet(process.env.PRIVATE_KEY_COPROCESSOR_ACCOUNT!).address;
+ } else {
+ coprocAddress = process.env.ADDRESS_COPROCESSOR;
+ }
const envFilePath2 = path.join(__dirname, '../lib/.env.coprocessor');
const content2 = `COPROCESSOR_ADDRESS=${coprocAddress}\n`;
try {
From ada674c717bd3daee2e58ae607f1c0fb2aab16e7 Mon Sep 17 00:00:00 2001
From: Aurora Poppyseed <30662672+poppyseedDev@users.noreply.github.com>
Date: Mon, 7 Oct 2024 20:09:00 +0900
Subject: [PATCH 27/51] docs: apply suggestions from code review
---
docs/guides/cli.md | 5 ++---
docs/guides/decrypt.md | 11 ++++++-----
docs/guides/reencryption.md | 6 ++++--
3 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/docs/guides/cli.md b/docs/guides/cli.md
index 01f491b2..d0fb1631 100644
--- a/docs/guides/cli.md
+++ b/docs/guides/cli.md
@@ -1,9 +1,8 @@
# Use the CLI
-This document provides instructions on how to use the Command-Line Interface (CLI) tool included in the `fhevmjs` package for encrypting integers with a blockchain's Fully Homomorphic Encryption (FHE) public key.
-
-`fhevmjs` include a CLI tool. With this handy utility, you can encrypt 8/16/32bits integer with the blockchain's FHE public key.
+This document introduces the Command-Line Interface (CLI) tool that is included in the `fhevmjs` package.
+It can be used for encrypting 8/16/32 bit integers with the blockchain's Fully Homomorphic Encryption (FHE) public key.
To get started with fhevmjs CLI, first, ensure you have Node.js installed on your system. Next, install the fhevmjs package globally using the '-g' flag, which allows you to access the CLI tool from any directory:
```bash
diff --git a/docs/guides/decrypt.md b/docs/guides/decrypt.md
index 1830aada..16666232 100644
--- a/docs/guides/decrypt.md
+++ b/docs/guides/decrypt.md
@@ -1,8 +1,8 @@
-# Decrypt
-This document provides a guide on performing asynchronous decryption using the `GatewayCaller` contract in Solidity, covering the necessary setup, usage, and detailed function explanations.
+# Decryption
+This document provides a guide on performing decryption on smart contracts in Solidity.
## Overview
-The decryption operation is asynchronous. To use it, your contract must extend the `GatewayCaller` contract. This will import automatically the `Gateway` solidity library as well. See the following example:
+The decryption operation is asynchronous. To use it, your contract must extend the `GatewayCaller` contract. This action will import automatically the `Gateway` solidity library as well. See the following example:
```solidity
pragma solidity ^0.8.24;
@@ -32,9 +32,10 @@ contract TestAsyncDecrypt is GatewayCaller {
```
## `GatewayContract` set up
-A [`GatewayContract`](../../gateway/GatewayContract.sol) is predeployed on the fhEVM testnet. It uses a default relayer account specified by the `PRIVATE_KEY_GATEWAY_RELAYER` environment variable in the `.env` file.
+The [`GatewayContract`](../../gateway/GatewayContract.sol) is pre-deployed on the fhEVM testnet. It uses a default relayer account specified in the `PRIVATE_KEY_GATEWAY_RELAYER` environment variable in the `.env` file.
-Relayers are the only accounts authorized to fulfill decryption requests. However, the `GatewayContract` verifies the KMS signature during fulfillment, ensuring that even if we trust the relayer only to forward the request on time, a malicious relayer could not cheat by sending fake decryption results.
+Relayers are the only accounts authorized to fulfill decryption requests. The role of the `GatewayContract`, however, is to independently verify the KMS signature during execution. This ensures that the relayers cannot manipulate or send fraudulent decryption results, even if compromised.
+However, the relayers are still trusted to forward decryption requests on time.
## `Gateway.requestDecryption` function
The interface of the `Gateway.requestDecryption` function from previous snippet is the following:
diff --git a/docs/guides/reencryption.md b/docs/guides/reencryption.md
index a216485c..6306a19e 100644
--- a/docs/guides/reencryption.md
+++ b/docs/guides/reencryption.md
@@ -1,9 +1,11 @@
# How to get a re-encryption
-This document explains how to perform a re-encryption. The process involves implementing a contract function to retrieve the ciphertext and then using client-side code to re-encrypt the ciphertext.
+This document explains how to perform re-encryption. Re-encryption is required when you want a user to access their private data without it being exposed to the blockchain.
+To preform the process you will first need to retrieve the ciphertext from the blockchain and then use the client-side code to preform the re-encryption.
-Re-encryption is the process of converting ciphertext encrypted with an FHE blockchain key into ciphertext encrypted with a NaCl public key.
+
+Re-encryption allows you to securely convert the encrypted ciphertext from one form - encrypted with a FHE blockchain key - to another - encrypted with a Client-side public key (NaCl public key) without revealing the underlying plaintext in between.
## Retrieve the ciphertext
To retrieve the ciphertext that needs to be re-encrypted, you must implement a view function in your contract. Here's is an example:
From dc78c07aadb80a609a89b7780a12af5a794b6288 Mon Sep 17 00:00:00 2001
From: Aurora Poppyseed
Date: Mon, 7 Oct 2024 14:51:14 +0200
Subject: [PATCH 28/51] docs: prettier
---
docs/guides/decrypt.md | 5 +++++
docs/guides/gas.md | 3 ++-
docs/guides/loop.md | 5 +++++
docs/guides/node.md | 4 ++--
docs/guides/pitfalls.md | 3 ++-
docs/guides/reencryption.md | 4 +++-
docs/guides/webapp.md | 7 ++++++-
docs/guides/webpack.md | 2 ++
docs/references/fhevmjs.md | 1 +
9 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/docs/guides/decrypt.md b/docs/guides/decrypt.md
index 16666232..3c81969b 100644
--- a/docs/guides/decrypt.md
+++ b/docs/guides/decrypt.md
@@ -1,7 +1,9 @@
# Decryption
+
This document provides a guide on performing decryption on smart contracts in Solidity.
## Overview
+
The decryption operation is asynchronous. To use it, your contract must extend the `GatewayCaller` contract. This action will import automatically the `Gateway` solidity library as well. See the following example:
```solidity
@@ -30,6 +32,7 @@ contract TestAsyncDecrypt is GatewayCaller {
return yBool;
}
```
+
## `GatewayContract` set up
The [`GatewayContract`](../../gateway/GatewayContract.sol) is pre-deployed on the fhEVM testnet. It uses a default relayer account specified in the `PRIVATE_KEY_GATEWAY_RELAYER` environment variable in the `.env` file.
@@ -38,6 +41,7 @@ Relayers are the only accounts authorized to fulfill decryption requests. The ro
However, the relayers are still trusted to forward decryption requests on time.
## `Gateway.requestDecryption` function
+
The interface of the `Gateway.requestDecryption` function from previous snippet is the following:
```solidity
@@ -49,6 +53,7 @@ function requestDecryption(
bool passSignaturesToCaller
) returns(uint256 requestID)
```
+
### Parameters
The first argument, `ct`, should be an array of ciphertexts handles which could be of different types, i.e `uint256` values coming from unwrapping handles of type either `ebool`, `euint4`, `euint8`, `euint16`, `euint32`, `euint64` or `eaddress`. `ct` is the list of ciphertexts that are requested to be decrypted. Calling `requestDecryption` will emit an `EventDecryption` on the `GatewayContract` contract which will be detected by a relayer. Then, the relayer will send the corresponding ciphertexts to the KMS for decryption before fulfilling the request.
diff --git a/docs/guides/gas.md b/docs/guides/gas.md
index 24d5560a..ff43c05f 100644
--- a/docs/guides/gas.md
+++ b/docs/guides/gas.md
@@ -1,5 +1,6 @@
# Gas estimation
-This document provides an overview of gas estimation for Fully Homomorphic Encryption (FHE) operations, detailing the gas costs associated with various operations across different data types.
+
+This document provides an overview of gas estimation for Fully Homomorphic Encryption (FHE) operations, detailing the gas costs associated with various operations across different data types.
FHE operations are typically more computationally expensive than classical operations due to their inherent complexity. As a reference, here is an approximation of the gas cost associated with each operation.
diff --git a/docs/guides/loop.md b/docs/guides/loop.md
index c18ff7e2..f2c5996d 100644
--- a/docs/guides/loop.md
+++ b/docs/guides/loop.md
@@ -1,6 +1,9 @@
# How can I break a loop ?
+
This document explains how to handle loops when working with Fully Homomorphic Encryption (FHE), specifically when a loop break is based on an encrypted condition.
+
## Breaking a loop
+
❌ In FHE, it is not possible to break a loop based on an encrypted condition. For example, this would not work:
```solidity
@@ -13,7 +16,9 @@ while(TFHE.lt(x, maxValue)){
```
If your code logic requires looping on an encrypted boolean condition, we highly suggest to try to replace it by a finite loop with an appropriate constant maximum number of steps and use `TFHE.select` inside the loop.
+
## Suggested approach
+
✅ For example, the previous code could maybe be replaced by the following snippet:
```solidity
diff --git a/docs/guides/node.md b/docs/guides/node.md
index d9b96b6d..ae870e08 100644
--- a/docs/guides/node.md
+++ b/docs/guides/node.md
@@ -1,7 +1,9 @@
# Build with Node
+
This document provides instructions on how to build with `Node.js` using the `fhevmjs` library.
## Install the library
+
First, you need to install the library:
```bash
@@ -28,8 +30,6 @@ An instance receives an object containing:
- `gatewayUrl` (optional): the URL of the gateway to retrieve a reencryption
- `coprocessorUrl` (optional): the URL of the coprocessor
-
-
```javascript
const { createInstance } = require("fhevmjs");
diff --git a/docs/guides/pitfalls.md b/docs/guides/pitfalls.md
index d3bf83ff..2446cbcb 100644
--- a/docs/guides/pitfalls.md
+++ b/docs/guides/pitfalls.md
@@ -1,5 +1,6 @@
# Common pitfalls and best practises
-This document provides guidance on common pitfalls to avoid and best practices to follow when working with fhEVM.
+
+This document provides guidance on common pitfalls to avoid and best practices to follow when working with fhEVM.
## Common pitfalls to avoid
diff --git a/docs/guides/reencryption.md b/docs/guides/reencryption.md
index 6306a19e..4de62097 100644
--- a/docs/guides/reencryption.md
+++ b/docs/guides/reencryption.md
@@ -4,10 +4,10 @@ This document explains how to perform re-encryption. Re-encryption is required w
To preform the process you will first need to retrieve the ciphertext from the blockchain and then use the client-side code to preform the re-encryption.
-
Re-encryption allows you to securely convert the encrypted ciphertext from one form - encrypted with a FHE blockchain key - to another - encrypted with a Client-side public key (NaCl public key) without revealing the underlying plaintext in between.
## Retrieve the ciphertext
+
To retrieve the ciphertext that needs to be re-encrypted, you must implement a view function in your contract. Here's is an example:
```solidity
@@ -21,7 +21,9 @@ contract EncryptedERC20 {
...
}
```
+
## Re-encrypt the ciphertext
+
Then, you can implement the client-side code to re-encrypt the ciphertext. This step is designed to run in a browser, here is an example:
```javascript
diff --git a/docs/guides/webapp.md b/docs/guides/webapp.md
index 9070b217..212b9688 100644
--- a/docs/guides/webapp.md
+++ b/docs/guides/webapp.md
@@ -1,5 +1,6 @@
# Build a web application
-This document guides you through building a web application using the fhevmjs library. You can either start with a template or directly integrate the library into your project.
+
+This document guides you through building a web application using the fhevmjs library. You can either start with a template or directly integrate the library into your project.
## Using a template
@@ -20,6 +21,7 @@ You can also use [this template](https://github.com/zama-ai/fhevmjs-next-templat
## Using directly the library
### Step 1: Install the library
+
Install the `fhevmjs` library to your project:
```bash
@@ -32,6 +34,7 @@ yarn add fhevmjs
# Using pnpm
pnpm add fhevmjs
```
+
### Step 2: Initialize your project
`fhevmjs` uses ESM format. You need to set the [type to "module" in your package.json](https://nodejs.org/api/packages.html#type). If your node project use `"type": "commonjs"` or no type, you can force the loading of the web version by using `import { createInstance } from 'fhevmjs/web';`
@@ -45,7 +48,9 @@ const init = async () => {
await initFhevm(); // Load needed WASM
};
```
+
### Step 3: Create an instance
+
Once the WASM is loaded, you can now create an instance. An instance receives an object containing:
- `chainId` (optional): the chainId of the network
diff --git a/docs/guides/webpack.md b/docs/guides/webpack.md
index 5a73ee6c..a034532c 100644
--- a/docs/guides/webpack.md
+++ b/docs/guides/webpack.md
@@ -1,5 +1,7 @@
# Common webpack errors
+
This document provides solutions for common Webpack errors encountered during the development process. Follow the steps below to resolve each issue.
+
## "Module not found: Error: Can't resolve 'tfhe_bg.wasm'"
In the codebase, there is a `new URL('tfhe_bg.wasm')` which triggers a resolve by Webpack. If you encounter an issue, you can add a fallback for this file by adding a resolve configuration in your `webpack.config.js`:
diff --git a/docs/references/fhevmjs.md b/docs/references/fhevmjs.md
index b75664d9..b8298db0 100644
--- a/docs/references/fhevmjs.md
+++ b/docs/references/fhevmjs.md
@@ -1,4 +1,5 @@
# fhevmjs function specifications
+
This document provides an overview of the `fhevmjs` library, detailing its initialization, instance creation, input handling, encryption, and re-encryption processes.
[fhevmjs](https://github.com/zama-ai/fhevmjs/) is designed to assist in creating encrypted inputs and retrieving re-encryption data off-chain through a gateway. The library works with any fhEVM and fhEVM Coprocessors.
From 0a709946a714f5ecf51f36e18c94bb308c6ea291 Mon Sep 17 00:00:00 2001
From: Aurora Poppyseed <30662672+poppyseedDev@users.noreply.github.com>
Date: Mon, 7 Oct 2024 15:04:08 +0200
Subject: [PATCH 29/51] docs: Apply suggestions from code review
---
docs/getting_started/write_contract/hardhat.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/getting_started/write_contract/hardhat.md b/docs/getting_started/write_contract/hardhat.md
index 6b092313..3ada54e5 100644
--- a/docs/getting_started/write_contract/hardhat.md
+++ b/docs/getting_started/write_contract/hardhat.md
@@ -2,7 +2,7 @@
This document guides you to start with fhEVM by using our [Hardhat template](https://github.com/zama-ai/fhevm-hardhat-template).
## Using Hardhat with fhEVM
-To start writing smart contracts with fhEVM, we recommend use our [Hardhat template](https://github.com/zama-ai/fhevm-hardhat-template). This template allows you to launch an fhEVM Docker image and run your smart contract on it. For more information, refer to the [README](https://github.com/zama-ai/fhevm-hardhat-template/blob/main/README.md).
+To start writing smart contracts with fhEVM, we recommend using our [Hardhat template](https://github.com/zama-ai/fhevm-hardhat-template). This template allows you to launch an fhEVM Docker image and run your smart contract on it. For more information, refer to the [README](https://github.com/zama-ai/fhevm-hardhat-template/blob/main/README.md).
When developing confidential contracts, we recommend using the mocked version of fhEVM first for faster testing. You can achieve this by running `pnpm test:mock` for tests and `pnpm coverage:mock` for coverage computation. This approach provides a better developer experience. However, keep in mind that the mocked fhEVM has limitations and discrepancies compared to the real fhEVM node, as detailed in the [limitations](#limitations) section below.
@@ -10,7 +10,7 @@ It's essential to test the final contract version with the real fhEVM before dep
## Mocked mode
-For faster testing iterations, you can use the mocked version of the fhEVM instead of launching all tests on a local fhEVM node with `pnpm test` or `npx hardhat test`, which can take several minutes.
+For faster iteration testing, you can use the mocked version of the fhEVM instead of launching all tests on a local fhEVM node with `pnpm test` or `npx hardhat test`, which can take several minutes.
The same tests should generally pass without modification—no changes to the JavaScript or Solidity files are required when switching between the mocked and real versions.
From a2f7d82b29629f729c38d7bcca249564397af4f4 Mon Sep 17 00:00:00 2001
From: Aurora Poppyseed
Date: Mon, 7 Oct 2024 15:07:55 +0200
Subject: [PATCH 30/51] docs: prettier
---
docs/getting_started/write_contract/hardhat.md | 13 +++++++------
docs/getting_started/write_contract/others.md | 1 +
docs/getting_started/write_contract/remix.md | 6 ++++--
3 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/docs/getting_started/write_contract/hardhat.md b/docs/getting_started/write_contract/hardhat.md
index 3ada54e5..8d378cc8 100644
--- a/docs/getting_started/write_contract/hardhat.md
+++ b/docs/getting_started/write_contract/hardhat.md
@@ -1,7 +1,9 @@
# Using Hardhat
+
This document guides you to start with fhEVM by using our [Hardhat template](https://github.com/zama-ai/fhevm-hardhat-template).
## Using Hardhat with fhEVM
+
To start writing smart contracts with fhEVM, we recommend using our [Hardhat template](https://github.com/zama-ai/fhevm-hardhat-template). This template allows you to launch an fhEVM Docker image and run your smart contract on it. For more information, refer to the [README](https://github.com/zama-ai/fhevm-hardhat-template/blob/main/README.md).
When developing confidential contracts, we recommend using the mocked version of fhEVM first for faster testing. You can achieve this by running `pnpm test:mock` for tests and `pnpm coverage:mock` for coverage computation. This approach provides a better developer experience. However, keep in mind that the mocked fhEVM has limitations and discrepancies compared to the real fhEVM node, as detailed in the [limitations](#limitations) section below.
@@ -10,13 +12,12 @@ It's essential to test the final contract version with the real fhEVM before dep
## Mocked mode
-For faster iteration testing, you can use the mocked version of the fhEVM instead of launching all tests on a local fhEVM node with `pnpm test` or `npx hardhat test`, which can take several minutes.
+For faster iteration testing, you can use the mocked version of the fhEVM instead of launching all tests on a local fhEVM node with `pnpm test` or `npx hardhat test`, which can take several minutes.
The same tests should generally pass without modification—no changes to the JavaScript or Solidity files are required when switching between the mocked and real versions.
In mocked mode, actual encryption for encrypted types is not performed. Instead, the tests run on a local Hardhat node that implements the original EVM (non-fhEVM). Additionally, this mode supports all Hardhat-related testing and debugging methods, such as `evm_mine`, `evm_snapshot`, and `evm_revert`, which are highly useful for testing.
-
To run the mocked tests use either:
```
@@ -32,8 +33,8 @@ npx hardhat test --network hardhat
In mocked mode, all tests should pass in few seconds instead of few minutes, allowing a better developer experience.
### Coverage in mocked mode
-Coverage computation is only possible in mocked mode. Run the following command to compute coverage:
+Coverage computation is only possible in mocked mode. Run the following command to compute coverage:
```
pnpm coverage:mock
@@ -45,10 +46,10 @@ Or equivalently:
npx hardhat coverage
```
-
After running the command, open the `coverage/index.html` file to view the results. This helps identify any missing branches not covered by the current test suite, increasing the security of your contracts.
#### Important note
+
Due to limitations in the `solidity-coverage` package, coverage computation in fhEVM does not support tests involving the `evm_snapshot` Hardhat testing method. However, this method is still supported when running tests in mocked mode. If you are using Hardhat snapshots, we recommend to end your your test description with the `[skip-on-coverage]` tag to to avoid coverage issues. Here is an example:
```js
@@ -122,7 +123,7 @@ describe('Rand', function () {
});
```
-In this snippet, the first test will always run, whether in "real" non-mocked mode (`pnpm test`), testing mocked mode (`pnpm test:mock`) or coverage (mocked) mode (`pnpm coverage:mock`). On the other hand, the second test will be run **only** in testing mocked mode(`pnpm test:mock`), because snapshots only works in that specific case.
+In this snippet, the first test will always run, whether in "real" non-mocked mode (`pnpm test`), testing mocked mode (`pnpm test:mock`) or coverage (mocked) mode (`pnpm coverage:mock`). On the other hand, the second test will be run **only** in testing mocked mode(`pnpm test:mock`), because snapshots only works in that specific case.
Actually, the second test will be skipped if run in coverage mode, since its description string ends with `[skip-on-coverage]` and similarly, we avoid the test to fail in non-mocked mode since we check that the network name is `hardhat`.
### Limitations
@@ -133,4 +134,4 @@ Actually, the second test will be skipped if run in coverage mode, since its des
**Zama 5-Question Developer Survey**
We want to hear from you! Take 1 minute to share your thoughts and helping us enhance our documentation and libraries. **👉** [**Click here**](https://www.zama.ai/developer-survey) to participate.
-{% endhint %}
\ No newline at end of file
+{% endhint %}
diff --git a/docs/getting_started/write_contract/others.md b/docs/getting_started/write_contract/others.md
index 3ed2a897..b5d10aee 100644
--- a/docs/getting_started/write_contract/others.md
+++ b/docs/getting_started/write_contract/others.md
@@ -1,4 +1,5 @@
# Other development environment
+
This document provides guidance on using the fhEVM in other development environments.
## Foundry
diff --git a/docs/getting_started/write_contract/remix.md b/docs/getting_started/write_contract/remix.md
index 5f05a408..f0b0f765 100644
--- a/docs/getting_started/write_contract/remix.md
+++ b/docs/getting_started/write_contract/remix.md
@@ -1,4 +1,5 @@
# Using Remix
+
This document provides guidance on using the new Zama plugin for the [the official Remix IDE](https://remix.ethereum.org), which replaces the deprecated Remix fork. This allows you to develop and manage contracts directly in Remix by simply loading the fhEVM plugin.
## Installing the Zama plugin
@@ -12,10 +13,11 @@ This document provides guidance on using the new Zama plugin for the [the offici
## Configuring the Zama plugin
+
After connecting to the Zama Plugin, follow the steps to configure it:
- 1. Click on the plugin button located on the left of the screen
- 2. Add a Gateway URL to be able to request reencryption of ciphertexts, as shown in the picture below.
+1. Click on the plugin button located on the left of the screen
+2. Add a Gateway URL to be able to request reencryption of ciphertexts, as shown in the picture below.
The default recommended Gateway URL is: `https://gateway.devnet.zama.ai`.
From eef0666de66bcf5c383ea3317736f40334f7fa43 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Mon, 7 Oct 2024 17:39:28 +0200
Subject: [PATCH 31/51] feat: added etherscan verification task
chore: fixed typo
---
.env.example | 5 ++-
.env.example.deployment | 6 ++--
.gitignore | 1 +
hardhat.config.ts | 8 +++++
launch-fhevm.sh | 16 +++++----
tasks/etherscanVerify.ts | 77 ++++++++++++++++++++++++++++++++++++++++
tasks/taskTFHE.ts | 2 +-
7 files changed, 105 insertions(+), 10 deletions(-)
create mode 100644 tasks/etherscanVerify.ts
diff --git a/.env.example b/.env.example
index 4a93f29e..2382aeae 100644
--- a/.env.example
+++ b/.env.example
@@ -8,4 +8,7 @@ export PRIVATE_KEY_KMS_SIGNER_1="bbaed91514fa4b7c86aa4f73becbabcf4bce0ae130240f0
export PRIVATE_KEY_KMS_SIGNER_2="1bfa3e2233b0103ad67954a728b246c528916791f7fab4894ff361e3937b47e1"
export PRIVATE_KEY_KMS_SIGNER_3="7a604eed8cf4a43277d192aa0c7894d368577a4021e52bf45420f256e34c7dd7"
export PRIVATE_KEY_COPROCESSOR_ACCOUNT="7ec8ada6642fc4ccfb7729bc29c17cf8d21b61abd5642d1db992c0b8672ab901"
-export IS_COPROCESSOR="true"
\ No newline at end of file
+export IS_COPROCESSOR="true"
+
+export SEPOLIA_RPC_RUL="https://sepolia.infura.io/v3/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+export ETHERSCAN_API_KEY="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
\ No newline at end of file
diff --git a/.env.example.deployment b/.env.example.deployment
index bfa69a83..0ea36af5 100644
--- a/.env.example.deployment
+++ b/.env.example.deployment
@@ -6,5 +6,7 @@ export ADDRESS_KMS_SIGNER_0="0x0971C80fF03B428fD2094dd5354600ab103201C5"
export ADDRESS_KMS_SIGNER_1="0xB68deCb047B5e6Cc82280502A7E2318c6b3E5eC6"
export ADDRESS_KMS_SIGNER_2="0xfe0fB0BCceb872ee7a6ef6c455e6E127Aef55DD7"
export ADDRESS_KMS_SIGNER_3="0x2dac5193bE0AB0eD8871399E6Ae61EAe6cc8cAE1"
-export ADDRESS_COPROCESSOR="0xc9990FEfE0c27D31D0C2aa36196b085c0c4d456c"
-export IS_COPROCESSOR="true"
\ No newline at end of file
+export ADDRESS_COPROCESSOR_ACCOUNT="0xc9990FEfE0c27D31D0C2aa36196b085c0c4d456c"
+export IS_COPROCESSOR="true"
+export SEPOLIA_RPC_RUL="https://sepolia.infura.io/v3/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+export ETHERSCAN_API_KEY="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 69caed40..b766d354 100644
--- a/.gitignore
+++ b/.gitignore
@@ -137,3 +137,4 @@ deployments
typechain
typechain-types
.openzeppelin/unknown*
+.openzeppelin/sepolia.json
diff --git a/hardhat.config.ts b/hardhat.config.ts
index f6004614..7e80191e 100644
--- a/hardhat.config.ts
+++ b/hardhat.config.ts
@@ -11,6 +11,7 @@ import { resolve } from 'path';
import CustomProvider from './CustomProvider';
// Adjust the import path as needed
import './tasks/accounts';
+import './tasks/etherscanVerify';
import './tasks/getEthereumAddress';
import './tasks/mint';
import './tasks/taskDeploy';
@@ -45,6 +46,7 @@ const chainIds = {
local: 9000,
localNetwork1: 9000,
multipleValidatorTestnet: 8009,
+ sepolia: 11155111,
};
function getChainConfig(chain: keyof typeof chainIds): NetworkUserConfig {
@@ -62,6 +64,8 @@ function getChainConfig(chain: keyof typeof chainIds): NetworkUserConfig {
case 'zama':
jsonRpcUrl = 'https://devnet.zama.ai';
break;
+ case 'sepolia':
+ jsonRpcUrl = process.env.SEPOLIA_RPC_RUL!;
}
return {
accounts: {
@@ -135,6 +139,7 @@ const config: HardhatUserConfig = {
path: "m/44'/60'/0'/0",
},
},
+ sepolia: getChainConfig('sepolia'),
zama: getChainConfig('zama'),
localDev: getChainConfig('local'),
local: getChainConfig('local'),
@@ -164,6 +169,9 @@ const config: HardhatUserConfig = {
evmVersion: 'cancun',
},
},
+ etherscan: {
+ apiKey: process.env.ETHERSCAN_API_KEY!,
+ },
warnings: {
'*': {
'transient-storage': false,
diff --git a/launch-fhevm.sh b/launch-fhevm.sh
index 9be75e38..d8178f0d 100755
--- a/launch-fhevm.sh
+++ b/launch-fhevm.sh
@@ -18,12 +18,16 @@ npx hardhat task:computeFHEPaymentAddress --private-key "$PRIVATE_KEY_FHEVM_DEPL
npx hardhat compile:specific --contract lib
npx hardhat compile:specific --contract gateway
-npx hardhat task:deployACL --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
-npx hardhat task:deployTFHEExecutor --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
-npx hardhat task:deployKMSVerifier --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
-npx hardhat task:deployInputVerifier --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
-npx hardhat task:deployFHEPayment --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
+npx hardhat task:deployACL --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia
+npx hardhat task:deployTFHEExecutor --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia
+npx hardhat task:deployKMSVerifier --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia
+npx hardhat task:deployInputVerifier --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia
+npx hardhat task:deployFHEPayment --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia
npx hardhat task:addSigners --num-signers $NUM_KMS_SIGNERS --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --use-address true
-npx hardhat task:launchFhevm --skip-get-coin true --use-address true
\ No newline at end of file
+npx hardhat task:launchFhevm --skip-get-coin true --use-address true --network sepolia
+
+echo "Waiting 2 minutes before contract verification... Please wait..."
+sleep 120 # makes sure that contracts bytescode propagates on Etherscan, otherwise contracts verification might fail in next step
+npx hardhat task:verifyContracts --network sepolia
\ No newline at end of file
diff --git a/tasks/etherscanVerify.ts b/tasks/etherscanVerify.ts
new file mode 100644
index 00000000..ab4aa10a
--- /dev/null
+++ b/tasks/etherscanVerify.ts
@@ -0,0 +1,77 @@
+import dotenv from 'dotenv';
+import fs from 'fs';
+import { task } from 'hardhat/config';
+
+task('task:verifyContracts').setAction(async function (taskArguments, { upgrades, run }) {
+ const parsedEnvACL = dotenv.parse(fs.readFileSync('lib/.env.acl'));
+ const proxyACLAddress = parsedEnvACL.ACL_CONTRACT_ADDRESS;
+ const implementationACLAddress = await upgrades.erc1967.getImplementationAddress(proxyACLAddress);
+ await run('verify:verify', {
+ address: implementationACLAddress,
+ constructorArguments: [],
+ });
+ await run('verify:verify', {
+ address: proxyACLAddress,
+ constructorArguments: [],
+ });
+
+ const parsedEnvTFHEExecutor = dotenv.parse(fs.readFileSync('lib/.env.exec'));
+ const proxyTFHEExecutorAddress = parsedEnvTFHEExecutor.TFHE_EXECUTOR_CONTRACT_ADDRESS;
+ const implementationTFHEExecutorAddress = await upgrades.erc1967.getImplementationAddress(proxyTFHEExecutorAddress);
+ await run('verify:verify', {
+ address: implementationTFHEExecutorAddress,
+ constructorArguments: [],
+ });
+ await run('verify:verify', {
+ address: proxyTFHEExecutorAddress,
+ constructorArguments: [],
+ });
+
+ const parsedEnvKMSVerifier = dotenv.parse(fs.readFileSync('lib/.env.kmsverifier'));
+ const proxyKMSVerifier = parsedEnvKMSVerifier.KMS_VERIFIER_CONTRACT_ADDRESS;
+ const implementationKMSVerifierAddress = await upgrades.erc1967.getImplementationAddress(proxyKMSVerifier);
+ await run('verify:verify', {
+ address: implementationKMSVerifierAddress,
+ constructorArguments: [],
+ });
+ await run('verify:verify', {
+ address: proxyKMSVerifier,
+ constructorArguments: [],
+ });
+
+ const parsedEnvInputVerifier = dotenv.parse(fs.readFileSync('lib/.env.inputverifier'));
+ const proxyInputVerifier = parsedEnvInputVerifier.INPUT_VERIFIER_CONTRACT_ADDRESS;
+ const implementationInputVerifierAddress = await upgrades.erc1967.getImplementationAddress(proxyInputVerifier);
+ await run('verify:verify', {
+ address: implementationInputVerifierAddress,
+ constructorArguments: [],
+ });
+ await run('verify:verify', {
+ address: proxyInputVerifier,
+ constructorArguments: [],
+ });
+
+ const parsedEnvFHEPayment = dotenv.parse(fs.readFileSync('lib/.env.fhepayment'));
+ const proxyFHEPayment = parsedEnvFHEPayment.FHE_PAYMENT_CONTRACT_ADDRESS;
+ const implementationFHEPaymentAddress = await upgrades.erc1967.getImplementationAddress(proxyFHEPayment);
+ await run('verify:verify', {
+ address: implementationFHEPaymentAddress,
+ constructorArguments: [],
+ });
+ await run('verify:verify', {
+ address: proxyFHEPayment,
+ constructorArguments: [],
+ });
+
+ const parsedEnvGateway = dotenv.parse(fs.readFileSync('gateway/.env.gateway'));
+ const proxyGateway = parsedEnvGateway.GATEWAY_CONTRACT_PREDEPLOY_ADDRESS;
+ const implementationGatewayAddress = await upgrades.erc1967.getImplementationAddress(proxyGateway);
+ await run('verify:verify', {
+ address: implementationGatewayAddress,
+ constructorArguments: [],
+ });
+ await run('verify:verify', {
+ address: proxyGateway,
+ constructorArguments: [],
+ });
+});
diff --git a/tasks/taskTFHE.ts b/tasks/taskTFHE.ts
index 28332012..934787ac 100644
--- a/tasks/taskTFHE.ts
+++ b/tasks/taskTFHE.ts
@@ -136,7 +136,7 @@ address constant inputVerifierAdd = ${inputVerfierAddress};\n`;
if (!taskArguments.useAddress) {
coprocAddress = new ethers.Wallet(process.env.PRIVATE_KEY_COPROCESSOR_ACCOUNT!).address;
} else {
- coprocAddress = process.env.ADDRESS_COPROCESSOR;
+ coprocAddress = process.env.ADDRESS_COPROCESSOR_ACCOUNT;
}
const envFilePath2 = path.join(__dirname, '../lib/.env.coprocessor');
const content2 = `COPROCESSOR_ADDRESS=${coprocAddress}\n`;
From 8f9945d84427e1d1dc2b9f1ed77c571ac72658de Mon Sep 17 00:00:00 2001
From: Aurora Poppyseed
Date: Tue, 8 Oct 2024 12:14:24 +0200
Subject: [PATCH 32/51] docs: merged unclear docs and bug docs template into
one
---
.github/ISSUE_TEMPLATE/docs_bug_report.md | 32 ++++++++++--
.github/ISSUE_TEMPLATE/docs_unclear_report.md | 52 -------------------
.gitignore | 1 +
3 files changed, 28 insertions(+), 57 deletions(-)
delete mode 100644 .github/ISSUE_TEMPLATE/docs_unclear_report.md
diff --git a/.github/ISSUE_TEMPLATE/docs_bug_report.md b/.github/ISSUE_TEMPLATE/docs_bug_report.md
index d7b9f7f7..5176f679 100644
--- a/.github/ISSUE_TEMPLATE/docs_bug_report.md
+++ b/.github/ISSUE_TEMPLATE/docs_bug_report.md
@@ -1,6 +1,6 @@
---
-name: Documentation Bug Report
-about: Use this template to report issues, inconsistencies, or inaccuracies in our documentation.
+name: Documentation Bug Report / Unclear Documentation
+about: Use this template to report issues, inconsistencies, or inaccuracies in our documentation. Or to report sections of our documentation that are unclear, confusing, or require further explanation.
title: ""
labels: bug, documentation
assignees: ""
@@ -13,19 +13,41 @@ Please provide a link to the page where the issue is located:
### **Description**
-Provide a clear and detailed description of the bug. Include any inconsistencies, typos, broken links, or missing information.
+Describe in detail what part of the documentation is unclear or provide a clear and detailed description of the bug. Include any inconsistencies, typos, broken links, or missing information.
For example:
Inaccurate technical explanations or missing prerequisites.
Deprecated code snippets or outdated references.
Formatting issues or broken links.
+ Is there a lack of explanation for certain technical terms or concepts?
+ Are there missing examples for a complex function or feature?
+ Does the documentation assume prior knowledge that hasn't been introduced?
-### **Suggested Fix / Expected Behavior**
+### **Suggested Fix / Expected Behavior / What Would You Like Clarified?**
-Describe what you expected the documentation to include or suggest the correct information. For example, provide a corrected code snippet, explanation, or a link to the correct resource.
+Please provide your suggestions for improvement or clarification:
+
+- Describe expected content or suggest corrections for bugs/inaccuracies.
+- Explain what needs clarification for unclear documentation.
+
+Examples of helpful suggestions:
+
+
Corrected code snippet
+ Improved explanation.
+ Link to a more accurate or up-to-date resource
+
+
+
+Examples of clarification requests:
+
+
“Can you provide an example of this function in use?”
+ "What are the expected inputs and outputs for this operation?”
+ “Could you add a section explaining how this feature integrates with other components?”
+
+
### **Screenshots / Logs**
diff --git a/.github/ISSUE_TEMPLATE/docs_unclear_report.md b/.github/ISSUE_TEMPLATE/docs_unclear_report.md
deleted file mode 100644
index 646561d2..00000000
--- a/.github/ISSUE_TEMPLATE/docs_unclear_report.md
+++ /dev/null
@@ -1,52 +0,0 @@
----
-name: Unclear Documentation Report
-about: Use this template to report sections of our documentation that are unclear, confusing, or require further explanation.
-title: ""
-labels: documentation
-assignees: ""
----
-
-### **Page Link**
-
-Provide a link to the documentation page where the unclear content is located:
-**URL**: '[https://docs.zama.ai/fhevm/\_\_\_](https://docs.zama.ai/fhevm/___)'
-
-### **Description of the Issue**
-
-Describe in detail what part of the documentation is unclear.
-
-For example:
-
-
Is there a lack of explanation for certain technical terms or concepts?
- Are there missing examples for a complex function or feature?
- Does the documentation assume prior knowledge that hasn't been introduced?
-
-
-
-### **What Would You Like Clarified?**
-
-Provide details on what you expected to understand better or where more explanation is needed.
-
-Include questions such as:
-
-
“Can you provide an example of this function in use?”
- "What are the expected inputs and outputs for this operation?”
- “Could you add a section explaining how this feature integrates with other components?”
-
-
-
-### **Suggestions for Improvement**
-
-(Optional) If you have suggestions for how the documentation can be made clearer, provide them here. For example:
-
-Include questions such as:
-
-
“Adding a diagram would help clarify this process.”
- “Please include code snippets showing both successful and unsuccessful cases.”
- “Include a glossary for the FHE-specific terms used in this section.”
-
-
-
-### **Screenshots / Logs**
-
-If applicable, provide screenshots or logs to help us understand what part of the documentation caused confusion.
diff --git a/.gitignore b/.gitignore
index b9b70a29..d0c33875 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@ yarn-error.log*
lerna-debug.log*
pnpm-lock.yaml
yarn.lock
+.vscode
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
From f371bd6ec5fce14c7584122a318c690f139db328 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Tue, 8 Oct 2024 12:21:18 +0200
Subject: [PATCH 33/51] feat: adds upgrade tasks
---
hardhat.config.ts | 1 +
tasks/upgradeProxy.ts | 186 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 187 insertions(+)
create mode 100644 tasks/upgradeProxy.ts
diff --git a/hardhat.config.ts b/hardhat.config.ts
index 7e80191e..4ed3795d 100644
--- a/hardhat.config.ts
+++ b/hardhat.config.ts
@@ -17,6 +17,7 @@ import './tasks/mint';
import './tasks/taskDeploy';
import './tasks/taskGatewayRelayer';
import './tasks/taskTFHE';
+import './tasks/upgradeProxy';
extendProvider(async (provider, config, network) => {
const newProvider = new CustomProvider(provider);
diff --git a/tasks/upgradeProxy.ts b/tasks/upgradeProxy.ts
new file mode 100644
index 00000000..ca7b43c6
--- /dev/null
+++ b/tasks/upgradeProxy.ts
@@ -0,0 +1,186 @@
+import dotenv from 'dotenv';
+import fs from 'fs';
+import { task } from 'hardhat/config';
+import type { TaskArguments } from 'hardhat/types';
+
+function stripContractName(input: string): string {
+ const colonIndex = input.lastIndexOf('/');
+ if (colonIndex !== -1) {
+ return input.substring(0, colonIndex);
+ }
+ return input;
+}
+
+task('task:upgradeACL')
+ .addParam(
+ 'currentImplementation',
+ 'The currently deployed implementation solidity contract path and name, eg: lib/ACL.sol:ACL',
+ )
+ .addParam(
+ 'newImplementation',
+ 'The new implementation solidity contract path and name, eg: examples/ACLUpgradedExample.sol:ACLUpgradedExample',
+ )
+ .addParam('privateKey', 'The deployer private key')
+ .setAction(async function (taskArguments: TaskArguments, { ethers, upgrades, run }) {
+ const parsedEnv = dotenv.parse(fs.readFileSync('lib/.env.acl'));
+ const proxyAddress = parsedEnv.ACL_CONTRACT_ADDRESS;
+ const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
+ await run('compile:specific', { contract: stripContractName(taskArguments.currentImplementation) });
+ await run('compile:specific', { contract: stripContractName(taskArguments.newImplementation) });
+ const currentImplementation = await ethers.getContractFactory(taskArguments.currentImplementation, deployer);
+ const proxy = await upgrades.forceImport(proxyAddress, currentImplementation);
+ const newImplementationFactory = await ethers.getContractFactory(taskArguments.newImplementation, deployer);
+ await upgrades.upgradeProxy(proxy, newImplementationFactory);
+ console.log('Waiting 2 minutes before contract verification... Please wait...');
+ await new Promise((resolve) => setTimeout(resolve, 2 * 60 * 1000));
+ const implementationACLAddress = await upgrades.erc1967.getImplementationAddress(proxyAddress);
+ await run('verify:verify', {
+ address: implementationACLAddress,
+ constructorArguments: [],
+ });
+ });
+
+task('task:upgradeTFHEExecutor')
+ .addParam(
+ 'currentImplementation',
+ 'The currently deployed implementation solidity contract path and name, eg: lib/TFHEExecutor.sol:TFHEExecutor',
+ )
+ .addParam(
+ 'newImplementation',
+ 'The new implementation solidity contract path and name, eg: examples/TFHEExecutorUpgradedExample.sol:TFHEExecutorUpgradedExample',
+ )
+ .addParam('privateKey', 'The deployer private key')
+ .setAction(async function (taskArguments: TaskArguments, { ethers, upgrades, run }) {
+ const parsedEnv = dotenv.parse(fs.readFileSync('lib/.env.exec'));
+ const proxyAddress = parsedEnv.TFHE_EXECUTOR_CONTRACT_ADDRESS;
+ const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
+ await run('compile:specific', { contract: stripContractName(taskArguments.currentImplementation) });
+ await run('compile:specific', { contract: stripContractName(taskArguments.newImplementation) });
+ const currentImplementation = await ethers.getContractFactory(taskArguments.currentImplementation, deployer);
+ const proxy = await upgrades.forceImport(proxyAddress, currentImplementation);
+ const newImplementationFactory = await ethers.getContractFactory(taskArguments.newImplementation, deployer);
+ await upgrades.upgradeProxy(proxy, newImplementationFactory);
+ console.log('Waiting 2 minutes before contract verification... Please wait...');
+ await new Promise((resolve) => setTimeout(resolve, 2 * 60 * 1000));
+ const implementationACLAddress = await upgrades.erc1967.getImplementationAddress(proxyAddress);
+ await run('verify:verify', {
+ address: implementationACLAddress,
+ constructorArguments: [],
+ });
+ });
+
+task('task:upgradeKMSVerifier')
+ .addParam(
+ 'currentImplementation',
+ 'The currently deployed implementation solidity contract path and name, eg: lib/KMSVerifier.sol:KMSVerifier',
+ )
+ .addParam(
+ 'newImplementation',
+ 'The new implementation solidity contract path and name, eg: examples/KMSVerifierUpgradedExample.sol:KMSVerifierUpgradedExample',
+ )
+ .addParam('privateKey', 'The deployer private key')
+ .setAction(async function (taskArguments: TaskArguments, { ethers, upgrades, run }) {
+ const parsedEnv = dotenv.parse(fs.readFileSync('lib/.env.kmsverifier'));
+ const proxyAddress = parsedEnv.KMS_VERIFIER_CONTRACT_ADDRESS;
+ const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
+ await run('compile:specific', { contract: stripContractName(taskArguments.currentImplementation) });
+ await run('compile:specific', { contract: stripContractName(taskArguments.newImplementation) });
+ const currentImplementation = await ethers.getContractFactory(taskArguments.currentImplementation, deployer);
+ const proxy = await upgrades.forceImport(proxyAddress, currentImplementation);
+ const newImplementationFactory = await ethers.getContractFactory(taskArguments.newImplementation, deployer);
+ await upgrades.upgradeProxy(proxy, newImplementationFactory);
+ console.log('Waiting 2 minutes before contract verification... Please wait...');
+ await new Promise((resolve) => setTimeout(resolve, 2 * 60 * 1000));
+ const implementationACLAddress = await upgrades.erc1967.getImplementationAddress(proxyAddress);
+ await run('verify:verify', {
+ address: implementationACLAddress,
+ constructorArguments: [],
+ });
+ });
+
+task('task:upgradeInputVerifier')
+ .addParam(
+ 'currentImplementation',
+ 'The currently deployed implementation solidity contract path and name, eg: lib/InputVerifier.coprocessor.sol:InputVerifier',
+ )
+ .addParam(
+ 'newImplementation',
+ 'The new implementation solidity contract path and name, eg: examples/InputVerifierUpgradedExample.coprocessor.sol:InputVerifierUpgradedExample',
+ )
+ .addParam('privateKey', 'The deployer private key')
+ .setAction(async function (taskArguments: TaskArguments, { ethers, upgrades, run }) {
+ const parsedEnv = dotenv.parse(fs.readFileSync('lib/.env.inputverifier'));
+ const proxyAddress = parsedEnv.INPUT_VERIFIER_CONTRACT_ADDRESS;
+ const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
+ await run('compile:specific', { contract: stripContractName(taskArguments.currentImplementation) });
+ await run('compile:specific', { contract: stripContractName(taskArguments.newImplementation) });
+ const currentImplementation = await ethers.getContractFactory(taskArguments.currentImplementation, deployer);
+ const proxy = await upgrades.forceImport(proxyAddress, currentImplementation);
+ const newImplementationFactory = await ethers.getContractFactory(taskArguments.newImplementation, deployer);
+ await upgrades.upgradeProxy(proxy, newImplementationFactory);
+ console.log('Waiting 2 minutes before contract verification... Please wait...');
+ await new Promise((resolve) => setTimeout(resolve, 2 * 60 * 1000));
+ const implementationACLAddress = await upgrades.erc1967.getImplementationAddress(proxyAddress);
+ await run('verify:verify', {
+ address: implementationACLAddress,
+ constructorArguments: [],
+ });
+ });
+
+task('task:upgradeFHEPayment')
+ .addParam(
+ 'currentImplementation',
+ 'The currently deployed implementation solidity contract path and name, eg: lib/FHEPayment.sol:FHEPayment',
+ )
+ .addParam(
+ 'newImplementation',
+ 'The new implementation solidity contract path and name, eg: examples/FHEPaymentUpgradedExample.sol:FHEPaymentUpgradedExample',
+ )
+ .addParam('privateKey', 'The deployer private key')
+ .setAction(async function (taskArguments: TaskArguments, { ethers, upgrades, run }) {
+ const parsedEnv = dotenv.parse(fs.readFileSync('lib/.env.fhepayment'));
+ const proxyAddress = parsedEnv.FHE_PAYMENT_CONTRACT_ADDRESS;
+ const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
+ await run('compile:specific', { contract: stripContractName(taskArguments.currentImplementation) });
+ await run('compile:specific', { contract: stripContractName(taskArguments.newImplementation) });
+ const currentImplementation = await ethers.getContractFactory(taskArguments.currentImplementation, deployer);
+ const proxy = await upgrades.forceImport(proxyAddress, currentImplementation);
+ const newImplementationFactory = await ethers.getContractFactory(taskArguments.newImplementation, deployer);
+ await upgrades.upgradeProxy(proxy, newImplementationFactory);
+ console.log('Waiting 2 minutes before contract verification... Please wait...');
+ await new Promise((resolve) => setTimeout(resolve, 2 * 60 * 1000));
+ const implementationACLAddress = await upgrades.erc1967.getImplementationAddress(proxyAddress);
+ await run('verify:verify', {
+ address: implementationACLAddress,
+ constructorArguments: [],
+ });
+ });
+
+task('task:upgradeGatewayContract')
+ .addParam(
+ 'currentImplementation',
+ 'The currently deployed implementation solidity contract path and name, eg: gateway/GatewayContract.sol:GatewayContract',
+ )
+ .addParam(
+ 'newImplementation',
+ 'The new implementation solidity contract path and name, eg: example/GatewayContractUpgradedExample.sol:GatewayContractUpgradedExample',
+ )
+ .addParam('privateKey', 'The deployer private key')
+ .setAction(async function (taskArguments: TaskArguments, { ethers, upgrades, run }) {
+ const parsedEnv = dotenv.parse(fs.readFileSync('gateway/.env.gateway'));
+ const proxyAddress = parsedEnv.GATEWAY_CONTRACT_PREDEPLOY_ADDRESS;
+ const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
+ await run('compile:specific', { contract: stripContractName(taskArguments.currentImplementation) });
+ await run('compile:specific', { contract: stripContractName(taskArguments.newImplementation) });
+ const currentImplementation = await ethers.getContractFactory(taskArguments.currentImplementation, deployer);
+ const proxy = await upgrades.forceImport(proxyAddress, currentImplementation);
+ const newImplementationFactory = await ethers.getContractFactory(taskArguments.newImplementation, deployer);
+ await upgrades.upgradeProxy(proxy, newImplementationFactory);
+ console.log('Waiting 2 minutes before contract verification... Please wait...');
+ await new Promise((resolve) => setTimeout(resolve, 2 * 60 * 1000));
+ const implementationACLAddress = await upgrades.erc1967.getImplementationAddress(proxyAddress);
+ await run('verify:verify', {
+ address: implementationACLAddress,
+ constructorArguments: [],
+ });
+ });
From f1642be48fd9247da1c06611371542646a7e8e6c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Tue, 8 Oct 2024 12:49:17 +0200
Subject: [PATCH 34/51] chore: refactored task and added optional
verifyContract
---
tasks/upgradeProxy.ts | 214 +++++++++++++++++++++++++-----------------
1 file changed, 128 insertions(+), 86 deletions(-)
diff --git a/tasks/upgradeProxy.ts b/tasks/upgradeProxy.ts
index ca7b43c6..3971b2fd 100644
--- a/tasks/upgradeProxy.ts
+++ b/tasks/upgradeProxy.ts
@@ -1,7 +1,9 @@
+import { HardhatEthersHelpers } from '@nomicfoundation/hardhat-ethers/types';
+import { HardhatUpgrades } from '@openzeppelin/hardhat-upgrades';
import dotenv from 'dotenv';
import fs from 'fs';
-import { task } from 'hardhat/config';
-import type { TaskArguments } from 'hardhat/types';
+import { task, types } from 'hardhat/config';
+import type { RunTaskFunction, TaskArguments } from 'hardhat/types';
function stripContractName(input: string): string {
const colonIndex = input.lastIndexOf('/');
@@ -11,6 +13,34 @@ function stripContractName(input: string): string {
return input;
}
+async function upgradeCurrentToNew(
+ privateKey: string,
+ proxyAddress: string,
+ currentImplem: string,
+ newImplem: string,
+ verifyContract: boolean,
+ upgrades: HardhatUpgrades,
+ run: RunTaskFunction,
+ ethers: any,
+) {
+ const deployer = new ethers.Wallet(privateKey).connect(ethers.provider);
+ await run('compile:specific', { contract: stripContractName(currentImplem) });
+ await run('compile:specific', { contract: stripContractName(newImplem) });
+ const currentImplementation = await ethers.getContractFactory(currentImplem, deployer);
+ const proxy = await upgrades.forceImport(proxyAddress, currentImplementation);
+ const newImplementationFactory = await ethers.getContractFactory(newImplem, deployer);
+ await upgrades.upgradeProxy(proxy, newImplementationFactory);
+ if (verifyContract) {
+ console.log('Waiting 2 minutes before contract verification... Please wait...');
+ await new Promise((resolve) => setTimeout(resolve, 2 * 60 * 1000));
+ const implementationACLAddress = await upgrades.erc1967.getImplementationAddress(proxyAddress);
+ await run('verify:verify', {
+ address: implementationACLAddress,
+ constructorArguments: [],
+ });
+ }
+}
+
task('task:upgradeACL')
.addParam(
'currentImplementation',
@@ -21,23 +51,25 @@ task('task:upgradeACL')
'The new implementation solidity contract path and name, eg: examples/ACLUpgradedExample.sol:ACLUpgradedExample',
)
.addParam('privateKey', 'The deployer private key')
+ .addOptionalParam(
+ 'verifyContract',
+ 'Verify new implementation on Etherscan (for eg if deploying on Sepolia or Mainnet)',
+ false,
+ types.boolean,
+ )
.setAction(async function (taskArguments: TaskArguments, { ethers, upgrades, run }) {
const parsedEnv = dotenv.parse(fs.readFileSync('lib/.env.acl'));
const proxyAddress = parsedEnv.ACL_CONTRACT_ADDRESS;
- const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
- await run('compile:specific', { contract: stripContractName(taskArguments.currentImplementation) });
- await run('compile:specific', { contract: stripContractName(taskArguments.newImplementation) });
- const currentImplementation = await ethers.getContractFactory(taskArguments.currentImplementation, deployer);
- const proxy = await upgrades.forceImport(proxyAddress, currentImplementation);
- const newImplementationFactory = await ethers.getContractFactory(taskArguments.newImplementation, deployer);
- await upgrades.upgradeProxy(proxy, newImplementationFactory);
- console.log('Waiting 2 minutes before contract verification... Please wait...');
- await new Promise((resolve) => setTimeout(resolve, 2 * 60 * 1000));
- const implementationACLAddress = await upgrades.erc1967.getImplementationAddress(proxyAddress);
- await run('verify:verify', {
- address: implementationACLAddress,
- constructorArguments: [],
- });
+ await upgradeCurrentToNew(
+ taskArguments.privateKey,
+ proxyAddress,
+ taskArguments.currentImplementation,
+ taskArguments.newImplementation,
+ taskArguments.verifyContract,
+ upgrades,
+ run,
+ ethers,
+ );
});
task('task:upgradeTFHEExecutor')
@@ -50,23 +82,25 @@ task('task:upgradeTFHEExecutor')
'The new implementation solidity contract path and name, eg: examples/TFHEExecutorUpgradedExample.sol:TFHEExecutorUpgradedExample',
)
.addParam('privateKey', 'The deployer private key')
+ .addOptionalParam(
+ 'verifyContract',
+ 'Verify new implementation on Etherscan (for eg if deploying on Sepolia or Mainnet)',
+ false,
+ types.boolean,
+ )
.setAction(async function (taskArguments: TaskArguments, { ethers, upgrades, run }) {
const parsedEnv = dotenv.parse(fs.readFileSync('lib/.env.exec'));
const proxyAddress = parsedEnv.TFHE_EXECUTOR_CONTRACT_ADDRESS;
- const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
- await run('compile:specific', { contract: stripContractName(taskArguments.currentImplementation) });
- await run('compile:specific', { contract: stripContractName(taskArguments.newImplementation) });
- const currentImplementation = await ethers.getContractFactory(taskArguments.currentImplementation, deployer);
- const proxy = await upgrades.forceImport(proxyAddress, currentImplementation);
- const newImplementationFactory = await ethers.getContractFactory(taskArguments.newImplementation, deployer);
- await upgrades.upgradeProxy(proxy, newImplementationFactory);
- console.log('Waiting 2 minutes before contract verification... Please wait...');
- await new Promise((resolve) => setTimeout(resolve, 2 * 60 * 1000));
- const implementationACLAddress = await upgrades.erc1967.getImplementationAddress(proxyAddress);
- await run('verify:verify', {
- address: implementationACLAddress,
- constructorArguments: [],
- });
+ await upgradeCurrentToNew(
+ taskArguments.privateKey,
+ proxyAddress,
+ taskArguments.currentImplementation,
+ taskArguments.newImplementation,
+ taskArguments.verifyContract,
+ upgrades,
+ run,
+ ethers,
+ );
});
task('task:upgradeKMSVerifier')
@@ -79,23 +113,25 @@ task('task:upgradeKMSVerifier')
'The new implementation solidity contract path and name, eg: examples/KMSVerifierUpgradedExample.sol:KMSVerifierUpgradedExample',
)
.addParam('privateKey', 'The deployer private key')
+ .addOptionalParam(
+ 'verifyContract',
+ 'Verify new implementation on Etherscan (for eg if deploying on Sepolia or Mainnet)',
+ false,
+ types.boolean,
+ )
.setAction(async function (taskArguments: TaskArguments, { ethers, upgrades, run }) {
const parsedEnv = dotenv.parse(fs.readFileSync('lib/.env.kmsverifier'));
const proxyAddress = parsedEnv.KMS_VERIFIER_CONTRACT_ADDRESS;
- const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
- await run('compile:specific', { contract: stripContractName(taskArguments.currentImplementation) });
- await run('compile:specific', { contract: stripContractName(taskArguments.newImplementation) });
- const currentImplementation = await ethers.getContractFactory(taskArguments.currentImplementation, deployer);
- const proxy = await upgrades.forceImport(proxyAddress, currentImplementation);
- const newImplementationFactory = await ethers.getContractFactory(taskArguments.newImplementation, deployer);
- await upgrades.upgradeProxy(proxy, newImplementationFactory);
- console.log('Waiting 2 minutes before contract verification... Please wait...');
- await new Promise((resolve) => setTimeout(resolve, 2 * 60 * 1000));
- const implementationACLAddress = await upgrades.erc1967.getImplementationAddress(proxyAddress);
- await run('verify:verify', {
- address: implementationACLAddress,
- constructorArguments: [],
- });
+ await upgradeCurrentToNew(
+ taskArguments.privateKey,
+ proxyAddress,
+ taskArguments.currentImplementation,
+ taskArguments.newImplementation,
+ taskArguments.verifyContract,
+ upgrades,
+ run,
+ ethers,
+ );
});
task('task:upgradeInputVerifier')
@@ -108,23 +144,25 @@ task('task:upgradeInputVerifier')
'The new implementation solidity contract path and name, eg: examples/InputVerifierUpgradedExample.coprocessor.sol:InputVerifierUpgradedExample',
)
.addParam('privateKey', 'The deployer private key')
+ .addOptionalParam(
+ 'verifyContract',
+ 'Verify new implementation on Etherscan (for eg if deploying on Sepolia or Mainnet)',
+ false,
+ types.boolean,
+ )
.setAction(async function (taskArguments: TaskArguments, { ethers, upgrades, run }) {
const parsedEnv = dotenv.parse(fs.readFileSync('lib/.env.inputverifier'));
const proxyAddress = parsedEnv.INPUT_VERIFIER_CONTRACT_ADDRESS;
- const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
- await run('compile:specific', { contract: stripContractName(taskArguments.currentImplementation) });
- await run('compile:specific', { contract: stripContractName(taskArguments.newImplementation) });
- const currentImplementation = await ethers.getContractFactory(taskArguments.currentImplementation, deployer);
- const proxy = await upgrades.forceImport(proxyAddress, currentImplementation);
- const newImplementationFactory = await ethers.getContractFactory(taskArguments.newImplementation, deployer);
- await upgrades.upgradeProxy(proxy, newImplementationFactory);
- console.log('Waiting 2 minutes before contract verification... Please wait...');
- await new Promise((resolve) => setTimeout(resolve, 2 * 60 * 1000));
- const implementationACLAddress = await upgrades.erc1967.getImplementationAddress(proxyAddress);
- await run('verify:verify', {
- address: implementationACLAddress,
- constructorArguments: [],
- });
+ await upgradeCurrentToNew(
+ taskArguments.privateKey,
+ proxyAddress,
+ taskArguments.currentImplementation,
+ taskArguments.newImplementation,
+ taskArguments.verifyContract,
+ upgrades,
+ run,
+ ethers,
+ );
});
task('task:upgradeFHEPayment')
@@ -137,23 +175,25 @@ task('task:upgradeFHEPayment')
'The new implementation solidity contract path and name, eg: examples/FHEPaymentUpgradedExample.sol:FHEPaymentUpgradedExample',
)
.addParam('privateKey', 'The deployer private key')
+ .addOptionalParam(
+ 'verifyContract',
+ 'Verify new implementation on Etherscan (for eg if deploying on Sepolia or Mainnet)',
+ false,
+ types.boolean,
+ )
.setAction(async function (taskArguments: TaskArguments, { ethers, upgrades, run }) {
const parsedEnv = dotenv.parse(fs.readFileSync('lib/.env.fhepayment'));
const proxyAddress = parsedEnv.FHE_PAYMENT_CONTRACT_ADDRESS;
- const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
- await run('compile:specific', { contract: stripContractName(taskArguments.currentImplementation) });
- await run('compile:specific', { contract: stripContractName(taskArguments.newImplementation) });
- const currentImplementation = await ethers.getContractFactory(taskArguments.currentImplementation, deployer);
- const proxy = await upgrades.forceImport(proxyAddress, currentImplementation);
- const newImplementationFactory = await ethers.getContractFactory(taskArguments.newImplementation, deployer);
- await upgrades.upgradeProxy(proxy, newImplementationFactory);
- console.log('Waiting 2 minutes before contract verification... Please wait...');
- await new Promise((resolve) => setTimeout(resolve, 2 * 60 * 1000));
- const implementationACLAddress = await upgrades.erc1967.getImplementationAddress(proxyAddress);
- await run('verify:verify', {
- address: implementationACLAddress,
- constructorArguments: [],
- });
+ await upgradeCurrentToNew(
+ taskArguments.privateKey,
+ proxyAddress,
+ taskArguments.currentImplementation,
+ taskArguments.newImplementation,
+ taskArguments.verifyContract,
+ upgrades,
+ run,
+ ethers,
+ );
});
task('task:upgradeGatewayContract')
@@ -166,21 +206,23 @@ task('task:upgradeGatewayContract')
'The new implementation solidity contract path and name, eg: example/GatewayContractUpgradedExample.sol:GatewayContractUpgradedExample',
)
.addParam('privateKey', 'The deployer private key')
+ .addOptionalParam(
+ 'verifyContract',
+ 'Verify new implementation on Etherscan (for eg if deploying on Sepolia or Mainnet)',
+ false,
+ types.boolean,
+ )
.setAction(async function (taskArguments: TaskArguments, { ethers, upgrades, run }) {
const parsedEnv = dotenv.parse(fs.readFileSync('gateway/.env.gateway'));
const proxyAddress = parsedEnv.GATEWAY_CONTRACT_PREDEPLOY_ADDRESS;
- const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
- await run('compile:specific', { contract: stripContractName(taskArguments.currentImplementation) });
- await run('compile:specific', { contract: stripContractName(taskArguments.newImplementation) });
- const currentImplementation = await ethers.getContractFactory(taskArguments.currentImplementation, deployer);
- const proxy = await upgrades.forceImport(proxyAddress, currentImplementation);
- const newImplementationFactory = await ethers.getContractFactory(taskArguments.newImplementation, deployer);
- await upgrades.upgradeProxy(proxy, newImplementationFactory);
- console.log('Waiting 2 minutes before contract verification... Please wait...');
- await new Promise((resolve) => setTimeout(resolve, 2 * 60 * 1000));
- const implementationACLAddress = await upgrades.erc1967.getImplementationAddress(proxyAddress);
- await run('verify:verify', {
- address: implementationACLAddress,
- constructorArguments: [],
- });
+ await upgradeCurrentToNew(
+ taskArguments.privateKey,
+ proxyAddress,
+ taskArguments.currentImplementation,
+ taskArguments.newImplementation,
+ taskArguments.verifyContract,
+ upgrades,
+ run,
+ ethers,
+ );
});
From 43a8d3d977ca701b223771d6ce29ab92549eac98 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Tue, 8 Oct 2024 17:25:08 +0200
Subject: [PATCH 35/51] feat: adds getter functions for address constants
---
codegen/payments.ts | 2 +-
lib/ACL.sol | 1 +
lib/FHEPayment.sol | 3 ++-
lib/InputVerifier.coprocessor.sol | 12 +++++++++++-
lib/InputVerifier.native.sol | 5 +++++
lib/TFHEExecutor.sol | 15 +++++++++++++++
6 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/codegen/payments.ts b/codegen/payments.ts
index de8e96e9..875ff024 100644
--- a/codegen/payments.ts
+++ b/codegen/payments.ts
@@ -37,7 +37,7 @@ export function generateFHEPayment(priceData: PriceData): string {
uint256 private constant MAJOR_VERSION = 0;
uint256 private constant MINOR_VERSION = 1;
uint256 private constant PATCH_VERSION = 0;
- address public constant tfheExecutorAddress = tfheExecutorAdd;
+ address private constant tfheExecutorAddress = tfheExecutorAdd;
uint256 private constant FHE_GAS_BLOCKLIMIT = 10_000_000;
uint256 private constant MIN_FHE_GASPRICE = 0; // eg: 10_000_000 means a minimum of 0.01 Gwei
diff --git a/lib/ACL.sol b/lib/ACL.sol
index 074f1328..6c79a6cc 100644
--- a/lib/ACL.sol
+++ b/lib/ACL.sol
@@ -34,6 +34,7 @@ contract ACL is UUPSUpgradeable, Ownable2StepUpgradeable {
}
}
+ /// @notice Getter function for the TFHEExecutor contract address
function getTFHEExecutorAddress() public view virtual returns (address) {
return tfheExecutorAddress;
}
diff --git a/lib/FHEPayment.sol b/lib/FHEPayment.sol
index d0e6d3dc..92c8caca 100644
--- a/lib/FHEPayment.sol
+++ b/lib/FHEPayment.sol
@@ -27,7 +27,7 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
uint256 private constant MAJOR_VERSION = 0;
uint256 private constant MINOR_VERSION = 1;
uint256 private constant PATCH_VERSION = 0;
- address public constant tfheExecutorAddress = tfheExecutorAdd;
+ address private constant tfheExecutorAddress = tfheExecutorAdd;
uint256 private constant FHE_GAS_BLOCKLIMIT = 10_000_000;
uint256 private constant MIN_FHE_GASPRICE = 0; // eg: 10_000_000 means a minimum of 0.01 Gwei
@@ -53,6 +53,7 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
}
}
+ /// @notice Getter function for the TFHEExecutor contract address
function getTFHEExecutorAddress() public view virtual returns (address) {
return tfheExecutorAddress;
}
diff --git a/lib/InputVerifier.coprocessor.sol b/lib/InputVerifier.coprocessor.sol
index 1ebdbcb4..48641cb8 100644
--- a/lib/InputVerifier.coprocessor.sol
+++ b/lib/InputVerifier.coprocessor.sol
@@ -29,7 +29,7 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad
/// @notice Handle version
uint8 public constant HANDLE_VERSION = 0;
- address constant coprocessorAddress = coprocessorAdd;
+ address private constant coprocessorAddress = coprocessorAdd;
KMSVerifier public constant kmsVerifier = KMSVerifier(kmsVerifierAdd);
string public constant CIPHERTEXTVERIFICATION_COPRO_TYPE =
@@ -51,6 +51,16 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad
return CIPHERTEXTVERIFICATION_COPRO_TYPE;
}
+ /// @notice Getter function for the Coprocessor account address
+ function getCoprocessorAddress() public view virtual returns (address) {
+ return coprocessorAddress;
+ }
+
+ /// @notice Getter function for the KMSVerifier contract address
+ function getKMSVerifierAddress() public view virtual returns (address) {
+ return address(kmsVerifier);
+ }
+
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
diff --git a/lib/InputVerifier.native.sol b/lib/InputVerifier.native.sol
index d1e708c6..ca14fe31 100644
--- a/lib/InputVerifier.native.sol
+++ b/lib/InputVerifier.native.sol
@@ -32,6 +32,11 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable {
function _authorizeUpgrade(address _newImplementation) internal virtual override onlyOwner {}
+ /// @notice Getter function for the KMSVerifier contract address
+ function getKMSVerifierAddress() public view virtual returns (address) {
+ return address(kmsVerifier);
+ }
+
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
diff --git a/lib/TFHEExecutor.sol b/lib/TFHEExecutor.sol
index 8936f3ce..732d4457 100644
--- a/lib/TFHEExecutor.sol
+++ b/lib/TFHEExecutor.sol
@@ -58,6 +58,21 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
function _authorizeUpgrade(address _newImplementation) internal virtual override onlyOwner {}
+ /// @notice Getter function for the ACL contract address
+ function getACLAddress() public view virtual returns (address) {
+ return address(acl);
+ }
+
+ /// @notice Getter function for the FHEPayment contract address
+ function getFHEPaymentAddress() public view virtual returns (address) {
+ return address(fhePayment);
+ }
+
+ /// @notice Getter function for the InputVerifier contract address
+ function getInputVerifierAddress() public view virtual returns (address) {
+ return address(inputVerifier);
+ }
+
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
From 294c85d2e0d604b8687daa3eca91b32d1a9e245f Mon Sep 17 00:00:00 2001
From: Aurora Poppyseed <30662672+poppyseedDev@users.noreply.github.com>
Date: Wed, 9 Oct 2024 19:52:07 +0900
Subject: [PATCH 36/51] ci: fix YAML error
---
.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md b/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
index dc2dff46..5515221a 100644
--- a/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
+++ b/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
@@ -1,6 +1,6 @@
---
-name: `fhevmjs` Bug report
-about: Use this template to report issues encountered while using the `fhevmjs` library for interacting with fhEVM smart contracts.
+name: fhevmjs Bug report
+about: Use this template to report issues encountered while using the fhevmjs library for interacting with fhEVM smart contracts.
title: ''
labels: bug, fhevmjs
assignees: ''
From 0b9c219983d604c8fc3ad56394846b5785dfbc40 Mon Sep 17 00:00:00 2001
From: Aurora Poppyseed <30662672+poppyseedDev@users.noreply.github.com>
Date: Wed, 9 Oct 2024 13:14:25 +0200
Subject: [PATCH 37/51] ci: name FHEVM change to fhEVM
---
.github/ISSUE_TEMPLATE/bug_report_fhevm.md | 6 +++---
.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md | 4 ++--
.github/ISSUE_TEMPLATE/feature-request.md | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/.github/ISSUE_TEMPLATE/bug_report_fhevm.md b/.github/ISSUE_TEMPLATE/bug_report_fhevm.md
index fc807f6a..d1ea04d4 100644
--- a/.github/ISSUE_TEMPLATE/bug_report_fhevm.md
+++ b/.github/ISSUE_TEMPLATE/bug_report_fhevm.md
@@ -1,6 +1,6 @@
---
name: Smart Contracts Bug Report
-about: Use this template to report issues encountered with confidential smart contracts on the FHEVM.
+about: Use this template to report issues encountered with confidential smart contracts on the fhEVM.
title: ""
labels: bug
assignees: ""
@@ -48,8 +48,8 @@ Fill in the relevant environment details where the issue was observed:
- **Operating System**: [e.g., Ubuntu 20.04, Windows 10]
- **Browser**: [e.g., Chrome v90, Safari v14]
-- **FHEVM Version**: [e.g., v1.0.0]
-- **Tooling**: [Hardhat, Remix, FHEVM CLI]
+- **fhEVM Version**: [e.g., v1.0.0]
+- **Tooling**: [Hardhat, Remix, fhEVM CLI]
- **Devnet / Local Node Configuration**:
- Chain ID: [e.g., 9000]
- RPC URL: [e.g., `https://devnet.zama.ai`]
diff --git a/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md b/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
index 5515221a..9d8bab32 100644
--- a/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
+++ b/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
@@ -1,9 +1,9 @@
---
name: fhevmjs Bug report
about: Use this template to report issues encountered while using the fhevmjs library for interacting with fhEVM smart contracts.
-title: ''
+title: ""
labels: bug, fhevmjs
-assignees: ''
+assignees: ""
---
### **Description**
diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md
index 07196dda..c5579a5d 100644
--- a/.github/ISSUE_TEMPLATE/feature-request.md
+++ b/.github/ISSUE_TEMPLATE/feature-request.md
@@ -1,5 +1,5 @@
---
-name: General feature request for FHEVM
+name: General feature request for fhEVM
about: Suggest an idea for this project
title: ""
labels: enhancement
From 8a59ebbf292650dce671e41e11375ebc88786582 Mon Sep 17 00:00:00 2001
From: Aurora Poppyseed <30662672+poppyseedDev@users.noreply.github.com>
Date: Wed, 9 Oct 2024 13:17:13 +0200
Subject: [PATCH 38/51] ci: added emojies to name
---
.github/ISSUE_TEMPLATE/bug_report_fhevm.md | 2 +-
.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md | 2 +-
.github/ISSUE_TEMPLATE/docs_bug_report.md | 2 +-
.github/ISSUE_TEMPLATE/feature-request.md | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/ISSUE_TEMPLATE/bug_report_fhevm.md b/.github/ISSUE_TEMPLATE/bug_report_fhevm.md
index d1ea04d4..468bb526 100644
--- a/.github/ISSUE_TEMPLATE/bug_report_fhevm.md
+++ b/.github/ISSUE_TEMPLATE/bug_report_fhevm.md
@@ -1,5 +1,5 @@
---
-name: Smart Contracts Bug Report
+name: 🐞 Smart Contracts Bug Report
about: Use this template to report issues encountered with confidential smart contracts on the fhEVM.
title: ""
labels: bug
diff --git a/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md b/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
index 9d8bab32..6720fcb9 100644
--- a/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
+++ b/.github/ISSUE_TEMPLATE/bug_report_fhevmjs.md
@@ -1,5 +1,5 @@
---
-name: fhevmjs Bug report
+name: 🐛 fhevmjs Bug report
about: Use this template to report issues encountered while using the fhevmjs library for interacting with fhEVM smart contracts.
title: ""
labels: bug, fhevmjs
diff --git a/.github/ISSUE_TEMPLATE/docs_bug_report.md b/.github/ISSUE_TEMPLATE/docs_bug_report.md
index 5176f679..236bceaf 100644
--- a/.github/ISSUE_TEMPLATE/docs_bug_report.md
+++ b/.github/ISSUE_TEMPLATE/docs_bug_report.md
@@ -1,5 +1,5 @@
---
-name: Documentation Bug Report / Unclear Documentation
+name: 📚 Documentation Bug Report / Unclear Documentation
about: Use this template to report issues, inconsistencies, or inaccuracies in our documentation. Or to report sections of our documentation that are unclear, confusing, or require further explanation.
title: ""
labels: bug, documentation
diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md
index c5579a5d..f9b21c98 100644
--- a/.github/ISSUE_TEMPLATE/feature-request.md
+++ b/.github/ISSUE_TEMPLATE/feature-request.md
@@ -1,5 +1,5 @@
---
-name: General feature request for fhEVM
+name: 🚀 General feature request for fhEVM
about: Suggest an idea for this project
title: ""
labels: enhancement
From 7ca92ca693bc3eea01bca027143280f28e9c4281 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Wed, 9 Oct 2024 16:45:20 +0200
Subject: [PATCH 39/51] chore: fixed typo
---
.env.example | 2 +-
.env.example.deployment | 2 +-
.gitignore | 2 -
gateway/.env.gateway | 1 +
hardhat.config.ts | 2 +-
package-lock.json | 635 +++++++++++++++++++++++-----------------
6 files changed, 375 insertions(+), 269 deletions(-)
create mode 100644 gateway/.env.gateway
diff --git a/.env.example b/.env.example
index 2382aeae..e3bd56db 100644
--- a/.env.example
+++ b/.env.example
@@ -10,5 +10,5 @@ export PRIVATE_KEY_KMS_SIGNER_3="7a604eed8cf4a43277d192aa0c7894d368577a4021e52bf
export PRIVATE_KEY_COPROCESSOR_ACCOUNT="7ec8ada6642fc4ccfb7729bc29c17cf8d21b61abd5642d1db992c0b8672ab901"
export IS_COPROCESSOR="true"
-export SEPOLIA_RPC_RUL="https://sepolia.infura.io/v3/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+export SEPOLIA_RPC_URL="https://sepolia.infura.io/v3/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
export ETHERSCAN_API_KEY="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
\ No newline at end of file
diff --git a/.env.example.deployment b/.env.example.deployment
index 0ea36af5..6d9a2a38 100644
--- a/.env.example.deployment
+++ b/.env.example.deployment
@@ -8,5 +8,5 @@ export ADDRESS_KMS_SIGNER_2="0xfe0fB0BCceb872ee7a6ef6c455e6E127Aef55DD7"
export ADDRESS_KMS_SIGNER_3="0x2dac5193bE0AB0eD8871399E6Ae61EAe6cc8cAE1"
export ADDRESS_COPROCESSOR_ACCOUNT="0xc9990FEfE0c27D31D0C2aa36196b085c0c4d456c"
export IS_COPROCESSOR="true"
-export SEPOLIA_RPC_RUL="https://sepolia.infura.io/v3/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+export SEPOLIA_RPC_URL="https://sepolia.infura.io/v3/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
export ETHERSCAN_API_KEY="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index df4f6eb9..b3d21760 100644
--- a/.gitignore
+++ b/.gitignore
@@ -74,8 +74,6 @@ typings/
# dotenv environment variables file
.env
.env.test
-gateway/.env.gateway
-gateway/lib/PredeployAddress.sol
# parcel-bundler cache (https://parceljs.org/)
.cache
diff --git a/gateway/.env.gateway b/gateway/.env.gateway
new file mode 100644
index 00000000..0228cb70
--- /dev/null
+++ b/gateway/.env.gateway
@@ -0,0 +1 @@
+GATEWAY_CONTRACT_PREDEPLOY_ADDRESS=0x096b4679d45fB675d4e2c1E4565009Cec99A12B1
\ No newline at end of file
diff --git a/hardhat.config.ts b/hardhat.config.ts
index 4ed3795d..2d5ce93c 100644
--- a/hardhat.config.ts
+++ b/hardhat.config.ts
@@ -66,7 +66,7 @@ function getChainConfig(chain: keyof typeof chainIds): NetworkUserConfig {
jsonRpcUrl = 'https://devnet.zama.ai';
break;
case 'sepolia':
- jsonRpcUrl = process.env.SEPOLIA_RPC_RUL!;
+ jsonRpcUrl = process.env.SEPOLIA_RPC_URL!;
}
return {
accounts: {
diff --git a/package-lock.json b/package-lock.json
index 867e1a78..7da5c97b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -90,12 +90,12 @@
}
},
"node_modules/@aws-sdk/types": {
- "version": "3.654.0",
- "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.654.0.tgz",
- "integrity": "sha512-VWvbED3SV+10QJIcmU/PKjsKilsTV16d1I7/on4bvD/jo1qGeMXqLDBSen3ks/tuvXZF/mFc7ZW/W2DiLVtO7A==",
+ "version": "3.667.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.667.0.tgz",
+ "integrity": "sha512-gYq0xCsqFfQaSL/yT1Gl1vIUjtsg7d7RhnUfsXaHt8xTxOKRTdH9GjbesBjXOzgOvB0W0vfssfreSNGFlOOMJg==",
"dev": true,
"dependencies": {
- "@smithy/types": "^3.4.2",
+ "@smithy/types": "^3.5.0",
"tslib": "^2.6.2"
},
"engines": {
@@ -124,12 +124,12 @@
"dev": true
},
"node_modules/@babel/code-frame": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz",
- "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==",
+ "version": "7.25.7",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.7.tgz",
+ "integrity": "sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==",
"dev": true,
"dependencies": {
- "@babel/highlight": "^7.24.7",
+ "@babel/highlight": "^7.25.7",
"picocolors": "^1.0.0"
},
"engines": {
@@ -163,13 +163,13 @@
}
},
"node_modules/@babel/helper-environment-visitor/node_modules/@babel/types": {
- "version": "7.25.6",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz",
- "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==",
+ "version": "7.25.7",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.7.tgz",
+ "integrity": "sha512-vwIVdXG+j+FOpkwqHRcBgHLYNL7XMkufrlaFvL9o6Ai9sJn9+PdyIL5qa0XzTZw084c+u9LOls53eoZWP/W5WQ==",
"dev": true,
"dependencies": {
- "@babel/helper-string-parser": "^7.24.8",
- "@babel/helper-validator-identifier": "^7.24.7",
+ "@babel/helper-string-parser": "^7.25.7",
+ "@babel/helper-validator-identifier": "^7.25.7",
"to-fast-properties": "^2.0.0"
},
"engines": {
@@ -190,13 +190,13 @@
}
},
"node_modules/@babel/helper-function-name/node_modules/@babel/types": {
- "version": "7.25.6",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz",
- "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==",
+ "version": "7.25.7",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.7.tgz",
+ "integrity": "sha512-vwIVdXG+j+FOpkwqHRcBgHLYNL7XMkufrlaFvL9o6Ai9sJn9+PdyIL5qa0XzTZw084c+u9LOls53eoZWP/W5WQ==",
"dev": true,
"dependencies": {
- "@babel/helper-string-parser": "^7.24.8",
- "@babel/helper-validator-identifier": "^7.24.7",
+ "@babel/helper-string-parser": "^7.25.7",
+ "@babel/helper-validator-identifier": "^7.25.7",
"to-fast-properties": "^2.0.0"
},
"engines": {
@@ -216,13 +216,13 @@
}
},
"node_modules/@babel/helper-hoist-variables/node_modules/@babel/types": {
- "version": "7.25.6",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz",
- "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==",
+ "version": "7.25.7",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.7.tgz",
+ "integrity": "sha512-vwIVdXG+j+FOpkwqHRcBgHLYNL7XMkufrlaFvL9o6Ai9sJn9+PdyIL5qa0XzTZw084c+u9LOls53eoZWP/W5WQ==",
"dev": true,
"dependencies": {
- "@babel/helper-string-parser": "^7.24.8",
- "@babel/helper-validator-identifier": "^7.24.7",
+ "@babel/helper-string-parser": "^7.25.7",
+ "@babel/helper-validator-identifier": "^7.25.7",
"to-fast-properties": "^2.0.0"
},
"engines": {
@@ -242,13 +242,13 @@
}
},
"node_modules/@babel/helper-split-export-declaration/node_modules/@babel/types": {
- "version": "7.25.6",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz",
- "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==",
+ "version": "7.25.7",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.7.tgz",
+ "integrity": "sha512-vwIVdXG+j+FOpkwqHRcBgHLYNL7XMkufrlaFvL9o6Ai9sJn9+PdyIL5qa0XzTZw084c+u9LOls53eoZWP/W5WQ==",
"dev": true,
"dependencies": {
- "@babel/helper-string-parser": "^7.24.8",
- "@babel/helper-validator-identifier": "^7.24.7",
+ "@babel/helper-string-parser": "^7.25.7",
+ "@babel/helper-validator-identifier": "^7.25.7",
"to-fast-properties": "^2.0.0"
},
"engines": {
@@ -256,30 +256,30 @@
}
},
"node_modules/@babel/helper-string-parser": {
- "version": "7.24.8",
- "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz",
- "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==",
+ "version": "7.25.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.7.tgz",
+ "integrity": "sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==",
"dev": true,
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-validator-identifier": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz",
- "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==",
+ "version": "7.25.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz",
+ "integrity": "sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==",
"dev": true,
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/highlight": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz",
- "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==",
+ "version": "7.25.7",
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.7.tgz",
+ "integrity": "sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==",
"dev": true,
"dependencies": {
- "@babel/helper-validator-identifier": "^7.24.7",
+ "@babel/helper-validator-identifier": "^7.25.7",
"chalk": "^2.4.2",
"js-tokens": "^4.0.0",
"picocolors": "^1.0.0"
@@ -360,12 +360,12 @@
}
},
"node_modules/@babel/parser": {
- "version": "7.25.6",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.6.tgz",
- "integrity": "sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q==",
+ "version": "7.25.7",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.7.tgz",
+ "integrity": "sha512-aZn7ETtQsjjGG5HruveUK06cU3Hljuhd9Iojm4M8WWv3wLE6OkE5PWbDUkItmMgegmccaITudyuW5RPYrYlgWw==",
"dev": true,
"dependencies": {
- "@babel/types": "^7.25.6"
+ "@babel/types": "^7.25.7"
},
"bin": {
"parser": "bin/babel-parser.js"
@@ -375,13 +375,13 @@
}
},
"node_modules/@babel/parser/node_modules/@babel/types": {
- "version": "7.25.6",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz",
- "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==",
+ "version": "7.25.7",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.7.tgz",
+ "integrity": "sha512-vwIVdXG+j+FOpkwqHRcBgHLYNL7XMkufrlaFvL9o6Ai9sJn9+PdyIL5qa0XzTZw084c+u9LOls53eoZWP/W5WQ==",
"dev": true,
"dependencies": {
- "@babel/helper-string-parser": "^7.24.8",
- "@babel/helper-validator-identifier": "^7.24.7",
+ "@babel/helper-string-parser": "^7.25.7",
+ "@babel/helper-validator-identifier": "^7.25.7",
"to-fast-properties": "^2.0.0"
},
"engines": {
@@ -389,27 +389,27 @@
}
},
"node_modules/@babel/template": {
- "version": "7.25.0",
- "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz",
- "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==",
+ "version": "7.25.7",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.7.tgz",
+ "integrity": "sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA==",
"dev": true,
"dependencies": {
- "@babel/code-frame": "^7.24.7",
- "@babel/parser": "^7.25.0",
- "@babel/types": "^7.25.0"
+ "@babel/code-frame": "^7.25.7",
+ "@babel/parser": "^7.25.7",
+ "@babel/types": "^7.25.7"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/template/node_modules/@babel/types": {
- "version": "7.25.6",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz",
- "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==",
+ "version": "7.25.7",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.7.tgz",
+ "integrity": "sha512-vwIVdXG+j+FOpkwqHRcBgHLYNL7XMkufrlaFvL9o6Ai9sJn9+PdyIL5qa0XzTZw084c+u9LOls53eoZWP/W5WQ==",
"dev": true,
"dependencies": {
- "@babel/helper-string-parser": "^7.24.8",
- "@babel/helper-validator-identifier": "^7.24.7",
+ "@babel/helper-string-parser": "^7.25.7",
+ "@babel/helper-validator-identifier": "^7.25.7",
"to-fast-properties": "^2.0.0"
},
"engines": {
@@ -438,28 +438,28 @@
}
},
"node_modules/@babel/traverse/node_modules/@babel/generator": {
- "version": "7.25.6",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.6.tgz",
- "integrity": "sha512-VPC82gr1seXOpkjAAKoLhP50vx4vGNlF4msF64dSFq1P8RfB+QAuJWGHPXXPc8QyfVWwwB/TNNU4+ayZmHNbZw==",
+ "version": "7.25.7",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.7.tgz",
+ "integrity": "sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA==",
"dev": true,
"dependencies": {
- "@babel/types": "^7.25.6",
+ "@babel/types": "^7.25.7",
"@jridgewell/gen-mapping": "^0.3.5",
"@jridgewell/trace-mapping": "^0.3.25",
- "jsesc": "^2.5.1"
+ "jsesc": "^3.0.2"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/traverse/node_modules/@babel/types": {
- "version": "7.25.6",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz",
- "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==",
+ "version": "7.25.7",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.7.tgz",
+ "integrity": "sha512-vwIVdXG+j+FOpkwqHRcBgHLYNL7XMkufrlaFvL9o6Ai9sJn9+PdyIL5qa0XzTZw084c+u9LOls53eoZWP/W5WQ==",
"dev": true,
"dependencies": {
- "@babel/helper-string-parser": "^7.24.8",
- "@babel/helper-validator-identifier": "^7.24.7",
+ "@babel/helper-string-parser": "^7.25.7",
+ "@babel/helper-validator-identifier": "^7.25.7",
"to-fast-properties": "^2.0.0"
},
"engines": {
@@ -476,6 +476,18 @@
"@jridgewell/sourcemap-codec": "^1.4.14"
}
},
+ "node_modules/@babel/traverse/node_modules/jsesc": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz",
+ "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==",
+ "dev": true,
+ "bin": {
+ "jsesc": "bin/jsesc"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/@babel/types": {
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz",
@@ -542,9 +554,9 @@
}
},
"node_modules/@eslint-community/regexpp": {
- "version": "4.11.0",
- "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz",
- "integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==",
+ "version": "4.11.1",
+ "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz",
+ "integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==",
"dev": true,
"engines": {
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
@@ -623,9 +635,9 @@
}
},
"node_modules/@eslint/js": {
- "version": "8.57.0",
- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz",
- "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==",
+ "version": "8.57.1",
+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz",
+ "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==",
"dev": true,
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@@ -1437,13 +1449,13 @@
"optional": true
},
"node_modules/@humanwhocodes/config-array": {
- "version": "0.11.14",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
- "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==",
+ "version": "0.13.0",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz",
+ "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==",
"deprecated": "Use @eslint/config-array instead",
"dev": true,
"dependencies": {
- "@humanwhocodes/object-schema": "^2.0.2",
+ "@humanwhocodes/object-schema": "^2.0.3",
"debug": "^4.3.1",
"minimatch": "^3.0.5"
},
@@ -1669,81 +1681,81 @@
}
},
"node_modules/@nomicfoundation/edr": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/@nomicfoundation/edr/-/edr-0.5.2.tgz",
- "integrity": "sha512-hW/iLvUQZNTVjFyX/I40rtKvvDOqUEyIi96T28YaLfmPL+3LW2lxmYLUXEJ6MI14HzqxDqrLyhf6IbjAa2r3Dw==",
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/@nomicfoundation/edr/-/edr-0.6.3.tgz",
+ "integrity": "sha512-hThe5ORR75WFYTXKL0K2AyLDxkTMrG+VQ1yL9BhQYsuh3OIH+3yNDxMz2LjfvrpOrMmJ4kk5NKdFewpqDojjXQ==",
"dev": true,
"dependencies": {
- "@nomicfoundation/edr-darwin-arm64": "0.5.2",
- "@nomicfoundation/edr-darwin-x64": "0.5.2",
- "@nomicfoundation/edr-linux-arm64-gnu": "0.5.2",
- "@nomicfoundation/edr-linux-arm64-musl": "0.5.2",
- "@nomicfoundation/edr-linux-x64-gnu": "0.5.2",
- "@nomicfoundation/edr-linux-x64-musl": "0.5.2",
- "@nomicfoundation/edr-win32-x64-msvc": "0.5.2"
+ "@nomicfoundation/edr-darwin-arm64": "0.6.3",
+ "@nomicfoundation/edr-darwin-x64": "0.6.3",
+ "@nomicfoundation/edr-linux-arm64-gnu": "0.6.3",
+ "@nomicfoundation/edr-linux-arm64-musl": "0.6.3",
+ "@nomicfoundation/edr-linux-x64-gnu": "0.6.3",
+ "@nomicfoundation/edr-linux-x64-musl": "0.6.3",
+ "@nomicfoundation/edr-win32-x64-msvc": "0.6.3"
},
"engines": {
"node": ">= 18"
}
},
"node_modules/@nomicfoundation/edr-darwin-arm64": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.5.2.tgz",
- "integrity": "sha512-Gm4wOPKhbDjGTIRyFA2QUAPfCXA1AHxYOKt3yLSGJkQkdy9a5WW+qtqKeEKHc/+4wpJSLtsGQfpzyIzggFfo/A==",
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.6.3.tgz",
+ "integrity": "sha512-hqtI7tYDqKG5PDmZ//Z65EH5cgH8VL/SAAu50rpHP7WAVfJWkOCcYbecywwF6nhHdonJbRTDGAeG1/+VOy6zew==",
"dev": true,
"engines": {
"node": ">= 18"
}
},
"node_modules/@nomicfoundation/edr-darwin-x64": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.5.2.tgz",
- "integrity": "sha512-ClyABq2dFCsrYEED3/UIO0c7p4H1/4vvlswFlqUyBpOkJccr75qIYvahOSJRM62WgUFRhbSS0OJXFRwc/PwmVg==",
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.6.3.tgz",
+ "integrity": "sha512-4fGi79/lyOlRUORhCYsYb3sWqRHuHT7qqzyZfZuNOn8llaxmT1k36xNmvpyg37R8SzjnhT/DzoukSJrs23Ip9Q==",
"dev": true,
"engines": {
"node": ">= 18"
}
},
"node_modules/@nomicfoundation/edr-linux-arm64-gnu": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.5.2.tgz",
- "integrity": "sha512-HWMTVk1iOabfvU2RvrKLDgtFjJZTC42CpHiw2h6rfpsgRqMahvIlx2jdjWYzFNy1jZKPTN1AStQ/91MRrg5KnA==",
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.6.3.tgz",
+ "integrity": "sha512-yFFTvGFMhfAvQ1Z2itUh1jpoUA+mVROyVELcaxjIq8fyg602lQmbS+NXkhQ+oaeDgJ+06mSENrHBg4fcfRf9cw==",
"dev": true,
"engines": {
"node": ">= 18"
}
},
"node_modules/@nomicfoundation/edr-linux-arm64-musl": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.5.2.tgz",
- "integrity": "sha512-CwsQ10xFx/QAD5y3/g5alm9+jFVuhc7uYMhrZAu9UVF+KtVjeCvafj0PaVsZ8qyijjqVuVsJ8hD1x5ob7SMcGg==",
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.6.3.tgz",
+ "integrity": "sha512-pOKmd0Fa3a6BHg5qbjbl/jMRELVi9oazbfiuU7Bvgn/dpTK+ID3jwT0SXiuC2zxjmPByWgXL6G9XRf5BPAM2rQ==",
"dev": true,
"engines": {
"node": ">= 18"
}
},
"node_modules/@nomicfoundation/edr-linux-x64-gnu": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.5.2.tgz",
- "integrity": "sha512-CWVCEdhWJ3fmUpzWHCRnC0/VLBDbqtqTGTR6yyY1Ep3S3BOrHEAvt7h5gx85r2vLcztisu2vlDq51auie4IU1A==",
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.6.3.tgz",
+ "integrity": "sha512-3AUferhkLIXtLV63w5GjpHttzdxZ36i656XMy+pkBZbbiqnzIVeKWg6DJv1A94fQY16gB4gqj9CLq4CWvbNN6w==",
"dev": true,
"engines": {
"node": ">= 18"
}
},
"node_modules/@nomicfoundation/edr-linux-x64-musl": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.5.2.tgz",
- "integrity": "sha512-+aJDfwhkddy2pP5u1ISg3IZVAm0dO836tRlDTFWtvvSMQ5hRGqPcWwlsbobhDQsIxhPJyT7phL0orCg5W3WMeA==",
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.6.3.tgz",
+ "integrity": "sha512-fr6bD872WIBXe9YnTDi0CzYepMcYRgSnkVqn0yK4wRnIvKrloWhxXNVY45GVIl51aNZguBnvoA4WEt6HIazs3A==",
"dev": true,
"engines": {
"node": ">= 18"
}
},
"node_modules/@nomicfoundation/edr-win32-x64-msvc": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.5.2.tgz",
- "integrity": "sha512-CcvvuA3sAv7liFNPsIR/68YlH6rrybKzYttLlMr80d4GKJjwJ5OKb3YgE6FdZZnOfP19HEHhsLcE0DPLtY3r0w==",
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.6.3.tgz",
+ "integrity": "sha512-sn34MvN1ajw2Oq1+Drpxej78Z0HfIzI4p4WlolupAV9dOZKzp2JAIQeLVfZpjIFbF3zuyxLPP4dUBrQoFPEqhA==",
"dev": true,
"engines": {
"node": ">= 18"
@@ -1815,9 +1827,9 @@
}
},
"node_modules/@nomicfoundation/hardhat-chai-matchers": {
- "version": "2.0.7",
- "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.7.tgz",
- "integrity": "sha512-RQfsiTwdf0SP+DtuNYvm4921X6VirCQq0Xyh+mnuGlTwEFSPZ/o27oQC+l+3Y/l48DDU7+ZcYBR+Fp+Rp94LfQ==",
+ "version": "2.0.8",
+ "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.8.tgz",
+ "integrity": "sha512-Z5PiCXH4xhNLASROlSUOADfhfpfhYO6D7Hn9xp8PddmHey0jq704cr6kfU8TRrQ4PUZbpfsZadPj+pCfZdjPIg==",
"dev": true,
"dependencies": {
"@types/chai-as-promised": "^7.1.3",
@@ -1847,17 +1859,18 @@
}
},
"node_modules/@nomicfoundation/hardhat-ignition": {
- "version": "0.15.5",
- "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ignition/-/hardhat-ignition-0.15.5.tgz",
- "integrity": "sha512-Y5nhFXFqt4owA6Ooag8ZBFDF2RAZElMXViknVIsi3m45pbQimS50ti6FU8HxfRkDnBARa40CIn7UGV0hrelzDw==",
+ "version": "0.15.6",
+ "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ignition/-/hardhat-ignition-0.15.6.tgz",
+ "integrity": "sha512-PcMf4xlYvwHYej2jcuOd/rBNNMM5FO11vh9c+MF8+m7NxV4b6NOameL3uscoD7ghg0H2GNgnGXgQ67ryRqtdIQ==",
"dev": true,
"peer": true,
"dependencies": {
- "@nomicfoundation/ignition-core": "^0.15.5",
- "@nomicfoundation/ignition-ui": "^0.15.5",
+ "@nomicfoundation/ignition-core": "^0.15.6",
+ "@nomicfoundation/ignition-ui": "^0.15.6",
"chalk": "^4.0.0",
"debug": "^4.3.2",
"fs-extra": "^10.0.0",
+ "json5": "^2.2.3",
"prompts": "^2.4.2"
},
"peerDependencies": {
@@ -1866,23 +1879,23 @@
}
},
"node_modules/@nomicfoundation/hardhat-ignition-ethers": {
- "version": "0.15.5",
- "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ignition-ethers/-/hardhat-ignition-ethers-0.15.5.tgz",
- "integrity": "sha512-W6s1QN9CFxzSVZS6w9Jcj3WLaK32z2FP5MxNU2OKY1Fn9ZzLr+miXbUbWYuRHl6dxrrl6sE8cv33Cybv19pmCg==",
+ "version": "0.15.6",
+ "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ignition-ethers/-/hardhat-ignition-ethers-0.15.6.tgz",
+ "integrity": "sha512-+jXDGWdfkuIGm0W+aFEZ9SLQz2MIj7Cf4j7ANTXUIIbK8sUkvnVOhTTAQEdqa0KgGEb45XS88BPg0w8fixwrXQ==",
"dev": true,
"peer": true,
"peerDependencies": {
"@nomicfoundation/hardhat-ethers": "^3.0.4",
- "@nomicfoundation/hardhat-ignition": "^0.15.5",
- "@nomicfoundation/ignition-core": "^0.15.5",
+ "@nomicfoundation/hardhat-ignition": "^0.15.6",
+ "@nomicfoundation/ignition-core": "^0.15.6",
"ethers": "^6.7.0",
"hardhat": "^2.18.0"
}
},
"node_modules/@nomicfoundation/hardhat-network-helpers": {
- "version": "1.0.11",
- "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-network-helpers/-/hardhat-network-helpers-1.0.11.tgz",
- "integrity": "sha512-uGPL7QSKvxrHRU69dx8jzoBvuztlLCtyFsbgfXIwIjnO3dqZRz2GNMHJoO3C3dIiUNM6jdNF4AUnoQKDscdYrA==",
+ "version": "1.0.12",
+ "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-network-helpers/-/hardhat-network-helpers-1.0.12.tgz",
+ "integrity": "sha512-xTNQNI/9xkHvjmCJnJOTyqDSl8uq1rKb2WOVmixQxFtRd7Oa3ecO8zM0cyC2YmOK+jHB9WPZ+F/ijkHg1CoORA==",
"dev": true,
"dependencies": {
"ethereumjs-util": "^7.1.4"
@@ -1918,9 +1931,9 @@
}
},
"node_modules/@nomicfoundation/hardhat-verify": {
- "version": "2.0.10",
- "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.0.10.tgz",
- "integrity": "sha512-3zoTZGQhpeOm6piJDdsGb6euzZAd7N5Tk0zPQvGnfKQ0+AoxKz/7i4if12goi8IDTuUGElAUuZyQB8PMQoXA5g==",
+ "version": "2.0.11",
+ "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.0.11.tgz",
+ "integrity": "sha512-lGIo4dNjVQFdsiEgZp3KP6ntLiF7xJEJsbNHfSyIiFCyI0Yv0518ElsFtMC5uCuHEChiBBMrib9jWQvHHT+X3Q==",
"dev": true,
"dependencies": {
"@ethersproject/abi": "^5.1.2",
@@ -2009,9 +2022,9 @@
}
},
"node_modules/@nomicfoundation/ignition-core": {
- "version": "0.15.5",
- "resolved": "https://registry.npmjs.org/@nomicfoundation/ignition-core/-/ignition-core-0.15.5.tgz",
- "integrity": "sha512-FgvuoIXhakRSP524JzNQ4BviyzBBKpsFaOWubPZ4XACLT4/7vGqlJ/7DIn0D2NL2anQ2qs98/BNBY9WccXUX1Q==",
+ "version": "0.15.6",
+ "resolved": "https://registry.npmjs.org/@nomicfoundation/ignition-core/-/ignition-core-0.15.6.tgz",
+ "integrity": "sha512-9eD1NJ2G4vh7IleRNmCz/3bGVoNEPYrRVPqx0uvWzG2xD226GGQcTgtK+NovyxsQOE/AcLF1xjX3/+8kNc1sSg==",
"dev": true,
"peer": true,
"dependencies": {
@@ -2064,9 +2077,9 @@
}
},
"node_modules/@nomicfoundation/ignition-ui": {
- "version": "0.15.5",
- "resolved": "https://registry.npmjs.org/@nomicfoundation/ignition-ui/-/ignition-ui-0.15.5.tgz",
- "integrity": "sha512-ZcE4rIn10qKahR4OqS8rl8NM2Fbg2QYiBXgMgj74ZI0++LlCcZgB5HyaBbX+lsnKHjTXtjYD3b+2mtg7jFbAMQ==",
+ "version": "0.15.6",
+ "resolved": "https://registry.npmjs.org/@nomicfoundation/ignition-ui/-/ignition-ui-0.15.6.tgz",
+ "integrity": "sha512-CW14g/BVcGZtBSF1K4eZSCjyvtz1fr9yppkFKC+Z0+sm/lXFWpwcwaVN+UiugQ/9wz9HAfSk4Y0gagdAMiSs0w==",
"dev": true,
"peer": true
},
@@ -2338,9 +2351,9 @@
}
},
"node_modules/@openzeppelin/defender-sdk-base-client": {
- "version": "1.14.4",
- "resolved": "https://registry.npmjs.org/@openzeppelin/defender-sdk-base-client/-/defender-sdk-base-client-1.14.4.tgz",
- "integrity": "sha512-tOePVQLKpqfGQ1GMzHvSBNd2psPYd86LDNpvdl5gjD0Y2kW/zNh5qBXy29RraGtk/qc8zs9hzS5pAOh0vhGkGQ==",
+ "version": "1.15.0",
+ "resolved": "https://registry.npmjs.org/@openzeppelin/defender-sdk-base-client/-/defender-sdk-base-client-1.15.0.tgz",
+ "integrity": "sha512-nuf/xegMIuKCO0hMrxI1KQKTzQw1iCl/9kew2nJM9MrFIohhfEXItc5rbJRoV/jehmK/Jhi9ATF9OHH09StEsQ==",
"dev": true,
"dependencies": {
"amazon-cognito-identity-js": "^6.3.6",
@@ -2348,37 +2361,37 @@
}
},
"node_modules/@openzeppelin/defender-sdk-deploy-client": {
- "version": "1.14.4",
- "resolved": "https://registry.npmjs.org/@openzeppelin/defender-sdk-deploy-client/-/defender-sdk-deploy-client-1.14.4.tgz",
- "integrity": "sha512-+diSoz1zid37LMsY2RDxI+uAsYx9Eryg8Vz+yfvuyd56fXrzjQEln7BBtYQw+2zp9yvyAByOL5XSQdrQga9OBQ==",
+ "version": "1.15.0",
+ "resolved": "https://registry.npmjs.org/@openzeppelin/defender-sdk-deploy-client/-/defender-sdk-deploy-client-1.15.0.tgz",
+ "integrity": "sha512-2ODMN4j5pPYWyIOvA/zRQmJ0tJyqi6NV3S/PyvufBXa3oj/MDnVO5bMGSQFH0M2VE3bg+i/rcUb0hdbX9Rtm5Q==",
"dev": true,
"dependencies": {
- "@openzeppelin/defender-sdk-base-client": "^1.14.4",
+ "@openzeppelin/defender-sdk-base-client": "^1.15.0",
"axios": "^1.7.2",
"lodash": "^4.17.21"
}
},
"node_modules/@openzeppelin/defender-sdk-network-client": {
- "version": "1.14.4",
- "resolved": "https://registry.npmjs.org/@openzeppelin/defender-sdk-network-client/-/defender-sdk-network-client-1.14.4.tgz",
- "integrity": "sha512-OS0H5b0vgYacJcwkvUFJUaRuyUaXhIRl916W5xLvGia5H6i/qn3dP8MZ7oLcPwKc8jB+ucRytO4H/AHsea0aVA==",
+ "version": "1.15.0",
+ "resolved": "https://registry.npmjs.org/@openzeppelin/defender-sdk-network-client/-/defender-sdk-network-client-1.15.0.tgz",
+ "integrity": "sha512-tNynCqFB1XYancq/8yGuj0HCSIyNLSRSuH53Hp2Tl+DpM7W5vIkzSRfvJJxC+8Sld83bVavyNJzTN9xid992Ag==",
"dev": true,
"dependencies": {
- "@openzeppelin/defender-sdk-base-client": "^1.14.4",
+ "@openzeppelin/defender-sdk-base-client": "^1.15.0",
"axios": "^1.7.2",
"lodash": "^4.17.21"
}
},
"node_modules/@openzeppelin/hardhat-upgrades": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/@openzeppelin/hardhat-upgrades/-/hardhat-upgrades-3.3.0.tgz",
- "integrity": "sha512-0RwCpkBKWViG0nIERk8tV5E71DCtZ6PXgsjoCYg+Bi2IWYgD8Skt4Q8b6QqE7tuWsFCK5yVQIVfCFL99JKMK5A==",
+ "version": "3.4.0",
+ "resolved": "https://registry.npmjs.org/@openzeppelin/hardhat-upgrades/-/hardhat-upgrades-3.4.0.tgz",
+ "integrity": "sha512-bfPtUCmRT6kfh/Mz56tAAGS8N22Zr3rdCMG3E3g8CW61QRGsaeFHnZRetBgu1JoKocjCavEtis5/x60m+o5XUQ==",
"dev": true,
"dependencies": {
"@openzeppelin/defender-sdk-base-client": "^1.14.4",
"@openzeppelin/defender-sdk-deploy-client": "^1.14.4",
"@openzeppelin/defender-sdk-network-client": "^1.14.4",
- "@openzeppelin/upgrades-core": "^1.35.0",
+ "@openzeppelin/upgrades-core": "^1.38.0",
"chalk": "^4.1.0",
"debug": "^4.1.1",
"ethereumjs-util": "^7.1.5",
@@ -2401,18 +2414,18 @@
}
},
"node_modules/@openzeppelin/hardhat-upgrades/node_modules/undici": {
- "version": "6.19.8",
- "resolved": "https://registry.npmjs.org/undici/-/undici-6.19.8.tgz",
- "integrity": "sha512-U8uCCl2x9TK3WANvmBavymRzxbfFYG+tAu+fgx3zxQy3qdagQqBLwJVrdyO1TBfUXvfKveMKJZhpvUYoOjM+4g==",
+ "version": "6.20.0",
+ "resolved": "https://registry.npmjs.org/undici/-/undici-6.20.0.tgz",
+ "integrity": "sha512-AITZfPuxubm31Sx0vr8bteSalEbs9wQb/BOBi9FPlD9Qpd6HxZ4Q0+hI742jBhkPb4RT2v5MQzaW5VhRVyj+9A==",
"dev": true,
"engines": {
"node": ">=18.17"
}
},
"node_modules/@openzeppelin/upgrades-core": {
- "version": "1.37.0",
- "resolved": "https://registry.npmjs.org/@openzeppelin/upgrades-core/-/upgrades-core-1.37.0.tgz",
- "integrity": "sha512-vpxe60KrbFubY09vlGZqBJdBXs0IqvZmH7+UueFiM0xK/V12lMwxyiNXkFv8+HZ7K8abRevYphVtEzrUWelQhQ==",
+ "version": "1.39.0",
+ "resolved": "https://registry.npmjs.org/@openzeppelin/upgrades-core/-/upgrades-core-1.39.0.tgz",
+ "integrity": "sha512-TJ1kMeyp7yD4aDR2bFDK+9m5JVe/ObFDck3erVm2WcBKPtRsmFOP6b0QO1DM6w0HOOIiu8VKfrFDqZ6NyJcUyw==",
"dev": true,
"dependencies": {
"@nomicfoundation/slang": "^0.17.0",
@@ -2443,9 +2456,9 @@
}
},
"node_modules/@scure/base": {
- "version": "1.1.8",
- "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.8.tgz",
- "integrity": "sha512-6CyAclxj3Nb0XT7GHK6K4zK6k2xJm6E4Ft0Ohjt4WgegiFUHEtFb2CGzmPmGBwoIhrLsqNLYfLr04Y1GePrzZg==",
+ "version": "1.1.9",
+ "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.9.tgz",
+ "integrity": "sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==",
"dev": true,
"funding": {
"url": "https://paulmillr.com/funding/"
@@ -2617,9 +2630,9 @@
}
},
"node_modules/@smithy/types": {
- "version": "3.4.2",
- "resolved": "https://registry.npmjs.org/@smithy/types/-/types-3.4.2.tgz",
- "integrity": "sha512-tHiFcfcVedVBHpmHUEUHOCCih8iZbIAYn9NvPsNzaPm/237I3imdDdZoOC8c87H5HBAVEa06tTgb+OcSWV9g5w==",
+ "version": "3.5.0",
+ "resolved": "https://registry.npmjs.org/@smithy/types/-/types-3.5.0.tgz",
+ "integrity": "sha512-QN0twHNfe8mNJdH9unwsCK13GURU7oEAZqkBI+rsvpv1jrmserO+WnLE7jidR9W/1dxwZ0u/CB01mV2Gms/K2Q==",
"dev": true,
"dependencies": {
"tslib": "^2.6.2"
@@ -2745,18 +2758,18 @@
}
},
"node_modules/@types/bn.js": {
- "version": "5.1.5",
- "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.5.tgz",
- "integrity": "sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A==",
+ "version": "5.1.6",
+ "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.6.tgz",
+ "integrity": "sha512-Xh8vSwUeMKeYYrj3cX4lGQgFSF/N03r+tv4AiLl1SucqV+uTQpxRcnM8AkXKHwYP9ZPXOYXRr2KPXpVlIvqh9w==",
"dev": true,
"dependencies": {
"@types/node": "*"
}
},
"node_modules/@types/chai": {
- "version": "4.3.19",
- "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.19.tgz",
- "integrity": "sha512-2hHHvQBVE2FiSK4eN0Br6snX9MtolHaTo/batnLjlGRhoQzlCL61iVpxoqO7SfFyOw+P/pwv+0zNHzKoGWz9Cw==",
+ "version": "4.3.20",
+ "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.20.tgz",
+ "integrity": "sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ==",
"dev": true
},
"node_modules/@types/chai-as-promised": {
@@ -2812,9 +2825,9 @@
"dev": true
},
"node_modules/@types/keccak": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/@types/keccak/-/keccak-3.0.4.tgz",
- "integrity": "sha512-hdnkmbie7tE0yXnQQvlIOqCyjEsoXDVEZ3ACqO+F305XgUOW4Z9ElWdogCXXRAW/khnZ7GxM0t/BGB5bORKt/g==",
+ "version": "3.0.5",
+ "resolved": "https://registry.npmjs.org/@types/keccak/-/keccak-3.0.5.tgz",
+ "integrity": "sha512-Mvu4StIJ9KyfPXDVRv3h0fWNBAjHPBQZ8EPcxhqA8FG6pLzxtytVXU5owB6J2/8xZ+ZspWTXJEUjAHt0pk0I1Q==",
"dev": true,
"dependencies": {
"@types/node": "*"
@@ -2842,15 +2855,15 @@
}
},
"node_modules/@types/mocha": {
- "version": "10.0.7",
- "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.7.tgz",
- "integrity": "sha512-GN8yJ1mNTcFcah/wKEFIJckJx9iJLoMSzWcfRRuxz/Jk+U6KQNnml+etbtxFK8lPjzOw3zp4Ha/kjSst9fsHYw==",
+ "version": "10.0.9",
+ "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.9.tgz",
+ "integrity": "sha512-sicdRoWtYevwxjOHNMPTl3vSfJM6oyW8o1wXeI7uww6b6xHg8eBznQDNSGBCDJmsE8UMxP05JgZRtsKbTqt//Q==",
"dev": true
},
"node_modules/@types/node": {
- "version": "20.16.4",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.4.tgz",
- "integrity": "sha512-ioyQ1zK9aGEomJ45zz8S8IdzElyxhvP1RVWnPrXDf6wFaUb+kk1tEcVVJkF7RPGM0VWI7cp5U57oCPIn5iN1qg==",
+ "version": "20.16.11",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.11.tgz",
+ "integrity": "sha512-y+cTCACu92FyA5fgQSAI8A1H429g7aSK2HsO7K4XYUWc4dY5IUz55JSDIYT6/VsOLfGy8vmvQYC2hfb0iF16Uw==",
"dev": true,
"dependencies": {
"undici-types": "~6.19.2"
@@ -2872,9 +2885,9 @@
"dev": true
},
"node_modules/@types/qs": {
- "version": "6.9.15",
- "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz",
- "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==",
+ "version": "6.9.16",
+ "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.16.tgz",
+ "integrity": "sha512-7i+zxXdPD0T4cKDuxCUXJ4wHcsJLwENa6Z3dCu8cfCK743OGy5Nu1RmAGqDPsoTDINVEcdXKRvR/zre+P2Ku1A==",
"dev": true
},
"node_modules/@types/resolve": {
@@ -3159,9 +3172,9 @@
}
},
"node_modules/acorn-walk": {
- "version": "8.3.3",
- "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.3.tgz",
- "integrity": "sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==",
+ "version": "8.3.4",
+ "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz",
+ "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==",
"dev": true,
"dependencies": {
"acorn": "^8.11.0"
@@ -3916,39 +3929,18 @@
}
},
"node_modules/chokidar": {
- "version": "3.6.0",
- "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
- "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.1.tgz",
+ "integrity": "sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==",
"dev": true,
"dependencies": {
- "anymatch": "~3.1.2",
- "braces": "~3.0.2",
- "glob-parent": "~5.1.2",
- "is-binary-path": "~2.1.0",
- "is-glob": "~4.0.1",
- "normalize-path": "~3.0.0",
- "readdirp": "~3.6.0"
+ "readdirp": "^4.0.1"
},
"engines": {
- "node": ">= 8.10.0"
+ "node": ">= 14.16.0"
},
"funding": {
"url": "https://paulmillr.com/funding/"
- },
- "optionalDependencies": {
- "fsevents": "~2.3.2"
- }
- },
- "node_modules/chokidar/node_modules/glob-parent": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
- "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
- "dev": true,
- "dependencies": {
- "is-glob": "^4.0.1"
- },
- "engines": {
- "node": ">= 6"
}
},
"node_modules/chownr": {
@@ -4438,12 +4430,12 @@
"dev": true
},
"node_modules/debug": {
- "version": "4.3.6",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz",
- "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==",
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
"devOptional": true,
"dependencies": {
- "ms": "2.1.2"
+ "ms": "^2.1.3"
},
"engines": {
"node": ">=6.0"
@@ -4852,16 +4844,17 @@
}
},
"node_modules/eslint": {
- "version": "8.57.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz",
- "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==",
+ "version": "8.57.1",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz",
+ "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==",
+ "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.6.1",
"@eslint/eslintrc": "^2.1.4",
- "@eslint/js": "8.57.0",
- "@humanwhocodes/config-array": "^0.11.14",
+ "@eslint/js": "8.57.1",
+ "@humanwhocodes/config-array": "^0.13.0",
"@humanwhocodes/module-importer": "^1.0.1",
"@nodelib/fs.walk": "^1.2.8",
"@ungap/structured-clone": "^1.2.0",
@@ -5342,9 +5335,9 @@
}
},
"node_modules/ethers": {
- "version": "6.13.2",
- "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.2.tgz",
- "integrity": "sha512-9VkriTTed+/27BGuY1s0hf441kqwHJ1wtN2edksEtiRvXx+soxRX3iSXTfFqq2+YwrOqbDoTHjIhQnjJRlzKmg==",
+ "version": "6.13.3",
+ "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.3.tgz",
+ "integrity": "sha512-/DzbZOLVtoO4fKvvQwpEucHAQgIwBGWuRvBdwE/lMXgXvvHHTSkn7XqAQ2b+gjJzZDJjWA9OD05bVceVOsBHbg==",
"dev": true,
"funding": [
{
@@ -5434,9 +5427,9 @@
}
},
"node_modules/extra-bigint": {
- "version": "1.1.18",
- "resolved": "https://registry.npmjs.org/extra-bigint/-/extra-bigint-1.1.18.tgz",
- "integrity": "sha512-edCTFKhq84Htzmg3MTii8TNsyQlIIG5k9f/OJ7/PrX80Ob57GXtIW6PJt/UqRvyCa4TgYKhmYVRfQfajL3ku0w=="
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/extra-bigint/-/extra-bigint-1.2.0.tgz",
+ "integrity": "sha512-F9T/pcT5xPZTjlFMKGCZgBY2/jKqEPxXHT4kLSwsa7gp7D05nQq8z9NzRTzVy5Z4AOO1E/iD9r9OBz4csGD7nw=="
},
"node_modules/fast-base64-decode": {
"version": "1.0.0",
@@ -5491,9 +5484,9 @@
"dev": true
},
"node_modules/fast-uri": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz",
- "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==",
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.2.tgz",
+ "integrity": "sha512-GR6f0hD7XXyNJa25Tb9BuIdN0tdr+0BMi6/CJPH3wJO1JjNG3n/VsSw38AwRdKZABm8lGbPfakLRkYzx2V9row==",
"dev": true
},
"node_modules/fastq": {
@@ -5640,9 +5633,9 @@
}
},
"node_modules/follow-redirects": {
- "version": "1.15.8",
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.8.tgz",
- "integrity": "sha512-xgrmBhBToVKay1q2Tao5LI26B83UhrB/vM1avwVSDzt8rx3rO6AizBAaF46EgksTVr+rFTQaqZZ9MVBfUe4nig==",
+ "version": "1.15.9",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
+ "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
"dev": true,
"funding": [
{
@@ -6085,14 +6078,14 @@
}
},
"node_modules/hardhat": {
- "version": "2.22.10",
- "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.22.10.tgz",
- "integrity": "sha512-JRUDdiystjniAvBGFmJRsiIZSOP2/6s++8xRDe3TzLeQXlWWHsXBrd9wd3JWFyKXvgMqMeLL5Sz/oNxXKYw9vg==",
+ "version": "2.22.13",
+ "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.22.13.tgz",
+ "integrity": "sha512-psVJX4FSXDpSXwsU8OcKTJN04pQEj9cFBMX5OPko+OFwbIoiOpvRmafa954/UaA1934npTj8sV3gaTSdx9bPbA==",
"dev": true,
"dependencies": {
"@ethersproject/abi": "^5.1.2",
"@metamask/eth-sig-util": "^4.0.0",
- "@nomicfoundation/edr": "^0.5.2",
+ "@nomicfoundation/edr": "^0.6.3",
"@nomicfoundation/ethereumjs-common": "4.0.4",
"@nomicfoundation/ethereumjs-tx": "5.0.4",
"@nomicfoundation/ethereumjs-util": "9.0.4",
@@ -6105,7 +6098,7 @@
"ansi-escapes": "^4.3.0",
"boxen": "^5.1.2",
"chalk": "^2.4.2",
- "chokidar": "^3.4.0",
+ "chokidar": "^4.0.0",
"ci-info": "^2.0.0",
"debug": "^4.1.1",
"enquirer": "^2.3.0",
@@ -6118,6 +6111,7 @@
"glob": "7.2.0",
"immutable": "^4.0.0-rc.12",
"io-ts": "1.10.4",
+ "json-stream-stringify": "^3.1.4",
"keccak": "^3.0.2",
"lodash": "^4.17.11",
"mnemonist": "^0.38.0",
@@ -6191,6 +6185,30 @@
"follow-redirects": "^1.14.0"
}
},
+ "node_modules/hardhat-deploy/node_modules/chokidar": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
+ "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
+ "dev": true,
+ "dependencies": {
+ "anymatch": "~3.1.2",
+ "braces": "~3.0.2",
+ "glob-parent": "~5.1.2",
+ "is-binary-path": "~2.1.0",
+ "is-glob": "~4.0.1",
+ "normalize-path": "~3.0.0",
+ "readdirp": "~3.6.0"
+ },
+ "engines": {
+ "node": ">= 8.10.0"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.2"
+ }
+ },
"node_modules/hardhat-deploy/node_modules/ethers": {
"version": "5.7.2",
"resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz",
@@ -6239,6 +6257,30 @@
"@ethersproject/wordlists": "5.7.0"
}
},
+ "node_modules/hardhat-deploy/node_modules/glob-parent": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
+ "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
+ "dev": true,
+ "dependencies": {
+ "is-glob": "^4.0.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/hardhat-deploy/node_modules/readdirp": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
+ "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
+ "dev": true,
+ "dependencies": {
+ "picomatch": "^2.2.1"
+ },
+ "engines": {
+ "node": ">=8.10.0"
+ }
+ },
"node_modules/hardhat-deploy/node_modules/zksync-web3": {
"version": "0.14.4",
"resolved": "https://registry.npmjs.org/zksync-web3/-/zksync-web3-0.14.4.tgz",
@@ -7157,6 +7199,15 @@
"integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
"dev": true
},
+ "node_modules/json-stream-stringify": {
+ "version": "3.1.6",
+ "resolved": "https://registry.npmjs.org/json-stream-stringify/-/json-stream-stringify-3.1.6.tgz",
+ "integrity": "sha512-x7fpwxOkbhFCaJDJ8vb1fBY3DdSa4AlITaz+HHILQJzdPMnHEFjxPwVUi1ALIbcIxDE0PNe/0i7frnY8QnBQog==",
+ "dev": true,
+ "engines": {
+ "node": ">=7.10.1"
+ }
+ },
"node_modules/json-stringify-safe": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
@@ -7164,6 +7215,19 @@
"dev": true,
"peer": true
},
+ "node_modules/json5": {
+ "version": "2.2.3",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
+ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
+ "dev": true,
+ "peer": true,
+ "bin": {
+ "json5": "lib/cli.js"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/jsonfile": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
@@ -7644,6 +7708,30 @@
"node": ">= 14.0.0"
}
},
+ "node_modules/mocha/node_modules/chokidar": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
+ "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
+ "dev": true,
+ "dependencies": {
+ "anymatch": "~3.1.2",
+ "braces": "~3.0.2",
+ "glob-parent": "~5.1.2",
+ "is-binary-path": "~2.1.0",
+ "is-glob": "~4.0.1",
+ "normalize-path": "~3.0.0",
+ "readdirp": "~3.6.0"
+ },
+ "engines": {
+ "node": ">= 8.10.0"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.2"
+ }
+ },
"node_modules/mocha/node_modules/glob": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz",
@@ -7664,6 +7752,18 @@
"url": "https://github.com/sponsors/isaacs"
}
},
+ "node_modules/mocha/node_modules/glob-parent": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
+ "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
+ "dev": true,
+ "dependencies": {
+ "is-glob": "^4.0.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
"node_modules/mocha/node_modules/minimatch": {
"version": "5.1.6",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
@@ -7676,11 +7776,17 @@
"node": ">=10"
}
},
- "node_modules/mocha/node_modules/ms": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
- "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
- "dev": true
+ "node_modules/mocha/node_modules/readdirp": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
+ "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
+ "dev": true,
+ "dependencies": {
+ "picomatch": "^2.2.1"
+ },
+ "engines": {
+ "node": ">=8.10.0"
+ }
},
"node_modules/mocha/node_modules/supports-color": {
"version": "8.1.1",
@@ -7698,9 +7804,9 @@
}
},
"node_modules/ms": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
- "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
"devOptional": true
},
"node_modules/murmur-128": {
@@ -7767,9 +7873,9 @@
"dev": true
},
"node_modules/node-abi": {
- "version": "3.67.0",
- "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.67.0.tgz",
- "integrity": "sha512-bLn/fU/ALVBE9wj+p4Y21ZJWYFjUXLXPi/IewyLZkx3ApxKDNBWCKdReeKOtD8dWpOdDCeMyLh6ZewzcLsG2Nw==",
+ "version": "3.68.0",
+ "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.68.0.tgz",
+ "integrity": "sha512-7vbj10trelExNjFSBm5kTvZXXa7pZyKWx9RCKIyqe6I9Ev3IzGpQoqBP3a+cOdxY+pWj6VkP28n/2wWysBHD/A==",
"dependencies": {
"semver": "^7.3.5"
},
@@ -8425,9 +8531,9 @@
"dev": true
},
"node_modules/pump": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
- "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz",
+ "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==",
"dependencies": {
"end-of-stream": "^1.1.0",
"once": "^1.3.1"
@@ -8537,15 +8643,16 @@
}
},
"node_modules/readdirp": {
- "version": "3.6.0",
- "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
- "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.0.2.tgz",
+ "integrity": "sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==",
"dev": true,
- "dependencies": {
- "picomatch": "^2.2.1"
- },
"engines": {
- "node": ">=8.10.0"
+ "node": ">= 14.16.0"
+ },
+ "funding": {
+ "type": "individual",
+ "url": "https://paulmillr.com/funding/"
}
},
"node_modules/rechoir": {
@@ -9323,9 +9430,9 @@
}
},
"node_modules/solidity-ast": {
- "version": "0.4.58",
- "resolved": "https://registry.npmjs.org/solidity-ast/-/solidity-ast-0.4.58.tgz",
- "integrity": "sha512-fiAEDlMEc+xziMn0IpZf2vUbqxyXYZK4BqBiTaz2ZUqOP0p1fdJzUc9xpv74Jdxb5BLAiCUFv5UenkXIpHn3cA==",
+ "version": "0.4.59",
+ "resolved": "https://registry.npmjs.org/solidity-ast/-/solidity-ast-0.4.59.tgz",
+ "integrity": "sha512-I+CX0wrYUN9jDfYtcgWSe+OAowaXy8/1YQy7NS4ni5IBDmIYBq7ZzaP/7QqouLjzZapmQtvGLqCaYgoUWqBo5g==",
"dev": true
},
"node_modules/solidity-comments": {
@@ -10549,9 +10656,9 @@
"dev": true
},
"node_modules/typescript": {
- "version": "5.5.4",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz",
- "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==",
+ "version": "5.6.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz",
+ "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
@@ -10724,9 +10831,9 @@
}
},
"node_modules/web3-types": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/web3-types/-/web3-types-1.7.0.tgz",
- "integrity": "sha512-nhXxDJ7a5FesRw9UG5SZdP/C/3Q2EzHGnB39hkAV+YGXDMgwxBXFWebQLfEzZzuArfHnvC0sQqkIHNwSKcVjdA==",
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/web3-types/-/web3-types-1.8.0.tgz",
+ "integrity": "sha512-Z51wFLPGhZM/1uDxrxE8gzju3t2aEdRGn+YmLX463id5UjTuMEmP/9in1GFjqrsPB3m86czs8RnGBUt3ovueMw==",
"dev": true,
"engines": {
"node": ">=14",
From 7d178ca3ac8ccc7f00ac9677e7f459c74a67c77a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Wed, 9 Oct 2024 16:56:19 +0200
Subject: [PATCH 40/51] feat: adds localCoprocessor config
---
hardhat.config.ts | 5 +++++
launch-fhevm.sh | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/hardhat.config.ts b/hardhat.config.ts
index 2d5ce93c..8179d1f6 100644
--- a/hardhat.config.ts
+++ b/hardhat.config.ts
@@ -45,6 +45,7 @@ if (!mnemonic) {
const chainIds = {
zama: 8009,
local: 9000,
+ localCoprocessor: 12345,
localNetwork1: 9000,
multipleValidatorTestnet: 8009,
sepolia: 11155111,
@@ -56,6 +57,9 @@ function getChainConfig(chain: keyof typeof chainIds): NetworkUserConfig {
case 'local':
jsonRpcUrl = 'http://localhost:8545';
break;
+ case 'localCoprocessor':
+ jsonRpcUrl = 'http://localhost:8745';
+ break;
case 'localNetwork1':
jsonRpcUrl = 'http://127.0.0.1:9650/ext/bc/fhevm/rpc';
break;
@@ -144,6 +148,7 @@ const config: HardhatUserConfig = {
zama: getChainConfig('zama'),
localDev: getChainConfig('local'),
local: getChainConfig('local'),
+ localCoprocessor: getChainConfig('localCoprocessor'),
localNetwork1: getChainConfig('localNetwork1'),
multipleValidatorTestnet: getChainConfig('multipleValidatorTestnet'),
},
diff --git a/launch-fhevm.sh b/launch-fhevm.sh
index d8178f0d..1193a18c 100755
--- a/launch-fhevm.sh
+++ b/launch-fhevm.sh
@@ -24,7 +24,7 @@ npx hardhat task:deployKMSVerifier --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" -
npx hardhat task:deployInputVerifier --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia
npx hardhat task:deployFHEPayment --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia
-npx hardhat task:addSigners --num-signers $NUM_KMS_SIGNERS --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --use-address true
+npx hardhat task:addSigners --num-signers $NUM_KMS_SIGNERS --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --use-address true --network sepolia
npx hardhat task:launchFhevm --skip-get-coin true --use-address true --network sepolia
From 23a463928039d4704367263853d3f5d1606d633b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Wed, 9 Oct 2024 19:07:56 +0200
Subject: [PATCH 41/51] feat: splits launch-fhevm.sh in 2 scripts
---
launch-fhevm.sh => launch-fhevm-sepolia.sh | 14 ++------------
precompute-addresses.sh | 12 ++++++++++++
2 files changed, 14 insertions(+), 12 deletions(-)
rename launch-fhevm.sh => launch-fhevm-sepolia.sh (52%)
create mode 100755 precompute-addresses.sh
diff --git a/launch-fhevm.sh b/launch-fhevm-sepolia.sh
similarity index 52%
rename from launch-fhevm.sh
rename to launch-fhevm-sepolia.sh
index 1193a18c..f78bd042 100755
--- a/launch-fhevm.sh
+++ b/launch-fhevm-sepolia.sh
@@ -1,19 +1,9 @@
#!/bin/bash
+# This script should be launched after precomputing the addresses via `precompute-addresses.sh`, and preferably after setting up the different services - KMS, Geth node, Gateway
npx hardhat clean
-PRIVATE_KEY_GATEWAY_DEPLOYER=$(grep PRIVATE_KEY_GATEWAY_DEPLOYER .env | cut -d '"' -f 2)
PRIVATE_KEY_FHEVM_DEPLOYER=$(grep PRIVATE_KEY_FHEVM_DEPLOYER .env | cut -d '"' -f 2)
NUM_KMS_SIGNERS=$(grep NUM_KMS_SIGNERS .env | cut -d '"' -f 2)
-IS_COPROCESSOR=$(grep IS_COPROCESSOR .env | cut -d '"' -f 2)
-
-npx hardhat task:computeGatewayAddress --private-key "$PRIVATE_KEY_GATEWAY_DEPLOYER"
-npx hardhat task:computeACLAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
-npx hardhat task:computeTFHEExecutorAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
-npx hardhat task:computeKMSVerifierAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
-npx hardhat task:computeInputVerifierAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --use-address true
-npx hardhat task:computeFHEPaymentAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
-
-# [ADD DOCKER-COMPOSE COMMAND HERE] // Geth node, Gateway service, KMS service etc should be launched here, using previously precomputed addresses
npx hardhat compile:specific --contract lib
npx hardhat compile:specific --contract gateway
@@ -24,7 +14,7 @@ npx hardhat task:deployKMSVerifier --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" -
npx hardhat task:deployInputVerifier --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia
npx hardhat task:deployFHEPayment --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia
-npx hardhat task:addSigners --num-signers $NUM_KMS_SIGNERS --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --use-address true --network sepolia
+npx hardhat task:addSigners --num-signers "$NUM_KMS_SIGNERS" --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --use-address true --network sepolia
npx hardhat task:launchFhevm --skip-get-coin true --use-address true --network sepolia
diff --git a/precompute-addresses.sh b/precompute-addresses.sh
new file mode 100755
index 00000000..d4754064
--- /dev/null
+++ b/precompute-addresses.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+npx hardhat clean
+
+PRIVATE_KEY_GATEWAY_DEPLOYER=$(grep PRIVATE_KEY_GATEWAY_DEPLOYER .env | cut -d '"' -f 2)
+PRIVATE_KEY_FHEVM_DEPLOYER=$(grep PRIVATE_KEY_FHEVM_DEPLOYER .env | cut -d '"' -f 2)
+
+npx hardhat task:computeGatewayAddress --private-key "$PRIVATE_KEY_GATEWAY_DEPLOYER"
+npx hardhat task:computeACLAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
+npx hardhat task:computeTFHEExecutorAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
+npx hardhat task:computeKMSVerifierAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
+npx hardhat task:computeInputVerifierAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --use-address true
+npx hardhat task:computeFHEPaymentAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
\ No newline at end of file
From f76de69a4f53c9167afcaea2c96130d72a2babb1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Wed, 9 Oct 2024 23:36:53 +0200
Subject: [PATCH 42/51] chore: updates fhevmjs and fhevmjsMocked to v0.6
chore: small refactor
---
package-lock.json | 97 ++++++++++++++++++++++++++++++++++++++++-------
package.json | 2 +-
test/instance.ts | 29 ++++++++++----
3 files changed, 107 insertions(+), 21 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 7da5c97b..1198eb33 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -41,7 +41,7 @@
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"ethers": "^6.8.0",
- "fhevmjs": "^0.5.0",
+ "fhevmjs": "^0.6.0-1",
"hardhat": "^2.22.10",
"hardhat-deploy": "^0.11.29",
"hardhat-gas-reporter": "^1.0.2",
@@ -2818,6 +2818,12 @@
"@types/node": "*"
}
},
+ "node_modules/@types/glob-to-regexp": {
+ "version": "0.4.4",
+ "resolved": "https://registry.npmjs.org/@types/glob-to-regexp/-/glob-to-regexp-0.4.4.tgz",
+ "integrity": "sha512-nDKoaKJYbnn1MZxUY0cA1bPmmgZbg0cTq7Rh13d0KWYNOiKbqoR+2d89SnRPszGh7ROzSwZ/GOjZ4jPbmmZ6Eg==",
+ "dev": true
+ },
"node_modules/@types/json-schema": {
"version": "7.0.15",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
@@ -4539,6 +4545,15 @@
"node": ">= 0.8"
}
},
+ "node_modules/dequal": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
+ "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/detect-libc": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz",
@@ -5498,19 +5513,42 @@
"reusify": "^1.0.4"
}
},
+ "node_modules/fetch-mock": {
+ "version": "11.1.5",
+ "resolved": "https://registry.npmjs.org/fetch-mock/-/fetch-mock-11.1.5.tgz",
+ "integrity": "sha512-KHmZDnZ1ry0pCTrX4YG5DtThHi0MH+GNI9caESnzX/nMJBrvppUHMvLx47M0WY9oAtKOMiPfZDRpxhlHg89BOA==",
+ "dev": true,
+ "dependencies": {
+ "@types/glob-to-regexp": "^0.4.4",
+ "dequal": "^2.0.3",
+ "glob-to-regexp": "^0.4.1",
+ "is-subset": "^0.1.1",
+ "regexparam": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8.0.0"
+ },
+ "peerDependenciesMeta": {
+ "node-fetch": {
+ "optional": true
+ }
+ }
+ },
"node_modules/fhevmjs": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/fhevmjs/-/fhevmjs-0.5.2.tgz",
- "integrity": "sha512-p/p4VTuUUohhGLZ8UgWUnO0rbuw5VummB4fAovUyILeyJ0oBVpGKKwkoaBXNKv40HDo+mvpkDBi6+HdSsMHvNg==",
+ "version": "0.6.0-1",
+ "resolved": "https://registry.npmjs.org/fhevmjs/-/fhevmjs-0.6.0-1.tgz",
+ "integrity": "sha512-KHZJZXq6E6WHl1psS8ddfOTFnzpXitCjJS+6EWBqiGgqQysjHb5gP4KdUfDG3ewkfxcojMgJR1TNK03vsN69Aw==",
"dev": true,
"dependencies": {
"@types/keccak": "^3.0.4",
"bigint-buffer": "^1.1.5",
"commander": "^11.0.0",
- "node-fetch": "^2.7.0",
- "node-tfhe": "^0.6.3",
+ "fetch-mock": "^11.1.3",
+ "node-tfhe": "^0.8.0",
+ "node-tkms": "^0.9.0-rc11",
"sha3": "^2.1.4",
- "tfhe": "^0.6.3",
+ "tfhe": "^0.8.0",
+ "tkms": "^0.9.0-rc11",
"url": "^0.11.3",
"web3-validator": "^2.0.6"
},
@@ -5934,6 +5972,12 @@
"node": ">=10.13.0"
}
},
+ "node_modules/glob-to-regexp": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz",
+ "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==",
+ "dev": true
+ },
"node_modules/glob/node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -7078,6 +7122,12 @@
"node": ">=8"
}
},
+ "node_modules/is-subset": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/is-subset/-/is-subset-0.1.1.tgz",
+ "integrity": "sha512-6Ybun0IkarhmEqxXCNw/C0bna6Zb/TkfUX9UbwJtK6ObwAVCxmAP308WWTHviM/zAqXk05cdhYsUsZeGQh99iw==",
+ "dev": true
+ },
"node_modules/is-typed-array": {
"version": "1.1.13",
"resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz",
@@ -8020,9 +8070,15 @@
}
},
"node_modules/node-tfhe": {
- "version": "0.6.4",
- "resolved": "https://registry.npmjs.org/node-tfhe/-/node-tfhe-0.6.4.tgz",
- "integrity": "sha512-V/SJjc5GPKIB/KcNGEFSDDQelIKvFIFiCgefeDARgxOnN69fyB+omV4e4j3tMDEz6aN7xRd/NqqQ0im17emXeA==",
+ "version": "0.8.2",
+ "resolved": "https://registry.npmjs.org/node-tfhe/-/node-tfhe-0.8.2.tgz",
+ "integrity": "sha512-UWJFToNhtE9lCN/zHRrIFvDdC7OU7W5aZKyrIudgdWZ5SZur/PJ2DXUqASiRFq2yK28lAZeT2awfAF4GxYaccg==",
+ "dev": true
+ },
+ "node_modules/node-tkms": {
+ "version": "0.9.0-rc3",
+ "resolved": "https://registry.npmjs.org/node-tkms/-/node-tkms-0.9.0-rc3.tgz",
+ "integrity": "sha512-Jr3faNAudjBO2Up+Gc3QPF7Dq07fDR/n0NKCHGtS69qLKnoqqaKxGULdKg3gpbtdx0wnj/GaQjvprUIgnIm7yQ==",
"dev": true
},
"node_modules/nofilter": {
@@ -8710,6 +8766,15 @@
"node": ">=6"
}
},
+ "node_modules/regexparam": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/regexparam/-/regexparam-3.0.0.tgz",
+ "integrity": "sha512-RSYAtP31mvYLkAHrOlh25pCNQ5hWnT106VukGaaFfuJrZFkGRX5GhUAdPqpSDXxOhA2c4akmRuplv1mRqnBn6Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/req-cwd": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/req-cwd/-/req-cwd-2.0.0.tgz",
@@ -10147,9 +10212,9 @@
"dev": true
},
"node_modules/tfhe": {
- "version": "0.6.4",
- "resolved": "https://registry.npmjs.org/tfhe/-/tfhe-0.6.4.tgz",
- "integrity": "sha512-80fP2iJJQXrlhyC81u6/aUWMMMDoOXmlY5uqKka2CEd222xM96+z9+FTZc0MjlrR3U+NHja1WOte+A3nlvZkKw==",
+ "version": "0.8.2",
+ "resolved": "https://registry.npmjs.org/tfhe/-/tfhe-0.8.2.tgz",
+ "integrity": "sha512-p/QQRGGaE3z8BSTFCCOGPLHnQQjtES2AhYLPNUl9vdIb6NdJIc2p7qU+7fWbGtzJnCmGaQZmbLA6788cL3WlCg==",
"dev": true
},
"node_modules/then-request": {
@@ -10204,6 +10269,12 @@
"readable-stream": "3"
}
},
+ "node_modules/tkms": {
+ "version": "0.9.0-rc3",
+ "resolved": "https://registry.npmjs.org/tkms/-/tkms-0.9.0-rc3.tgz",
+ "integrity": "sha512-7ynaHiFnXS9Xok62vsi2GGeTUxmb1Ao7I5k9akE8lEQ5M9FERmaGLF3TapDLGsYMDz7Km7dFeTfrsjCg38OC/w==",
+ "dev": true
+ },
"node_modules/tmp": {
"version": "0.0.33",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
diff --git a/package.json b/package.json
index ead155f0..1bc66eec 100644
--- a/package.json
+++ b/package.json
@@ -71,7 +71,7 @@
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"ethers": "^6.8.0",
- "fhevmjs": "^0.5.0",
+ "fhevmjs": "^0.6.0-1",
"hardhat": "^2.22.10",
"hardhat-deploy": "^0.11.29",
"hardhat-gas-reporter": "^1.0.2",
diff --git a/test/instance.ts b/test/instance.ts
index 03090137..ee307d9d 100644
--- a/test/instance.ts
+++ b/test/instance.ts
@@ -1,5 +1,13 @@
-import { clientKeyDecryptor, createInstance as createFhevmInstance, getCiphertextCallParams } from 'fhevmjs';
+import dotenv from 'dotenv';
+import {
+ clientKeyDecryptor,
+ createEIP712,
+ createInstance as createFhevmInstance,
+ generateKeypair,
+ getCiphertextCallParams,
+} from 'fhevmjs';
import { readFileSync } from 'fs';
+import * as fs from 'fs';
import { ethers, ethers as hethers, network } from 'hardhat';
import { homedir } from 'os';
import path from 'path';
@@ -13,13 +21,17 @@ const FHE_CLIENT_KEY_PATH = process.env.FHE_CLIENT_KEY_PATH;
let clientKey: Uint8Array | undefined;
+const kmsAdd = dotenv.parse(fs.readFileSync('lib/.env.kmsverifier')).KMS_VERIFIER_CONTRACT_ADDRESS;
+const aclAdd = dotenv.parse(fs.readFileSync('lib/.env.acl')).ACL_CONTRACT_ADDRESS;
+
const createInstanceMocked = async () => {
- const instance = await createFhevmInstance({
- chainId: network.config.chainId,
- });
- instance.reencrypt = reencryptRequestMocked;
- instance.createEncryptedInput = createEncryptedInputMocked;
- instance.getPublicKey = () => '0xFFAA44433';
+ const instance = {
+ reencrypt: reencryptRequestMocked,
+ createEncryptedInput: createEncryptedInputMocked,
+ getPublicKey: () => '0xFFAA44433',
+ generateKeypair: generateKeypair,
+ createEIP712: createEIP712(network.config.chainId),
+ };
return instance;
};
@@ -43,7 +55,10 @@ export const createInstances = async (accounts: Signers): Promise {
+ console.log('net url:', network.config.url);
const instance = await createFhevmInstance({
+ kmsContractAddress: kmsAdd,
+ aclContractAddress: aclAdd,
networkUrl: network.config.url,
gatewayUrl: 'http://localhost:7077',
});
From 4a4dfacb442e1111ddea3fea6ed77b99f8bdfaf9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20=27birdy=27=20Danjou?=
Date: Fri, 11 Oct 2024 00:19:33 +0200
Subject: [PATCH 43/51] docs: update docs for fhevmjs
---
docs/fundamentals/inputs.md | 7 ++++++-
docs/guides/reencryption.md | 7 ++++---
docs/guides/webapp.md | 2 ++
docs/guides/webpack.md | 13 ++++++++++---
docs/references/fhevmjs.md | 25 ++++++++++++++++++-------
5 files changed, 40 insertions(+), 14 deletions(-)
diff --git a/docs/fundamentals/inputs.md b/docs/fundamentals/inputs.md
index e24fa7d0..1b6cf548 100644
--- a/docs/fundamentals/inputs.md
+++ b/docs/fundamentals/inputs.md
@@ -32,7 +32,12 @@ function myExample(
On client side, you can interact with the the previous function using [fhevmjs](https://github.com/zama-ai/fhevmjs). Here's an example:
```javascript
-const instance = await createInstance({ networkUrl: "http://localhost:8545" });
+const instance = await createInstance({
+ kmsContractAddress: "0x208De73316E44722e16f6dDFF40881A3e4F86104",
+ aclContractAddress: "0xc9990FEfE0c27D31D0C2aa36196b085c0c4d456c",
+ networkUrl: "https://devnet.zama.ai/",
+ gatewayUrl: "https://gateway.zama.ai/",
+});
const input = instance.createEncryptedInput(contractAddress, userAddress);
const inputs = input.add64(64).addBool(true).add8(4).encrypt(); // Encrypt the three parameters
diff --git a/docs/guides/reencryption.md b/docs/guides/reencryption.md
index 4de62097..10dca3fb 100644
--- a/docs/guides/reencryption.md
+++ b/docs/guides/reencryption.md
@@ -39,9 +39,10 @@ const USER_ADDRESS = accounts[0];
// Create a fhevmjs instance using the Zama's network and the Zama's Gateway
const instance = await createInstance({
- chainId: 8009,
- networkUrl: "https://devnet.zama.ai",
- gatewayUrl: "https://gateway.zama.ai",
+ kmsContractAddress: "0x208De73316E44722e16f6dDFF40881A3e4F86104",
+ aclContractAddress: "0xc9990FEfE0c27D31D0C2aa36196b085c0c4d456c",
+ networkUrl: "https://devnet.zama.ai/",
+ gatewayUrl: "https://gateway.zama.ai/",
});
// Generate the private and public key, used for the reencryption
diff --git a/docs/guides/webapp.md b/docs/guides/webapp.md
index 212b9688..f91daa7f 100644
--- a/docs/guides/webapp.md
+++ b/docs/guides/webapp.md
@@ -66,6 +66,8 @@ import { initFhevm, createInstance } from "fhevmjs";
const init = async () => {
await initFhevm(); // Load TFHE
return createInstance({
+ kmsContractAddress: "0x208De73316E44722e16f6dDFF40881A3e4F86104",
+ aclContractAddress: "0xc9990FEfE0c27D31D0C2aa36196b085c0c4d456c",
network: window.ethereum,
gatewayUrl: "https://gateway.zama.ai/",
});
diff --git a/docs/guides/webpack.md b/docs/guides/webpack.md
index a034532c..3ab7563a 100644
--- a/docs/guides/webpack.md
+++ b/docs/guides/webpack.md
@@ -48,8 +48,15 @@ If you have an issue with bundling the library (for example with some SSR framew
```javascript
const start = async () => {
await window.fhevm.initFhevm(); // load wasm needed
- const instance = window.fhevm.createInstance({ chainId, publicKey }).then((instance) => {
- console.log(instance);
- });
+ const instance = window.fhevm
+ .createInstance({
+ kmsContractAddress: "0x208De73316E44722e16f6dDFF40881A3e4F86104",
+ aclContractAddress: "0xc9990FEfE0c27D31D0C2aa36196b085c0c4d456c",
+ network: window.ethereum,
+ gatewayUrl: "https://gateway.zama.ai/",
+ })
+ .then((instance) => {
+ console.log(instance);
+ });
};
```
diff --git a/docs/references/fhevmjs.md b/docs/references/fhevmjs.md
index b8298db0..e2e37722 100644
--- a/docs/references/fhevmjs.md
+++ b/docs/references/fhevmjs.md
@@ -14,7 +14,8 @@ import { initFhevm, createInstance } from "fhevmjs";
initFhevm().then(() => {
const instance = await createInstance({
- chainId: 8009,
+ kmsContractAddress: '0x208De73316E44722e16f6dDFF40881A3e4F86104',
+ aclContractAddress: '0xc9990FEfE0c27D31D0C2aa36196b085c0c4d456c',
networkUrl: "https://devnet.zama.ai/",
gatewayUrl: "https://gateway.zama.ai/",
});
@@ -25,17 +26,20 @@ initFhevm().then(() => {
This function returns an instance of fhevmjs, which accepts an object containing:
+- `kmsContractAddress`: the address of the KMSVerifier contract;
+- `aclContractAddress`: the address of the ACL contract;
+- `networkUrl` or `network`: the URL or Eip1193 object provided by `window.ethereum` - used to fetch chainId and KMS nodes' public key
+- `gatewayUrl`: the URL of the gateway - used to retrieve the public key, ZKPoK public parameters and send inputs and get reencryption
- `chainId` (optional): the chainId of the network
-- `network` (optional): the Eip1193 object provided by `window.ethereum` (used to fetch the public key and/or chain id)
-- `networkUrl` (optional): the URL of the network (used to fetch the public key and/or chain id)
-- `publicKey` (optional): if the public key has been fetched separately (cache), you can provide it
-- `gatewayUrl` (optional): the URL of the gateway to retrieve a reencryption
-- `coprocessorUrl` (optional): the URL of the coprocessor
+- `publicKey` (optional): if the public key has been fetched separately or stored in cache, you can provide it
+- `publicParams` (optional): if the public params has been fetched separately or stored in cache, you can provide it
```javascript
import { createInstance } from "fhevmjs";
const instance = await createInstance({
+ kmsContractAddress: "0x208De73316E44722e16f6dDFF40881A3e4F86104",
+ aclContractAddress: "0xc9990FEfE0c27D31D0C2aa36196b085c0c4d456c",
networkUrl: "https://devnet.zama.ai/",
gatewayUrl: "https://gateway.zama.ai/",
});
@@ -47,6 +51,8 @@ Using `window.ethereum` object:
import { createInstance } from "fhevmjs";
const instance = await createInstance({
+ kmsContractAddress: "0x208De73316E44722e16f6dDFF40881A3e4F86104",
+ aclContractAddress: "0xc9990FEfE0c27D31D0C2aa36196b085c0c4d456c",
network: window.ethereum,
gatewayUrl: "https://gateway.zama.ai/",
});
@@ -74,6 +80,11 @@ Input object has different method to add values:
- `add16`
- `add32`
- `add64`
+- `add128`
+- `add256`
+- `addBytes64`
+- `addBytes128`
+- `addBytes256`
- `addAddress`
```javascript
@@ -93,7 +104,7 @@ These methods process values and return the necessary data for use on the blockc
input.addBool(true);
input.addBool(true);
input.add8(4);
-const inputs = input.encrypt(); // or input.send() if using a coprocessor
+const inputs = await input.encrypt(); // or input.send() if using a coprocessor
contract.myExample(
"0xa5e1defb98EFe38EBb2D958CEe052410247F4c80",
From 45e860d577dd6a6391fb5e01d353b0741da139f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Thu, 10 Oct 2024 16:07:42 +0200
Subject: [PATCH 44/51] feat: updated TFHEExecutor to support new types
chore: eq-neq bool support and bitwise scalar support
chore: overloads for fheEq and fheNe
fix: reverts onchain when rhs is 0 in fheDiv-fheRem
feat: added support for scalar and,or,xor
chore: cleanup codegen
feat: adds euint128 and euint256 types
chore: removes ebool fheRandBounded and adds manual tests
feat: adds new types for fheRand
feat: adds trivialEncrypt for ebytesXXX
feat: adds fheEq fheNe ifThenElse for new types
chore: rename asyncDecrypt() to initGateway()
---
codegen/common.ts | 21 +-
codegen/generateOverloads.ts | 5 +-
codegen/main.ts | 9 +-
codegen/operatorsPrices.json | 183 +-
codegen/overloads.json | 8108 +++++++++++++++++-----
codegen/payments.ts | 20 +-
codegen/templates.ts | 481 +-
codegen/testgen.ts | 16 +-
docs/guides/decrypt.md | 10 +-
examples/Rand.sol | 59 +-
examples/Reencrypt.sol | 36 +-
examples/TestAsyncDecrypt.sol | 99 +-
examples/tests/TFHEManualTestSuite.sol | 253 +
examples/tests/TFHETestSuite1.sol | 222 +-
examples/tests/TFHETestSuite10.sol | 650 ++
examples/tests/TFHETestSuite11.sol | 440 ++
examples/tests/TFHETestSuite2.sol | 688 +-
examples/tests/TFHETestSuite3.sol | 808 +--
examples/tests/TFHETestSuite4.sol | 676 +-
examples/tests/TFHETestSuite5.sol | 866 ++-
examples/tests/TFHETestSuite6.sol | 634 +-
examples/tests/TFHETestSuite7.sol | 650 ++
examples/tests/TFHETestSuite8.sol | 650 ++
examples/tests/TFHETestSuite9.sol | 650 ++
gateway/GatewayContract.sol | 4 +-
gateway/lib/Gateway.sol | 16 +
lib/FHEPayment.sol | 472 +-
lib/Impl.sol | 57 +-
lib/TFHE.sol | 8396 ++++++++++++++++++-----
lib/TFHEExecutor.sol | 189 +-
test/asyncDecrypt.ts | 18 +-
test/coprocessorUtils.ts | 49 +
test/gatewayDecrypt/testAsyncDecrypt.ts | 122 +-
test/instance.ts | 90 +
test/kmsVerifier/kmsVerifier.ts | 4 +-
test/rand/Rand.ts | 196 +-
test/reencryption/reencryption.ts | 104 +-
test/tfheOperations/manual.ts | 642 ++
test/tfheOperations/tfheOperations1.ts | 3032 ++++++--
test/tfheOperations/tfheOperations10.ts | 4566 ++++++++----
test/tfheOperations/tfheOperations11.ts | 4606 +++++++++----
test/tfheOperations/tfheOperations12.ts | 3684 +++++++---
test/tfheOperations/tfheOperations13.ts | 221 +
test/tfheOperations/tfheOperations2.ts | 4290 +++++++++---
test/tfheOperations/tfheOperations3.ts | 4344 +++++++++---
test/tfheOperations/tfheOperations4.ts | 4292 +++++++++---
test/tfheOperations/tfheOperations5.ts | 4540 ++++++++----
test/tfheOperations/tfheOperations6.ts | 4520 +++++++++---
test/tfheOperations/tfheOperations7.ts | 4692 ++++++++++---
test/tfheOperations/tfheOperations8.ts | 4480 +++++++++---
test/tfheOperations/tfheOperations9.ts | 4666 +++++++++----
51 files changed, 60523 insertions(+), 18003 deletions(-)
create mode 100644 examples/tests/TFHETestSuite10.sol
create mode 100644 examples/tests/TFHETestSuite11.sol
create mode 100644 examples/tests/TFHETestSuite7.sol
create mode 100644 examples/tests/TFHETestSuite8.sol
create mode 100644 examples/tests/TFHETestSuite9.sol
create mode 100644 test/tfheOperations/tfheOperations13.ts
diff --git a/codegen/common.ts b/codegen/common.ts
index 269081d7..3c40fb65 100644
--- a/codegen/common.ts
+++ b/codegen/common.ts
@@ -39,7 +39,7 @@ export enum ReturnType {
Ebool,
}
-export const SUPPORTED_BITS: number[] = [4, 8, 16, 32, 64];
+export const SUPPORTED_BITS: number[] = [4, 8, 16, 32, 64, 128, 256];
export const ALL_OPERATORS: Operator[] = [
{
@@ -91,7 +91,7 @@ export const ALL_OPERATORS: Operator[] = [
{
name: 'and',
precompileName: 'BitwiseAnd',
- hasScalar: false,
+ hasScalar: true,
hasEncrypted: true,
arguments: OperatorArguments.Binary,
returnType: ReturnType.Uint,
@@ -101,7 +101,7 @@ export const ALL_OPERATORS: Operator[] = [
{
name: 'or',
precompileName: 'BitwiseOr',
- hasScalar: false,
+ hasScalar: true,
hasEncrypted: true,
arguments: OperatorArguments.Binary,
returnType: ReturnType.Uint,
@@ -111,7 +111,7 @@ export const ALL_OPERATORS: Operator[] = [
{
name: 'xor',
precompileName: 'BitwiseXor',
- hasScalar: false,
+ hasScalar: true,
hasEncrypted: true,
arguments: OperatorArguments.Binary,
returnType: ReturnType.Uint,
@@ -260,16 +260,3 @@ export function checks(operators: Operator[]): Operator[] {
return operators;
}
-
-export function networkCodegenContext(network: Network): CodegenContext {
- switch (network) {
- case Network.Evmos:
- return {
- libFheAddress: '0x000000000000000000000000000000000000005d',
- };
- case Network.Network1:
- return {
- libFheAddress: '0x010000000000000000000000000000000000005D',
- };
- }
-}
diff --git a/codegen/generateOverloads.ts b/codegen/generateOverloads.ts
index cc925a5d..48689280 100644
--- a/codegen/generateOverloads.ts
+++ b/codegen/generateOverloads.ts
@@ -33,7 +33,7 @@ type SupportedFunction = SupportedFunctionParams &
};
const SUPPORTED_UINT = [8, 16, 32, 64, 128, 256];
-const SUPPORTED_BITS = [4, 8, 16, 32, 64];
+const SUPPORTED_BITS = [4, 8, 16, 32, 64, 128, 256];
const bigIntMin = (...args: bigint[]) => {
return args.reduce((min, e) => (e < min ? e : min), args[0]);
@@ -183,17 +183,14 @@ export const SUPPORTED_FUNCTIONS: SupportedFunctions = {
},
or: {
supportedBits: SUPPORTED_BITS,
- noScalar: true,
evalTest: (lhsNumber, rhsNumber) => lhsNumber | rhsNumber,
},
and: {
supportedBits: SUPPORTED_BITS,
- noScalar: true,
evalTest: (lhsNumber, rhsNumber) => lhsNumber & rhsNumber,
},
xor: {
supportedBits: SUPPORTED_BITS,
- noScalar: true,
evalTest: (lhsNumber, rhsNumber) => lhsNumber ^ rhsNumber,
},
not: {
diff --git a/codegen/main.ts b/codegen/main.ts
index 241c6445..05025c5c 100644
--- a/codegen/main.ts
+++ b/codegen/main.ts
@@ -1,6 +1,6 @@
import { mkdirSync, writeFileSync } from 'fs';
-import { ALL_OPERATORS, Network, SUPPORTED_BITS, checks, networkCodegenContext } from './common';
+import { ALL_OPERATORS, SUPPORTED_BITS, checks } from './common';
import operatorsPrices from './operatorsPrices.json';
import { generateFHEPayment } from './payments';
import * as t from './templates';
@@ -9,12 +9,9 @@ import * as testgen from './testgen';
function generateAllFiles() {
const numSplits = 12;
const operators = checks(ALL_OPERATORS);
-
- const network = Network[(process.env.TARGET_NETWORK as keyof typeof Network) || 'Evmos'];
- const context = networkCodegenContext(network);
- const [tfheSolSource, overloads] = t.tfheSol(context, operators, SUPPORTED_BITS, false);
+ const [tfheSolSource, overloads] = t.tfheSol(operators, SUPPORTED_BITS, false);
const ovShards = testgen.splitOverloadsToShards(overloads);
- writeFileSync('lib/Impl.sol', t.implSol(context, operators));
+ writeFileSync('lib/Impl.sol', t.implSol(operators));
writeFileSync('lib/TFHE.sol', tfheSolSource);
writeFileSync('lib/FHEPayment.sol', generateFHEPayment(operatorsPrices));
writeFileSync('payment/Payment.sol', t.paymentSol());
diff --git a/codegen/operatorsPrices.json b/codegen/operatorsPrices.json
index 3d61844e..d7f31a6f 100644
--- a/codegen/operatorsPrices.json
+++ b/codegen/operatorsPrices.json
@@ -1,119 +1,218 @@
{
"fheAdd": {
"binary": true,
- "scalar": { "1": 65000, "2": 94000, "3": 133000, "4": 162000, "5": 188000 },
- "nonScalar": { "1": 65000, "2": 94000, "3": 133000, "4": 162000, "5": 188000 }
+ "scalar": { "1": 65000, "2": 94000, "3": 133000, "4": 162000, "5": 188000, "6": 218000, "8": 253000 },
+ "nonScalar": { "1": 65000, "2": 94000, "3": 133000, "4": 162000, "5": 188000, "6": 218000, "8": 253000 }
},
"fheSub": {
"binary": true,
- "scalar": { "1": 65000, "2": 94000, "3": 133000, "4": 162000, "5": 188000 },
- "nonScalar": { "1": 65000, "2": 94000, "3": 133000, "4": 162000, "5": 188000 }
+ "scalar": { "1": 65000, "2": 94000, "3": 133000, "4": 162000, "5": 188000, "6": 218000, "8": 253000 },
+ "nonScalar": { "1": 65000, "2": 94000, "3": 133000, "4": 162000, "5": 188000, "6": 218000, "8": 253000 }
},
"fheMul": {
"binary": true,
- "scalar": { "1": 88000, "2": 159000, "3": 208000, "4": 264000, "5": 356000 },
- "nonScalar": { "1": 150000, "2": 197000, "3": 262000, "4": 359000, "5": 641000 }
+ "scalar": { "1": 88000, "2": 159000, "3": 208000, "4": 264000, "5": 356000, "6": 480000, "8": 647000 },
+ "nonScalar": { "1": 150000, "2": 197000, "3": 262000, "4": 359000, "5": 641000, "6": 1145000, "8": 2045000 }
+ },
+ "fheDiv": {
+ "binary": true,
+ "scalar": { "1": 139000, "2": 238000, "3": 314000, "4": 398000, "5": 584000, "6": 857000, "8": 1258000 }
+ },
+ "fheRem": {
+ "binary": true,
+ "scalar": { "1": 286000, "2": 460000, "3": 622000, "4": 805000, "5": 1095000, "6": 1499000, "8": 2052000 }
},
- "fheDiv": { "binary": true, "scalar": { "1": 139000, "2": 238000, "3": 314000, "4": 398000, "5": 584000 } },
- "fheRem": { "binary": true, "scalar": { "1": 286000, "2": 460000, "3": 622000, "4": 805000, "5": 1095000 } },
"fheBitAnd": {
"binary": true,
- "nonScalar": { "0": 26000, "1": 32000, "2": 34000, "3": 34000, "4": 35000, "5": 38000 }
+ "scalar": { "0": 26000, "1": 32000, "2": 34000, "3": 34000, "4": 35000, "5": 38000, "6": 41000, "8": 44000 },
+ "nonScalar": { "0": 26000, "1": 32000, "2": 34000, "3": 34000, "4": 35000, "5": 38000, "6": 41000, "8": 44000 }
},
"fheBitOr": {
"binary": true,
- "nonScalar": { "0": 26000, "1": 32000, "2": 34000, "3": 34000, "4": 35000, "5": 38000 }
+ "scalar": { "0": 26000, "1": 32000, "2": 34000, "3": 34000, "4": 35000, "5": 38000, "6": 41000, "8": 44000 },
+ "nonScalar": { "0": 26000, "1": 32000, "2": 34000, "3": 34000, "4": 35000, "5": 38000, "6": 41000, "8": 44000 }
},
"fheBitXor": {
"binary": true,
- "nonScalar": { "0": 26000, "1": 32000, "2": 34000, "3": 34000, "4": 35000, "5": 38000 }
+ "scalar": { "0": 26000, "1": 32000, "2": 34000, "3": 34000, "4": 35000, "5": 38000, "6": 41000, "8": 44000 },
+ "nonScalar": { "0": 26000, "1": 32000, "2": 34000, "3": 34000, "4": 35000, "5": 38000, "6": 41000, "8": 44000 }
},
"fheShl": {
"binary": true,
- "scalar": { "1": 35000, "2": 35000, "3": 35000, "4": 35000, "5": 38000 },
- "nonScalar": { "1": 116000, "2": 133000, "3": 153000, "4": 183000, "5": 227000 }
+ "scalar": { "1": 35000, "2": 35000, "3": 35000, "4": 35000, "5": 38000, "6": 41000, "8": 44000 },
+ "nonScalar": { "1": 116000, "2": 133000, "3": 153000, "4": 183000, "5": 227000, "6": 282000, "8": 350000 }
},
"fheShr": {
"binary": true,
- "scalar": { "1": 35000, "2": 35000, "3": 35000, "4": 35000, "5": 38000 },
- "nonScalar": { "1": 116000, "2": 133000, "3": 153000, "4": 183000, "5": 227000 }
+ "scalar": { "1": 35000, "2": 35000, "3": 35000, "4": 35000, "5": 38000, "6": 41000, "8": 44000 },
+ "nonScalar": { "1": 116000, "2": 133000, "3": 153000, "4": 183000, "5": 227000, "6": 282000, "8": 350000 }
},
"fheRotl": {
"binary": true,
- "scalar": { "1": 35000, "2": 35000, "3": 35000, "4": 35000, "5": 38000 },
- "nonScalar": { "1": 116000, "2": 133000, "3": 153000, "4": 183000, "5": 227000 }
+ "scalar": { "1": 35000, "2": 35000, "3": 35000, "4": 35000, "5": 38000, "6": 41000, "8": 44000 },
+ "nonScalar": { "1": 116000, "2": 133000, "3": 153000, "4": 183000, "5": 227000, "6": 282000, "8": 350000 }
},
"fheRotr": {
"binary": true,
- "scalar": { "1": 35000, "2": 35000, "3": 35000, "4": 35000, "5": 38000 },
- "nonScalar": { "1": 116000, "2": 133000, "3": 153000, "4": 183000, "5": 227000 }
+ "scalar": { "1": 35000, "2": 35000, "3": 35000, "4": 35000, "5": 38000, "6": 41000, "8": 44000 },
+ "nonScalar": { "1": 116000, "2": 133000, "3": 153000, "4": 183000, "5": 227000, "6": 282000, "8": 350000 }
},
"fheEq": {
"binary": true,
- "scalar": { "1": 51000, "2": 53000, "3": 54000, "4": 82000, "5": 86000, "7": 90000, "11": 300000 },
- "nonScalar": { "1": 51000, "2": 53000, "3": 54000, "4": 82000, "5": 86000, "7": 90000, "11": 300000 }
+ "scalar": {
+ "0": 49000,
+ "1": 51000,
+ "2": 53000,
+ "3": 54000,
+ "4": 82000,
+ "5": 86000,
+ "6": 88000,
+ "7": 90000,
+ "8": 100000,
+ "9": 150000,
+ "10": 200000,
+ "11": 300000
+ },
+ "nonScalar": {
+ "0": 49000,
+ "1": 51000,
+ "2": 53000,
+ "3": 54000,
+ "4": 82000,
+ "5": 86000,
+ "6": 88000,
+ "7": 90000,
+ "8": 100000,
+ "9": 150000,
+ "10": 200000,
+ "11": 300000
+ }
},
"fheNe": {
"binary": true,
- "scalar": { "1": 51000, "2": 53000, "3": 54000, "4": 82000, "5": 86000, "7": 90000, "11": 300000 },
- "nonScalar": { "1": 51000, "2": 53000, "3": 54000, "4": 82000, "5": 86000, "7": 90000, "11": 300000 }
+ "scalar": {
+ "0": 49000,
+ "1": 51000,
+ "2": 53000,
+ "3": 54000,
+ "4": 82000,
+ "5": 86000,
+ "6": 88000,
+ "7": 90000,
+ "8": 100000,
+ "9": 150000,
+ "10": 200000,
+ "11": 300000
+ },
+ "nonScalar": {
+ "0": 49000,
+ "1": 51000,
+ "2": 53000,
+ "3": 54000,
+ "4": 82000,
+ "5": 86000,
+ "6": 88000,
+ "7": 90000,
+ "8": 100000,
+ "9": 150000,
+ "10": 200000,
+ "11": 300000
+ }
},
"fheGe": {
"binary": true,
- "scalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000 },
- "nonScalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000 }
+ "scalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000, "6": 190000, "8": 231000 },
+ "nonScalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000, "6": 190000, "8": 231000 }
},
"fheGt": {
"binary": true,
- "scalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000 },
- "nonScalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000 }
+ "scalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000, "6": 190000, "8": 231000 },
+ "nonScalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000, "6": 190000, "8": 231000 }
},
"fheLe": {
"binary": true,
- "scalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000 },
- "nonScalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000 }
+ "scalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000, "6": 190000, "8": 231000 },
+ "nonScalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000, "6": 190000, "8": 231000 }
},
"fheLt": {
"binary": true,
- "scalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000 },
- "nonScalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000 }
+ "scalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000, "6": 190000, "8": 231000 },
+ "nonScalar": { "1": 70000, "2": 82000, "3": 105000, "4": 128000, "5": 156000, "6": 190000, "8": 231000 }
},
"fheMin": {
"binary": true,
- "scalar": { "1": 121000, "2": 128000, "3": 150000, "4": 164000, "5": 192000 },
- "nonScalar": { "1": 121000, "2": 128000, "3": 153000, "4": 183000, "5": 210000 }
+ "scalar": { "1": 121000, "2": 128000, "3": 150000, "4": 164000, "5": 192000, "6": 225000, "8": 264000 },
+ "nonScalar": { "1": 121000, "2": 128000, "3": 153000, "4": 183000, "5": 210000, "6": 241000, "8": 277000 }
},
"fheMax": {
"binary": true,
- "scalar": { "1": 121000, "2": 128000, "3": 150000, "4": 164000, "5": 192000 },
- "nonScalar": { "1": 121000, "2": 128000, "3": 153000, "4": 183000, "5": 210000 }
+ "scalar": { "1": 121000, "2": 128000, "3": 150000, "4": 164000, "5": 192000, "6": 225000, "8": 264000 },
+ "nonScalar": { "1": 121000, "2": 128000, "3": 153000, "4": 183000, "5": 210000, "6": 241000, "8": 277000 }
},
"fheNeg": {
"binary": false,
- "types": { "1": 60000, "2": 95000, "3": 131000, "4": 160000, "5": 199000 }
+ "types": { "1": 60000, "2": 95000, "3": 131000, "4": 160000, "5": 199000, "6": 248000, "8": 309000 }
},
"fheNot": {
"binary": false,
- "types": { "0": 30000, "1": 33000, "2": 34000, "3": 35000, "4": 36000, "5": 37000 }
+ "types": { "0": 30000, "1": 33000, "2": 34000, "3": 35000, "4": 36000, "5": 37000, "6": 38000, "8": 39000 }
},
"cast": {
"binary": false,
- "types": { "1": 200, "2": 200, "3": 200, "4": 200, "5": 200 }
+ "types": { "0": 200, "1": 200, "2": 200, "3": 200, "4": 200, "5": 200, "6": 200, "8": 200 }
},
"trivialEncrypt": {
"binary": false,
- "types": { "0": 100, "1": 100, "2": 100, "3": 200, "4": 300, "5": 600, "7": 700 }
+ "types": {
+ "0": 100,
+ "1": 100,
+ "2": 100,
+ "3": 200,
+ "4": 300,
+ "5": 600,
+ "6": 650,
+ "7": 700,
+ "8": 800,
+ "9": 1600,
+ "10": 3200,
+ "11": 6400
+ }
},
"ifThenElse": {
"binary": false,
- "types": { "1": 45000, "2": 47000, "3": 47000, "4": 50000, "5": 53000, "7": 80000 }
+ "types": {
+ "0": 43000,
+ "1": 45000,
+ "2": 47000,
+ "3": 47000,
+ "4": 50000,
+ "5": 53000,
+ "6": 70000,
+ "7": 80000,
+ "8": 90000,
+ "9": 150000,
+ "10": 200000,
+ "11": 300000
+ }
},
"fheRand": {
"binary": false,
- "types": { "2": 100000, "3": 100000, "4": 100000, "5": 100000 }
+ "types": {
+ "0": 100000,
+ "1": 100000,
+ "2": 100000,
+ "3": 100000,
+ "4": 100000,
+ "5": 100000,
+ "6": 100000,
+ "8": 100000,
+ "9": 200000,
+ "10": 300000,
+ "11": 400000
+ }
},
"fheRandBounded": {
"binary": false,
- "types": { "2": 100000, "3": 100000, "4": 100000, "5": 100000 }
+ "types": { "1": 100000, "2": 100000, "3": 100000, "4": 100000, "5": 100000, "6": 100000, "8": 100000 }
}
}
diff --git a/codegen/overloads.json b/codegen/overloads.json
index 3e8ea336..d810199d 100644
--- a/codegen/overloads.json
+++ b/codegen/overloads.json
@@ -1,87 +1,111 @@
{
"add_euint4_euint4": [
- { "inputs": ["3", "2"], "output": "5" },
+ { "inputs": ["2", "7"], "output": "9" },
{ "inputs": ["4", "8"], "output": "12" },
{ "inputs": ["5", "5"], "output": "10" },
{ "inputs": ["8", "4"], "output": "12" }
],
"add_euint4_euint8": [
- { "inputs": ["1", "9"], "output": "10" },
- { "inputs": ["4", "8"], "output": "12" },
+ { "inputs": ["2", "10"], "output": "12" },
+ { "inputs": ["5", "9"], "output": "14" },
{ "inputs": ["5", "5"], "output": "10" },
- { "inputs": ["8", "4"], "output": "12" }
+ { "inputs": ["9", "5"], "output": "14" }
],
"add_euint4_uint8": [
- { "inputs": ["1", "1"], "output": "2" },
- { "inputs": ["4", "8"], "output": "12" },
+ { "inputs": ["9", "2"], "output": "11" },
+ { "inputs": ["5", "9"], "output": "14" },
{ "inputs": ["5", "5"], "output": "10" },
- { "inputs": ["8", "4"], "output": "12" }
+ { "inputs": ["9", "5"], "output": "14" }
],
"add_euint4_euint16": [
- { "inputs": ["2", "13"], "output": "15" },
+ { "inputs": ["2", "9"], "output": "11" },
+ { "inputs": ["6", "8"], "output": "14" },
+ { "inputs": ["5", "5"], "output": "10" },
+ { "inputs": ["8", "6"], "output": "14" }
+ ],
+ "add_euint4_euint32": [
+ { "inputs": ["2", "9"], "output": "11" },
+ { "inputs": ["4", "6"], "output": "10" },
+ { "inputs": ["6", "6"], "output": "12" },
+ { "inputs": ["6", "4"], "output": "10" }
+ ],
+ "add_euint4_euint64": [
+ { "inputs": ["1", "9"], "output": "10" },
{ "inputs": ["4", "8"], "output": "12" },
{ "inputs": ["5", "5"], "output": "10" },
{ "inputs": ["8", "4"], "output": "12" }
],
- "add_euint4_euint32": [
- { "inputs": ["2", "8"], "output": "10" },
+ "add_euint4_euint128": [
+ { "inputs": ["2", "9"], "output": "11" },
{ "inputs": ["4", "8"], "output": "12" },
{ "inputs": ["5", "5"], "output": "10" },
{ "inputs": ["8", "4"], "output": "12" }
],
- "add_euint4_euint64": [
+ "add_euint4_euint256": [
{ "inputs": ["2", "9"], "output": "11" },
- { "inputs": ["6", "8"], "output": "14" },
+ { "inputs": ["4", "8"], "output": "12" },
{ "inputs": ["5", "5"], "output": "10" },
- { "inputs": ["8", "6"], "output": "14" }
+ { "inputs": ["8", "4"], "output": "12" }
],
"add_euint8_euint4": [
{ "inputs": ["10", "2"], "output": "12" },
- { "inputs": ["4", "8"], "output": "12" },
+ { "inputs": ["5", "9"], "output": "14" },
{ "inputs": ["5", "5"], "output": "10" },
- { "inputs": ["8", "4"], "output": "12" }
+ { "inputs": ["9", "5"], "output": "14" }
],
"add_uint8_euint4": [
- { "inputs": ["1", "2"], "output": "3" },
- { "inputs": ["4", "8"], "output": "12" },
+ { "inputs": ["6", "9"], "output": "15" },
+ { "inputs": ["5", "9"], "output": "14" },
{ "inputs": ["5", "5"], "output": "10" },
- { "inputs": ["8", "4"], "output": "12" }
+ { "inputs": ["9", "5"], "output": "14" }
],
"add_euint8_euint8": [
- { "inputs": ["56", "89"], "output": "145" },
- { "inputs": ["52", "56"], "output": "108" },
- { "inputs": ["56", "56"], "output": "112" },
- { "inputs": ["56", "52"], "output": "108" }
+ { "inputs": ["219", "18"], "output": "237" },
+ { "inputs": ["14", "18"], "output": "32" },
+ { "inputs": ["18", "18"], "output": "36" },
+ { "inputs": ["18", "14"], "output": "32" }
],
"add_euint8_uint8": [
- { "inputs": ["56", "11"], "output": "67" },
- { "inputs": ["52", "56"], "output": "108" },
- { "inputs": ["56", "56"], "output": "112" },
- { "inputs": ["56", "52"], "output": "108" }
+ { "inputs": ["110", "64"], "output": "174" },
+ { "inputs": ["14", "18"], "output": "32" },
+ { "inputs": ["18", "18"], "output": "36" },
+ { "inputs": ["18", "14"], "output": "32" }
],
"add_uint8_euint8": [
- { "inputs": ["69", "11"], "output": "80" },
- { "inputs": ["52", "56"], "output": "108" },
- { "inputs": ["56", "56"], "output": "112" },
- { "inputs": ["56", "52"], "output": "108" }
+ { "inputs": ["52", "126"], "output": "178" },
+ { "inputs": ["14", "18"], "output": "32" },
+ { "inputs": ["18", "18"], "output": "36" },
+ { "inputs": ["18", "14"], "output": "32" }
],
"add_euint8_euint16": [
- { "inputs": ["2", "246"], "output": "248" },
- { "inputs": ["104", "106"], "output": "210" },
- { "inputs": ["106", "106"], "output": "212" },
- { "inputs": ["106", "104"], "output": "210" }
+ { "inputs": ["2", "132"], "output": "134" },
+ { "inputs": ["4", "8"], "output": "12" },
+ { "inputs": ["8", "8"], "output": "16" },
+ { "inputs": ["8", "4"], "output": "12" }
],
"add_euint8_euint32": [
- { "inputs": ["2", "131"], "output": "133" },
- { "inputs": ["88", "92"], "output": "180" },
- { "inputs": ["92", "92"], "output": "184" },
- { "inputs": ["92", "88"], "output": "180" }
+ { "inputs": ["2", "251"], "output": "253" },
+ { "inputs": ["59", "63"], "output": "122" },
+ { "inputs": ["63", "63"], "output": "126" },
+ { "inputs": ["63", "59"], "output": "122" }
],
"add_euint8_euint64": [
{ "inputs": ["2", "129"], "output": "131" },
- { "inputs": ["12", "16"], "output": "28" },
- { "inputs": ["16", "16"], "output": "32" },
- { "inputs": ["16", "12"], "output": "28" }
+ { "inputs": ["87", "91"], "output": "178" },
+ { "inputs": ["91", "91"], "output": "182" },
+ { "inputs": ["91", "87"], "output": "178" }
+ ],
+ "add_euint8_euint128": [
+ { "inputs": ["2", "129"], "output": "131" },
+ { "inputs": ["16", "20"], "output": "36" },
+ { "inputs": ["20", "20"], "output": "40" },
+ { "inputs": ["20", "16"], "output": "36" }
+ ],
+ "add_euint8_euint256": [
+ { "inputs": ["2", "129"], "output": "131" },
+ { "inputs": ["82", "86"], "output": "168" },
+ { "inputs": ["86", "86"], "output": "172" },
+ { "inputs": ["86", "82"], "output": "168" }
],
"add_euint16_euint4": [
{ "inputs": ["8", "2"], "output": "10" },
@@ -90,432 +114,898 @@
{ "inputs": ["8", "4"], "output": "12" }
],
"add_euint16_euint8": [
- { "inputs": ["147", "3"], "output": "150" },
- { "inputs": ["116", "118"], "output": "234" },
- { "inputs": ["118", "118"], "output": "236" },
- { "inputs": ["118", "116"], "output": "234" }
+ { "inputs": ["205", "2"], "output": "207" },
+ { "inputs": ["90", "94"], "output": "184" },
+ { "inputs": ["94", "94"], "output": "188" },
+ { "inputs": ["94", "90"], "output": "184" }
],
"add_euint16_euint16": [
- { "inputs": ["12135", "15379"], "output": "27514" },
- { "inputs": ["12131", "12135"], "output": "24266" },
- { "inputs": ["12135", "12135"], "output": "24270" },
- { "inputs": ["12135", "12131"], "output": "24266" }
+ { "inputs": ["26028", "36322"], "output": "62350" },
+ { "inputs": ["26024", "26028"], "output": "52052" },
+ { "inputs": ["26028", "26028"], "output": "52056" },
+ { "inputs": ["26028", "26024"], "output": "52052" }
],
"add_euint16_uint16": [
- { "inputs": ["12135", "52126"], "output": "64261" },
- { "inputs": ["12131", "12135"], "output": "24266" },
- { "inputs": ["12135", "12135"], "output": "24270" },
- { "inputs": ["12135", "12131"], "output": "24266" }
+ { "inputs": ["26028", "15417"], "output": "41445" },
+ { "inputs": ["26024", "26028"], "output": "52052" },
+ { "inputs": ["26028", "26028"], "output": "52056" },
+ { "inputs": ["26028", "26024"], "output": "52052" }
],
"add_uint16_euint16": [
- { "inputs": ["12140", "26064"], "output": "38204" },
- { "inputs": ["12131", "12135"], "output": "24266" },
- { "inputs": ["12135", "12135"], "output": "24270" },
- { "inputs": ["12135", "12131"], "output": "24266" }
+ { "inputs": ["22897", "15417"], "output": "38314" },
+ { "inputs": ["26024", "26028"], "output": "52052" },
+ { "inputs": ["26028", "26028"], "output": "52056" },
+ { "inputs": ["26028", "26024"], "output": "52052" }
],
"add_euint16_euint32": [
- { "inputs": ["2", "40496"], "output": "40498" },
- { "inputs": ["18317", "18319"], "output": "36636" },
- { "inputs": ["18319", "18319"], "output": "36638" },
- { "inputs": ["18319", "18317"], "output": "36636" }
+ { "inputs": ["2", "52896"], "output": "52898" },
+ { "inputs": ["19184", "19188"], "output": "38372" },
+ { "inputs": ["19188", "19188"], "output": "38376" },
+ { "inputs": ["19188", "19184"], "output": "38372" }
],
"add_euint16_euint64": [
{ "inputs": ["2", "65506"], "output": "65508" },
- { "inputs": ["12725", "12729"], "output": "25454" },
- { "inputs": ["12729", "12729"], "output": "25458" },
- { "inputs": ["12729", "12725"], "output": "25454" }
+ { "inputs": ["32347", "32349"], "output": "64696" },
+ { "inputs": ["32349", "32349"], "output": "64698" },
+ { "inputs": ["32349", "32347"], "output": "64696" }
+ ],
+ "add_euint16_euint128": [
+ { "inputs": ["2", "32769"], "output": "32771" },
+ { "inputs": ["25454", "25456"], "output": "50910" },
+ { "inputs": ["25456", "25456"], "output": "50912" },
+ { "inputs": ["25456", "25454"], "output": "50910" }
+ ],
+ "add_euint16_euint256": [
+ { "inputs": ["2", "32769"], "output": "32771" },
+ { "inputs": ["20019", "20021"], "output": "40040" },
+ { "inputs": ["20021", "20021"], "output": "40042" },
+ { "inputs": ["20021", "20019"], "output": "40040" }
],
"add_euint32_euint4": [
- { "inputs": ["12", "2"], "output": "14" },
- { "inputs": ["4", "6"], "output": "10" },
- { "inputs": ["6", "6"], "output": "12" },
- { "inputs": ["6", "4"], "output": "10" }
+ { "inputs": ["10", "1"], "output": "11" },
+ { "inputs": ["4", "8"], "output": "12" },
+ { "inputs": ["5", "5"], "output": "10" },
+ { "inputs": ["8", "4"], "output": "12" }
],
"add_euint32_euint8": [
- { "inputs": ["153", "2"], "output": "155" },
- { "inputs": ["123", "125"], "output": "248" },
- { "inputs": ["125", "125"], "output": "250" },
- { "inputs": ["125", "123"], "output": "248" }
+ { "inputs": ["129", "2"], "output": "131" },
+ { "inputs": ["79", "81"], "output": "160" },
+ { "inputs": ["81", "81"], "output": "162" },
+ { "inputs": ["81", "79"], "output": "160" }
],
"add_euint32_euint16": [
- { "inputs": ["62662", "2"], "output": "62664" },
- { "inputs": ["19188", "19190"], "output": "38378" },
- { "inputs": ["19190", "19190"], "output": "38380" },
- { "inputs": ["19190", "19188"], "output": "38378" }
+ { "inputs": ["35595", "11"], "output": "35606" },
+ { "inputs": ["18477", "18479"], "output": "36956" },
+ { "inputs": ["18479", "18479"], "output": "36958" },
+ { "inputs": ["18479", "18477"], "output": "36956" }
],
"add_euint32_euint32": [
- { "inputs": ["451501910", "1802073207"], "output": "2253575117" },
- { "inputs": ["903003814", "903003818"], "output": "1806007632" },
- { "inputs": ["903003818", "903003818"], "output": "1806007636" },
- { "inputs": ["903003818", "903003814"], "output": "1806007632" }
+ { "inputs": ["1855544902", "1743021443"], "output": "3598566345" },
+ { "inputs": ["1743021441", "1743021443"], "output": "3486042884" },
+ { "inputs": ["1743021443", "1743021443"], "output": "3486042886" },
+ { "inputs": ["1743021443", "1743021441"], "output": "3486042884" }
],
"add_euint32_uint32": [
- { "inputs": ["451501910", "2087738652"], "output": "2539240562" },
- { "inputs": ["903003814", "903003818"], "output": "1806007632" },
- { "inputs": ["903003818", "903003818"], "output": "1806007636" },
- { "inputs": ["903003818", "903003814"], "output": "1806007632" }
+ { "inputs": ["1855544902", "749023821"], "output": "2604568723" },
+ { "inputs": ["1743021441", "1743021443"], "output": "3486042884" },
+ { "inputs": ["1743021443", "1743021443"], "output": "3486042886" },
+ { "inputs": ["1743021443", "1743021441"], "output": "3486042884" }
],
"add_uint32_euint32": [
- { "inputs": ["823987277", "2087738652"], "output": "2911725929" },
- { "inputs": ["903003814", "903003818"], "output": "1806007632" },
- { "inputs": ["903003818", "903003818"], "output": "1806007636" },
- { "inputs": ["903003818", "903003814"], "output": "1806007632" }
+ { "inputs": ["1745146365", "1498047640"], "output": "3243194005" },
+ { "inputs": ["1743021441", "1743021443"], "output": "3486042884" },
+ { "inputs": ["1743021443", "1743021443"], "output": "3486042886" },
+ { "inputs": ["1743021443", "1743021441"], "output": "3486042884" }
],
"add_euint32_euint64": [
- { "inputs": ["2", "4294200415"], "output": "4294200417" },
- { "inputs": ["184177949", "184177953"], "output": "368355902" },
- { "inputs": ["184177953", "184177953"], "output": "368355906" },
- { "inputs": ["184177953", "184177949"], "output": "368355902" }
+ { "inputs": ["2", "4294187631"], "output": "4294187633" },
+ { "inputs": ["1977492101", "1977492105"], "output": "3954984206" },
+ { "inputs": ["1977492105", "1977492105"], "output": "3954984210" },
+ { "inputs": ["1977492105", "1977492101"], "output": "3954984206" }
+ ],
+ "add_euint32_euint128": [
+ { "inputs": ["2", "2147483649"], "output": "2147483651" },
+ { "inputs": ["788156404", "788156408"], "output": "1576312812" },
+ { "inputs": ["788156408", "788156408"], "output": "1576312816" },
+ { "inputs": ["788156408", "788156404"], "output": "1576312812" }
+ ],
+ "add_euint32_euint256": [
+ { "inputs": ["2", "2147483649"], "output": "2147483651" },
+ { "inputs": ["1370548128", "1370548130"], "output": "2741096258" },
+ { "inputs": ["1370548130", "1370548130"], "output": "2741096260" },
+ { "inputs": ["1370548130", "1370548128"], "output": "2741096258" }
],
"add_euint64_euint4": [
{ "inputs": ["9", "2"], "output": "11" },
- { "inputs": ["4", "8"], "output": "12" },
- { "inputs": ["5", "5"], "output": "10" },
- { "inputs": ["8", "4"], "output": "12" }
+ { "inputs": ["5", "7"], "output": "12" },
+ { "inputs": ["7", "7"], "output": "14" },
+ { "inputs": ["7", "5"], "output": "12" }
],
"add_euint64_euint8": [
{ "inputs": ["129", "2"], "output": "131" },
- { "inputs": ["89", "91"], "output": "180" },
- { "inputs": ["91", "91"], "output": "182" },
- { "inputs": ["91", "89"], "output": "180" }
+ { "inputs": ["66", "70"], "output": "136" },
+ { "inputs": ["70", "70"], "output": "140" },
+ { "inputs": ["70", "66"], "output": "136" }
],
"add_euint64_euint16": [
- { "inputs": ["65527", "2"], "output": "65529" },
- { "inputs": ["22102", "22104"], "output": "44206" },
- { "inputs": ["22104", "22104"], "output": "44208" },
- { "inputs": ["22104", "22102"], "output": "44206" }
+ { "inputs": ["65532", "2"], "output": "65534" },
+ { "inputs": ["23004", "23006"], "output": "46010" },
+ { "inputs": ["23006", "23006"], "output": "46012" },
+ { "inputs": ["23006", "23004"], "output": "46010" }
],
"add_euint64_euint32": [
- { "inputs": ["4293751578", "2"], "output": "4293751580" },
- { "inputs": ["1806019599", "1806019601"], "output": "3612039200" },
- { "inputs": ["1806019601", "1806019601"], "output": "3612039202" },
- { "inputs": ["1806019601", "1806019599"], "output": "3612039200" }
+ { "inputs": ["4294529095", "2"], "output": "4294529097" },
+ { "inputs": ["1772669097", "1772669099"], "output": "3545338196" },
+ { "inputs": ["1772669099", "1772669099"], "output": "3545338198" },
+ { "inputs": ["1772669099", "1772669097"], "output": "3545338196" }
],
"add_euint64_euint64": [
- { "inputs": ["9219336648067240893", "9223239842705786428"], "output": "18442576490773027321" },
- { "inputs": ["9219336648067240891", "9219336648067240893"], "output": "18438673296134481784" },
- { "inputs": ["9219336648067240893", "9219336648067240893"], "output": "18438673296134481786" },
- { "inputs": ["9219336648067240893", "9219336648067240891"], "output": "18438673296134481784" }
+ { "inputs": ["9222005500490563257", "9222323180954998973"], "output": "18444328681445562230" },
+ { "inputs": ["9222005500490563255", "9222005500490563257"], "output": "18444011000981126512" },
+ { "inputs": ["9222005500490563257", "9222005500490563257"], "output": "18444011000981126514" },
+ { "inputs": ["9222005500490563257", "9222005500490563255"], "output": "18444011000981126512" }
],
"add_euint64_uint64": [
- { "inputs": ["9219336648067240893", "9219865027937887870"], "output": "18439201676005128763" },
- { "inputs": ["9219336648067240891", "9219336648067240893"], "output": "18438673296134481784" },
- { "inputs": ["9219336648067240893", "9219336648067240893"], "output": "18438673296134481786" },
- { "inputs": ["9219336648067240893", "9219336648067240891"], "output": "18438673296134481784" }
+ { "inputs": ["9222005500490563257", "9221821229831123671"], "output": "18443826730321686928" },
+ { "inputs": ["9222005500490563255", "9222005500490563257"], "output": "18444011000981126512" },
+ { "inputs": ["9222005500490563257", "9222005500490563257"], "output": "18444011000981126514" },
+ { "inputs": ["9222005500490563257", "9222005500490563255"], "output": "18444011000981126512" }
],
"add_uint64_euint64": [
- { "inputs": ["9221821645145019755", "9219865027937887870"], "output": "18441686673082907625" },
- { "inputs": ["9219336648067240891", "9219336648067240893"], "output": "18438673296134481784" },
- { "inputs": ["9219336648067240893", "9219336648067240893"], "output": "18438673296134481786" },
- { "inputs": ["9219336648067240893", "9219336648067240891"], "output": "18438673296134481784" }
+ { "inputs": ["9221960957990697049", "9221821229831123671"], "output": "18443782187821820720" },
+ { "inputs": ["9222005500490563255", "9222005500490563257"], "output": "18444011000981126512" },
+ { "inputs": ["9222005500490563257", "9222005500490563257"], "output": "18444011000981126514" },
+ { "inputs": ["9222005500490563257", "9222005500490563255"], "output": "18444011000981126512" }
+ ],
+ "add_euint64_euint128": [
+ { "inputs": ["2", "9223372036854775809"], "output": "9223372036854775811" },
+ { "inputs": ["9220019285142748118", "9220019285142748120"], "output": "18440038570285496238" },
+ { "inputs": ["9220019285142748120", "9220019285142748120"], "output": "18440038570285496240" },
+ { "inputs": ["9220019285142748120", "9220019285142748118"], "output": "18440038570285496238" }
+ ],
+ "add_euint64_euint256": [
+ { "inputs": ["2", "9223372036854775809"], "output": "9223372036854775811" },
+ { "inputs": ["9223002406300982591", "9223002406300982593"], "output": "18446004812601965184" },
+ { "inputs": ["9223002406300982593", "9223002406300982593"], "output": "18446004812601965186" },
+ { "inputs": ["9223002406300982593", "9223002406300982591"], "output": "18446004812601965184" }
+ ],
+ "add_euint128_euint4": [
+ { "inputs": ["9", "2"], "output": "11" },
+ { "inputs": ["4", "8"], "output": "12" },
+ { "inputs": ["5", "5"], "output": "10" },
+ { "inputs": ["8", "4"], "output": "12" }
+ ],
+ "add_euint128_euint8": [
+ { "inputs": ["129", "2"], "output": "131" },
+ { "inputs": ["118", "120"], "output": "238" },
+ { "inputs": ["120", "120"], "output": "240" },
+ { "inputs": ["120", "118"], "output": "238" }
+ ],
+ "add_euint128_euint16": [
+ { "inputs": ["32769", "2"], "output": "32771" },
+ { "inputs": ["31253", "31255"], "output": "62508" },
+ { "inputs": ["31255", "31255"], "output": "62510" },
+ { "inputs": ["31255", "31253"], "output": "62508" }
+ ],
+ "add_euint128_euint32": [
+ { "inputs": ["2147483649", "2"], "output": "2147483651" },
+ { "inputs": ["417384794", "417384798"], "output": "834769592" },
+ { "inputs": ["417384798", "417384798"], "output": "834769596" },
+ { "inputs": ["417384798", "417384794"], "output": "834769592" }
+ ],
+ "add_euint128_euint64": [
+ { "inputs": ["9223372036854775809", "2"], "output": "9223372036854775811" },
+ { "inputs": ["9219789077213425563", "9219789077213425565"], "output": "18439578154426851128" },
+ { "inputs": ["9219789077213425565", "9219789077213425565"], "output": "18439578154426851130" },
+ { "inputs": ["9219789077213425565", "9219789077213425563"], "output": "18439578154426851128" }
+ ],
+ "add_euint128_euint128": [
+ {
+ "inputs": ["170141183460469231731685489259224150459", "170141183460469231731686328709125723252"],
+ "output": "340282366920938463463371817968349873711"
+ },
+ {
+ "inputs": ["170141183460469231731685489259224150457", "170141183460469231731685489259224150459"],
+ "output": "340282366920938463463370978518448300916"
+ },
+ {
+ "inputs": ["170141183460469231731685489259224150459", "170141183460469231731685489259224150459"],
+ "output": "340282366920938463463370978518448300918"
+ },
+ {
+ "inputs": ["170141183460469231731685489259224150459", "170141183460469231731685489259224150457"],
+ "output": "340282366920938463463370978518448300916"
+ }
+ ],
+ "add_euint128_uint128": [
+ {
+ "inputs": ["170141183460469231731685489259224150459", "170141183460469231731685023392215721043"],
+ "output": "340282366920938463463370512651439871502"
+ },
+ {
+ "inputs": ["170141183460469231731685489259224150457", "170141183460469231731685489259224150459"],
+ "output": "340282366920938463463370978518448300916"
+ },
+ {
+ "inputs": ["170141183460469231731685489259224150459", "170141183460469231731685489259224150459"],
+ "output": "340282366920938463463370978518448300918"
+ },
+ {
+ "inputs": ["170141183460469231731685489259224150459", "170141183460469231731685489259224150457"],
+ "output": "340282366920938463463370978518448300916"
+ }
+ ],
+ "add_uint128_euint128": [
+ {
+ "inputs": ["170141183460469231731685837916615726593", "170141183460469231731685023392215721043"],
+ "output": "340282366920938463463370861308831447636"
+ },
+ {
+ "inputs": ["170141183460469231731685489259224150457", "170141183460469231731685489259224150459"],
+ "output": "340282366920938463463370978518448300916"
+ },
+ {
+ "inputs": ["170141183460469231731685489259224150459", "170141183460469231731685489259224150459"],
+ "output": "340282366920938463463370978518448300918"
+ },
+ {
+ "inputs": ["170141183460469231731685489259224150459", "170141183460469231731685489259224150457"],
+ "output": "340282366920938463463370978518448300916"
+ }
+ ],
+ "add_euint128_euint256": [
+ { "inputs": ["2", "170141183460469231731687303715884105729"], "output": "170141183460469231731687303715884105731" },
+ {
+ "inputs": ["170141183460469231731686007573348351546", "170141183460469231731686007573348351548"],
+ "output": "340282366920938463463372015146696703094"
+ },
+ {
+ "inputs": ["170141183460469231731686007573348351548", "170141183460469231731686007573348351548"],
+ "output": "340282366920938463463372015146696703096"
+ },
+ {
+ "inputs": ["170141183460469231731686007573348351548", "170141183460469231731686007573348351546"],
+ "output": "340282366920938463463372015146696703094"
+ }
+ ],
+ "add_euint256_euint4": [
+ { "inputs": ["9", "2"], "output": "11" },
+ { "inputs": ["6", "8"], "output": "14" },
+ { "inputs": ["5", "5"], "output": "10" },
+ { "inputs": ["8", "6"], "output": "14" }
+ ],
+ "add_euint256_euint8": [
+ { "inputs": ["129", "2"], "output": "131" },
+ { "inputs": ["101", "103"], "output": "204" },
+ { "inputs": ["103", "103"], "output": "206" },
+ { "inputs": ["103", "101"], "output": "204" }
+ ],
+ "add_euint256_euint16": [
+ { "inputs": ["32769", "2"], "output": "32771" },
+ { "inputs": ["18590", "18592"], "output": "37182" },
+ { "inputs": ["18592", "18592"], "output": "37184" },
+ { "inputs": ["18592", "18590"], "output": "37182" }
+ ],
+ "add_euint256_euint32": [
+ { "inputs": ["2147483649", "2"], "output": "2147483651" },
+ { "inputs": ["1298573356", "1298573358"], "output": "2597146714" },
+ { "inputs": ["1298573358", "1298573358"], "output": "2597146716" },
+ { "inputs": ["1298573358", "1298573356"], "output": "2597146714" }
+ ],
+ "add_euint256_euint64": [
+ { "inputs": ["9223372036854775809", "2"], "output": "9223372036854775811" },
+ { "inputs": ["9220748041203345234", "9220748041203345236"], "output": "18441496082406690470" },
+ { "inputs": ["9220748041203345236", "9220748041203345236"], "output": "18441496082406690472" },
+ { "inputs": ["9220748041203345236", "9220748041203345234"], "output": "18441496082406690470" }
+ ],
+ "add_euint256_euint128": [
+ { "inputs": ["170141183460469231731687303715884105729", "2"], "output": "170141183460469231731687303715884105731" },
+ {
+ "inputs": ["170141183460469231731684278054029333276", "170141183460469231731684278054029333278"],
+ "output": "340282366920938463463368556108058666554"
+ },
+ {
+ "inputs": ["170141183460469231731684278054029333278", "170141183460469231731684278054029333278"],
+ "output": "340282366920938463463368556108058666556"
+ },
+ {
+ "inputs": ["170141183460469231731684278054029333278", "170141183460469231731684278054029333276"],
+ "output": "340282366920938463463368556108058666554"
+ }
+ ],
+ "add_euint256_euint256": [
+ {
+ "inputs": [
+ "57896044618658097711785492504343953926634992332820282019728789013802824080146",
+ "57896044618658097711785492504343953926634992332820282019728788109485910742180"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577123288734822326"
+ },
+ {
+ "inputs": [
+ "57896044618658097711785492504343953926634992332820282019728788109485910742178",
+ "57896044618658097711785492504343953926634992332820282019728788109485910742180"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457576218971821484358"
+ },
+ {
+ "inputs": [
+ "57896044618658097711785492504343953926634992332820282019728788109485910742180",
+ "57896044618658097711785492504343953926634992332820282019728788109485910742180"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457576218971821484360"
+ },
+ {
+ "inputs": [
+ "57896044618658097711785492504343953926634992332820282019728788109485910742180",
+ "57896044618658097711785492504343953926634992332820282019728788109485910742178"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457576218971821484358"
+ }
+ ],
+ "add_euint256_uint256": [
+ {
+ "inputs": [
+ "57896044618658097711785492504343953926634992332820282019728789013802824080146",
+ "57896044618658097711785492504343953926634992332820282019728788733583887971237"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577747386712051383"
+ },
+ {
+ "inputs": [
+ "57896044618658097711785492504343953926634992332820282019728788109485910742178",
+ "57896044618658097711785492504343953926634992332820282019728788109485910742180"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457576218971821484358"
+ },
+ {
+ "inputs": [
+ "57896044618658097711785492504343953926634992332820282019728788109485910742180",
+ "57896044618658097711785492504343953926634992332820282019728788109485910742180"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457576218971821484360"
+ },
+ {
+ "inputs": [
+ "57896044618658097711785492504343953926634992332820282019728788109485910742180",
+ "57896044618658097711785492504343953926634992332820282019728788109485910742178"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457576218971821484358"
+ }
+ ],
+ "add_uint256_euint256": [
+ {
+ "inputs": [
+ "57896044618658097711785492504343953926634992332820282019728789372175656948236",
+ "57896044618658097711785492504343953926634992332820282019728788733583887971237"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457578105759544919473"
+ },
+ {
+ "inputs": [
+ "57896044618658097711785492504343953926634992332820282019728788109485910742178",
+ "57896044618658097711785492504343953926634992332820282019728788109485910742180"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457576218971821484358"
+ },
+ {
+ "inputs": [
+ "57896044618658097711785492504343953926634992332820282019728788109485910742180",
+ "57896044618658097711785492504343953926634992332820282019728788109485910742180"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457576218971821484360"
+ },
+ {
+ "inputs": [
+ "57896044618658097711785492504343953926634992332820282019728788109485910742180",
+ "57896044618658097711785492504343953926634992332820282019728788109485910742178"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457576218971821484358"
+ }
],
"sub_euint4_euint4": [
{ "inputs": ["8", "8"], "output": "0" },
{ "inputs": ["8", "4"], "output": "4" }
],
"sub_euint4_euint8": [
- { "inputs": ["10", "10"], "output": "0" },
- { "inputs": ["10", "6"], "output": "4" }
+ { "inputs": ["8", "8"], "output": "0" },
+ { "inputs": ["8", "4"], "output": "4" }
],
"sub_euint4_uint8": [
- { "inputs": ["10", "10"], "output": "0" },
- { "inputs": ["10", "6"], "output": "4" }
+ { "inputs": ["8", "8"], "output": "0" },
+ { "inputs": ["8", "4"], "output": "4" }
],
"sub_euint4_euint16": [
- { "inputs": ["11", "11"], "output": "0" },
- { "inputs": ["11", "7"], "output": "4" }
+ { "inputs": ["13", "13"], "output": "0" },
+ { "inputs": ["13", "9"], "output": "4" }
],
"sub_euint4_euint32": [
- { "inputs": ["8", "8"], "output": "0" },
- { "inputs": ["8", "4"], "output": "4" }
+ { "inputs": ["13", "13"], "output": "0" },
+ { "inputs": ["13", "9"], "output": "4" }
],
"sub_euint4_euint64": [
- { "inputs": ["8", "8"], "output": "0" },
- { "inputs": ["8", "4"], "output": "4" }
+ { "inputs": ["12", "12"], "output": "0" },
+ { "inputs": ["12", "8"], "output": "4" }
+ ],
+ "sub_euint4_euint128": [
+ { "inputs": ["13", "13"], "output": "0" },
+ { "inputs": ["13", "9"], "output": "4" }
+ ],
+ "sub_euint4_euint256": [
+ { "inputs": ["14", "14"], "output": "0" },
+ { "inputs": ["14", "10"], "output": "4" }
],
"sub_euint8_euint4": [
- { "inputs": ["9", "9"], "output": "0" },
- { "inputs": ["9", "5"], "output": "4" }
+ { "inputs": ["14", "14"], "output": "0" },
+ { "inputs": ["14", "10"], "output": "4" }
],
"sub_uint8_euint4": [
- { "inputs": ["9", "9"], "output": "0" },
- { "inputs": ["9", "5"], "output": "4" }
+ { "inputs": ["14", "14"], "output": "0" },
+ { "inputs": ["14", "10"], "output": "4" }
],
"sub_euint8_euint8": [
- { "inputs": ["64", "64"], "output": "0" },
- { "inputs": ["64", "60"], "output": "4" }
+ { "inputs": ["152", "152"], "output": "0" },
+ { "inputs": ["152", "148"], "output": "4" }
],
"sub_euint8_uint8": [
- { "inputs": ["64", "64"], "output": "0" },
- { "inputs": ["64", "60"], "output": "4" }
+ { "inputs": ["152", "152"], "output": "0" },
+ { "inputs": ["152", "148"], "output": "4" }
],
"sub_uint8_euint8": [
- { "inputs": ["64", "64"], "output": "0" },
- { "inputs": ["64", "60"], "output": "4" }
+ { "inputs": ["152", "152"], "output": "0" },
+ { "inputs": ["152", "148"], "output": "4" }
],
"sub_euint8_euint16": [
- { "inputs": ["17", "17"], "output": "0" },
- { "inputs": ["17", "13"], "output": "4" }
+ { "inputs": ["32", "32"], "output": "0" },
+ { "inputs": ["32", "28"], "output": "4" }
],
"sub_euint8_euint32": [
- { "inputs": ["10", "10"], "output": "0" },
- { "inputs": ["10", "6"], "output": "4" }
+ { "inputs": ["102", "102"], "output": "0" },
+ { "inputs": ["102", "98"], "output": "4" }
],
"sub_euint8_euint64": [
- { "inputs": ["15", "15"], "output": "0" },
- { "inputs": ["15", "11"], "output": "4" }
+ { "inputs": ["8", "8"], "output": "0" },
+ { "inputs": ["8", "4"], "output": "4" }
+ ],
+ "sub_euint8_euint128": [
+ { "inputs": ["157", "157"], "output": "0" },
+ { "inputs": ["157", "153"], "output": "4" }
+ ],
+ "sub_euint8_euint256": [
+ { "inputs": ["224", "224"], "output": "0" },
+ { "inputs": ["224", "220"], "output": "4" }
],
"sub_euint16_euint4": [
{ "inputs": ["14", "14"], "output": "0" },
{ "inputs": ["14", "10"], "output": "4" }
],
"sub_euint16_euint8": [
- { "inputs": ["143", "143"], "output": "0" },
- { "inputs": ["143", "139"], "output": "4" }
+ { "inputs": ["195", "195"], "output": "0" },
+ { "inputs": ["195", "191"], "output": "4" }
],
"sub_euint16_euint16": [
- { "inputs": ["3171", "3171"], "output": "0" },
- { "inputs": ["3171", "3167"], "output": "4" }
+ { "inputs": ["14486", "14486"], "output": "0" },
+ { "inputs": ["14486", "14482"], "output": "4" }
],
"sub_euint16_uint16": [
- { "inputs": ["3171", "3171"], "output": "0" },
- { "inputs": ["3171", "3167"], "output": "4" }
+ { "inputs": ["14486", "14486"], "output": "0" },
+ { "inputs": ["14486", "14482"], "output": "4" }
],
"sub_uint16_euint16": [
- { "inputs": ["3171", "3171"], "output": "0" },
- { "inputs": ["3171", "3167"], "output": "4" }
+ { "inputs": ["14486", "14486"], "output": "0" },
+ { "inputs": ["14486", "14482"], "output": "4" }
],
"sub_euint16_euint32": [
- { "inputs": ["17812", "17812"], "output": "0" },
- { "inputs": ["17812", "17808"], "output": "4" }
+ { "inputs": ["32818", "32818"], "output": "0" },
+ { "inputs": ["32818", "32814"], "output": "4" }
],
"sub_euint16_euint64": [
- { "inputs": ["45021", "45021"], "output": "0" },
- { "inputs": ["45021", "45017"], "output": "4" }
+ { "inputs": ["12596", "12596"], "output": "0" },
+ { "inputs": ["12596", "12592"], "output": "4" }
+ ],
+ "sub_euint16_euint128": [
+ { "inputs": ["45485", "45485"], "output": "0" },
+ { "inputs": ["45485", "45481"], "output": "4" }
+ ],
+ "sub_euint16_euint256": [
+ { "inputs": ["40273", "40273"], "output": "0" },
+ { "inputs": ["40273", "40269"], "output": "4" }
],
"sub_euint32_euint4": [
{ "inputs": ["8", "8"], "output": "0" },
{ "inputs": ["8", "4"], "output": "4" }
],
"sub_euint32_euint8": [
- { "inputs": ["52", "52"], "output": "0" },
- { "inputs": ["52", "48"], "output": "4" }
+ { "inputs": ["69", "69"], "output": "0" },
+ { "inputs": ["69", "65"], "output": "4" }
],
"sub_euint32_euint16": [
- { "inputs": ["35686", "35686"], "output": "0" },
- { "inputs": ["35686", "35682"], "output": "4" }
+ { "inputs": ["18922", "18922"], "output": "0" },
+ { "inputs": ["18922", "18918"], "output": "4" }
],
"sub_euint32_euint32": [
- { "inputs": ["296156690", "296156690"], "output": "0" },
- { "inputs": ["296156690", "296156686"], "output": "4" }
+ { "inputs": ["1818111464", "1818111464"], "output": "0" },
+ { "inputs": ["1818111464", "1818111460"], "output": "4" }
],
"sub_euint32_uint32": [
- { "inputs": ["296156690", "296156690"], "output": "0" },
- { "inputs": ["296156690", "296156686"], "output": "4" }
+ { "inputs": ["1818111464", "1818111464"], "output": "0" },
+ { "inputs": ["1818111464", "1818111460"], "output": "4" }
],
"sub_uint32_euint32": [
- { "inputs": ["296156690", "296156690"], "output": "0" },
- { "inputs": ["296156690", "296156686"], "output": "4" }
+ { "inputs": ["1818111464", "1818111464"], "output": "0" },
+ { "inputs": ["1818111464", "1818111460"], "output": "4" }
],
"sub_euint32_euint64": [
- { "inputs": ["2163998221", "2163998221"], "output": "0" },
- { "inputs": ["2163998221", "2163998217"], "output": "4" }
+ { "inputs": ["2880371585", "2880371585"], "output": "0" },
+ { "inputs": ["2880371585", "2880371581"], "output": "4" }
+ ],
+ "sub_euint32_euint128": [
+ { "inputs": ["3561141951", "3561141951"], "output": "0" },
+ { "inputs": ["3561141951", "3561141947"], "output": "4" }
+ ],
+ "sub_euint32_euint256": [
+ { "inputs": ["3022897647", "3022897647"], "output": "0" },
+ { "inputs": ["3022897647", "3022897643"], "output": "4" }
],
"sub_euint64_euint4": [
- { "inputs": ["10", "10"], "output": "0" },
- { "inputs": ["10", "6"], "output": "4" }
+ { "inputs": ["8", "8"], "output": "0" },
+ { "inputs": ["8", "4"], "output": "4" }
],
"sub_euint64_euint8": [
- { "inputs": ["25", "25"], "output": "0" },
- { "inputs": ["25", "21"], "output": "4" }
+ { "inputs": ["117", "117"], "output": "0" },
+ { "inputs": ["117", "113"], "output": "4" }
],
"sub_euint64_euint16": [
- { "inputs": ["45502", "45502"], "output": "0" },
- { "inputs": ["45502", "45498"], "output": "4" }
+ { "inputs": ["54317", "54317"], "output": "0" },
+ { "inputs": ["54317", "54313"], "output": "4" }
],
"sub_euint64_euint32": [
- { "inputs": ["3425308729", "3425308729"], "output": "0" },
- { "inputs": ["3425308729", "3425308725"], "output": "4" }
+ { "inputs": ["148706478", "148706478"], "output": "0" },
+ { "inputs": ["148706478", "148706474"], "output": "4" }
],
"sub_euint64_euint64": [
- { "inputs": ["18442295292010752223", "18442295292010752223"], "output": "0" },
- { "inputs": ["18442295292010752223", "18442295292010752219"], "output": "4" }
+ { "inputs": ["18440691834306324731", "18440691834306324731"], "output": "0" },
+ { "inputs": ["18440691834306324731", "18440691834306324727"], "output": "4" }
],
"sub_euint64_uint64": [
- { "inputs": ["18442295292010752223", "18442295292010752223"], "output": "0" },
- { "inputs": ["18442295292010752223", "18442295292010752219"], "output": "4" }
+ { "inputs": ["18440691834306324731", "18440691834306324731"], "output": "0" },
+ { "inputs": ["18440691834306324731", "18440691834306324727"], "output": "4" }
],
"sub_uint64_euint64": [
- { "inputs": ["18442295292010752223", "18442295292010752223"], "output": "0" },
- { "inputs": ["18442295292010752223", "18442295292010752219"], "output": "4" }
+ { "inputs": ["18440691834306324731", "18440691834306324731"], "output": "0" },
+ { "inputs": ["18440691834306324731", "18440691834306324727"], "output": "4" }
+ ],
+ "sub_euint64_euint128": [
+ { "inputs": ["18445847707614326699", "18445847707614326699"], "output": "0" },
+ { "inputs": ["18445847707614326699", "18445847707614326695"], "output": "4" }
+ ],
+ "sub_euint64_euint256": [
+ { "inputs": ["18445224051732608013", "18445224051732608013"], "output": "0" },
+ { "inputs": ["18445224051732608013", "18445224051732608009"], "output": "4" }
+ ],
+ "sub_euint128_euint4": [
+ { "inputs": ["8", "8"], "output": "0" },
+ { "inputs": ["8", "4"], "output": "4" }
+ ],
+ "sub_euint128_euint8": [
+ { "inputs": ["232", "232"], "output": "0" },
+ { "inputs": ["232", "228"], "output": "4" }
+ ],
+ "sub_euint128_euint16": [
+ { "inputs": ["25392", "25392"], "output": "0" },
+ { "inputs": ["25392", "25388"], "output": "4" }
+ ],
+ "sub_euint128_euint32": [
+ { "inputs": ["373346389", "373346389"], "output": "0" },
+ { "inputs": ["373346389", "373346385"], "output": "4" }
+ ],
+ "sub_euint128_euint64": [
+ { "inputs": ["18441111603467904997", "18441111603467904997"], "output": "0" },
+ { "inputs": ["18441111603467904997", "18441111603467904993"], "output": "4" }
+ ],
+ "sub_euint128_euint128": [
+ { "inputs": ["340282366920938463463366688248127833841", "340282366920938463463366688248127833841"], "output": "0" },
+ { "inputs": ["340282366920938463463366688248127833841", "340282366920938463463366688248127833837"], "output": "4" }
+ ],
+ "sub_euint128_uint128": [
+ { "inputs": ["340282366920938463463366688248127833841", "340282366920938463463366688248127833841"], "output": "0" },
+ { "inputs": ["340282366920938463463366688248127833841", "340282366920938463463366688248127833837"], "output": "4" }
+ ],
+ "sub_uint128_euint128": [
+ { "inputs": ["340282366920938463463366688248127833841", "340282366920938463463366688248127833841"], "output": "0" },
+ { "inputs": ["340282366920938463463366688248127833841", "340282366920938463463366688248127833837"], "output": "4" }
+ ],
+ "sub_euint128_euint256": [
+ { "inputs": ["340282366920938463463369549263218693865", "340282366920938463463369549263218693865"], "output": "0" },
+ { "inputs": ["340282366920938463463369549263218693865", "340282366920938463463369549263218693861"], "output": "4" }
+ ],
+ "sub_euint256_euint4": [
+ { "inputs": ["11", "11"], "output": "0" },
+ { "inputs": ["11", "7"], "output": "4" }
+ ],
+ "sub_euint256_euint8": [
+ { "inputs": ["234", "234"], "output": "0" },
+ { "inputs": ["234", "230"], "output": "4" }
+ ],
+ "sub_euint256_euint16": [
+ { "inputs": ["46280", "46280"], "output": "0" },
+ { "inputs": ["46280", "46276"], "output": "4" }
+ ],
+ "sub_euint256_euint32": [
+ { "inputs": ["2775500374", "2775500374"], "output": "0" },
+ { "inputs": ["2775500374", "2775500370"], "output": "4" }
+ ],
+ "sub_euint256_euint64": [
+ { "inputs": ["18445296154698553701", "18445296154698553701"], "output": "0" },
+ { "inputs": ["18445296154698553701", "18445296154698553697"], "output": "4" }
+ ],
+ "sub_euint256_euint128": [
+ { "inputs": ["340282366920938463463373776145256730539", "340282366920938463463373776145256730539"], "output": "0" },
+ { "inputs": ["340282366920938463463373776145256730539", "340282366920938463463373776145256730535"], "output": "4" }
+ ],
+ "sub_euint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579667871013646565",
+ "115792089237316195423570985008687907853269984665640564039457579667871013646565"
+ ],
+ "output": "0"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579667871013646565",
+ "115792089237316195423570985008687907853269984665640564039457579667871013646561"
+ ],
+ "output": "4"
+ }
+ ],
+ "sub_euint256_uint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579667871013646565",
+ "115792089237316195423570985008687907853269984665640564039457579667871013646565"
+ ],
+ "output": "0"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579667871013646565",
+ "115792089237316195423570985008687907853269984665640564039457579667871013646561"
+ ],
+ "output": "4"
+ }
+ ],
+ "sub_uint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579667871013646565",
+ "115792089237316195423570985008687907853269984665640564039457579667871013646565"
+ ],
+ "output": "0"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579667871013646565",
+ "115792089237316195423570985008687907853269984665640564039457579667871013646561"
+ ],
+ "output": "4"
+ }
],
"mul_euint4_euint4": [
- { "inputs": ["3", "3"], "output": "9" },
+ { "inputs": ["1", "7"], "output": "7" },
{ "inputs": ["3", "5"], "output": "15" },
{ "inputs": ["3", "3"], "output": "9" },
{ "inputs": ["5", "3"], "output": "15" }
],
"mul_euint4_euint8": [
{ "inputs": ["2", "5"], "output": "10" },
+ { "inputs": ["3", "5"], "output": "15" },
{ "inputs": ["3", "3"], "output": "9" },
- { "inputs": ["3", "3"], "output": "9" },
- { "inputs": ["3", "3"], "output": "9" }
+ { "inputs": ["5", "3"], "output": "15" }
],
"mul_euint4_uint8": [
- { "inputs": ["5", "2"], "output": "10" },
- { "inputs": ["3", "3"], "output": "9" },
+ { "inputs": ["3", "4"], "output": "12" },
+ { "inputs": ["3", "5"], "output": "15" },
{ "inputs": ["3", "3"], "output": "9" },
- { "inputs": ["3", "3"], "output": "9" }
+ { "inputs": ["5", "3"], "output": "15" }
],
"mul_euint4_euint16": [
- { "inputs": ["2", "5"], "output": "10" },
+ { "inputs": ["2", "6"], "output": "12" },
{ "inputs": ["3", "5"], "output": "15" },
{ "inputs": ["3", "3"], "output": "9" },
{ "inputs": ["5", "3"], "output": "15" }
],
"mul_euint4_euint32": [
+ { "inputs": ["2", "5"], "output": "10" },
+ { "inputs": ["3", "4"], "output": "12" },
+ { "inputs": ["3", "3"], "output": "9" },
+ { "inputs": ["4", "3"], "output": "12" }
+ ],
+ "mul_euint4_euint64": [
+ { "inputs": ["2", "5"], "output": "10" },
+ { "inputs": ["3", "5"], "output": "15" },
+ { "inputs": ["3", "3"], "output": "9" },
+ { "inputs": ["5", "3"], "output": "15" }
+ ],
+ "mul_euint4_euint128": [
{ "inputs": ["2", "5"], "output": "10" },
{ "inputs": ["3", "3"], "output": "9" },
{ "inputs": ["3", "3"], "output": "9" },
{ "inputs": ["3", "3"], "output": "9" }
],
- "mul_euint4_euint64": [
+ "mul_euint4_euint256": [
{ "inputs": ["2", "5"], "output": "10" },
{ "inputs": ["3", "5"], "output": "15" },
{ "inputs": ["3", "3"], "output": "9" },
{ "inputs": ["5", "3"], "output": "15" }
],
"mul_euint8_euint4": [
- { "inputs": ["5", "2"], "output": "10" },
+ { "inputs": ["7", "2"], "output": "14" },
{ "inputs": ["3", "5"], "output": "15" },
{ "inputs": ["3", "3"], "output": "9" },
{ "inputs": ["5", "3"], "output": "15" }
],
"mul_uint8_euint4": [
- { "inputs": ["3", "3"], "output": "9" },
+ { "inputs": ["2", "4"], "output": "8" },
{ "inputs": ["3", "5"], "output": "15" },
{ "inputs": ["3", "3"], "output": "9" },
{ "inputs": ["5", "3"], "output": "15" }
],
"mul_euint8_euint8": [
- { "inputs": ["14", "15"], "output": "210" },
- { "inputs": ["14", "14"], "output": "196" },
+ { "inputs": ["8", "12"], "output": "96" },
+ { "inputs": ["12", "14"], "output": "168" },
{ "inputs": ["14", "14"], "output": "196" },
- { "inputs": ["14", "14"], "output": "196" }
+ { "inputs": ["14", "12"], "output": "168" }
],
"mul_euint8_uint8": [
- { "inputs": ["8", "14"], "output": "112" },
+ { "inputs": ["14", "6"], "output": "84" },
+ { "inputs": ["12", "14"], "output": "168" },
{ "inputs": ["14", "14"], "output": "196" },
- { "inputs": ["14", "14"], "output": "196" },
- { "inputs": ["14", "14"], "output": "196" }
+ { "inputs": ["14", "12"], "output": "168" }
],
"mul_uint8_euint8": [
- { "inputs": ["8", "14"], "output": "112" },
- { "inputs": ["14", "14"], "output": "196" },
+ { "inputs": ["12", "11"], "output": "132" },
+ { "inputs": ["12", "14"], "output": "168" },
{ "inputs": ["14", "14"], "output": "196" },
- { "inputs": ["14", "14"], "output": "196" }
+ { "inputs": ["14", "12"], "output": "168" }
],
"mul_euint8_euint16": [
- { "inputs": ["2", "56"], "output": "112" },
- { "inputs": ["10", "10"], "output": "100" },
- { "inputs": ["10", "10"], "output": "100" },
- { "inputs": ["10", "10"], "output": "100" }
+ { "inputs": ["2", "60"], "output": "120" },
+ { "inputs": ["13", "13"], "output": "169" },
+ { "inputs": ["13", "13"], "output": "169" },
+ { "inputs": ["13", "13"], "output": "169" }
],
"mul_euint8_euint32": [
{ "inputs": ["2", "79"], "output": "158" },
- { "inputs": ["10", "11"], "output": "110" },
- { "inputs": ["11", "11"], "output": "121" },
- { "inputs": ["11", "10"], "output": "110" }
+ { "inputs": ["10", "14"], "output": "140" },
+ { "inputs": ["14", "14"], "output": "196" },
+ { "inputs": ["14", "10"], "output": "140" }
],
"mul_euint8_euint64": [
{ "inputs": ["2", "65"], "output": "130" },
- { "inputs": ["13", "13"], "output": "169" },
- { "inputs": ["13", "13"], "output": "169" },
- { "inputs": ["13", "13"], "output": "169" }
+ { "inputs": ["8", "10"], "output": "80" },
+ { "inputs": ["10", "10"], "output": "100" },
+ { "inputs": ["10", "8"], "output": "80" }
+ ],
+ "mul_euint8_euint128": [
+ { "inputs": ["2", "65"], "output": "130" },
+ { "inputs": ["9", "10"], "output": "90" },
+ { "inputs": ["10", "10"], "output": "100" },
+ { "inputs": ["10", "9"], "output": "90" }
+ ],
+ "mul_euint8_euint256": [
+ { "inputs": ["2", "65"], "output": "130" },
+ { "inputs": ["4", "8"], "output": "32" },
+ { "inputs": ["8", "8"], "output": "64" },
+ { "inputs": ["8", "4"], "output": "32" }
],
"mul_euint16_euint4": [
{ "inputs": ["5", "2"], "output": "10" },
- { "inputs": ["3", "4"], "output": "12" },
+ { "inputs": ["3", "5"], "output": "15" },
{ "inputs": ["3", "3"], "output": "9" },
- { "inputs": ["4", "3"], "output": "12" }
+ { "inputs": ["5", "3"], "output": "15" }
],
"mul_euint16_euint8": [
- { "inputs": ["127", "2"], "output": "254" },
- { "inputs": ["10", "10"], "output": "100" },
+ { "inputs": ["87", "2"], "output": "174" },
+ { "inputs": ["9", "10"], "output": "90" },
{ "inputs": ["10", "10"], "output": "100" },
- { "inputs": ["10", "10"], "output": "100" }
+ { "inputs": ["10", "9"], "output": "90" }
],
"mul_euint16_euint16": [
- { "inputs": ["78", "381"], "output": "29718" },
- { "inputs": ["155", "155"], "output": "24025" },
- { "inputs": ["155", "155"], "output": "24025" },
- { "inputs": ["155", "155"], "output": "24025" }
+ { "inputs": ["117", "200"], "output": "23400" },
+ { "inputs": ["233", "233"], "output": "54289" },
+ { "inputs": ["233", "233"], "output": "54289" },
+ { "inputs": ["233", "233"], "output": "54289" }
],
"mul_euint16_uint16": [
- { "inputs": ["78", "344"], "output": "26832" },
- { "inputs": ["155", "155"], "output": "24025" },
- { "inputs": ["155", "155"], "output": "24025" },
- { "inputs": ["155", "155"], "output": "24025" }
+ { "inputs": ["233", "168"], "output": "39144" },
+ { "inputs": ["233", "233"], "output": "54289" },
+ { "inputs": ["233", "233"], "output": "54289" },
+ { "inputs": ["233", "233"], "output": "54289" }
],
"mul_uint16_euint16": [
- { "inputs": ["256", "173"], "output": "44288" },
- { "inputs": ["155", "155"], "output": "24025" },
- { "inputs": ["155", "155"], "output": "24025" },
- { "inputs": ["155", "155"], "output": "24025" }
+ { "inputs": ["140", "168"], "output": "23520" },
+ { "inputs": ["233", "233"], "output": "54289" },
+ { "inputs": ["233", "233"], "output": "54289" },
+ { "inputs": ["233", "233"], "output": "54289" }
],
"mul_euint16_euint32": [
- { "inputs": ["2", "18411"], "output": "36822" },
- { "inputs": ["139", "139"], "output": "19321" },
- { "inputs": ["139", "139"], "output": "19321" },
- { "inputs": ["139", "139"], "output": "19321" }
+ { "inputs": ["2", "27164"], "output": "54328" },
+ { "inputs": ["244", "244"], "output": "59536" },
+ { "inputs": ["244", "244"], "output": "59536" },
+ { "inputs": ["244", "244"], "output": "59536" }
],
"mul_euint16_euint64": [
- { "inputs": ["2", "32761"], "output": "65522" },
- { "inputs": ["221", "221"], "output": "48841" },
- { "inputs": ["221", "221"], "output": "48841" },
- { "inputs": ["221", "221"], "output": "48841" }
+ { "inputs": ["2", "32755"], "output": "65510" },
+ { "inputs": ["216", "216"], "output": "46656" },
+ { "inputs": ["216", "216"], "output": "46656" },
+ { "inputs": ["216", "216"], "output": "46656" }
+ ],
+ "mul_euint16_euint128": [
+ { "inputs": ["2", "16385"], "output": "32770" },
+ { "inputs": ["206", "206"], "output": "42436" },
+ { "inputs": ["206", "206"], "output": "42436" },
+ { "inputs": ["206", "206"], "output": "42436" }
+ ],
+ "mul_euint16_euint256": [
+ { "inputs": ["2", "16385"], "output": "32770" },
+ { "inputs": ["228", "228"], "output": "51984" },
+ { "inputs": ["228", "228"], "output": "51984" },
+ { "inputs": ["228", "228"], "output": "51984" }
],
"mul_euint32_euint4": [
- { "inputs": ["5", "2"], "output": "10" },
- { "inputs": ["3", "3"], "output": "9" },
+ { "inputs": ["6", "2"], "output": "12" },
+ { "inputs": ["3", "5"], "output": "15" },
{ "inputs": ["3", "3"], "output": "9" },
- { "inputs": ["3", "3"], "output": "9" }
+ { "inputs": ["5", "3"], "output": "15" }
],
"mul_euint32_euint8": [
- { "inputs": ["102", "2"], "output": "204" },
- { "inputs": ["10", "12"], "output": "120" },
- { "inputs": ["12", "12"], "output": "144" },
- { "inputs": ["12", "10"], "output": "120" }
+ { "inputs": ["114", "2"], "output": "228" },
+ { "inputs": ["15", "16"], "output": "240" },
+ { "inputs": ["9", "9"], "output": "81" },
+ { "inputs": ["16", "15"], "output": "240" }
],
"mul_euint32_euint16": [
- { "inputs": ["22131", "2"], "output": "44262" },
- { "inputs": ["158", "158"], "output": "24964" },
- { "inputs": ["158", "158"], "output": "24964" },
- { "inputs": ["158", "158"], "output": "24964" }
+ { "inputs": ["30224", "2"], "output": "60448" },
+ { "inputs": ["160", "160"], "output": "25600" },
+ { "inputs": ["160", "160"], "output": "25600" },
+ { "inputs": ["160", "160"], "output": "25600" }
],
"mul_euint32_euint32": [
- { "inputs": ["54583", "21224"], "output": "1158469592" },
- { "inputs": ["42446", "42446"], "output": "1801662916" },
- { "inputs": ["42446", "42446"], "output": "1801662916" },
- { "inputs": ["42446", "42446"], "output": "1801662916" }
+ { "inputs": ["96111", "23856"], "output": "2292824016" },
+ { "inputs": ["47710", "47710"], "output": "2276244100" },
+ { "inputs": ["47710", "47710"], "output": "2276244100" },
+ { "inputs": ["47710", "47710"], "output": "2276244100" }
],
"mul_euint32_uint32": [
- { "inputs": ["54583", "52500"], "output": "2865607500" },
- { "inputs": ["42446", "42446"], "output": "1801662916" },
- { "inputs": ["42446", "42446"], "output": "1801662916" },
- { "inputs": ["42446", "42446"], "output": "1801662916" }
+ { "inputs": ["48056", "45037"], "output": "2164298072" },
+ { "inputs": ["47710", "47710"], "output": "2276244100" },
+ { "inputs": ["47710", "47710"], "output": "2276244100" },
+ { "inputs": ["47710", "47710"], "output": "2276244100" }
],
"mul_uint32_euint32": [
- { "inputs": ["39745", "104998"], "output": "4173145510" },
- { "inputs": ["42446", "42446"], "output": "1801662916" },
- { "inputs": ["42446", "42446"], "output": "1801662916" },
- { "inputs": ["42446", "42446"], "output": "1801662916" }
+ { "inputs": ["25623", "45037"], "output": "1153983051" },
+ { "inputs": ["47710", "47710"], "output": "2276244100" },
+ { "inputs": ["47710", "47710"], "output": "2276244100" },
+ { "inputs": ["47710", "47710"], "output": "2276244100" }
],
"mul_euint32_euint64": [
- { "inputs": ["2", "2146443814"], "output": "4292887628" },
- { "inputs": ["61456", "61456"], "output": "3776839936" },
- { "inputs": ["61456", "61456"], "output": "3776839936" },
- { "inputs": ["61456", "61456"], "output": "3776839936" }
+ { "inputs": ["2", "2146877501"], "output": "4293755002" },
+ { "inputs": ["43587", "43587"], "output": "1899826569" },
+ { "inputs": ["43587", "43587"], "output": "1899826569" },
+ { "inputs": ["43587", "43587"], "output": "1899826569" }
+ ],
+ "mul_euint32_euint128": [
+ { "inputs": ["2", "1073741825"], "output": "2147483650" },
+ { "inputs": ["63676", "63676"], "output": "4054632976" },
+ { "inputs": ["63676", "63676"], "output": "4054632976" },
+ { "inputs": ["63676", "63676"], "output": "4054632976" }
+ ],
+ "mul_euint32_euint256": [
+ { "inputs": ["2", "1073741825"], "output": "2147483650" },
+ { "inputs": ["59596", "59596"], "output": "3551683216" },
+ { "inputs": ["59596", "59596"], "output": "3551683216" },
+ { "inputs": ["59596", "59596"], "output": "3551683216" }
],
"mul_euint64_euint4": [
{ "inputs": ["5", "2"], "output": "10" },
@@ -525,39 +1015,195 @@
],
"mul_euint64_euint8": [
{ "inputs": ["65", "2"], "output": "130" },
- { "inputs": ["9", "10"], "output": "90" },
- { "inputs": ["10", "10"], "output": "100" },
- { "inputs": ["10", "9"], "output": "90" }
+ { "inputs": ["12", "13"], "output": "156" },
+ { "inputs": ["13", "13"], "output": "169" },
+ { "inputs": ["13", "12"], "output": "156" }
],
"mul_euint64_euint16": [
- { "inputs": ["32761", "2"], "output": "65522" },
- { "inputs": ["252", "252"], "output": "63504" },
- { "inputs": ["252", "252"], "output": "63504" },
- { "inputs": ["252", "252"], "output": "63504" }
+ { "inputs": ["32754", "2"], "output": "65508" },
+ { "inputs": ["191", "191"], "output": "36481" },
+ { "inputs": ["191", "191"], "output": "36481" },
+ { "inputs": ["191", "191"], "output": "36481" }
],
"mul_euint64_euint32": [
- { "inputs": ["2147367784", "2"], "output": "4294735568" },
- { "inputs": ["50787", "50787"], "output": "2579319369" },
- { "inputs": ["50787", "50787"], "output": "2579319369" },
- { "inputs": ["50787", "50787"], "output": "2579319369" }
+ { "inputs": ["2147463302", "2"], "output": "4294926604" },
+ { "inputs": ["62313", "62313"], "output": "3882909969" },
+ { "inputs": ["62313", "62313"], "output": "3882909969" },
+ { "inputs": ["62313", "62313"], "output": "3882909969" }
],
"mul_euint64_euint64": [
- { "inputs": ["4294744203", "4293841776"], "output": "18440952076075224528" },
- { "inputs": ["4293841776", "4293841776"], "output": "18437077197322834176" },
- { "inputs": ["4293841776", "4293841776"], "output": "18437077197322834176" },
- { "inputs": ["4293841776", "4293841776"], "output": "18437077197322834176" }
+ { "inputs": ["4294482875", "4294789499"], "output": "18443899955185329625" },
+ { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" },
+ { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" },
+ { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" }
],
"mul_euint64_uint64": [
- { "inputs": ["4294744203", "4294589707"], "output": "18444164248401718521" },
- { "inputs": ["4293841776", "4293841776"], "output": "18437077197322834176" },
- { "inputs": ["4293841776", "4293841776"], "output": "18437077197322834176" },
- { "inputs": ["4293841776", "4293841776"], "output": "18437077197322834176" }
+ { "inputs": ["4294482875", "4294108167"], "output": "18440973986579140125" },
+ { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" },
+ { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" },
+ { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" }
],
"mul_uint64_euint64": [
- { "inputs": ["4293263967", "4294589707"], "output": "18437807242112187669" },
- { "inputs": ["4293841776", "4293841776"], "output": "18437077197322834176" },
- { "inputs": ["4293841776", "4293841776"], "output": "18437077197322834176" },
- { "inputs": ["4293841776", "4293841776"], "output": "18437077197322834176" }
+ { "inputs": ["4293014414", "4294108167"], "output": "18434668256206119138" },
+ { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" },
+ { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" },
+ { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" }
+ ],
+ "mul_euint64_euint128": [
+ { "inputs": ["2", "4611686018427387905"], "output": "9223372036854775810" },
+ { "inputs": ["4293652736", "4293652736"], "output": "18435453817360285696" },
+ { "inputs": ["4293652736", "4293652736"], "output": "18435453817360285696" },
+ { "inputs": ["4293652736", "4293652736"], "output": "18435453817360285696" }
+ ],
+ "mul_euint64_euint256": [
+ { "inputs": ["2", "4611686018427387905"], "output": "9223372036854775810" },
+ { "inputs": ["4292932541", "4292932541"], "output": "18429269801576716681" },
+ { "inputs": ["4292932541", "4292932541"], "output": "18429269801576716681" },
+ { "inputs": ["4292932541", "4292932541"], "output": "18429269801576716681" }
+ ],
+ "mul_euint128_euint4": [
+ { "inputs": ["5", "2"], "output": "10" },
+ { "inputs": ["3", "4"], "output": "12" },
+ { "inputs": ["3", "3"], "output": "9" },
+ { "inputs": ["4", "3"], "output": "12" }
+ ],
+ "mul_euint128_euint8": [
+ { "inputs": ["65", "2"], "output": "130" },
+ { "inputs": ["9", "9"], "output": "81" },
+ { "inputs": ["9", "9"], "output": "81" },
+ { "inputs": ["9", "9"], "output": "81" }
+ ],
+ "mul_euint128_euint16": [
+ { "inputs": ["16385", "2"], "output": "32770" },
+ { "inputs": ["233", "233"], "output": "54289" },
+ { "inputs": ["233", "233"], "output": "54289" },
+ { "inputs": ["233", "233"], "output": "54289" }
+ ],
+ "mul_euint128_euint32": [
+ { "inputs": ["1073741825", "2"], "output": "2147483650" },
+ { "inputs": ["46331", "46331"], "output": "2146561561" },
+ { "inputs": ["46331", "46331"], "output": "2146561561" },
+ { "inputs": ["46331", "46331"], "output": "2146561561" }
+ ],
+ "mul_euint128_euint64": [
+ { "inputs": ["4611686018427387905", "2"], "output": "9223372036854775810" },
+ { "inputs": ["4294304633", "4294304633"], "output": "18441052281005264689" },
+ { "inputs": ["4294304633", "4294304633"], "output": "18441052281005264689" },
+ { "inputs": ["4294304633", "4294304633"], "output": "18441052281005264689" }
+ ],
+ "mul_euint128_euint128": [
+ { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" },
+ { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" },
+ { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" },
+ { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" }
+ ],
+ "mul_euint128_uint128": [
+ { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" },
+ { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" },
+ { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" },
+ { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" }
+ ],
+ "mul_uint128_euint128": [
+ { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" },
+ { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" },
+ { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" },
+ { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" }
+ ],
+ "mul_euint128_euint256": [
+ { "inputs": ["2", "85070591730234615865843651857942052865"], "output": "170141183460469231731687303715884105730" },
+ { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" },
+ { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" },
+ { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" }
+ ],
+ "mul_euint256_euint4": [
+ { "inputs": ["5", "2"], "output": "10" },
+ { "inputs": ["3", "5"], "output": "15" },
+ { "inputs": ["3", "3"], "output": "9" },
+ { "inputs": ["5", "3"], "output": "15" }
+ ],
+ "mul_euint256_euint8": [
+ { "inputs": ["65", "2"], "output": "130" },
+ { "inputs": ["13", "14"], "output": "182" },
+ { "inputs": ["14", "14"], "output": "196" },
+ { "inputs": ["14", "13"], "output": "182" }
+ ],
+ "mul_euint256_euint16": [
+ { "inputs": ["16385", "2"], "output": "32770" },
+ { "inputs": ["233", "233"], "output": "54289" },
+ { "inputs": ["233", "233"], "output": "54289" },
+ { "inputs": ["233", "233"], "output": "54289" }
+ ],
+ "mul_euint256_euint32": [
+ { "inputs": ["1073741825", "2"], "output": "2147483650" },
+ { "inputs": ["60165", "60165"], "output": "3619827225" },
+ { "inputs": ["60165", "60165"], "output": "3619827225" },
+ { "inputs": ["60165", "60165"], "output": "3619827225" }
+ ],
+ "mul_euint256_euint64": [
+ { "inputs": ["4611686018427387905", "2"], "output": "9223372036854775810" },
+ { "inputs": ["4292912378", "4292912378"], "output": "18429096685185614884" },
+ { "inputs": ["4292912378", "4292912378"], "output": "18429096685185614884" },
+ { "inputs": ["4292912378", "4292912378"], "output": "18429096685185614884" }
+ ],
+ "mul_euint256_euint128": [
+ { "inputs": ["85070591730234615865843651857942052865", "2"], "output": "170141183460469231731687303715884105730" },
+ { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" },
+ { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" },
+ { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" }
+ ],
+ "mul_euint256_euint256": [
+ {
+ "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"],
+ "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441"
+ },
+ {
+ "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"],
+ "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441"
+ },
+ {
+ "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"],
+ "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441"
+ },
+ {
+ "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"],
+ "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441"
+ }
+ ],
+ "mul_euint256_uint256": [
+ {
+ "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"],
+ "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441"
+ },
+ {
+ "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"],
+ "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441"
+ },
+ {
+ "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"],
+ "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441"
+ },
+ {
+ "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"],
+ "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441"
+ }
+ ],
+ "mul_uint256_euint256": [
+ {
+ "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"],
+ "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441"
+ },
+ {
+ "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"],
+ "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441"
+ },
+ {
+ "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"],
+ "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441"
+ },
+ {
+ "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"],
+ "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441"
+ }
],
"div_euint4_uint8": [
{ "inputs": ["14", "14"], "output": "1" },
@@ -566,2413 +1212,6573 @@
{ "inputs": ["14", "10"], "output": "1" }
],
"div_euint8_uint8": [
- { "inputs": ["168", "148"], "output": "1" },
- { "inputs": ["164", "168"], "output": "0" },
- { "inputs": ["168", "168"], "output": "1" },
- { "inputs": ["168", "164"], "output": "1" }
+ { "inputs": ["87", "167"], "output": "0" },
+ { "inputs": ["31", "35"], "output": "0" },
+ { "inputs": ["35", "35"], "output": "1" },
+ { "inputs": ["35", "31"], "output": "1" }
],
"div_euint16_uint16": [
- { "inputs": ["8852", "38586"], "output": "0" },
- { "inputs": ["8848", "8852"], "output": "0" },
- { "inputs": ["8852", "8852"], "output": "1" },
- { "inputs": ["8852", "8848"], "output": "1" }
+ { "inputs": ["20304", "59132"], "output": "0" },
+ { "inputs": ["20300", "20304"], "output": "0" },
+ { "inputs": ["20304", "20304"], "output": "1" },
+ { "inputs": ["20304", "20300"], "output": "1" }
],
"div_euint32_uint32": [
- { "inputs": ["1758653773", "1926631032"], "output": "0" },
- { "inputs": ["569518498", "569518502"], "output": "0" },
- { "inputs": ["569518502", "569518502"], "output": "1" },
- { "inputs": ["569518502", "569518498"], "output": "1" }
+ { "inputs": ["1492630984", "1624831749"], "output": "0" },
+ { "inputs": ["1492630980", "1492630984"], "output": "0" },
+ { "inputs": ["1492630984", "1492630984"], "output": "1" },
+ { "inputs": ["1492630984", "1492630980"], "output": "1" }
],
"div_euint64_uint64": [
- { "inputs": ["18442885434890559161", "18443612733078410209"], "output": "0" },
- { "inputs": ["18442885434890559157", "18442885434890559161"], "output": "0" },
- { "inputs": ["18442885434890559161", "18442885434890559161"], "output": "1" },
- { "inputs": ["18442885434890559161", "18442885434890559157"], "output": "1" }
+ { "inputs": ["18444804438871636581", "18440669978814863107"], "output": "1" },
+ { "inputs": ["18444804438871636577", "18444804438871636581"], "output": "0" },
+ { "inputs": ["18444804438871636581", "18444804438871636581"], "output": "1" },
+ { "inputs": ["18444804438871636581", "18444804438871636577"], "output": "1" }
+ ],
+ "div_euint128_uint128": [
+ { "inputs": ["340282366920938463463372619792959880891", "340282366920938463463368477899733272407"], "output": "1" },
+ { "inputs": ["340282366920938463463372619792959880887", "340282366920938463463372619792959880891"], "output": "0" },
+ { "inputs": ["340282366920938463463372619792959880891", "340282366920938463463372619792959880891"], "output": "1" },
+ { "inputs": ["340282366920938463463372619792959880891", "340282366920938463463372619792959880887"], "output": "1" }
+ ],
+ "div_euint256_uint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457583310417243027629",
+ "115792089237316195423570985008687907853269984665640564039457577919950085050983"
+ ],
+ "output": "1"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457576535097376895415",
+ "115792089237316195423570985008687907853269984665640564039457576535097376895419"
+ ],
+ "output": "0"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457576535097376895419",
+ "115792089237316195423570985008687907853269984665640564039457576535097376895419"
+ ],
+ "output": "1"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457576535097376895419",
+ "115792089237316195423570985008687907853269984665640564039457576535097376895415"
+ ],
+ "output": "1"
+ }
],
"rem_euint4_uint8": [
- { "inputs": ["9", "5"], "output": "4" },
- { "inputs": ["5", "9"], "output": "5" },
- { "inputs": ["9", "9"], "output": "0" },
- { "inputs": ["9", "5"], "output": "4" }
+ { "inputs": ["13", "2"], "output": "1" },
+ { "inputs": ["9", "13"], "output": "9" },
+ { "inputs": ["13", "13"], "output": "0" },
+ { "inputs": ["13", "9"], "output": "4" }
],
"rem_euint8_uint8": [
- { "inputs": ["225", "242"], "output": "225" },
- { "inputs": ["183", "187"], "output": "183" },
- { "inputs": ["187", "187"], "output": "0" },
- { "inputs": ["187", "183"], "output": "4" }
+ { "inputs": ["85", "232"], "output": "85" },
+ { "inputs": ["38", "42"], "output": "38" },
+ { "inputs": ["42", "42"], "output": "0" },
+ { "inputs": ["42", "38"], "output": "4" }
],
"rem_euint16_uint16": [
- { "inputs": ["53463", "2321"], "output": "80" },
- { "inputs": ["20898", "20902"], "output": "20898" },
- { "inputs": ["20902", "20902"], "output": "0" },
- { "inputs": ["20902", "20898"], "output": "4" }
+ { "inputs": ["41581", "40239"], "output": "1342" },
+ { "inputs": ["40817", "40821"], "output": "40817" },
+ { "inputs": ["40821", "40821"], "output": "0" },
+ { "inputs": ["40821", "40817"], "output": "4" }
],
"rem_euint32_uint32": [
- { "inputs": ["514826887", "2242906184"], "output": "514826887" },
- { "inputs": ["514826883", "514826887"], "output": "514826883" },
- { "inputs": ["514826887", "514826887"], "output": "0" },
- { "inputs": ["514826887", "514826883"], "output": "4" }
+ { "inputs": ["631407091", "2150413493"], "output": "631407091" },
+ { "inputs": ["631407087", "631407091"], "output": "631407087" },
+ { "inputs": ["631407091", "631407091"], "output": "0" },
+ { "inputs": ["631407091", "631407087"], "output": "4" }
],
"rem_euint64_uint64": [
- { "inputs": ["18445299104872939013", "18441298343819074757"], "output": "4000761053864256" },
- { "inputs": ["18441202573467232859", "18441202573467232863"], "output": "18441202573467232859" },
- { "inputs": ["18441202573467232863", "18441202573467232863"], "output": "0" },
- { "inputs": ["18441202573467232863", "18441202573467232859"], "output": "4" }
+ { "inputs": ["18446008186519174615", "18445049964172995155"], "output": "958222346179460" },
+ { "inputs": ["18443920463081385689", "18443920463081385693"], "output": "18443920463081385689" },
+ { "inputs": ["18443920463081385693", "18443920463081385693"], "output": "0" },
+ { "inputs": ["18443920463081385693", "18443920463081385689"], "output": "4" }
+ ],
+ "rem_euint128_uint128": [
+ {
+ "inputs": ["340282366920938463463367984231624733459", "340282366920938463463368025855706253793"],
+ "output": "340282366920938463463367984231624733459"
+ },
+ {
+ "inputs": ["340282366920938463463367984231624733455", "340282366920938463463367984231624733459"],
+ "output": "340282366920938463463367984231624733455"
+ },
+ { "inputs": ["340282366920938463463367984231624733459", "340282366920938463463367984231624733459"], "output": "0" },
+ { "inputs": ["340282366920938463463367984231624733459", "340282366920938463463367984231624733455"], "output": "4" }
+ ],
+ "rem_euint256_uint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457578502975350831453",
+ "115792089237316195423570985008687907853269984665640564039457581127377285906497"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457578502975350831453"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577137781640958323",
+ "115792089237316195423570985008687907853269984665640564039457577137781640958327"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577137781640958323"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577137781640958327",
+ "115792089237316195423570985008687907853269984665640564039457577137781640958327"
+ ],
+ "output": "0"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577137781640958327",
+ "115792089237316195423570985008687907853269984665640564039457577137781640958323"
+ ],
+ "output": "4"
+ }
],
"le_euint4_euint4": [
- { "inputs": ["10", "9"], "output": false },
- { "inputs": ["5", "9"], "output": true },
- { "inputs": ["9", "9"], "output": true },
- { "inputs": ["9", "5"], "output": false }
+ { "inputs": ["6", "6"], "output": true },
+ { "inputs": ["4", "8"], "output": true },
+ { "inputs": ["8", "8"], "output": true },
+ { "inputs": ["8", "4"], "output": false }
],
"le_euint4_euint8": [
- { "inputs": ["13", "94"], "output": true },
- { "inputs": ["9", "13"], "output": true },
- { "inputs": ["13", "13"], "output": true },
- { "inputs": ["13", "9"], "output": false }
+ { "inputs": ["1", "98"], "output": true },
+ { "inputs": ["4", "8"], "output": true },
+ { "inputs": ["8", "8"], "output": true },
+ { "inputs": ["8", "4"], "output": false }
],
"le_euint4_uint8": [
- { "inputs": ["13", "9"], "output": false },
- { "inputs": ["9", "13"], "output": true },
- { "inputs": ["13", "13"], "output": true },
- { "inputs": ["13", "9"], "output": false }
- ],
- "le_euint4_euint16": [
- { "inputs": ["3", "38645"], "output": true },
+ { "inputs": ["1", "2"], "output": true },
{ "inputs": ["4", "8"], "output": true },
{ "inputs": ["8", "8"], "output": true },
{ "inputs": ["8", "4"], "output": false }
],
+ "le_euint4_euint16": [
+ { "inputs": ["14", "62468"], "output": true },
+ { "inputs": ["10", "14"], "output": true },
+ { "inputs": ["14", "14"], "output": true },
+ { "inputs": ["14", "10"], "output": false }
+ ],
"le_euint4_euint32": [
- { "inputs": ["5", "3704560179"], "output": true },
+ { "inputs": ["4", "1782114748"], "output": true },
{ "inputs": ["4", "8"], "output": true },
{ "inputs": ["8", "8"], "output": true },
{ "inputs": ["8", "4"], "output": false }
],
"le_euint4_euint64": [
- { "inputs": ["9", "18445100928210525947"], "output": true },
- { "inputs": ["5", "9"], "output": true },
- { "inputs": ["9", "9"], "output": true },
- { "inputs": ["9", "5"], "output": false }
+ { "inputs": ["14", "18446414069240547725"], "output": true },
+ { "inputs": ["10", "14"], "output": true },
+ { "inputs": ["14", "14"], "output": true },
+ { "inputs": ["14", "10"], "output": false }
+ ],
+ "le_euint4_euint128": [
+ { "inputs": ["5", "340282366920938463463372463025889881069"], "output": true },
+ { "inputs": ["4", "8"], "output": true },
+ { "inputs": ["8", "8"], "output": true },
+ { "inputs": ["8", "4"], "output": false }
+ ],
+ "le_euint4_euint256": [
+ {
+ "inputs": ["12", "115792089237316195423570985008687907853269984665640564039457582708981712427829"],
+ "output": true
+ },
+ { "inputs": ["8", "12"], "output": true },
+ { "inputs": ["12", "12"], "output": true },
+ { "inputs": ["12", "8"], "output": false }
],
"le_euint8_euint4": [
- { "inputs": ["92", "13"], "output": false },
- { "inputs": ["9", "13"], "output": true },
- { "inputs": ["13", "13"], "output": true },
- { "inputs": ["13", "9"], "output": false }
+ { "inputs": ["26", "10"], "output": false },
+ { "inputs": ["6", "10"], "output": true },
+ { "inputs": ["10", "10"], "output": true },
+ { "inputs": ["10", "6"], "output": false }
],
"le_uint8_euint4": [
- { "inputs": ["8", "13"], "output": true },
- { "inputs": ["9", "13"], "output": true },
- { "inputs": ["13", "13"], "output": true },
- { "inputs": ["13", "9"], "output": false }
+ { "inputs": ["11", "10"], "output": false },
+ { "inputs": ["6", "10"], "output": true },
+ { "inputs": ["10", "10"], "output": true },
+ { "inputs": ["10", "6"], "output": false }
],
"le_euint8_euint8": [
- { "inputs": ["182", "238"], "output": true },
- { "inputs": ["178", "182"], "output": true },
- { "inputs": ["182", "182"], "output": true },
- { "inputs": ["182", "178"], "output": false }
+ { "inputs": ["124", "71"], "output": false },
+ { "inputs": ["67", "71"], "output": true },
+ { "inputs": ["71", "71"], "output": true },
+ { "inputs": ["71", "67"], "output": false }
],
"le_euint8_uint8": [
- { "inputs": ["182", "83"], "output": false },
- { "inputs": ["178", "182"], "output": true },
- { "inputs": ["182", "182"], "output": true },
- { "inputs": ["182", "178"], "output": false }
+ { "inputs": ["124", "152"], "output": true },
+ { "inputs": ["67", "71"], "output": true },
+ { "inputs": ["71", "71"], "output": true },
+ { "inputs": ["71", "67"], "output": false }
],
"le_uint8_euint8": [
- { "inputs": ["14", "83"], "output": true },
- { "inputs": ["178", "182"], "output": true },
- { "inputs": ["182", "182"], "output": true },
- { "inputs": ["182", "178"], "output": false }
+ { "inputs": ["25", "152"], "output": true },
+ { "inputs": ["67", "71"], "output": true },
+ { "inputs": ["71", "71"], "output": true },
+ { "inputs": ["71", "67"], "output": false }
],
"le_euint8_euint16": [
- { "inputs": ["157", "25391"], "output": true },
- { "inputs": ["153", "157"], "output": true },
- { "inputs": ["157", "157"], "output": true },
- { "inputs": ["157", "153"], "output": false }
+ { "inputs": ["32", "25116"], "output": true },
+ { "inputs": ["28", "32"], "output": true },
+ { "inputs": ["32", "32"], "output": true },
+ { "inputs": ["32", "28"], "output": false }
],
"le_euint8_euint32": [
- { "inputs": ["217", "193633124"], "output": true },
- { "inputs": ["213", "217"], "output": true },
- { "inputs": ["217", "217"], "output": true },
- { "inputs": ["217", "213"], "output": false }
+ { "inputs": ["162", "1086789383"], "output": true },
+ { "inputs": ["158", "162"], "output": true },
+ { "inputs": ["162", "162"], "output": true },
+ { "inputs": ["162", "158"], "output": false }
],
"le_euint8_euint64": [
- { "inputs": ["18", "18442364533783886901"], "output": true },
- { "inputs": ["14", "18"], "output": true },
- { "inputs": ["18", "18"], "output": true },
- { "inputs": ["18", "14"], "output": false }
+ { "inputs": ["124", "18443185604881328715"], "output": true },
+ { "inputs": ["120", "124"], "output": true },
+ { "inputs": ["124", "124"], "output": true },
+ { "inputs": ["124", "120"], "output": false }
+ ],
+ "le_euint8_euint128": [
+ { "inputs": ["108", "340282366920938463463369577015243486211"], "output": true },
+ { "inputs": ["104", "108"], "output": true },
+ { "inputs": ["108", "108"], "output": true },
+ { "inputs": ["108", "104"], "output": false }
+ ],
+ "le_euint8_euint256": [
+ {
+ "inputs": ["133", "115792089237316195423570985008687907853269984665640564039457576630649713670389"],
+ "output": true
+ },
+ { "inputs": ["129", "133"], "output": true },
+ { "inputs": ["133", "133"], "output": true },
+ { "inputs": ["133", "129"], "output": false }
],
"le_euint16_euint4": [
- { "inputs": ["39104", "8"], "output": false },
- { "inputs": ["4", "8"], "output": true },
- { "inputs": ["8", "8"], "output": true },
- { "inputs": ["8", "4"], "output": false }
+ { "inputs": ["26735", "12"], "output": false },
+ { "inputs": ["8", "12"], "output": true },
+ { "inputs": ["12", "12"], "output": true },
+ { "inputs": ["12", "8"], "output": false }
],
"le_euint16_euint8": [
- { "inputs": ["53893", "183"], "output": false },
- { "inputs": ["179", "183"], "output": true },
- { "inputs": ["183", "183"], "output": true },
- { "inputs": ["183", "179"], "output": false }
+ { "inputs": ["7541", "42"], "output": false },
+ { "inputs": ["38", "42"], "output": true },
+ { "inputs": ["42", "42"], "output": true },
+ { "inputs": ["42", "38"], "output": false }
],
"le_euint16_euint16": [
- { "inputs": ["38605", "53936"], "output": true },
- { "inputs": ["38601", "38605"], "output": true },
- { "inputs": ["38605", "38605"], "output": true },
- { "inputs": ["38605", "38601"], "output": false }
+ { "inputs": ["20803", "873"], "output": false },
+ { "inputs": ["869", "873"], "output": true },
+ { "inputs": ["873", "873"], "output": true },
+ { "inputs": ["873", "869"], "output": false }
],
"le_euint16_uint16": [
- { "inputs": ["38605", "15668"], "output": false },
- { "inputs": ["38601", "38605"], "output": true },
- { "inputs": ["38605", "38605"], "output": true },
- { "inputs": ["38605", "38601"], "output": false }
+ { "inputs": ["20803", "27442"], "output": true },
+ { "inputs": ["869", "873"], "output": true },
+ { "inputs": ["873", "873"], "output": true },
+ { "inputs": ["873", "869"], "output": false }
],
"le_uint16_euint16": [
- { "inputs": ["26564", "15668"], "output": false },
- { "inputs": ["38601", "38605"], "output": true },
- { "inputs": ["38605", "38605"], "output": true },
- { "inputs": ["38605", "38601"], "output": false }
+ { "inputs": ["36363", "27442"], "output": false },
+ { "inputs": ["869", "873"], "output": true },
+ { "inputs": ["873", "873"], "output": true },
+ { "inputs": ["873", "869"], "output": false }
],
"le_euint16_euint32": [
- { "inputs": ["32489", "2097840840"], "output": true },
- { "inputs": ["32485", "32489"], "output": true },
- { "inputs": ["32489", "32489"], "output": true },
- { "inputs": ["32489", "32485"], "output": false }
+ { "inputs": ["44937", "2020262580"], "output": true },
+ { "inputs": ["44933", "44937"], "output": true },
+ { "inputs": ["44937", "44937"], "output": true },
+ { "inputs": ["44937", "44933"], "output": false }
],
"le_euint16_euint64": [
- { "inputs": ["46492", "18439416152876310159"], "output": true },
- { "inputs": ["46488", "46492"], "output": true },
- { "inputs": ["46492", "46492"], "output": true },
- { "inputs": ["46492", "46488"], "output": false }
+ { "inputs": ["33530", "18441393339688273439"], "output": true },
+ { "inputs": ["33526", "33530"], "output": true },
+ { "inputs": ["33530", "33530"], "output": true },
+ { "inputs": ["33530", "33526"], "output": false }
+ ],
+ "le_euint16_euint128": [
+ { "inputs": ["63634", "340282366920938463463365626120025172451"], "output": true },
+ { "inputs": ["63630", "63634"], "output": true },
+ { "inputs": ["63634", "63634"], "output": true },
+ { "inputs": ["63634", "63630"], "output": false }
+ ],
+ "le_euint16_euint256": [
+ {
+ "inputs": ["10398", "115792089237316195423570985008687907853269984665640564039457582877023510899415"],
+ "output": true
+ },
+ { "inputs": ["10394", "10398"], "output": true },
+ { "inputs": ["10398", "10398"], "output": true },
+ { "inputs": ["10398", "10394"], "output": false }
],
"le_euint32_euint4": [
- { "inputs": ["681177958", "4"], "output": false },
+ { "inputs": ["1297036148", "2"], "output": false },
{ "inputs": ["4", "8"], "output": true },
{ "inputs": ["8", "8"], "output": true },
{ "inputs": ["8", "4"], "output": false }
],
"le_euint32_euint8": [
- { "inputs": ["804391035", "133"], "output": false },
- { "inputs": ["129", "133"], "output": true },
- { "inputs": ["133", "133"], "output": true },
- { "inputs": ["133", "129"], "output": false }
+ { "inputs": ["884339915", "183"], "output": false },
+ { "inputs": ["179", "183"], "output": true },
+ { "inputs": ["183", "183"], "output": true },
+ { "inputs": ["183", "179"], "output": false }
],
"le_euint32_euint16": [
- { "inputs": ["1660443539", "63916"], "output": false },
- { "inputs": ["63912", "63916"], "output": true },
- { "inputs": ["63916", "63916"], "output": true },
- { "inputs": ["63916", "63912"], "output": false }
+ { "inputs": ["787386715", "25220"], "output": false },
+ { "inputs": ["25216", "25220"], "output": true },
+ { "inputs": ["25220", "25220"], "output": true },
+ { "inputs": ["25220", "25216"], "output": false }
],
"le_euint32_euint32": [
- { "inputs": ["2708913268", "1446383134"], "output": false },
- { "inputs": ["1446383130", "1446383134"], "output": true },
- { "inputs": ["1446383134", "1446383134"], "output": true },
- { "inputs": ["1446383134", "1446383130"], "output": false }
+ { "inputs": ["1814515265", "1215301262"], "output": false },
+ { "inputs": ["1215301258", "1215301262"], "output": true },
+ { "inputs": ["1215301262", "1215301262"], "output": true },
+ { "inputs": ["1215301262", "1215301258"], "output": false }
],
"le_euint32_uint32": [
- { "inputs": ["2708913268", "3120465053"], "output": true },
- { "inputs": ["1446383130", "1446383134"], "output": true },
- { "inputs": ["1446383134", "1446383134"], "output": true },
- { "inputs": ["1446383134", "1446383130"], "output": false }
+ { "inputs": ["1814515265", "524803703"], "output": false },
+ { "inputs": ["1215301258", "1215301262"], "output": true },
+ { "inputs": ["1215301262", "1215301262"], "output": true },
+ { "inputs": ["1215301262", "1215301258"], "output": false }
],
"le_uint32_euint32": [
- { "inputs": ["518556131", "3120465053"], "output": true },
- { "inputs": ["1446383130", "1446383134"], "output": true },
- { "inputs": ["1446383134", "1446383134"], "output": true },
- { "inputs": ["1446383134", "1446383130"], "output": false }
+ { "inputs": ["1873209457", "524803703"], "output": false },
+ { "inputs": ["1215301258", "1215301262"], "output": true },
+ { "inputs": ["1215301262", "1215301262"], "output": true },
+ { "inputs": ["1215301262", "1215301258"], "output": false }
],
"le_euint32_euint64": [
- { "inputs": ["557237517", "18442682499983449751"], "output": true },
- { "inputs": ["557237513", "557237517"], "output": true },
- { "inputs": ["557237517", "557237517"], "output": true },
- { "inputs": ["557237517", "557237513"], "output": false }
+ { "inputs": ["1718048813", "18439987431102861375"], "output": true },
+ { "inputs": ["1718048809", "1718048813"], "output": true },
+ { "inputs": ["1718048813", "1718048813"], "output": true },
+ { "inputs": ["1718048813", "1718048809"], "output": false }
+ ],
+ "le_euint32_euint128": [
+ { "inputs": ["867198677", "340282366920938463463369757600308236313"], "output": true },
+ { "inputs": ["867198673", "867198677"], "output": true },
+ { "inputs": ["867198677", "867198677"], "output": true },
+ { "inputs": ["867198677", "867198673"], "output": false }
+ ],
+ "le_euint32_euint256": [
+ {
+ "inputs": ["2709381066", "115792089237316195423570985008687907853269984665640564039457582000267248354603"],
+ "output": true
+ },
+ { "inputs": ["2709381062", "2709381066"], "output": true },
+ { "inputs": ["2709381066", "2709381066"], "output": true },
+ { "inputs": ["2709381066", "2709381062"], "output": false }
],
"le_euint64_euint4": [
- { "inputs": ["18438089675582739325", "8"], "output": false },
- { "inputs": ["4", "8"], "output": true },
- { "inputs": ["8", "8"], "output": true },
- { "inputs": ["8", "4"], "output": false }
+ { "inputs": ["18443622047758317419", "13"], "output": false },
+ { "inputs": ["9", "13"], "output": true },
+ { "inputs": ["13", "13"], "output": true },
+ { "inputs": ["13", "9"], "output": false }
],
"le_euint64_euint8": [
- { "inputs": ["18443934013808426023", "129"], "output": false },
- { "inputs": ["125", "129"], "output": true },
- { "inputs": ["129", "129"], "output": true },
- { "inputs": ["129", "125"], "output": false }
+ { "inputs": ["18443904556846943161", "36"], "output": false },
+ { "inputs": ["32", "36"], "output": true },
+ { "inputs": ["36", "36"], "output": true },
+ { "inputs": ["36", "32"], "output": false }
],
"le_euint64_euint16": [
- { "inputs": ["18445404390633548443", "34855"], "output": false },
- { "inputs": ["34851", "34855"], "output": true },
- { "inputs": ["34855", "34855"], "output": true },
- { "inputs": ["34855", "34851"], "output": false }
+ { "inputs": ["18437883313011515679", "51774"], "output": false },
+ { "inputs": ["51770", "51774"], "output": true },
+ { "inputs": ["51774", "51774"], "output": true },
+ { "inputs": ["51774", "51770"], "output": false }
],
"le_euint64_euint32": [
- { "inputs": ["18443133688534935497", "622548585"], "output": false },
- { "inputs": ["622548581", "622548585"], "output": true },
- { "inputs": ["622548585", "622548585"], "output": true },
- { "inputs": ["622548585", "622548581"], "output": false }
+ { "inputs": ["18442023388952183851", "1762835382"], "output": false },
+ { "inputs": ["1762835378", "1762835382"], "output": true },
+ { "inputs": ["1762835382", "1762835382"], "output": true },
+ { "inputs": ["1762835382", "1762835378"], "output": false }
],
"le_euint64_euint64": [
- { "inputs": ["18443782238591650169", "18441978790273961913"], "output": false },
- { "inputs": ["18441978790273961909", "18441978790273961913"], "output": true },
- { "inputs": ["18441978790273961913", "18441978790273961913"], "output": true },
- { "inputs": ["18441978790273961913", "18441978790273961909"], "output": false }
+ { "inputs": ["18440402951089431437", "18444684457474043493"], "output": true },
+ { "inputs": ["18440402951089431433", "18440402951089431437"], "output": true },
+ { "inputs": ["18440402951089431437", "18440402951089431437"], "output": true },
+ { "inputs": ["18440402951089431437", "18440402951089431433"], "output": false }
],
"le_euint64_uint64": [
- { "inputs": ["18443782238591650169", "18439298139086159343"], "output": false },
- { "inputs": ["18441978790273961909", "18441978790273961913"], "output": true },
- { "inputs": ["18441978790273961913", "18441978790273961913"], "output": true },
- { "inputs": ["18441978790273961913", "18441978790273961909"], "output": false }
+ { "inputs": ["18440402951089431437", "18443808705297812893"], "output": true },
+ { "inputs": ["18440402951089431433", "18440402951089431437"], "output": true },
+ { "inputs": ["18440402951089431437", "18440402951089431437"], "output": true },
+ { "inputs": ["18440402951089431437", "18440402951089431433"], "output": false }
],
"le_uint64_euint64": [
- { "inputs": ["18438386930936343347", "18439298139086159343"], "output": true },
- { "inputs": ["18441978790273961909", "18441978790273961913"], "output": true },
- { "inputs": ["18441978790273961913", "18441978790273961913"], "output": true },
- { "inputs": ["18441978790273961913", "18441978790273961909"], "output": false }
+ { "inputs": ["18443941229431137849", "18443808705297812893"], "output": false },
+ { "inputs": ["18440402951089431433", "18440402951089431437"], "output": true },
+ { "inputs": ["18440402951089431437", "18440402951089431437"], "output": true },
+ { "inputs": ["18440402951089431437", "18440402951089431433"], "output": false }
+ ],
+ "le_euint64_euint128": [
+ { "inputs": ["18443662339869468477", "340282366920938463463371042076884293495"], "output": true },
+ { "inputs": ["18443662339869468473", "18443662339869468477"], "output": true },
+ { "inputs": ["18443662339869468477", "18443662339869468477"], "output": true },
+ { "inputs": ["18443662339869468477", "18443662339869468473"], "output": false }
+ ],
+ "le_euint64_euint256": [
+ {
+ "inputs": [
+ "18443803742985479181",
+ "115792089237316195423570985008687907853269984665640564039457581800529684723115"
+ ],
+ "output": true
+ },
+ { "inputs": ["18443803742985479177", "18443803742985479181"], "output": true },
+ { "inputs": ["18443803742985479181", "18443803742985479181"], "output": true },
+ { "inputs": ["18443803742985479181", "18443803742985479177"], "output": false }
+ ],
+ "le_euint128_euint4": [
+ { "inputs": ["340282366920938463463373221658110991435", "1"], "output": false },
+ { "inputs": ["4", "8"], "output": true },
+ { "inputs": ["8", "8"], "output": true },
+ { "inputs": ["8", "4"], "output": false }
+ ],
+ "le_euint128_euint8": [
+ { "inputs": ["340282366920938463463373663014854424779", "48"], "output": false },
+ { "inputs": ["44", "48"], "output": true },
+ { "inputs": ["48", "48"], "output": true },
+ { "inputs": ["48", "44"], "output": false }
+ ],
+ "le_euint128_euint16": [
+ { "inputs": ["340282366920938463463371412966556965647", "54237"], "output": false },
+ { "inputs": ["54233", "54237"], "output": true },
+ { "inputs": ["54237", "54237"], "output": true },
+ { "inputs": ["54237", "54233"], "output": false }
+ ],
+ "le_euint128_euint32": [
+ { "inputs": ["340282366920938463463372847665266392859", "623901814"], "output": false },
+ { "inputs": ["623901810", "623901814"], "output": true },
+ { "inputs": ["623901814", "623901814"], "output": true },
+ { "inputs": ["623901814", "623901810"], "output": false }
+ ],
+ "le_euint128_euint64": [
+ { "inputs": ["340282366920938463463366067679463384359", "18440549964651513569"], "output": false },
+ { "inputs": ["18440549964651513565", "18440549964651513569"], "output": true },
+ { "inputs": ["18440549964651513569", "18440549964651513569"], "output": true },
+ { "inputs": ["18440549964651513569", "18440549964651513565"], "output": false }
+ ],
+ "le_euint128_euint128": [
+ {
+ "inputs": ["340282366920938463463373992528465349581", "340282366920938463463372840104721436799"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463372840104721436795", "340282366920938463463372840104721436799"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463372840104721436799", "340282366920938463463372840104721436799"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463372840104721436799", "340282366920938463463372840104721436795"],
+ "output": false
+ }
+ ],
+ "le_euint128_uint128": [
+ {
+ "inputs": ["340282366920938463463373992528465349581", "340282366920938463463373835012809081201"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463372840104721436795", "340282366920938463463372840104721436799"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463372840104721436799", "340282366920938463463372840104721436799"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463372840104721436799", "340282366920938463463372840104721436795"],
+ "output": false
+ }
+ ],
+ "le_uint128_euint128": [
+ {
+ "inputs": ["340282366920938463463374153561991926979", "340282366920938463463373835012809081201"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463372840104721436795", "340282366920938463463372840104721436799"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463372840104721436799", "340282366920938463463372840104721436799"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463372840104721436799", "340282366920938463463372840104721436795"],
+ "output": false
+ }
+ ],
+ "le_euint128_euint256": [
+ {
+ "inputs": [
+ "340282366920938463463370154534182411951",
+ "115792089237316195423570985008687907853269984665640564039457582642838670062225"
+ ],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463370154534182411947", "340282366920938463463370154534182411951"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463370154534182411951", "340282366920938463463370154534182411951"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463370154534182411951", "340282366920938463463370154534182411947"],
+ "output": false
+ }
+ ],
+ "le_euint256_euint4": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457578089704885195999", "11"],
+ "output": false
+ },
+ { "inputs": ["7", "11"], "output": true },
+ { "inputs": ["11", "11"], "output": true },
+ { "inputs": ["11", "7"], "output": false }
+ ],
+ "le_euint256_euint8": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457580743279895693245", "161"],
+ "output": false
+ },
+ { "inputs": ["157", "161"], "output": true },
+ { "inputs": ["161", "161"], "output": true },
+ { "inputs": ["161", "157"], "output": false }
+ ],
+ "le_euint256_euint16": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457582351250639102167", "47994"],
+ "output": false
+ },
+ { "inputs": ["47990", "47994"], "output": true },
+ { "inputs": ["47994", "47994"], "output": true },
+ { "inputs": ["47994", "47990"], "output": false }
+ ],
+ "le_euint256_euint32": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457582845443410851747", "1340548693"],
+ "output": false
+ },
+ { "inputs": ["1340548689", "1340548693"], "output": true },
+ { "inputs": ["1340548693", "1340548693"], "output": true },
+ { "inputs": ["1340548693", "1340548689"], "output": false }
+ ],
+ "le_euint256_euint64": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457576194967854445761",
+ "18441295092771573001"
+ ],
+ "output": false
+ },
+ { "inputs": ["18441295092771572997", "18441295092771573001"], "output": true },
+ { "inputs": ["18441295092771573001", "18441295092771573001"], "output": true },
+ { "inputs": ["18441295092771573001", "18441295092771572997"], "output": false }
+ ],
+ "le_euint256_euint128": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457580916980779426235",
+ "340282366920938463463367434270493244717"
+ ],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463367434270493244713", "340282366920938463463367434270493244717"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463367434270493244717", "340282366920938463463367434270493244717"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463367434270493244717", "340282366920938463463367434270493244713"],
+ "output": false
+ }
+ ],
+ "le_euint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457583300217912499775",
+ "115792089237316195423570985008687907853269984665640564039457582857952818399809"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457582857952818399805",
+ "115792089237316195423570985008687907853269984665640564039457582857952818399809"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457582857952818399809",
+ "115792089237316195423570985008687907853269984665640564039457582857952818399809"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457582857952818399809",
+ "115792089237316195423570985008687907853269984665640564039457582857952818399805"
+ ],
+ "output": false
+ }
+ ],
+ "le_euint256_uint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457583300217912499775",
+ "115792089237316195423570985008687907853269984665640564039457580310546116642945"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457582857952818399805",
+ "115792089237316195423570985008687907853269984665640564039457582857952818399809"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457582857952818399809",
+ "115792089237316195423570985008687907853269984665640564039457582857952818399809"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457582857952818399809",
+ "115792089237316195423570985008687907853269984665640564039457582857952818399805"
+ ],
+ "output": false
+ }
+ ],
+ "le_uint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579919776168086147",
+ "115792089237316195423570985008687907853269984665640564039457580310546116642945"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457582857952818399805",
+ "115792089237316195423570985008687907853269984665640564039457582857952818399809"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457582857952818399809",
+ "115792089237316195423570985008687907853269984665640564039457582857952818399809"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457582857952818399809",
+ "115792089237316195423570985008687907853269984665640564039457582857952818399805"
+ ],
+ "output": false
+ }
],
"lt_euint4_euint4": [
- { "inputs": ["4", "10"], "output": true },
+ { "inputs": ["2", "6"], "output": true },
{ "inputs": ["4", "8"], "output": true },
{ "inputs": ["8", "8"], "output": false },
{ "inputs": ["8", "4"], "output": false }
],
"lt_euint4_euint8": [
- { "inputs": ["13", "128"], "output": true },
- { "inputs": ["9", "13"], "output": true },
- { "inputs": ["13", "13"], "output": false },
- { "inputs": ["13", "9"], "output": false }
+ { "inputs": ["12", "31"], "output": true },
+ { "inputs": ["8", "12"], "output": true },
+ { "inputs": ["12", "12"], "output": false },
+ { "inputs": ["12", "8"], "output": false }
],
"lt_euint4_uint8": [
- { "inputs": ["13", "1"], "output": false },
- { "inputs": ["9", "13"], "output": true },
- { "inputs": ["13", "13"], "output": false },
- { "inputs": ["13", "9"], "output": false }
+ { "inputs": ["12", "9"], "output": false },
+ { "inputs": ["8", "12"], "output": true },
+ { "inputs": ["12", "12"], "output": false },
+ { "inputs": ["12", "8"], "output": false }
],
"lt_euint4_euint16": [
- { "inputs": ["10", "15096"], "output": true },
+ { "inputs": ["10", "24653"], "output": true },
{ "inputs": ["6", "10"], "output": true },
{ "inputs": ["10", "10"], "output": false },
{ "inputs": ["10", "6"], "output": false }
],
"lt_euint4_euint32": [
- { "inputs": ["6", "2034411051"], "output": true },
+ { "inputs": ["1", "3154883490"], "output": true },
{ "inputs": ["4", "8"], "output": true },
{ "inputs": ["8", "8"], "output": false },
{ "inputs": ["8", "4"], "output": false }
],
"lt_euint4_euint64": [
- { "inputs": ["7", "18445391148064274615"], "output": true },
+ { "inputs": ["13", "18441885120383916401"], "output": true },
+ { "inputs": ["9", "13"], "output": true },
+ { "inputs": ["13", "13"], "output": false },
+ { "inputs": ["13", "9"], "output": false }
+ ],
+ "lt_euint4_euint128": [
+ { "inputs": ["8", "340282366920938463463367828600285579945"], "output": true },
{ "inputs": ["4", "8"], "output": true },
{ "inputs": ["8", "8"], "output": false },
{ "inputs": ["8", "4"], "output": false }
],
+ "lt_euint4_euint256": [
+ {
+ "inputs": ["11", "115792089237316195423570985008687907853269984665640564039457582432165171824629"],
+ "output": true
+ },
+ { "inputs": ["7", "11"], "output": true },
+ { "inputs": ["11", "11"], "output": false },
+ { "inputs": ["11", "7"], "output": false }
+ ],
"lt_euint8_euint4": [
- { "inputs": ["195", "14"], "output": false },
- { "inputs": ["10", "14"], "output": true },
- { "inputs": ["14", "14"], "output": false },
- { "inputs": ["14", "10"], "output": false }
+ { "inputs": ["163", "11"], "output": false },
+ { "inputs": ["7", "11"], "output": true },
+ { "inputs": ["11", "11"], "output": false },
+ { "inputs": ["11", "7"], "output": false }
],
"lt_uint8_euint4": [
- { "inputs": ["11", "14"], "output": true },
- { "inputs": ["10", "14"], "output": true },
- { "inputs": ["14", "14"], "output": false },
- { "inputs": ["14", "10"], "output": false }
+ { "inputs": ["5", "11"], "output": true },
+ { "inputs": ["7", "11"], "output": true },
+ { "inputs": ["11", "11"], "output": false },
+ { "inputs": ["11", "7"], "output": false }
],
"lt_euint8_euint8": [
- { "inputs": ["44", "62"], "output": true },
- { "inputs": ["40", "44"], "output": true },
- { "inputs": ["44", "44"], "output": false },
- { "inputs": ["44", "40"], "output": false }
+ { "inputs": ["221", "45"], "output": false },
+ { "inputs": ["41", "45"], "output": true },
+ { "inputs": ["45", "45"], "output": false },
+ { "inputs": ["45", "41"], "output": false }
],
"lt_euint8_uint8": [
- { "inputs": ["44", "12"], "output": false },
- { "inputs": ["40", "44"], "output": true },
- { "inputs": ["44", "44"], "output": false },
- { "inputs": ["44", "40"], "output": false }
+ { "inputs": ["221", "96"], "output": false },
+ { "inputs": ["41", "45"], "output": true },
+ { "inputs": ["45", "45"], "output": false },
+ { "inputs": ["45", "41"], "output": false }
],
"lt_uint8_euint8": [
- { "inputs": ["106", "12"], "output": false },
- { "inputs": ["40", "44"], "output": true },
- { "inputs": ["44", "44"], "output": false },
- { "inputs": ["44", "40"], "output": false }
+ { "inputs": ["225", "96"], "output": false },
+ { "inputs": ["41", "45"], "output": true },
+ { "inputs": ["45", "45"], "output": false },
+ { "inputs": ["45", "41"], "output": false }
],
"lt_euint8_euint16": [
- { "inputs": ["115", "9566"], "output": true },
- { "inputs": ["111", "115"], "output": true },
- { "inputs": ["115", "115"], "output": false },
- { "inputs": ["115", "111"], "output": false }
+ { "inputs": ["31", "45682"], "output": true },
+ { "inputs": ["27", "31"], "output": true },
+ { "inputs": ["31", "31"], "output": false },
+ { "inputs": ["31", "27"], "output": false }
],
"lt_euint8_euint32": [
- { "inputs": ["97", "73387652"], "output": true },
- { "inputs": ["93", "97"], "output": true },
- { "inputs": ["97", "97"], "output": false },
- { "inputs": ["97", "93"], "output": false }
+ { "inputs": ["111", "1481942282"], "output": true },
+ { "inputs": ["107", "111"], "output": true },
+ { "inputs": ["111", "111"], "output": false },
+ { "inputs": ["111", "107"], "output": false }
],
"lt_euint8_euint64": [
- { "inputs": ["1", "18442662886837590601"], "output": true },
- { "inputs": ["4", "8"], "output": true },
- { "inputs": ["8", "8"], "output": false },
- { "inputs": ["8", "4"], "output": false }
+ { "inputs": ["213", "18441867518419136505"], "output": true },
+ { "inputs": ["209", "213"], "output": true },
+ { "inputs": ["213", "213"], "output": false },
+ { "inputs": ["213", "209"], "output": false }
+ ],
+ "lt_euint8_euint128": [
+ { "inputs": ["90", "340282366920938463463366855244560424809"], "output": true },
+ { "inputs": ["86", "90"], "output": true },
+ { "inputs": ["90", "90"], "output": false },
+ { "inputs": ["90", "86"], "output": false }
+ ],
+ "lt_euint8_euint256": [
+ {
+ "inputs": ["142", "115792089237316195423570985008687907853269984665640564039457583972137475354729"],
+ "output": true
+ },
+ { "inputs": ["138", "142"], "output": true },
+ { "inputs": ["142", "142"], "output": false },
+ { "inputs": ["142", "138"], "output": false }
],
"lt_euint16_euint4": [
- { "inputs": ["57762", "4"], "output": false },
+ { "inputs": ["38459", "3"], "output": false },
{ "inputs": ["4", "8"], "output": true },
{ "inputs": ["8", "8"], "output": false },
{ "inputs": ["8", "4"], "output": false }
],
"lt_euint16_euint8": [
- { "inputs": ["14349", "199"], "output": false },
- { "inputs": ["195", "199"], "output": true },
- { "inputs": ["199", "199"], "output": false },
- { "inputs": ["199", "195"], "output": false }
+ { "inputs": ["6772", "147"], "output": false },
+ { "inputs": ["143", "147"], "output": true },
+ { "inputs": ["147", "147"], "output": false },
+ { "inputs": ["147", "143"], "output": false }
],
"lt_euint16_euint16": [
- { "inputs": ["59332", "12427"], "output": false },
- { "inputs": ["12423", "12427"], "output": true },
- { "inputs": ["12427", "12427"], "output": false },
- { "inputs": ["12427", "12423"], "output": false }
+ { "inputs": ["34482", "5146"], "output": false },
+ { "inputs": ["5142", "5146"], "output": true },
+ { "inputs": ["5146", "5146"], "output": false },
+ { "inputs": ["5146", "5142"], "output": false }
],
"lt_euint16_uint16": [
- { "inputs": ["59332", "5218"], "output": false },
- { "inputs": ["12423", "12427"], "output": true },
- { "inputs": ["12427", "12427"], "output": false },
- { "inputs": ["12427", "12423"], "output": false }
+ { "inputs": ["34482", "38499"], "output": true },
+ { "inputs": ["5142", "5146"], "output": true },
+ { "inputs": ["5146", "5146"], "output": false },
+ { "inputs": ["5146", "5142"], "output": false }
],
"lt_uint16_euint16": [
- { "inputs": ["8638", "5218"], "output": false },
- { "inputs": ["12423", "12427"], "output": true },
- { "inputs": ["12427", "12427"], "output": false },
- { "inputs": ["12427", "12423"], "output": false }
+ { "inputs": ["21462", "38499"], "output": true },
+ { "inputs": ["5142", "5146"], "output": true },
+ { "inputs": ["5146", "5146"], "output": false },
+ { "inputs": ["5146", "5142"], "output": false }
],
"lt_euint16_euint32": [
- { "inputs": ["46117", "3066026054"], "output": true },
- { "inputs": ["46113", "46117"], "output": true },
- { "inputs": ["46117", "46117"], "output": false },
- { "inputs": ["46117", "46113"], "output": false }
+ { "inputs": ["31744", "3296344536"], "output": true },
+ { "inputs": ["31740", "31744"], "output": true },
+ { "inputs": ["31744", "31744"], "output": false },
+ { "inputs": ["31744", "31740"], "output": false }
],
"lt_euint16_euint64": [
- { "inputs": ["20266", "18439286572290779257"], "output": true },
- { "inputs": ["20262", "20266"], "output": true },
- { "inputs": ["20266", "20266"], "output": false },
- { "inputs": ["20266", "20262"], "output": false }
+ { "inputs": ["7192", "18440977990475901673"], "output": true },
+ { "inputs": ["7188", "7192"], "output": true },
+ { "inputs": ["7192", "7192"], "output": false },
+ { "inputs": ["7192", "7188"], "output": false }
+ ],
+ "lt_euint16_euint128": [
+ { "inputs": ["16589", "340282366920938463463371297893972390287"], "output": true },
+ { "inputs": ["16585", "16589"], "output": true },
+ { "inputs": ["16589", "16589"], "output": false },
+ { "inputs": ["16589", "16585"], "output": false }
+ ],
+ "lt_euint16_euint256": [
+ {
+ "inputs": ["58145", "115792089237316195423570985008687907853269984665640564039457578303118040864491"],
+ "output": true
+ },
+ { "inputs": ["58141", "58145"], "output": true },
+ { "inputs": ["58145", "58145"], "output": false },
+ { "inputs": ["58145", "58141"], "output": false }
],
"lt_euint32_euint4": [
- { "inputs": ["928445097", "2"], "output": false },
+ { "inputs": ["2282621038", "7"], "output": false },
{ "inputs": ["4", "8"], "output": true },
{ "inputs": ["8", "8"], "output": false },
{ "inputs": ["8", "4"], "output": false }
],
"lt_euint32_euint8": [
- { "inputs": ["3782116241", "158"], "output": false },
- { "inputs": ["154", "158"], "output": true },
- { "inputs": ["158", "158"], "output": false },
- { "inputs": ["158", "154"], "output": false }
+ { "inputs": ["1459989337", "220"], "output": false },
+ { "inputs": ["216", "220"], "output": true },
+ { "inputs": ["220", "220"], "output": false },
+ { "inputs": ["220", "216"], "output": false }
],
"lt_euint32_euint16": [
- { "inputs": ["1150183024", "6871"], "output": false },
- { "inputs": ["6867", "6871"], "output": true },
- { "inputs": ["6871", "6871"], "output": false },
- { "inputs": ["6871", "6867"], "output": false }
+ { "inputs": ["2091084769", "25571"], "output": false },
+ { "inputs": ["25567", "25571"], "output": true },
+ { "inputs": ["25571", "25571"], "output": false },
+ { "inputs": ["25571", "25567"], "output": false }
],
"lt_euint32_euint32": [
- { "inputs": ["1837089382", "4089682184"], "output": true },
- { "inputs": ["1837089378", "1837089382"], "output": true },
- { "inputs": ["1837089382", "1837089382"], "output": false },
- { "inputs": ["1837089382", "1837089378"], "output": false }
+ { "inputs": ["597865082", "2797648845"], "output": true },
+ { "inputs": ["597865078", "597865082"], "output": true },
+ { "inputs": ["597865082", "597865082"], "output": false },
+ { "inputs": ["597865082", "597865078"], "output": false }
],
"lt_euint32_uint32": [
- { "inputs": ["1837089382", "2866298985"], "output": true },
- { "inputs": ["1837089378", "1837089382"], "output": true },
- { "inputs": ["1837089382", "1837089382"], "output": false },
- { "inputs": ["1837089382", "1837089378"], "output": false }
+ { "inputs": ["597865082", "459499324"], "output": false },
+ { "inputs": ["597865078", "597865082"], "output": true },
+ { "inputs": ["597865082", "597865082"], "output": false },
+ { "inputs": ["597865082", "597865078"], "output": false }
],
"lt_uint32_euint32": [
- { "inputs": ["391192733", "2866298985"], "output": true },
- { "inputs": ["1837089378", "1837089382"], "output": true },
- { "inputs": ["1837089382", "1837089382"], "output": false },
- { "inputs": ["1837089382", "1837089378"], "output": false }
+ { "inputs": ["4239340674", "459499324"], "output": false },
+ { "inputs": ["597865078", "597865082"], "output": true },
+ { "inputs": ["597865082", "597865082"], "output": false },
+ { "inputs": ["597865082", "597865078"], "output": false }
],
"lt_euint32_euint64": [
- { "inputs": ["1941297565", "18438856464497751915"], "output": true },
- { "inputs": ["1941297561", "1941297565"], "output": true },
- { "inputs": ["1941297565", "1941297565"], "output": false },
- { "inputs": ["1941297565", "1941297561"], "output": false }
+ { "inputs": ["3259927115", "18445091130782070813"], "output": true },
+ { "inputs": ["3259927111", "3259927115"], "output": true },
+ { "inputs": ["3259927115", "3259927115"], "output": false },
+ { "inputs": ["3259927115", "3259927111"], "output": false }
+ ],
+ "lt_euint32_euint128": [
+ { "inputs": ["2093199071", "340282366920938463463370622002914075235"], "output": true },
+ { "inputs": ["2093199067", "2093199071"], "output": true },
+ { "inputs": ["2093199071", "2093199071"], "output": false },
+ { "inputs": ["2093199071", "2093199067"], "output": false }
+ ],
+ "lt_euint32_euint256": [
+ {
+ "inputs": ["3016190595", "115792089237316195423570985008687907853269984665640564039457583853908247743739"],
+ "output": true
+ },
+ { "inputs": ["3016190591", "3016190595"], "output": true },
+ { "inputs": ["3016190595", "3016190595"], "output": false },
+ { "inputs": ["3016190595", "3016190591"], "output": false }
],
"lt_euint64_euint4": [
- { "inputs": ["18443056909764585511", "1"], "output": false },
- { "inputs": ["4", "8"], "output": true },
- { "inputs": ["8", "8"], "output": false },
- { "inputs": ["8", "4"], "output": false }
+ { "inputs": ["18444247959988442675", "10"], "output": false },
+ { "inputs": ["6", "10"], "output": true },
+ { "inputs": ["10", "10"], "output": false },
+ { "inputs": ["10", "6"], "output": false }
],
"lt_euint64_euint8": [
- { "inputs": ["18444118039600142421", "79"], "output": false },
- { "inputs": ["75", "79"], "output": true },
- { "inputs": ["79", "79"], "output": false },
- { "inputs": ["79", "75"], "output": false }
+ { "inputs": ["18444886637718481993", "57"], "output": false },
+ { "inputs": ["53", "57"], "output": true },
+ { "inputs": ["57", "57"], "output": false },
+ { "inputs": ["57", "53"], "output": false }
],
"lt_euint64_euint16": [
- { "inputs": ["18438335232029320935", "10564"], "output": false },
- { "inputs": ["10560", "10564"], "output": true },
- { "inputs": ["10564", "10564"], "output": false },
- { "inputs": ["10564", "10560"], "output": false }
+ { "inputs": ["18440546263819960189", "42672"], "output": false },
+ { "inputs": ["42668", "42672"], "output": true },
+ { "inputs": ["42672", "42672"], "output": false },
+ { "inputs": ["42672", "42668"], "output": false }
],
"lt_euint64_euint32": [
- { "inputs": ["18446696862115863979", "853267915"], "output": false },
- { "inputs": ["853267911", "853267915"], "output": true },
- { "inputs": ["853267915", "853267915"], "output": false },
- { "inputs": ["853267915", "853267911"], "output": false }
+ { "inputs": ["18441377707016357467", "2876988629"], "output": false },
+ { "inputs": ["2876988625", "2876988629"], "output": true },
+ { "inputs": ["2876988629", "2876988629"], "output": false },
+ { "inputs": ["2876988629", "2876988625"], "output": false }
],
"lt_euint64_euint64": [
- { "inputs": ["18445972196307174659", "18438760003066140571"], "output": false },
- { "inputs": ["18438760003066140567", "18438760003066140571"], "output": true },
- { "inputs": ["18438760003066140571", "18438760003066140571"], "output": false },
- { "inputs": ["18438760003066140571", "18438760003066140567"], "output": false }
+ { "inputs": ["18443308354694945505", "18438494040818835505"], "output": false },
+ { "inputs": ["18438494040818835501", "18438494040818835505"], "output": true },
+ { "inputs": ["18438494040818835505", "18438494040818835505"], "output": false },
+ { "inputs": ["18438494040818835505", "18438494040818835501"], "output": false }
],
"lt_euint64_uint64": [
- { "inputs": ["18445972196307174659", "18441359463085216855"], "output": false },
- { "inputs": ["18438760003066140567", "18438760003066140571"], "output": true },
- { "inputs": ["18438760003066140571", "18438760003066140571"], "output": false },
- { "inputs": ["18438760003066140571", "18438760003066140567"], "output": false }
+ { "inputs": ["18443308354694945505", "18438426856220799235"], "output": false },
+ { "inputs": ["18438494040818835501", "18438494040818835505"], "output": true },
+ { "inputs": ["18438494040818835505", "18438494040818835505"], "output": false },
+ { "inputs": ["18438494040818835505", "18438494040818835501"], "output": false }
],
"lt_uint64_euint64": [
- { "inputs": ["18440565799944043085", "18441359463085216855"], "output": true },
- { "inputs": ["18438760003066140567", "18438760003066140571"], "output": true },
- { "inputs": ["18438760003066140571", "18438760003066140571"], "output": false },
- { "inputs": ["18438760003066140571", "18438760003066140567"], "output": false }
+ { "inputs": ["18444682732892858227", "18438426856220799235"], "output": false },
+ { "inputs": ["18438494040818835501", "18438494040818835505"], "output": true },
+ { "inputs": ["18438494040818835505", "18438494040818835505"], "output": false },
+ { "inputs": ["18438494040818835505", "18438494040818835501"], "output": false }
+ ],
+ "lt_euint64_euint128": [
+ { "inputs": ["18444814117403628673", "340282366920938463463365637360413874149"], "output": true },
+ { "inputs": ["18444814117403628669", "18444814117403628673"], "output": true },
+ { "inputs": ["18444814117403628673", "18444814117403628673"], "output": false },
+ { "inputs": ["18444814117403628673", "18444814117403628669"], "output": false }
+ ],
+ "lt_euint64_euint256": [
+ {
+ "inputs": [
+ "18440844601726997069",
+ "115792089237316195423570985008687907853269984665640564039457578884493044868087"
+ ],
+ "output": true
+ },
+ { "inputs": ["18440844601726997065", "18440844601726997069"], "output": true },
+ { "inputs": ["18440844601726997069", "18440844601726997069"], "output": false },
+ { "inputs": ["18440844601726997069", "18440844601726997065"], "output": false }
+ ],
+ "lt_euint128_euint4": [
+ { "inputs": ["340282366920938463463368530671945258801", "12"], "output": false },
+ { "inputs": ["8", "12"], "output": true },
+ { "inputs": ["12", "12"], "output": false },
+ { "inputs": ["12", "8"], "output": false }
+ ],
+ "lt_euint128_euint8": [
+ { "inputs": ["340282366920938463463371295793146087759", "46"], "output": false },
+ { "inputs": ["42", "46"], "output": true },
+ { "inputs": ["46", "46"], "output": false },
+ { "inputs": ["46", "42"], "output": false }
+ ],
+ "lt_euint128_euint16": [
+ { "inputs": ["340282366920938463463374223690909641239", "37855"], "output": false },
+ { "inputs": ["37851", "37855"], "output": true },
+ { "inputs": ["37855", "37855"], "output": false },
+ { "inputs": ["37855", "37851"], "output": false }
+ ],
+ "lt_euint128_euint32": [
+ { "inputs": ["340282366920938463463373212421821063067", "1708404829"], "output": false },
+ { "inputs": ["1708404825", "1708404829"], "output": true },
+ { "inputs": ["1708404829", "1708404829"], "output": false },
+ { "inputs": ["1708404829", "1708404825"], "output": false }
+ ],
+ "lt_euint128_euint64": [
+ { "inputs": ["340282366920938463463369469329980440219", "18446437448475645327"], "output": false },
+ { "inputs": ["18446437448475645323", "18446437448475645327"], "output": true },
+ { "inputs": ["18446437448475645327", "18446437448475645327"], "output": false },
+ { "inputs": ["18446437448475645327", "18446437448475645323"], "output": false }
+ ],
+ "lt_euint128_euint128": [
+ {
+ "inputs": ["340282366920938463463368309276517872429", "340282366920938463463372024309642476529"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463368309276517872425", "340282366920938463463368309276517872429"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463368309276517872429", "340282366920938463463368309276517872429"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463368309276517872429", "340282366920938463463368309276517872425"],
+ "output": false
+ }
+ ],
+ "lt_euint128_uint128": [
+ {
+ "inputs": ["340282366920938463463368309276517872429", "340282366920938463463366305725915183957"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463368309276517872425", "340282366920938463463368309276517872429"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463368309276517872429", "340282366920938463463368309276517872429"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463368309276517872429", "340282366920938463463368309276517872425"],
+ "output": false
+ }
+ ],
+ "lt_uint128_euint128": [
+ {
+ "inputs": ["340282366920938463463371881592186712743", "340282366920938463463366305725915183957"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463368309276517872425", "340282366920938463463368309276517872429"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463368309276517872429", "340282366920938463463368309276517872429"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463368309276517872429", "340282366920938463463368309276517872425"],
+ "output": false
+ }
+ ],
+ "lt_euint128_euint256": [
+ {
+ "inputs": [
+ "340282366920938463463373024758287549459",
+ "115792089237316195423570985008687907853269984665640564039457580686028388504291"
+ ],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463373024758287549455", "340282366920938463463373024758287549459"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463373024758287549459", "340282366920938463463373024758287549459"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463373024758287549459", "340282366920938463463373024758287549455"],
+ "output": false
+ }
+ ],
+ "lt_euint256_euint4": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457580046200927487349", "9"],
+ "output": false
+ },
+ { "inputs": ["5", "9"], "output": true },
+ { "inputs": ["9", "9"], "output": false },
+ { "inputs": ["9", "5"], "output": false }
+ ],
+ "lt_euint256_euint8": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457575356850463874977", "220"],
+ "output": false
+ },
+ { "inputs": ["216", "220"], "output": true },
+ { "inputs": ["220", "220"], "output": false },
+ { "inputs": ["220", "216"], "output": false }
+ ],
+ "lt_euint256_euint16": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457581793657869781609", "60020"],
+ "output": false
+ },
+ { "inputs": ["60016", "60020"], "output": true },
+ { "inputs": ["60020", "60020"], "output": false },
+ { "inputs": ["60020", "60016"], "output": false }
+ ],
+ "lt_euint256_euint32": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457577148837567008665", "1716202338"],
+ "output": false
+ },
+ { "inputs": ["1716202334", "1716202338"], "output": true },
+ { "inputs": ["1716202338", "1716202338"], "output": false },
+ { "inputs": ["1716202338", "1716202334"], "output": false }
+ ],
+ "lt_euint256_euint64": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577348858503949249",
+ "18446356831740760619"
+ ],
+ "output": false
+ },
+ { "inputs": ["18446356831740760615", "18446356831740760619"], "output": true },
+ { "inputs": ["18446356831740760619", "18446356831740760619"], "output": false },
+ { "inputs": ["18446356831740760619", "18446356831740760615"], "output": false }
+ ],
+ "lt_euint256_euint128": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457582200169426284819",
+ "340282366920938463463367486483424293599"
+ ],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463367486483424293595", "340282366920938463463367486483424293599"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463367486483424293599", "340282366920938463463367486483424293599"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463367486483424293599", "340282366920938463463367486483424293595"],
+ "output": false
+ }
+ ],
+ "lt_euint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579345439988102233",
+ "115792089237316195423570985008687907853269984665640564039457575518813902238261"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457575518813902238257",
+ "115792089237316195423570985008687907853269984665640564039457575518813902238261"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457575518813902238261",
+ "115792089237316195423570985008687907853269984665640564039457575518813902238261"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457575518813902238261",
+ "115792089237316195423570985008687907853269984665640564039457575518813902238257"
+ ],
+ "output": false
+ }
+ ],
+ "lt_euint256_uint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579345439988102233",
+ "115792089237316195423570985008687907853269984665640564039457581362267810923471"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457575518813902238257",
+ "115792089237316195423570985008687907853269984665640564039457575518813902238261"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457575518813902238261",
+ "115792089237316195423570985008687907853269984665640564039457575518813902238261"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457575518813902238261",
+ "115792089237316195423570985008687907853269984665640564039457575518813902238257"
+ ],
+ "output": false
+ }
+ ],
+ "lt_uint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457578628645763210627",
+ "115792089237316195423570985008687907853269984665640564039457581362267810923471"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457575518813902238257",
+ "115792089237316195423570985008687907853269984665640564039457575518813902238261"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457575518813902238261",
+ "115792089237316195423570985008687907853269984665640564039457575518813902238261"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457575518813902238261",
+ "115792089237316195423570985008687907853269984665640564039457575518813902238257"
+ ],
+ "output": false
+ }
],
"ge_euint4_euint4": [
- { "inputs": ["9", "9"], "output": true },
- { "inputs": ["5", "9"], "output": false },
- { "inputs": ["9", "9"], "output": true },
- { "inputs": ["9", "5"], "output": true }
+ { "inputs": ["6", "11"], "output": false },
+ { "inputs": ["4", "8"], "output": false },
+ { "inputs": ["8", "8"], "output": true },
+ { "inputs": ["8", "4"], "output": true }
],
"ge_euint4_euint8": [
- { "inputs": ["13", "91"], "output": false },
- { "inputs": ["9", "13"], "output": false },
- { "inputs": ["13", "13"], "output": true },
- { "inputs": ["13", "9"], "output": true }
+ { "inputs": ["3", "79"], "output": false },
+ { "inputs": ["4", "8"], "output": false },
+ { "inputs": ["8", "8"], "output": true },
+ { "inputs": ["8", "4"], "output": true }
],
"ge_euint4_uint8": [
- { "inputs": ["13", "2"], "output": true },
- { "inputs": ["9", "13"], "output": false },
- { "inputs": ["13", "13"], "output": true },
- { "inputs": ["13", "9"], "output": true }
+ { "inputs": ["3", "5"], "output": false },
+ { "inputs": ["4", "8"], "output": false },
+ { "inputs": ["8", "8"], "output": true },
+ { "inputs": ["8", "4"], "output": true }
],
"ge_euint4_euint16": [
- { "inputs": ["5", "34397"], "output": false },
+ { "inputs": ["1", "53247"], "output": false },
{ "inputs": ["4", "8"], "output": false },
{ "inputs": ["8", "8"], "output": true },
{ "inputs": ["8", "4"], "output": true }
],
"ge_euint4_euint32": [
- { "inputs": ["3", "735253791"], "output": false },
+ { "inputs": ["1", "2262617776"], "output": false },
{ "inputs": ["4", "8"], "output": false },
{ "inputs": ["8", "8"], "output": true },
{ "inputs": ["8", "4"], "output": true }
],
"ge_euint4_euint64": [
- { "inputs": ["7", "18446430329213146395"], "output": false },
+ { "inputs": ["12", "18446558548033148537"], "output": false },
+ { "inputs": ["8", "12"], "output": false },
+ { "inputs": ["12", "12"], "output": true },
+ { "inputs": ["12", "8"], "output": true }
+ ],
+ "ge_euint4_euint128": [
+ { "inputs": ["3", "340282366920938463463374467311851431135"], "output": false },
+ { "inputs": ["4", "8"], "output": false },
+ { "inputs": ["8", "8"], "output": true },
+ { "inputs": ["8", "4"], "output": true }
+ ],
+ "ge_euint4_euint256": [
+ {
+ "inputs": ["5", "115792089237316195423570985008687907853269984665640564039457582400238586978263"],
+ "output": false
+ },
{ "inputs": ["4", "8"], "output": false },
{ "inputs": ["8", "8"], "output": true },
{ "inputs": ["8", "4"], "output": true }
],
"ge_euint8_euint4": [
- { "inputs": ["85", "12"], "output": true },
- { "inputs": ["8", "12"], "output": false },
- { "inputs": ["12", "12"], "output": true },
- { "inputs": ["12", "8"], "output": true }
+ { "inputs": ["53", "1"], "output": true },
+ { "inputs": ["4", "8"], "output": false },
+ { "inputs": ["8", "8"], "output": true },
+ { "inputs": ["8", "4"], "output": true }
],
"ge_uint8_euint4": [
- { "inputs": ["1", "12"], "output": false },
- { "inputs": ["8", "12"], "output": false },
- { "inputs": ["12", "12"], "output": true },
- { "inputs": ["12", "8"], "output": true }
+ { "inputs": ["14", "1"], "output": true },
+ { "inputs": ["4", "8"], "output": false },
+ { "inputs": ["8", "8"], "output": true },
+ { "inputs": ["8", "4"], "output": true }
],
"ge_euint8_euint8": [
- { "inputs": ["89", "227"], "output": false },
- { "inputs": ["85", "89"], "output": false },
- { "inputs": ["89", "89"], "output": true },
- { "inputs": ["89", "85"], "output": true }
+ { "inputs": ["63", "190"], "output": false },
+ { "inputs": ["59", "63"], "output": false },
+ { "inputs": ["63", "63"], "output": true },
+ { "inputs": ["63", "59"], "output": true }
],
"ge_euint8_uint8": [
- { "inputs": ["89", "157"], "output": false },
- { "inputs": ["85", "89"], "output": false },
- { "inputs": ["89", "89"], "output": true },
- { "inputs": ["89", "85"], "output": true }
+ { "inputs": ["63", "223"], "output": false },
+ { "inputs": ["59", "63"], "output": false },
+ { "inputs": ["63", "63"], "output": true },
+ { "inputs": ["63", "59"], "output": true }
],
"ge_uint8_euint8": [
- { "inputs": ["164", "157"], "output": true },
- { "inputs": ["85", "89"], "output": false },
- { "inputs": ["89", "89"], "output": true },
- { "inputs": ["89", "85"], "output": true }
+ { "inputs": ["3", "223"], "output": false },
+ { "inputs": ["59", "63"], "output": false },
+ { "inputs": ["63", "63"], "output": true },
+ { "inputs": ["63", "59"], "output": true }
],
"ge_euint8_euint16": [
- { "inputs": ["12", "41571"], "output": false },
- { "inputs": ["8", "12"], "output": false },
- { "inputs": ["12", "12"], "output": true },
- { "inputs": ["12", "8"], "output": true }
+ { "inputs": ["93", "62769"], "output": false },
+ { "inputs": ["89", "93"], "output": false },
+ { "inputs": ["93", "93"], "output": true },
+ { "inputs": ["93", "89"], "output": true }
],
"ge_euint8_euint32": [
- { "inputs": ["222", "4025894176"], "output": false },
- { "inputs": ["218", "222"], "output": false },
- { "inputs": ["222", "222"], "output": true },
- { "inputs": ["222", "218"], "output": true }
+ { "inputs": ["108", "54055221"], "output": false },
+ { "inputs": ["104", "108"], "output": false },
+ { "inputs": ["108", "108"], "output": true },
+ { "inputs": ["108", "104"], "output": true }
],
"ge_euint8_euint64": [
- { "inputs": ["201", "18443640492228529453"], "output": false },
- { "inputs": ["197", "201"], "output": false },
- { "inputs": ["201", "201"], "output": true },
- { "inputs": ["201", "197"], "output": true }
+ { "inputs": ["27", "18441594146418724591"], "output": false },
+ { "inputs": ["23", "27"], "output": false },
+ { "inputs": ["27", "27"], "output": true },
+ { "inputs": ["27", "23"], "output": true }
+ ],
+ "ge_euint8_euint128": [
+ { "inputs": ["198", "340282366920938463463372202187873997337"], "output": false },
+ { "inputs": ["194", "198"], "output": false },
+ { "inputs": ["198", "198"], "output": true },
+ { "inputs": ["198", "194"], "output": true }
+ ],
+ "ge_euint8_euint256": [
+ {
+ "inputs": ["195", "115792089237316195423570985008687907853269984665640564039457578830037010369755"],
+ "output": false
+ },
+ { "inputs": ["191", "195"], "output": false },
+ { "inputs": ["195", "195"], "output": true },
+ { "inputs": ["195", "191"], "output": true }
],
"ge_euint16_euint4": [
- { "inputs": ["27268", "4"], "output": true },
- { "inputs": ["4", "8"], "output": false },
- { "inputs": ["8", "8"], "output": true },
- { "inputs": ["8", "4"], "output": true }
+ { "inputs": ["60257", "13"], "output": true },
+ { "inputs": ["9", "13"], "output": false },
+ { "inputs": ["13", "13"], "output": true },
+ { "inputs": ["13", "9"], "output": true }
],
"ge_euint16_euint8": [
- { "inputs": ["24994", "118"], "output": true },
- { "inputs": ["114", "118"], "output": false },
- { "inputs": ["118", "118"], "output": true },
- { "inputs": ["118", "114"], "output": true }
+ { "inputs": ["8192", "143"], "output": true },
+ { "inputs": ["139", "143"], "output": false },
+ { "inputs": ["143", "143"], "output": true },
+ { "inputs": ["143", "139"], "output": true }
],
"ge_euint16_euint16": [
- { "inputs": ["8825", "39131"], "output": false },
- { "inputs": ["8821", "8825"], "output": false },
- { "inputs": ["8825", "8825"], "output": true },
- { "inputs": ["8825", "8821"], "output": true }
+ { "inputs": ["51651", "13068"], "output": true },
+ { "inputs": ["13064", "13068"], "output": false },
+ { "inputs": ["13068", "13068"], "output": true },
+ { "inputs": ["13068", "13064"], "output": true }
],
"ge_euint16_uint16": [
- { "inputs": ["8825", "23737"], "output": false },
- { "inputs": ["8821", "8825"], "output": false },
- { "inputs": ["8825", "8825"], "output": true },
- { "inputs": ["8825", "8821"], "output": true }
+ { "inputs": ["51651", "48781"], "output": true },
+ { "inputs": ["13064", "13068"], "output": false },
+ { "inputs": ["13068", "13068"], "output": true },
+ { "inputs": ["13068", "13064"], "output": true }
],
"ge_uint16_euint16": [
- { "inputs": ["43508", "23737"], "output": true },
- { "inputs": ["8821", "8825"], "output": false },
- { "inputs": ["8825", "8825"], "output": true },
- { "inputs": ["8825", "8821"], "output": true }
+ { "inputs": ["60450", "48781"], "output": true },
+ { "inputs": ["13064", "13068"], "output": false },
+ { "inputs": ["13068", "13068"], "output": true },
+ { "inputs": ["13068", "13064"], "output": true }
],
"ge_euint16_euint32": [
- { "inputs": ["23826", "3191695510"], "output": false },
- { "inputs": ["23822", "23826"], "output": false },
- { "inputs": ["23826", "23826"], "output": true },
- { "inputs": ["23826", "23822"], "output": true }
+ { "inputs": ["63432", "458410498"], "output": false },
+ { "inputs": ["63428", "63432"], "output": false },
+ { "inputs": ["63432", "63432"], "output": true },
+ { "inputs": ["63432", "63428"], "output": true }
],
"ge_euint16_euint64": [
- { "inputs": ["63199", "18444428591303537867"], "output": false },
- { "inputs": ["63195", "63199"], "output": false },
- { "inputs": ["63199", "63199"], "output": true },
- { "inputs": ["63199", "63195"], "output": true }
+ { "inputs": ["14081", "18444389415407077285"], "output": false },
+ { "inputs": ["14077", "14081"], "output": false },
+ { "inputs": ["14081", "14081"], "output": true },
+ { "inputs": ["14081", "14077"], "output": true }
+ ],
+ "ge_euint16_euint128": [
+ { "inputs": ["25628", "340282366920938463463367234559875664879"], "output": false },
+ { "inputs": ["25624", "25628"], "output": false },
+ { "inputs": ["25628", "25628"], "output": true },
+ { "inputs": ["25628", "25624"], "output": true }
+ ],
+ "ge_euint16_euint256": [
+ {
+ "inputs": ["50106", "115792089237316195423570985008687907853269984665640564039457582313908377810967"],
+ "output": false
+ },
+ { "inputs": ["50102", "50106"], "output": false },
+ { "inputs": ["50106", "50106"], "output": true },
+ { "inputs": ["50106", "50102"], "output": true }
],
"ge_euint32_euint4": [
- { "inputs": ["1601227311", "14"], "output": true },
- { "inputs": ["10", "14"], "output": false },
- { "inputs": ["14", "14"], "output": true },
- { "inputs": ["14", "10"], "output": true }
+ { "inputs": ["417230890", "6"], "output": true },
+ { "inputs": ["4", "8"], "output": false },
+ { "inputs": ["8", "8"], "output": true },
+ { "inputs": ["8", "4"], "output": true }
],
"ge_euint32_euint8": [
- { "inputs": ["1799963609", "233"], "output": true },
- { "inputs": ["229", "233"], "output": false },
- { "inputs": ["233", "233"], "output": true },
- { "inputs": ["233", "229"], "output": true }
+ { "inputs": ["1009223821", "187"], "output": true },
+ { "inputs": ["183", "187"], "output": false },
+ { "inputs": ["187", "187"], "output": true },
+ { "inputs": ["187", "183"], "output": true }
],
"ge_euint32_euint16": [
- { "inputs": ["1742405068", "56059"], "output": true },
- { "inputs": ["56055", "56059"], "output": false },
- { "inputs": ["56059", "56059"], "output": true },
- { "inputs": ["56059", "56055"], "output": true }
+ { "inputs": ["3233856655", "54626"], "output": true },
+ { "inputs": ["54622", "54626"], "output": false },
+ { "inputs": ["54626", "54626"], "output": true },
+ { "inputs": ["54626", "54622"], "output": true }
],
"ge_euint32_euint32": [
- { "inputs": ["1736787381", "970577162"], "output": true },
- { "inputs": ["970577158", "970577162"], "output": false },
- { "inputs": ["970577162", "970577162"], "output": true },
- { "inputs": ["970577162", "970577158"], "output": true }
+ { "inputs": ["929694790", "907768232"], "output": true },
+ { "inputs": ["907768228", "907768232"], "output": false },
+ { "inputs": ["907768232", "907768232"], "output": true },
+ { "inputs": ["907768232", "907768228"], "output": true }
],
"ge_euint32_uint32": [
- { "inputs": ["1736787381", "3290514741"], "output": false },
- { "inputs": ["970577158", "970577162"], "output": false },
- { "inputs": ["970577162", "970577162"], "output": true },
- { "inputs": ["970577162", "970577158"], "output": true }
+ { "inputs": ["929694790", "603878469"], "output": true },
+ { "inputs": ["907768228", "907768232"], "output": false },
+ { "inputs": ["907768232", "907768232"], "output": true },
+ { "inputs": ["907768232", "907768228"], "output": true }
],
"ge_uint32_euint32": [
- { "inputs": ["586395582", "3290514741"], "output": false },
- { "inputs": ["970577158", "970577162"], "output": false },
- { "inputs": ["970577162", "970577162"], "output": true },
- { "inputs": ["970577162", "970577158"], "output": true }
+ { "inputs": ["2155494187", "603878469"], "output": true },
+ { "inputs": ["907768228", "907768232"], "output": false },
+ { "inputs": ["907768232", "907768232"], "output": true },
+ { "inputs": ["907768232", "907768228"], "output": true }
],
"ge_euint32_euint64": [
- { "inputs": ["2551620349", "18444102078323452175"], "output": false },
- { "inputs": ["2551620345", "2551620349"], "output": false },
- { "inputs": ["2551620349", "2551620349"], "output": true },
- { "inputs": ["2551620349", "2551620345"], "output": true }
+ { "inputs": ["2716663813", "18446666024340671893"], "output": false },
+ { "inputs": ["2716663809", "2716663813"], "output": false },
+ { "inputs": ["2716663813", "2716663813"], "output": true },
+ { "inputs": ["2716663813", "2716663809"], "output": true }
+ ],
+ "ge_euint32_euint128": [
+ { "inputs": ["3786584955", "340282366920938463463367364294961686443"], "output": false },
+ { "inputs": ["3786584951", "3786584955"], "output": false },
+ { "inputs": ["3786584955", "3786584955"], "output": true },
+ { "inputs": ["3786584955", "3786584951"], "output": true }
+ ],
+ "ge_euint32_euint256": [
+ {
+ "inputs": ["3646475026", "115792089237316195423570985008687907853269984665640564039457583473653753763859"],
+ "output": false
+ },
+ { "inputs": ["3646475022", "3646475026"], "output": false },
+ { "inputs": ["3646475026", "3646475026"], "output": true },
+ { "inputs": ["3646475026", "3646475022"], "output": true }
],
"ge_euint64_euint4": [
- { "inputs": ["18439251641807718563", "9"], "output": true },
- { "inputs": ["5", "9"], "output": false },
- { "inputs": ["9", "9"], "output": true },
- { "inputs": ["9", "5"], "output": true }
+ { "inputs": ["18438015014584183031", "11"], "output": true },
+ { "inputs": ["7", "11"], "output": false },
+ { "inputs": ["11", "11"], "output": true },
+ { "inputs": ["11", "7"], "output": true }
],
"ge_euint64_euint8": [
- { "inputs": ["18444294270645254277", "229"], "output": true },
- { "inputs": ["225", "229"], "output": false },
- { "inputs": ["229", "229"], "output": true },
- { "inputs": ["229", "225"], "output": true }
+ { "inputs": ["18444176095713623219", "248"], "output": true },
+ { "inputs": ["244", "248"], "output": false },
+ { "inputs": ["248", "248"], "output": true },
+ { "inputs": ["248", "244"], "output": true }
],
"ge_euint64_euint16": [
- { "inputs": ["18437766862316060605", "31992"], "output": true },
- { "inputs": ["31988", "31992"], "output": false },
- { "inputs": ["31992", "31992"], "output": true },
- { "inputs": ["31992", "31988"], "output": true }
+ { "inputs": ["18445173411231141809", "29055"], "output": true },
+ { "inputs": ["29051", "29055"], "output": false },
+ { "inputs": ["29055", "29055"], "output": true },
+ { "inputs": ["29055", "29051"], "output": true }
],
"ge_euint64_euint32": [
- { "inputs": ["18440264286866387829", "85256317"], "output": true },
- { "inputs": ["85256313", "85256317"], "output": false },
- { "inputs": ["85256317", "85256317"], "output": true },
- { "inputs": ["85256317", "85256313"], "output": true }
+ { "inputs": ["18439654895803536359", "1948462184"], "output": true },
+ { "inputs": ["1948462180", "1948462184"], "output": false },
+ { "inputs": ["1948462184", "1948462184"], "output": true },
+ { "inputs": ["1948462184", "1948462180"], "output": true }
],
"ge_euint64_euint64": [
- { "inputs": ["18441951286640352465", "18443086804815428517"], "output": false },
- { "inputs": ["18441951286640352461", "18441951286640352465"], "output": false },
- { "inputs": ["18441951286640352465", "18441951286640352465"], "output": true },
- { "inputs": ["18441951286640352465", "18441951286640352461"], "output": true }
+ { "inputs": ["18444613618003912273", "18441817383047397973"], "output": true },
+ { "inputs": ["18441817383047397969", "18441817383047397973"], "output": false },
+ { "inputs": ["18441817383047397973", "18441817383047397973"], "output": true },
+ { "inputs": ["18441817383047397973", "18441817383047397969"], "output": true }
],
"ge_euint64_uint64": [
- { "inputs": ["18441951286640352465", "18443569233121144247"], "output": false },
- { "inputs": ["18441951286640352461", "18441951286640352465"], "output": false },
- { "inputs": ["18441951286640352465", "18441951286640352465"], "output": true },
- { "inputs": ["18441951286640352465", "18441951286640352461"], "output": true }
+ { "inputs": ["18444613618003912273", "18444784193665775113"], "output": false },
+ { "inputs": ["18441817383047397969", "18441817383047397973"], "output": false },
+ { "inputs": ["18441817383047397973", "18441817383047397973"], "output": true },
+ { "inputs": ["18441817383047397973", "18441817383047397969"], "output": true }
],
"ge_uint64_euint64": [
- { "inputs": ["18439035083186430691", "18443569233121144247"], "output": false },
- { "inputs": ["18441951286640352461", "18441951286640352465"], "output": false },
- { "inputs": ["18441951286640352465", "18441951286640352465"], "output": true },
- { "inputs": ["18441951286640352465", "18441951286640352461"], "output": true }
+ { "inputs": ["18439321097396363619", "18444784193665775113"], "output": false },
+ { "inputs": ["18441817383047397969", "18441817383047397973"], "output": false },
+ { "inputs": ["18441817383047397973", "18441817383047397973"], "output": true },
+ { "inputs": ["18441817383047397973", "18441817383047397969"], "output": true }
+ ],
+ "ge_euint64_euint128": [
+ { "inputs": ["18442500358670120549", "340282366920938463463373603431929658391"], "output": false },
+ { "inputs": ["18442500358670120545", "18442500358670120549"], "output": false },
+ { "inputs": ["18442500358670120549", "18442500358670120549"], "output": true },
+ { "inputs": ["18442500358670120549", "18442500358670120545"], "output": true }
+ ],
+ "ge_euint64_euint256": [
+ {
+ "inputs": [
+ "18444770112796649545",
+ "115792089237316195423570985008687907853269984665640564039457581281801379635505"
+ ],
+ "output": false
+ },
+ { "inputs": ["18444770112796649541", "18444770112796649545"], "output": false },
+ { "inputs": ["18444770112796649545", "18444770112796649545"], "output": true },
+ { "inputs": ["18444770112796649545", "18444770112796649541"], "output": true }
+ ],
+ "ge_euint128_euint4": [
+ { "inputs": ["340282366920938463463366351520407667333", "12"], "output": true },
+ { "inputs": ["8", "12"], "output": false },
+ { "inputs": ["12", "12"], "output": true },
+ { "inputs": ["12", "8"], "output": true }
],
- "gt_euint4_euint4": [
- { "inputs": ["4", "14"], "output": false },
+ "ge_euint128_euint8": [
+ { "inputs": ["340282366920938463463365913686345200467", "55"], "output": true },
+ { "inputs": ["51", "55"], "output": false },
+ { "inputs": ["55", "55"], "output": true },
+ { "inputs": ["55", "51"], "output": true }
+ ],
+ "ge_euint128_euint16": [
+ { "inputs": ["340282366920938463463373250379836355353", "44459"], "output": true },
+ { "inputs": ["44455", "44459"], "output": false },
+ { "inputs": ["44459", "44459"], "output": true },
+ { "inputs": ["44459", "44455"], "output": true }
+ ],
+ "ge_euint128_euint32": [
+ { "inputs": ["340282366920938463463370684518045415615", "2276077429"], "output": true },
+ { "inputs": ["2276077425", "2276077429"], "output": false },
+ { "inputs": ["2276077429", "2276077429"], "output": true },
+ { "inputs": ["2276077429", "2276077425"], "output": true }
+ ],
+ "ge_euint128_euint64": [
+ { "inputs": ["340282366920938463463371033714627819917", "18439188692806479297"], "output": true },
+ { "inputs": ["18439188692806479293", "18439188692806479297"], "output": false },
+ { "inputs": ["18439188692806479297", "18439188692806479297"], "output": true },
+ { "inputs": ["18439188692806479297", "18439188692806479293"], "output": true }
+ ],
+ "ge_euint128_euint128": [
+ {
+ "inputs": ["340282366920938463463369991167430665173", "340282366920938463463367243418798341499"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463367243418798341495", "340282366920938463463367243418798341499"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463367243418798341499", "340282366920938463463367243418798341499"],
+ "output": true
+ },
+ { "inputs": ["340282366920938463463367243418798341499", "340282366920938463463367243418798341495"], "output": true }
+ ],
+ "ge_euint128_uint128": [
+ {
+ "inputs": ["340282366920938463463369991167430665173", "340282366920938463463370096368753149585"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463367243418798341495", "340282366920938463463367243418798341499"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463367243418798341499", "340282366920938463463367243418798341499"],
+ "output": true
+ },
+ { "inputs": ["340282366920938463463367243418798341499", "340282366920938463463367243418798341495"], "output": true }
+ ],
+ "ge_uint128_euint128": [
+ {
+ "inputs": ["340282366920938463463370285053807900009", "340282366920938463463370096368753149585"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463367243418798341495", "340282366920938463463367243418798341499"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463367243418798341499", "340282366920938463463367243418798341499"],
+ "output": true
+ },
+ { "inputs": ["340282366920938463463367243418798341499", "340282366920938463463367243418798341495"], "output": true }
+ ],
+ "ge_euint128_euint256": [
+ {
+ "inputs": [
+ "340282366920938463463372552646665539131",
+ "115792089237316195423570985008687907853269984665640564039457578321851153049841"
+ ],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463372552646665539127", "340282366920938463463372552646665539131"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463372552646665539131", "340282366920938463463372552646665539131"],
+ "output": true
+ },
+ { "inputs": ["340282366920938463463372552646665539131", "340282366920938463463372552646665539127"], "output": true }
+ ],
+ "ge_euint256_euint4": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457575496173341010993", "1"],
+ "output": true
+ },
{ "inputs": ["4", "8"], "output": false },
- { "inputs": ["8", "8"], "output": false },
+ { "inputs": ["8", "8"], "output": true },
{ "inputs": ["8", "4"], "output": true }
],
+ "ge_euint256_euint8": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457583777768346925767", "250"],
+ "output": true
+ },
+ { "inputs": ["246", "250"], "output": false },
+ { "inputs": ["250", "250"], "output": true },
+ { "inputs": ["250", "246"], "output": true }
+ ],
+ "ge_euint256_euint16": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457575882393460599321", "29301"],
+ "output": true
+ },
+ { "inputs": ["29297", "29301"], "output": false },
+ { "inputs": ["29301", "29301"], "output": true },
+ { "inputs": ["29301", "29297"], "output": true }
+ ],
+ "ge_euint256_euint32": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457576727756037416977", "2466446241"],
+ "output": true
+ },
+ { "inputs": ["2466446237", "2466446241"], "output": false },
+ { "inputs": ["2466446241", "2466446241"], "output": true },
+ { "inputs": ["2466446241", "2466446237"], "output": true }
+ ],
+ "ge_euint256_euint64": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577778171434629241",
+ "18443676400252575763"
+ ],
+ "output": true
+ },
+ { "inputs": ["18443676400252575759", "18443676400252575763"], "output": false },
+ { "inputs": ["18443676400252575763", "18443676400252575763"], "output": true },
+ { "inputs": ["18443676400252575763", "18443676400252575759"], "output": true }
+ ],
+ "ge_euint256_euint128": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457581781091933664799",
+ "340282366920938463463369397462507033255"
+ ],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463369397462507033251", "340282366920938463463369397462507033255"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463369397462507033255", "340282366920938463463369397462507033255"],
+ "output": true
+ },
+ { "inputs": ["340282366920938463463369397462507033255", "340282366920938463463369397462507033251"], "output": true }
+ ],
+ "ge_euint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579759156646767465",
+ "115792089237316195423570985008687907853269984665640564039457581776880742255263"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579759156646767461",
+ "115792089237316195423570985008687907853269984665640564039457579759156646767465"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579759156646767465",
+ "115792089237316195423570985008687907853269984665640564039457579759156646767465"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579759156646767465",
+ "115792089237316195423570985008687907853269984665640564039457579759156646767461"
+ ],
+ "output": true
+ }
+ ],
+ "ge_euint256_uint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579759156646767465",
+ "115792089237316195423570985008687907853269984665640564039457580411660636009627"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579759156646767461",
+ "115792089237316195423570985008687907853269984665640564039457579759156646767465"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579759156646767465",
+ "115792089237316195423570985008687907853269984665640564039457579759156646767465"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579759156646767465",
+ "115792089237316195423570985008687907853269984665640564039457579759156646767461"
+ ],
+ "output": true
+ }
+ ],
+ "ge_uint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457581430272333247909",
+ "115792089237316195423570985008687907853269984665640564039457580411660636009627"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579759156646767461",
+ "115792089237316195423570985008687907853269984665640564039457579759156646767465"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579759156646767465",
+ "115792089237316195423570985008687907853269984665640564039457579759156646767465"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579759156646767465",
+ "115792089237316195423570985008687907853269984665640564039457579759156646767461"
+ ],
+ "output": true
+ }
+ ],
+ "gt_euint4_euint4": [
+ { "inputs": ["12", "14"], "output": false },
+ { "inputs": ["8", "12"], "output": false },
+ { "inputs": ["12", "12"], "output": false },
+ { "inputs": ["12", "8"], "output": true }
+ ],
"gt_euint4_euint8": [
- { "inputs": ["14", "199"], "output": false },
- { "inputs": ["10", "14"], "output": false },
- { "inputs": ["14", "14"], "output": false },
- { "inputs": ["14", "10"], "output": true }
+ { "inputs": ["1", "59"], "output": false },
+ { "inputs": ["4", "8"], "output": false },
+ { "inputs": ["8", "8"], "output": false },
+ { "inputs": ["8", "4"], "output": true }
],
"gt_euint4_uint8": [
- { "inputs": ["14", "13"], "output": true },
- { "inputs": ["10", "14"], "output": false },
- { "inputs": ["14", "14"], "output": false },
- { "inputs": ["14", "10"], "output": true }
+ { "inputs": ["1", "3"], "output": false },
+ { "inputs": ["4", "8"], "output": false },
+ { "inputs": ["8", "8"], "output": false },
+ { "inputs": ["8", "4"], "output": true }
],
"gt_euint4_euint16": [
- { "inputs": ["10", "34348"], "output": false },
- { "inputs": ["6", "10"], "output": false },
- { "inputs": ["10", "10"], "output": false },
- { "inputs": ["10", "6"], "output": true }
+ { "inputs": ["13", "43765"], "output": false },
+ { "inputs": ["9", "13"], "output": false },
+ { "inputs": ["13", "13"], "output": false },
+ { "inputs": ["13", "9"], "output": true }
],
"gt_euint4_euint32": [
- { "inputs": ["1", "2112514560"], "output": false },
+ { "inputs": ["8", "1791761269"], "output": false },
{ "inputs": ["4", "8"], "output": false },
{ "inputs": ["8", "8"], "output": false },
{ "inputs": ["8", "4"], "output": true }
],
"gt_euint4_euint64": [
- { "inputs": ["10", "18442574847292216251"], "output": false },
- { "inputs": ["6", "10"], "output": false },
- { "inputs": ["10", "10"], "output": false },
- { "inputs": ["10", "6"], "output": true }
+ { "inputs": ["11", "18445624350177245281"], "output": false },
+ { "inputs": ["7", "11"], "output": false },
+ { "inputs": ["11", "11"], "output": false },
+ { "inputs": ["11", "7"], "output": true }
+ ],
+ "gt_euint4_euint128": [
+ { "inputs": ["14", "340282366920938463463369565306924367885"], "output": false },
+ { "inputs": ["10", "14"], "output": false },
+ { "inputs": ["14", "14"], "output": false },
+ { "inputs": ["14", "10"], "output": true }
+ ],
+ "gt_euint4_euint256": [
+ {
+ "inputs": ["1", "115792089237316195423570985008687907853269984665640564039457576918680285784187"],
+ "output": false
+ },
+ { "inputs": ["4", "8"], "output": false },
+ { "inputs": ["8", "8"], "output": false },
+ { "inputs": ["8", "4"], "output": true }
],
"gt_euint8_euint4": [
- { "inputs": ["248", "2"], "output": true },
+ { "inputs": ["94", "5"], "output": true },
{ "inputs": ["4", "8"], "output": false },
{ "inputs": ["8", "8"], "output": false },
{ "inputs": ["8", "4"], "output": true }
],
"gt_uint8_euint4": [
- { "inputs": ["1", "2"], "output": false },
+ { "inputs": ["1", "5"], "output": false },
{ "inputs": ["4", "8"], "output": false },
{ "inputs": ["8", "8"], "output": false },
{ "inputs": ["8", "4"], "output": true }
],
"gt_euint8_euint8": [
- { "inputs": ["247", "56"], "output": true },
- { "inputs": ["52", "56"], "output": false },
- { "inputs": ["56", "56"], "output": false },
- { "inputs": ["56", "52"], "output": true }
+ { "inputs": ["239", "212"], "output": true },
+ { "inputs": ["208", "212"], "output": false },
+ { "inputs": ["212", "212"], "output": false },
+ { "inputs": ["212", "208"], "output": true }
],
"gt_euint8_uint8": [
- { "inputs": ["247", "141"], "output": true },
- { "inputs": ["52", "56"], "output": false },
- { "inputs": ["56", "56"], "output": false },
- { "inputs": ["56", "52"], "output": true }
+ { "inputs": ["239", "184"], "output": true },
+ { "inputs": ["208", "212"], "output": false },
+ { "inputs": ["212", "212"], "output": false },
+ { "inputs": ["212", "208"], "output": true }
],
"gt_uint8_euint8": [
- { "inputs": ["186", "141"], "output": true },
- { "inputs": ["52", "56"], "output": false },
- { "inputs": ["56", "56"], "output": false },
- { "inputs": ["56", "52"], "output": true }
+ { "inputs": ["188", "184"], "output": true },
+ { "inputs": ["208", "212"], "output": false },
+ { "inputs": ["212", "212"], "output": false },
+ { "inputs": ["212", "208"], "output": true }
],
"gt_euint8_euint16": [
- { "inputs": ["67", "34612"], "output": false },
- { "inputs": ["63", "67"], "output": false },
- { "inputs": ["67", "67"], "output": false },
- { "inputs": ["67", "63"], "output": true }
+ { "inputs": ["207", "17375"], "output": false },
+ { "inputs": ["203", "207"], "output": false },
+ { "inputs": ["207", "207"], "output": false },
+ { "inputs": ["207", "203"], "output": true }
],
"gt_euint8_euint32": [
- { "inputs": ["193", "1536979513"], "output": false },
- { "inputs": ["189", "193"], "output": false },
- { "inputs": ["193", "193"], "output": false },
- { "inputs": ["193", "189"], "output": true }
+ { "inputs": ["16", "2217853328"], "output": false },
+ { "inputs": ["12", "16"], "output": false },
+ { "inputs": ["16", "16"], "output": false },
+ { "inputs": ["16", "12"], "output": true }
],
"gt_euint8_euint64": [
- { "inputs": ["237", "18441103586480031265"], "output": false },
- { "inputs": ["233", "237"], "output": false },
- { "inputs": ["237", "237"], "output": false },
- { "inputs": ["237", "233"], "output": true }
+ { "inputs": ["58", "18442407989859516937"], "output": false },
+ { "inputs": ["54", "58"], "output": false },
+ { "inputs": ["58", "58"], "output": false },
+ { "inputs": ["58", "54"], "output": true }
+ ],
+ "gt_euint8_euint128": [
+ { "inputs": ["246", "340282366920938463463368600113789095143"], "output": false },
+ { "inputs": ["242", "246"], "output": false },
+ { "inputs": ["246", "246"], "output": false },
+ { "inputs": ["246", "242"], "output": true }
+ ],
+ "gt_euint8_euint256": [
+ {
+ "inputs": ["73", "115792089237316195423570985008687907853269984665640564039457582598668635855029"],
+ "output": false
+ },
+ { "inputs": ["69", "73"], "output": false },
+ { "inputs": ["73", "73"], "output": false },
+ { "inputs": ["73", "69"], "output": true }
],
"gt_euint16_euint4": [
- { "inputs": ["6870", "8"], "output": true },
+ { "inputs": ["57987", "5"], "output": true },
{ "inputs": ["4", "8"], "output": false },
{ "inputs": ["8", "8"], "output": false },
{ "inputs": ["8", "4"], "output": true }
],
"gt_euint16_euint8": [
- { "inputs": ["15548", "171"], "output": true },
- { "inputs": ["167", "171"], "output": false },
- { "inputs": ["171", "171"], "output": false },
- { "inputs": ["171", "167"], "output": true }
+ { "inputs": ["18049", "102"], "output": true },
+ { "inputs": ["98", "102"], "output": false },
+ { "inputs": ["102", "102"], "output": false },
+ { "inputs": ["102", "98"], "output": true }
],
"gt_euint16_euint16": [
- { "inputs": ["33735", "54333"], "output": false },
- { "inputs": ["33731", "33735"], "output": false },
- { "inputs": ["33735", "33735"], "output": false },
- { "inputs": ["33735", "33731"], "output": true }
+ { "inputs": ["49523", "63498"], "output": false },
+ { "inputs": ["49519", "49523"], "output": false },
+ { "inputs": ["49523", "49523"], "output": false },
+ { "inputs": ["49523", "49519"], "output": true }
],
"gt_euint16_uint16": [
- { "inputs": ["33735", "40439"], "output": false },
- { "inputs": ["33731", "33735"], "output": false },
- { "inputs": ["33735", "33735"], "output": false },
- { "inputs": ["33735", "33731"], "output": true }
+ { "inputs": ["49523", "10749"], "output": true },
+ { "inputs": ["49519", "49523"], "output": false },
+ { "inputs": ["49523", "49523"], "output": false },
+ { "inputs": ["49523", "49519"], "output": true }
],
"gt_uint16_euint16": [
- { "inputs": ["47103", "40439"], "output": true },
- { "inputs": ["33731", "33735"], "output": false },
- { "inputs": ["33735", "33735"], "output": false },
- { "inputs": ["33735", "33731"], "output": true }
+ { "inputs": ["38042", "10749"], "output": true },
+ { "inputs": ["49519", "49523"], "output": false },
+ { "inputs": ["49523", "49523"], "output": false },
+ { "inputs": ["49523", "49519"], "output": true }
],
"gt_euint16_euint32": [
- { "inputs": ["20452", "2742403767"], "output": false },
- { "inputs": ["20448", "20452"], "output": false },
- { "inputs": ["20452", "20452"], "output": false },
- { "inputs": ["20452", "20448"], "output": true }
+ { "inputs": ["8095", "1426308540"], "output": false },
+ { "inputs": ["8091", "8095"], "output": false },
+ { "inputs": ["8095", "8095"], "output": false },
+ { "inputs": ["8095", "8091"], "output": true }
],
"gt_euint16_euint64": [
- { "inputs": ["63105", "18440430414982980885"], "output": false },
- { "inputs": ["63101", "63105"], "output": false },
- { "inputs": ["63105", "63105"], "output": false },
- { "inputs": ["63105", "63101"], "output": true }
+ { "inputs": ["45007", "18445308410216818905"], "output": false },
+ { "inputs": ["45003", "45007"], "output": false },
+ { "inputs": ["45007", "45007"], "output": false },
+ { "inputs": ["45007", "45003"], "output": true }
+ ],
+ "gt_euint16_euint128": [
+ { "inputs": ["29493", "340282366920938463463370329441548615949"], "output": false },
+ { "inputs": ["29489", "29493"], "output": false },
+ { "inputs": ["29493", "29493"], "output": false },
+ { "inputs": ["29493", "29489"], "output": true }
+ ],
+ "gt_euint16_euint256": [
+ {
+ "inputs": ["30875", "115792089237316195423570985008687907853269984665640564039457575028224206757889"],
+ "output": false
+ },
+ { "inputs": ["30871", "30875"], "output": false },
+ { "inputs": ["30875", "30875"], "output": false },
+ { "inputs": ["30875", "30871"], "output": true }
],
"gt_euint32_euint4": [
- { "inputs": ["3548820179", "1"], "output": true },
+ { "inputs": ["3015562136", "7"], "output": true },
{ "inputs": ["4", "8"], "output": false },
{ "inputs": ["8", "8"], "output": false },
{ "inputs": ["8", "4"], "output": true }
],
"gt_euint32_euint8": [
- { "inputs": ["3893344872", "37"], "output": true },
- { "inputs": ["33", "37"], "output": false },
- { "inputs": ["37", "37"], "output": false },
- { "inputs": ["37", "33"], "output": true }
+ { "inputs": ["1381529874", "57"], "output": true },
+ { "inputs": ["53", "57"], "output": false },
+ { "inputs": ["57", "57"], "output": false },
+ { "inputs": ["57", "53"], "output": true }
],
"gt_euint32_euint16": [
- { "inputs": ["4017313863", "63284"], "output": true },
- { "inputs": ["63280", "63284"], "output": false },
- { "inputs": ["63284", "63284"], "output": false },
- { "inputs": ["63284", "63280"], "output": true }
+ { "inputs": ["1059995818", "54018"], "output": true },
+ { "inputs": ["54014", "54018"], "output": false },
+ { "inputs": ["54018", "54018"], "output": false },
+ { "inputs": ["54018", "54014"], "output": true }
],
"gt_euint32_euint32": [
- { "inputs": ["212629196", "2875731526"], "output": false },
- { "inputs": ["212629192", "212629196"], "output": false },
- { "inputs": ["212629196", "212629196"], "output": false },
- { "inputs": ["212629196", "212629192"], "output": true }
+ { "inputs": ["3794643996", "619151916"], "output": true },
+ { "inputs": ["619151912", "619151916"], "output": false },
+ { "inputs": ["619151916", "619151916"], "output": false },
+ { "inputs": ["619151916", "619151912"], "output": true }
],
"gt_euint32_uint32": [
- { "inputs": ["212629196", "4059879084"], "output": false },
- { "inputs": ["212629192", "212629196"], "output": false },
- { "inputs": ["212629196", "212629196"], "output": false },
- { "inputs": ["212629196", "212629192"], "output": true }
+ { "inputs": ["3794643996", "3726690353"], "output": true },
+ { "inputs": ["619151912", "619151916"], "output": false },
+ { "inputs": ["619151916", "619151916"], "output": false },
+ { "inputs": ["619151916", "619151912"], "output": true }
],
"gt_uint32_euint32": [
- { "inputs": ["2732454384", "4059879084"], "output": false },
- { "inputs": ["212629192", "212629196"], "output": false },
- { "inputs": ["212629196", "212629196"], "output": false },
- { "inputs": ["212629196", "212629192"], "output": true }
+ { "inputs": ["3642906183", "3726690353"], "output": false },
+ { "inputs": ["619151912", "619151916"], "output": false },
+ { "inputs": ["619151916", "619151916"], "output": false },
+ { "inputs": ["619151916", "619151912"], "output": true }
],
"gt_euint32_euint64": [
- { "inputs": ["2256977835", "18442208006659778105"], "output": false },
- { "inputs": ["2256977831", "2256977835"], "output": false },
- { "inputs": ["2256977835", "2256977835"], "output": false },
- { "inputs": ["2256977835", "2256977831"], "output": true }
+ { "inputs": ["1898220780", "18441112726231908571"], "output": false },
+ { "inputs": ["1898220776", "1898220780"], "output": false },
+ { "inputs": ["1898220780", "1898220780"], "output": false },
+ { "inputs": ["1898220780", "1898220776"], "output": true }
+ ],
+ "gt_euint32_euint128": [
+ { "inputs": ["4277077408", "340282366920938463463374604764991737889"], "output": false },
+ { "inputs": ["4277077404", "4277077408"], "output": false },
+ { "inputs": ["4277077408", "4277077408"], "output": false },
+ { "inputs": ["4277077408", "4277077404"], "output": true }
+ ],
+ "gt_euint32_euint256": [
+ {
+ "inputs": ["27376130", "115792089237316195423570985008687907853269984665640564039457582301524979306099"],
+ "output": false
+ },
+ { "inputs": ["27376126", "27376130"], "output": false },
+ { "inputs": ["27376130", "27376130"], "output": false },
+ { "inputs": ["27376130", "27376126"], "output": true }
],
"gt_euint64_euint4": [
- { "inputs": ["18441781451110763323", "1"], "output": true },
+ { "inputs": ["18445379539074122583", "7"], "output": true },
{ "inputs": ["4", "8"], "output": false },
{ "inputs": ["8", "8"], "output": false },
{ "inputs": ["8", "4"], "output": true }
],
"gt_euint64_euint8": [
- { "inputs": ["18446048537684194985", "113"], "output": true },
- { "inputs": ["109", "113"], "output": false },
- { "inputs": ["113", "113"], "output": false },
- { "inputs": ["113", "109"], "output": true }
+ { "inputs": ["18445625176027562117", "124"], "output": true },
+ { "inputs": ["120", "124"], "output": false },
+ { "inputs": ["124", "124"], "output": false },
+ { "inputs": ["124", "120"], "output": true }
],
"gt_euint64_euint16": [
- { "inputs": ["18446546126614473389", "55175"], "output": true },
- { "inputs": ["55171", "55175"], "output": false },
- { "inputs": ["55175", "55175"], "output": false },
- { "inputs": ["55175", "55171"], "output": true }
+ { "inputs": ["18444002964571998281", "52124"], "output": true },
+ { "inputs": ["52120", "52124"], "output": false },
+ { "inputs": ["52124", "52124"], "output": false },
+ { "inputs": ["52124", "52120"], "output": true }
],
"gt_euint64_euint32": [
- { "inputs": ["18443613995542007651", "1679838761"], "output": true },
- { "inputs": ["1679838757", "1679838761"], "output": false },
- { "inputs": ["1679838761", "1679838761"], "output": false },
- { "inputs": ["1679838761", "1679838757"], "output": true }
+ { "inputs": ["18445739090666652013", "2575338339"], "output": true },
+ { "inputs": ["2575338335", "2575338339"], "output": false },
+ { "inputs": ["2575338339", "2575338339"], "output": false },
+ { "inputs": ["2575338339", "2575338335"], "output": true }
],
"gt_euint64_euint64": [
- { "inputs": ["18443021258691337483", "18443593997946075985"], "output": false },
- { "inputs": ["18443021258691337479", "18443021258691337483"], "output": false },
- { "inputs": ["18443021258691337483", "18443021258691337483"], "output": false },
- { "inputs": ["18443021258691337483", "18443021258691337479"], "output": true }
+ { "inputs": ["18444129545450155179", "18438304556640407461"], "output": true },
+ { "inputs": ["18438304556640407457", "18438304556640407461"], "output": false },
+ { "inputs": ["18438304556640407461", "18438304556640407461"], "output": false },
+ { "inputs": ["18438304556640407461", "18438304556640407457"], "output": true }
],
"gt_euint64_uint64": [
- { "inputs": ["18443021258691337483", "18440565481263531071"], "output": true },
- { "inputs": ["18443021258691337479", "18443021258691337483"], "output": false },
- { "inputs": ["18443021258691337483", "18443021258691337483"], "output": false },
- { "inputs": ["18443021258691337483", "18443021258691337479"], "output": true }
+ { "inputs": ["18444129545450155179", "18441052996137337147"], "output": true },
+ { "inputs": ["18438304556640407457", "18438304556640407461"], "output": false },
+ { "inputs": ["18438304556640407461", "18438304556640407461"], "output": false },
+ { "inputs": ["18438304556640407461", "18438304556640407457"], "output": true }
],
"gt_uint64_euint64": [
- { "inputs": ["18439903764692512057", "18440565481263531071"], "output": false },
- { "inputs": ["18443021258691337479", "18443021258691337483"], "output": false },
- { "inputs": ["18443021258691337483", "18443021258691337483"], "output": false },
- { "inputs": ["18443021258691337483", "18443021258691337479"], "output": true }
+ { "inputs": ["18440314139404889003", "18441052996137337147"], "output": false },
+ { "inputs": ["18438304556640407457", "18438304556640407461"], "output": false },
+ { "inputs": ["18438304556640407461", "18438304556640407461"], "output": false },
+ { "inputs": ["18438304556640407461", "18438304556640407457"], "output": true }
+ ],
+ "gt_euint64_euint128": [
+ { "inputs": ["18440808032965074109", "340282366920938463463365853534758019559"], "output": false },
+ { "inputs": ["18440808032965074105", "18440808032965074109"], "output": false },
+ { "inputs": ["18440808032965074109", "18440808032965074109"], "output": false },
+ { "inputs": ["18440808032965074109", "18440808032965074105"], "output": true }
+ ],
+ "gt_euint64_euint256": [
+ {
+ "inputs": [
+ "18443327594956328675",
+ "115792089237316195423570985008687907853269984665640564039457581268418001741927"
+ ],
+ "output": false
+ },
+ { "inputs": ["18443327594956328671", "18443327594956328675"], "output": false },
+ { "inputs": ["18443327594956328675", "18443327594956328675"], "output": false },
+ { "inputs": ["18443327594956328675", "18443327594956328671"], "output": true }
+ ],
+ "gt_euint128_euint4": [
+ { "inputs": ["340282366920938463463367426041495203879", "13"], "output": true },
+ { "inputs": ["9", "13"], "output": false },
+ { "inputs": ["13", "13"], "output": false },
+ { "inputs": ["13", "9"], "output": true }
+ ],
+ "gt_euint128_euint8": [
+ { "inputs": ["340282366920938463463373004399886925283", "9"], "output": true },
+ { "inputs": ["5", "9"], "output": false },
+ { "inputs": ["9", "9"], "output": false },
+ { "inputs": ["9", "5"], "output": true }
+ ],
+ "gt_euint128_euint16": [
+ { "inputs": ["340282366920938463463368543313259159187", "51225"], "output": true },
+ { "inputs": ["51221", "51225"], "output": false },
+ { "inputs": ["51225", "51225"], "output": false },
+ { "inputs": ["51225", "51221"], "output": true }
+ ],
+ "gt_euint128_euint32": [
+ { "inputs": ["340282366920938463463371084318415272059", "235874492"], "output": true },
+ { "inputs": ["235874488", "235874492"], "output": false },
+ { "inputs": ["235874492", "235874492"], "output": false },
+ { "inputs": ["235874492", "235874488"], "output": true }
+ ],
+ "gt_euint128_euint64": [
+ { "inputs": ["340282366920938463463366930376033772101", "18439752237470295949"], "output": true },
+ { "inputs": ["18439752237470295945", "18439752237470295949"], "output": false },
+ { "inputs": ["18439752237470295949", "18439752237470295949"], "output": false },
+ { "inputs": ["18439752237470295949", "18439752237470295945"], "output": true }
+ ],
+ "gt_euint128_euint128": [
+ {
+ "inputs": ["340282366920938463463367714696589499231", "340282366920938463463372280163710625125"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463367714696589499227", "340282366920938463463367714696589499231"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463367714696589499231", "340282366920938463463367714696589499231"],
+ "output": false
+ },
+ { "inputs": ["340282366920938463463367714696589499231", "340282366920938463463367714696589499227"], "output": true }
+ ],
+ "gt_euint128_uint128": [
+ {
+ "inputs": ["340282366920938463463367714696589499231", "340282366920938463463369886774124197135"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463367714696589499227", "340282366920938463463367714696589499231"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463367714696589499231", "340282366920938463463367714696589499231"],
+ "output": false
+ },
+ { "inputs": ["340282366920938463463367714696589499231", "340282366920938463463367714696589499227"], "output": true }
+ ],
+ "gt_uint128_euint128": [
+ {
+ "inputs": ["340282366920938463463371365285946007453", "340282366920938463463369886774124197135"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463367714696589499227", "340282366920938463463367714696589499231"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463367714696589499231", "340282366920938463463367714696589499231"],
+ "output": false
+ },
+ { "inputs": ["340282366920938463463367714696589499231", "340282366920938463463367714696589499227"], "output": true }
+ ],
+ "gt_euint128_euint256": [
+ {
+ "inputs": [
+ "340282366920938463463370843114455636527",
+ "115792089237316195423570985008687907853269984665640564039457583283635470770217"
+ ],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463370843114455636523", "340282366920938463463370843114455636527"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463370843114455636527", "340282366920938463463370843114455636527"],
+ "output": false
+ },
+ { "inputs": ["340282366920938463463370843114455636527", "340282366920938463463370843114455636523"], "output": true }
+ ],
+ "gt_euint256_euint4": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457576018520605547063", "8"],
+ "output": true
+ },
+ { "inputs": ["4", "8"], "output": false },
+ { "inputs": ["8", "8"], "output": false },
+ { "inputs": ["8", "4"], "output": true }
+ ],
+ "gt_euint256_euint8": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457583855482126679265", "93"],
+ "output": true
+ },
+ { "inputs": ["89", "93"], "output": false },
+ { "inputs": ["93", "93"], "output": false },
+ { "inputs": ["93", "89"], "output": true }
+ ],
+ "gt_euint256_euint16": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457580207253841161561", "59068"],
+ "output": true
+ },
+ { "inputs": ["59064", "59068"], "output": false },
+ { "inputs": ["59068", "59068"], "output": false },
+ { "inputs": ["59068", "59064"], "output": true }
+ ],
+ "gt_euint256_euint32": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457580729313167530831", "902297828"],
+ "output": true
+ },
+ { "inputs": ["902297824", "902297828"], "output": false },
+ { "inputs": ["902297828", "902297828"], "output": false },
+ { "inputs": ["902297828", "902297824"], "output": true }
+ ],
+ "gt_euint256_euint64": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457582386276584123553",
+ "18443192077233247397"
+ ],
+ "output": true
+ },
+ { "inputs": ["18443192077233247393", "18443192077233247397"], "output": false },
+ { "inputs": ["18443192077233247397", "18443192077233247397"], "output": false },
+ { "inputs": ["18443192077233247397", "18443192077233247393"], "output": true }
+ ],
+ "gt_euint256_euint128": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457583305927195076375",
+ "340282366920938463463370153073900549113"
+ ],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463370153073900549109", "340282366920938463463370153073900549113"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463370153073900549113", "340282366920938463463370153073900549113"],
+ "output": false
+ },
+ { "inputs": ["340282366920938463463370153073900549113", "340282366920938463463370153073900549109"], "output": true }
+ ],
+ "gt_euint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457580885855005541993",
+ "115792089237316195423570985008687907853269984665640564039457582339622165148199"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457580885855005541989",
+ "115792089237316195423570985008687907853269984665640564039457580885855005541993"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457580885855005541993",
+ "115792089237316195423570985008687907853269984665640564039457580885855005541993"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457580885855005541993",
+ "115792089237316195423570985008687907853269984665640564039457580885855005541989"
+ ],
+ "output": true
+ }
+ ],
+ "gt_euint256_uint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457580885855005541993",
+ "115792089237316195423570985008687907853269984665640564039457576330419987992913"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457580885855005541989",
+ "115792089237316195423570985008687907853269984665640564039457580885855005541993"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457580885855005541993",
+ "115792089237316195423570985008687907853269984665640564039457580885855005541993"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457580885855005541993",
+ "115792089237316195423570985008687907853269984665640564039457580885855005541989"
+ ],
+ "output": true
+ }
+ ],
+ "gt_uint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457583273117366659453",
+ "115792089237316195423570985008687907853269984665640564039457576330419987992913"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457580885855005541989",
+ "115792089237316195423570985008687907853269984665640564039457580885855005541993"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457580885855005541993",
+ "115792089237316195423570985008687907853269984665640564039457580885855005541993"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457580885855005541993",
+ "115792089237316195423570985008687907853269984665640564039457580885855005541989"
+ ],
+ "output": true
+ }
],
"eq_euint4_euint4": [
- { "inputs": ["6", "11"], "output": false },
+ { "inputs": ["2", "2"], "output": true },
{ "inputs": ["4", "8"], "output": false },
{ "inputs": ["8", "8"], "output": true },
{ "inputs": ["8", "4"], "output": false }
],
"eq_euint4_euint8": [
- { "inputs": ["4", "5"], "output": false },
+ { "inputs": ["14", "3"], "output": false },
{ "inputs": ["4", "8"], "output": false },
{ "inputs": ["8", "8"], "output": true },
{ "inputs": ["8", "4"], "output": false }
],
"eq_euint4_uint8": [
- { "inputs": ["4", "1"], "output": false },
+ { "inputs": ["14", "7"], "output": false },
{ "inputs": ["4", "8"], "output": false },
{ "inputs": ["8", "8"], "output": true },
{ "inputs": ["8", "4"], "output": false }
],
"eq_euint4_euint16": [
- { "inputs": ["10", "41899"], "output": false },
- { "inputs": ["6", "10"], "output": false },
- { "inputs": ["10", "10"], "output": true },
- { "inputs": ["10", "6"], "output": false }
+ { "inputs": ["11", "40901"], "output": false },
+ { "inputs": ["7", "11"], "output": false },
+ { "inputs": ["11", "11"], "output": true },
+ { "inputs": ["11", "7"], "output": false }
],
"eq_euint4_euint32": [
- { "inputs": ["2", "183972195"], "output": false },
- { "inputs": ["4", "8"], "output": false },
- { "inputs": ["8", "8"], "output": true },
- { "inputs": ["8", "4"], "output": false }
- ],
- "eq_euint4_euint64": [
- { "inputs": ["9", "18438414163462572393"], "output": false },
+ { "inputs": ["9", "1089894566"], "output": false },
{ "inputs": ["5", "9"], "output": false },
{ "inputs": ["9", "9"], "output": true },
{ "inputs": ["9", "5"], "output": false }
],
- "eq_euint8_euint4": [
- { "inputs": ["37", "7"], "output": false },
+ "eq_euint4_euint64": [
+ { "inputs": ["3", "18443050121569259433"], "output": false },
{ "inputs": ["4", "8"], "output": false },
{ "inputs": ["8", "8"], "output": true },
{ "inputs": ["8", "4"], "output": false }
],
+ "eq_euint4_euint128": [
+ { "inputs": ["10", "340282366920938463463370073243865312497"], "output": false },
+ { "inputs": ["6", "10"], "output": false },
+ { "inputs": ["10", "10"], "output": true },
+ { "inputs": ["10", "6"], "output": false }
+ ],
+ "eq_euint4_euint256": [
+ {
+ "inputs": ["14", "115792089237316195423570985008687907853269984665640564039457583778640701263885"],
+ "output": false
+ },
+ { "inputs": ["10", "14"], "output": false },
+ { "inputs": ["14", "14"], "output": true },
+ { "inputs": ["14", "10"], "output": false }
+ ],
+ "eq_euint8_euint4": [
+ { "inputs": ["65", "9"], "output": false },
+ { "inputs": ["5", "9"], "output": false },
+ { "inputs": ["9", "9"], "output": true },
+ { "inputs": ["9", "5"], "output": false }
+ ],
"eq_uint8_euint4": [
- { "inputs": ["2", "7"], "output": false },
- { "inputs": ["4", "8"], "output": false },
- { "inputs": ["8", "8"], "output": true },
- { "inputs": ["8", "4"], "output": false }
+ { "inputs": ["1", "9"], "output": false },
+ { "inputs": ["5", "9"], "output": false },
+ { "inputs": ["9", "9"], "output": true },
+ { "inputs": ["9", "5"], "output": false }
],
"eq_euint8_euint8": [
- { "inputs": ["51", "70"], "output": false },
- { "inputs": ["47", "51"], "output": false },
- { "inputs": ["51", "51"], "output": true },
- { "inputs": ["51", "47"], "output": false }
+ { "inputs": ["175", "224"], "output": false },
+ { "inputs": ["171", "175"], "output": false },
+ { "inputs": ["175", "175"], "output": true },
+ { "inputs": ["175", "171"], "output": false }
],
"eq_euint8_uint8": [
- { "inputs": ["51", "215"], "output": false },
- { "inputs": ["47", "51"], "output": false },
- { "inputs": ["51", "51"], "output": true },
- { "inputs": ["51", "47"], "output": false }
+ { "inputs": ["175", "253"], "output": false },
+ { "inputs": ["171", "175"], "output": false },
+ { "inputs": ["175", "175"], "output": true },
+ { "inputs": ["175", "171"], "output": false }
],
"eq_uint8_euint8": [
- { "inputs": ["31", "215"], "output": false },
- { "inputs": ["47", "51"], "output": false },
- { "inputs": ["51", "51"], "output": true },
- { "inputs": ["51", "47"], "output": false }
+ { "inputs": ["158", "253"], "output": false },
+ { "inputs": ["171", "175"], "output": false },
+ { "inputs": ["175", "175"], "output": true },
+ { "inputs": ["175", "171"], "output": false }
],
"eq_euint8_euint16": [
- { "inputs": ["22", "5993"], "output": false },
- { "inputs": ["18", "22"], "output": false },
- { "inputs": ["22", "22"], "output": true },
- { "inputs": ["22", "18"], "output": false }
+ { "inputs": ["205", "56577"], "output": false },
+ { "inputs": ["201", "205"], "output": false },
+ { "inputs": ["205", "205"], "output": true },
+ { "inputs": ["205", "201"], "output": false }
],
"eq_euint8_euint32": [
- { "inputs": ["110", "224862953"], "output": false },
- { "inputs": ["106", "110"], "output": false },
- { "inputs": ["110", "110"], "output": true },
- { "inputs": ["110", "106"], "output": false }
+ { "inputs": ["226", "3320102390"], "output": false },
+ { "inputs": ["222", "226"], "output": false },
+ { "inputs": ["226", "226"], "output": true },
+ { "inputs": ["226", "222"], "output": false }
],
"eq_euint8_euint64": [
- { "inputs": ["151", "18441484264494857597"], "output": false },
- { "inputs": ["147", "151"], "output": false },
- { "inputs": ["151", "151"], "output": true },
- { "inputs": ["151", "147"], "output": false }
+ { "inputs": ["141", "18441419220641833889"], "output": false },
+ { "inputs": ["137", "141"], "output": false },
+ { "inputs": ["141", "141"], "output": true },
+ { "inputs": ["141", "137"], "output": false }
+ ],
+ "eq_euint8_euint128": [
+ { "inputs": ["111", "340282366920938463463367365018688833419"], "output": false },
+ { "inputs": ["107", "111"], "output": false },
+ { "inputs": ["111", "111"], "output": true },
+ { "inputs": ["111", "107"], "output": false }
+ ],
+ "eq_euint8_euint256": [
+ {
+ "inputs": ["160", "115792089237316195423570985008687907853269984665640564039457581836943917626145"],
+ "output": false
+ },
+ { "inputs": ["156", "160"], "output": false },
+ { "inputs": ["160", "160"], "output": true },
+ { "inputs": ["160", "156"], "output": false }
],
"eq_euint16_euint4": [
- { "inputs": ["57152", "3"], "output": false },
- { "inputs": ["4", "8"], "output": false },
- { "inputs": ["8", "8"], "output": true },
- { "inputs": ["8", "4"], "output": false }
+ { "inputs": ["51541", "14"], "output": false },
+ { "inputs": ["10", "14"], "output": false },
+ { "inputs": ["14", "14"], "output": true },
+ { "inputs": ["14", "10"], "output": false }
],
"eq_euint16_euint8": [
- { "inputs": ["64589", "145"], "output": false },
- { "inputs": ["141", "145"], "output": false },
- { "inputs": ["145", "145"], "output": true },
- { "inputs": ["145", "141"], "output": false }
+ { "inputs": ["33521", "144"], "output": false },
+ { "inputs": ["140", "144"], "output": false },
+ { "inputs": ["144", "144"], "output": true },
+ { "inputs": ["144", "140"], "output": false }
],
"eq_euint16_euint16": [
- { "inputs": ["63705", "3249"], "output": false },
- { "inputs": ["3245", "3249"], "output": false },
- { "inputs": ["3249", "3249"], "output": true },
- { "inputs": ["3249", "3245"], "output": false }
+ { "inputs": ["45930", "43845"], "output": false },
+ { "inputs": ["43841", "43845"], "output": false },
+ { "inputs": ["43845", "43845"], "output": true },
+ { "inputs": ["43845", "43841"], "output": false }
],
"eq_euint16_uint16": [
- { "inputs": ["63705", "39705"], "output": false },
- { "inputs": ["3245", "3249"], "output": false },
- { "inputs": ["3249", "3249"], "output": true },
- { "inputs": ["3249", "3245"], "output": false }
+ { "inputs": ["45930", "25309"], "output": false },
+ { "inputs": ["43841", "43845"], "output": false },
+ { "inputs": ["43845", "43845"], "output": true },
+ { "inputs": ["43845", "43841"], "output": false }
],
"eq_uint16_euint16": [
- { "inputs": ["28254", "39705"], "output": false },
- { "inputs": ["3245", "3249"], "output": false },
- { "inputs": ["3249", "3249"], "output": true },
- { "inputs": ["3249", "3245"], "output": false }
+ { "inputs": ["50532", "25309"], "output": false },
+ { "inputs": ["43841", "43845"], "output": false },
+ { "inputs": ["43845", "43845"], "output": true },
+ { "inputs": ["43845", "43841"], "output": false }
],
"eq_euint16_euint32": [
- { "inputs": ["19428", "3260350416"], "output": false },
- { "inputs": ["19424", "19428"], "output": false },
- { "inputs": ["19428", "19428"], "output": true },
- { "inputs": ["19428", "19424"], "output": false }
+ { "inputs": ["14585", "2487581396"], "output": false },
+ { "inputs": ["14581", "14585"], "output": false },
+ { "inputs": ["14585", "14585"], "output": true },
+ { "inputs": ["14585", "14581"], "output": false }
],
"eq_euint16_euint64": [
- { "inputs": ["15185", "18442214214141554887"], "output": false },
- { "inputs": ["15181", "15185"], "output": false },
- { "inputs": ["15185", "15185"], "output": true },
- { "inputs": ["15185", "15181"], "output": false }
+ { "inputs": ["29419", "18446062766310773765"], "output": false },
+ { "inputs": ["29415", "29419"], "output": false },
+ { "inputs": ["29419", "29419"], "output": true },
+ { "inputs": ["29419", "29415"], "output": false }
+ ],
+ "eq_euint16_euint128": [
+ { "inputs": ["47922", "340282366920938463463372663915711616945"], "output": false },
+ { "inputs": ["47918", "47922"], "output": false },
+ { "inputs": ["47922", "47922"], "output": true },
+ { "inputs": ["47922", "47918"], "output": false }
+ ],
+ "eq_euint16_euint256": [
+ {
+ "inputs": ["55138", "115792089237316195423570985008687907853269984665640564039457576200268434748919"],
+ "output": false
+ },
+ { "inputs": ["55134", "55138"], "output": false },
+ { "inputs": ["55138", "55138"], "output": true },
+ { "inputs": ["55138", "55134"], "output": false }
],
"eq_euint32_euint4": [
- { "inputs": ["3027950561", "14"], "output": false },
- { "inputs": ["10", "14"], "output": false },
- { "inputs": ["14", "14"], "output": true },
- { "inputs": ["14", "10"], "output": false }
+ { "inputs": ["1592167767", "2"], "output": false },
+ { "inputs": ["4", "8"], "output": false },
+ { "inputs": ["8", "8"], "output": true },
+ { "inputs": ["8", "4"], "output": false }
],
"eq_euint32_euint8": [
- { "inputs": ["1831274090", "104"], "output": false },
- { "inputs": ["100", "104"], "output": false },
- { "inputs": ["104", "104"], "output": true },
- { "inputs": ["104", "100"], "output": false }
+ { "inputs": ["2371399582", "166"], "output": false },
+ { "inputs": ["162", "166"], "output": false },
+ { "inputs": ["166", "166"], "output": true },
+ { "inputs": ["166", "162"], "output": false }
],
"eq_euint32_euint16": [
- { "inputs": ["3944731587", "33929"], "output": false },
- { "inputs": ["33925", "33929"], "output": false },
- { "inputs": ["33929", "33929"], "output": true },
- { "inputs": ["33929", "33925"], "output": false }
+ { "inputs": ["843782707", "34473"], "output": false },
+ { "inputs": ["34469", "34473"], "output": false },
+ { "inputs": ["34473", "34473"], "output": true },
+ { "inputs": ["34473", "34469"], "output": false }
],
"eq_euint32_euint32": [
- { "inputs": ["287391998", "2464993294"], "output": false },
- { "inputs": ["287391994", "287391998"], "output": false },
- { "inputs": ["287391998", "287391998"], "output": true },
- { "inputs": ["287391998", "287391994"], "output": false }
+ { "inputs": ["3899668665", "3823635226"], "output": false },
+ { "inputs": ["3823635222", "3823635226"], "output": false },
+ { "inputs": ["3823635226", "3823635226"], "output": true },
+ { "inputs": ["3823635226", "3823635222"], "output": false }
],
"eq_euint32_uint32": [
- { "inputs": ["287391998", "3065919083"], "output": false },
- { "inputs": ["287391994", "287391998"], "output": false },
- { "inputs": ["287391998", "287391998"], "output": true },
- { "inputs": ["287391998", "287391994"], "output": false }
+ { "inputs": ["3899668665", "2460864818"], "output": false },
+ { "inputs": ["3823635222", "3823635226"], "output": false },
+ { "inputs": ["3823635226", "3823635226"], "output": true },
+ { "inputs": ["3823635226", "3823635222"], "output": false }
],
"eq_uint32_euint32": [
- { "inputs": ["833280044", "3065919083"], "output": false },
- { "inputs": ["287391994", "287391998"], "output": false },
- { "inputs": ["287391998", "287391998"], "output": true },
- { "inputs": ["287391998", "287391994"], "output": false }
+ { "inputs": ["3310168424", "2460864818"], "output": false },
+ { "inputs": ["3823635222", "3823635226"], "output": false },
+ { "inputs": ["3823635226", "3823635226"], "output": true },
+ { "inputs": ["3823635226", "3823635222"], "output": false }
],
"eq_euint32_euint64": [
- { "inputs": ["709957546", "18441724614470442911"], "output": false },
- { "inputs": ["709957542", "709957546"], "output": false },
- { "inputs": ["709957546", "709957546"], "output": true },
- { "inputs": ["709957546", "709957542"], "output": false }
+ { "inputs": ["3575591686", "18441139457541916589"], "output": false },
+ { "inputs": ["3575591682", "3575591686"], "output": false },
+ { "inputs": ["3575591686", "3575591686"], "output": true },
+ { "inputs": ["3575591686", "3575591682"], "output": false }
+ ],
+ "eq_euint32_euint128": [
+ { "inputs": ["764411697", "340282366920938463463368167171281881439"], "output": false },
+ { "inputs": ["764411693", "764411697"], "output": false },
+ { "inputs": ["764411697", "764411697"], "output": true },
+ { "inputs": ["764411697", "764411693"], "output": false }
+ ],
+ "eq_euint32_euint256": [
+ {
+ "inputs": ["1808856605", "115792089237316195423570985008687907853269984665640564039457582106419349698079"],
+ "output": false
+ },
+ { "inputs": ["1808856601", "1808856605"], "output": false },
+ { "inputs": ["1808856605", "1808856605"], "output": true },
+ { "inputs": ["1808856605", "1808856601"], "output": false }
],
"eq_euint64_euint4": [
- { "inputs": ["18446728320459652857", "10"], "output": false },
- { "inputs": ["6", "10"], "output": false },
- { "inputs": ["10", "10"], "output": true },
- { "inputs": ["10", "6"], "output": false }
+ { "inputs": ["18439903646396993533", "7"], "output": false },
+ { "inputs": ["4", "8"], "output": false },
+ { "inputs": ["8", "8"], "output": true },
+ { "inputs": ["8", "4"], "output": false }
],
"eq_euint64_euint8": [
- { "inputs": ["18446185668440461367", "98"], "output": false },
- { "inputs": ["94", "98"], "output": false },
- { "inputs": ["98", "98"], "output": true },
- { "inputs": ["98", "94"], "output": false }
+ { "inputs": ["18439031766765231937", "63"], "output": false },
+ { "inputs": ["59", "63"], "output": false },
+ { "inputs": ["63", "63"], "output": true },
+ { "inputs": ["63", "59"], "output": false }
],
"eq_euint64_euint16": [
- { "inputs": ["18439660654359160363", "41883"], "output": false },
- { "inputs": ["41879", "41883"], "output": false },
- { "inputs": ["41883", "41883"], "output": true },
- { "inputs": ["41883", "41879"], "output": false }
+ { "inputs": ["18445593277781135549", "65299"], "output": false },
+ { "inputs": ["65295", "65299"], "output": false },
+ { "inputs": ["65299", "65299"], "output": true },
+ { "inputs": ["65299", "65295"], "output": false }
],
"eq_euint64_euint32": [
- { "inputs": ["18445744067307966387", "926561519"], "output": false },
- { "inputs": ["926561515", "926561519"], "output": false },
- { "inputs": ["926561519", "926561519"], "output": true },
- { "inputs": ["926561519", "926561515"], "output": false }
+ { "inputs": ["18443073273307378367", "1540281447"], "output": false },
+ { "inputs": ["1540281443", "1540281447"], "output": false },
+ { "inputs": ["1540281447", "1540281447"], "output": true },
+ { "inputs": ["1540281447", "1540281443"], "output": false }
],
"eq_euint64_euint64": [
- { "inputs": ["18442470885463520691", "18445888562756211467"], "output": false },
- { "inputs": ["18442470885463520687", "18442470885463520691"], "output": false },
- { "inputs": ["18442470885463520691", "18442470885463520691"], "output": true },
- { "inputs": ["18442470885463520691", "18442470885463520687"], "output": false }
+ { "inputs": ["18443282870504090991", "18446028700927461615"], "output": false },
+ { "inputs": ["18443282870504090987", "18443282870504090991"], "output": false },
+ { "inputs": ["18443282870504090991", "18443282870504090991"], "output": true },
+ { "inputs": ["18443282870504090991", "18443282870504090987"], "output": false }
],
"eq_euint64_uint64": [
- { "inputs": ["18442470885463520691", "18444839379902899701"], "output": false },
- { "inputs": ["18442470885463520687", "18442470885463520691"], "output": false },
- { "inputs": ["18442470885463520691", "18442470885463520691"], "output": true },
- { "inputs": ["18442470885463520691", "18442470885463520687"], "output": false }
+ { "inputs": ["18443282870504090991", "18439130415590833625"], "output": false },
+ { "inputs": ["18443282870504090987", "18443282870504090991"], "output": false },
+ { "inputs": ["18443282870504090991", "18443282870504090991"], "output": true },
+ { "inputs": ["18443282870504090991", "18443282870504090987"], "output": false }
],
"eq_uint64_euint64": [
- { "inputs": ["18446106064654681685", "18444839379902899701"], "output": false },
- { "inputs": ["18442470885463520687", "18442470885463520691"], "output": false },
- { "inputs": ["18442470885463520691", "18442470885463520691"], "output": true },
- { "inputs": ["18442470885463520691", "18442470885463520687"], "output": false }
+ { "inputs": ["18442875587397628573", "18439130415590833625"], "output": false },
+ { "inputs": ["18443282870504090987", "18443282870504090991"], "output": false },
+ { "inputs": ["18443282870504090991", "18443282870504090991"], "output": true },
+ { "inputs": ["18443282870504090991", "18443282870504090987"], "output": false }
+ ],
+ "eq_euint64_euint128": [
+ { "inputs": ["18440180042915486669", "340282366920938463463371210059252201113"], "output": false },
+ { "inputs": ["18440180042915486665", "18440180042915486669"], "output": false },
+ { "inputs": ["18440180042915486669", "18440180042915486669"], "output": true },
+ { "inputs": ["18440180042915486669", "18440180042915486665"], "output": false }
+ ],
+ "eq_euint64_euint256": [
+ {
+ "inputs": [
+ "18443851863635995939",
+ "115792089237316195423570985008687907853269984665640564039457575030888379042775"
+ ],
+ "output": false
+ },
+ { "inputs": ["18443851863635995935", "18443851863635995939"], "output": false },
+ { "inputs": ["18443851863635995939", "18443851863635995939"], "output": true },
+ { "inputs": ["18443851863635995939", "18443851863635995935"], "output": false }
+ ],
+ "eq_euint128_euint4": [
+ { "inputs": ["340282366920938463463369794780094019941", "2"], "output": false },
+ { "inputs": ["4", "8"], "output": false },
+ { "inputs": ["8", "8"], "output": true },
+ { "inputs": ["8", "4"], "output": false }
+ ],
+ "eq_euint128_euint8": [
+ { "inputs": ["340282366920938463463368012116669397375", "111"], "output": false },
+ { "inputs": ["107", "111"], "output": false },
+ { "inputs": ["111", "111"], "output": true },
+ { "inputs": ["111", "107"], "output": false }
+ ],
+ "eq_euint128_euint16": [
+ { "inputs": ["340282366920938463463365947218770561253", "63555"], "output": false },
+ { "inputs": ["63551", "63555"], "output": false },
+ { "inputs": ["63555", "63555"], "output": true },
+ { "inputs": ["63555", "63551"], "output": false }
+ ],
+ "eq_euint128_euint32": [
+ { "inputs": ["340282366920938463463365905779679562131", "1923235589"], "output": false },
+ { "inputs": ["1923235585", "1923235589"], "output": false },
+ { "inputs": ["1923235589", "1923235589"], "output": true },
+ { "inputs": ["1923235589", "1923235585"], "output": false }
+ ],
+ "eq_euint128_euint64": [
+ { "inputs": ["340282366920938463463373700954879453501", "18443047059286955551"], "output": false },
+ { "inputs": ["18443047059286955547", "18443047059286955551"], "output": false },
+ { "inputs": ["18443047059286955551", "18443047059286955551"], "output": true },
+ { "inputs": ["18443047059286955551", "18443047059286955547"], "output": false }
+ ],
+ "eq_euint128_euint128": [
+ {
+ "inputs": ["340282366920938463463371368021216956093", "340282366920938463463370243874611927705"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463370243874611927701", "340282366920938463463370243874611927705"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463370243874611927705", "340282366920938463463370243874611927705"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463370243874611927705", "340282366920938463463370243874611927701"],
+ "output": false
+ }
+ ],
+ "eq_euint128_uint128": [
+ {
+ "inputs": ["340282366920938463463371368021216956093", "340282366920938463463373345909663104587"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463370243874611927701", "340282366920938463463370243874611927705"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463370243874611927705", "340282366920938463463370243874611927705"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463370243874611927705", "340282366920938463463370243874611927701"],
+ "output": false
+ }
+ ],
+ "eq_uint128_euint128": [
+ {
+ "inputs": ["340282366920938463463369712474902223435", "340282366920938463463373345909663104587"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463370243874611927701", "340282366920938463463370243874611927705"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463370243874611927705", "340282366920938463463370243874611927705"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463370243874611927705", "340282366920938463463370243874611927701"],
+ "output": false
+ }
+ ],
+ "eq_euint128_euint256": [
+ {
+ "inputs": [
+ "340282366920938463463367588896596491863",
+ "115792089237316195423570985008687907853269984665640564039457578982740222216241"
+ ],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463367588896596491859", "340282366920938463463367588896596491863"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463367588896596491863", "340282366920938463463367588896596491863"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463367588896596491863", "340282366920938463463367588896596491859"],
+ "output": false
+ }
+ ],
+ "eq_euint256_euint4": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457581942293222963611", "1"],
+ "output": false
+ },
+ { "inputs": ["4", "8"], "output": false },
+ { "inputs": ["8", "8"], "output": true },
+ { "inputs": ["8", "4"], "output": false }
+ ],
+ "eq_euint256_euint8": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457581724603808654415", "213"],
+ "output": false
+ },
+ { "inputs": ["209", "213"], "output": false },
+ { "inputs": ["213", "213"], "output": true },
+ { "inputs": ["213", "209"], "output": false }
+ ],
+ "eq_euint256_euint16": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457581937945784624293", "42555"],
+ "output": false
+ },
+ { "inputs": ["42551", "42555"], "output": false },
+ { "inputs": ["42555", "42555"], "output": true },
+ { "inputs": ["42555", "42551"], "output": false }
+ ],
+ "eq_euint256_euint32": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457580556825298662935", "2172668277"],
+ "output": false
+ },
+ { "inputs": ["2172668273", "2172668277"], "output": false },
+ { "inputs": ["2172668277", "2172668277"], "output": true },
+ { "inputs": ["2172668277", "2172668273"], "output": false }
+ ],
+ "eq_euint256_euint64": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579655327337947495",
+ "18438962761364358079"
+ ],
+ "output": false
+ },
+ { "inputs": ["18438962761364358075", "18438962761364358079"], "output": false },
+ { "inputs": ["18438962761364358079", "18438962761364358079"], "output": true },
+ { "inputs": ["18438962761364358079", "18438962761364358075"], "output": false }
+ ],
+ "eq_euint256_euint128": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457583147947133304483",
+ "340282366920938463463373080930672512019"
+ ],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463373080930672512015", "340282366920938463463373080930672512019"],
+ "output": false
+ },
+ {
+ "inputs": ["340282366920938463463373080930672512019", "340282366920938463463373080930672512019"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463373080930672512019", "340282366920938463463373080930672512015"],
+ "output": false
+ }
+ ],
+ "eq_euint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579028937132718443",
+ "115792089237316195423570985008687907853269984665640564039457575281612927984431"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457575281612927984427",
+ "115792089237316195423570985008687907853269984665640564039457575281612927984431"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457575281612927984431",
+ "115792089237316195423570985008687907853269984665640564039457575281612927984431"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457575281612927984431",
+ "115792089237316195423570985008687907853269984665640564039457575281612927984427"
+ ],
+ "output": false
+ }
+ ],
+ "eq_euint256_uint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579028937132718443",
+ "115792089237316195423570985008687907853269984665640564039457576393900678416361"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457575281612927984427",
+ "115792089237316195423570985008687907853269984665640564039457575281612927984431"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457575281612927984431",
+ "115792089237316195423570985008687907853269984665640564039457575281612927984431"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457575281612927984431",
+ "115792089237316195423570985008687907853269984665640564039457575281612927984427"
+ ],
+ "output": false
+ }
+ ],
+ "eq_uint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577173439170014457",
+ "115792089237316195423570985008687907853269984665640564039457576393900678416361"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457575281612927984427",
+ "115792089237316195423570985008687907853269984665640564039457575281612927984431"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457575281612927984431",
+ "115792089237316195423570985008687907853269984665640564039457575281612927984431"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457575281612927984431",
+ "115792089237316195423570985008687907853269984665640564039457575281612927984427"
+ ],
+ "output": false
+ }
],
"ne_euint4_euint4": [
- { "inputs": ["11", "4"], "output": true },
+ { "inputs": ["1", "9"], "output": true },
{ "inputs": ["4", "8"], "output": true },
{ "inputs": ["8", "8"], "output": false },
{ "inputs": ["8", "4"], "output": true }
],
"ne_euint4_euint8": [
- { "inputs": ["4", "62"], "output": true },
+ { "inputs": ["8", "128"], "output": true },
{ "inputs": ["4", "8"], "output": true },
{ "inputs": ["8", "8"], "output": false },
{ "inputs": ["8", "4"], "output": true }
],
"ne_euint4_uint8": [
- { "inputs": ["4", "6"], "output": true },
+ { "inputs": ["8", "9"], "output": true },
{ "inputs": ["4", "8"], "output": true },
{ "inputs": ["8", "8"], "output": false },
{ "inputs": ["8", "4"], "output": true }
],
"ne_euint4_euint16": [
- { "inputs": ["3", "41708"], "output": true },
- { "inputs": ["4", "8"], "output": true },
- { "inputs": ["8", "8"], "output": false },
- { "inputs": ["8", "4"], "output": true }
- ],
- "ne_euint4_euint32": [
- { "inputs": ["14", "1312265251"], "output": true },
+ { "inputs": ["14", "35568"], "output": true },
{ "inputs": ["10", "14"], "output": true },
{ "inputs": ["14", "14"], "output": false },
{ "inputs": ["14", "10"], "output": true }
],
+ "ne_euint4_euint32": [
+ { "inputs": ["5", "2818677977"], "output": true },
+ { "inputs": ["4", "8"], "output": true },
+ { "inputs": ["8", "8"], "output": false },
+ { "inputs": ["8", "4"], "output": true }
+ ],
"ne_euint4_euint64": [
- { "inputs": ["7", "18441024342807508949"], "output": true },
+ { "inputs": ["7", "18446555094221865045"], "output": true },
{ "inputs": ["4", "8"], "output": true },
{ "inputs": ["8", "8"], "output": false },
{ "inputs": ["8", "4"], "output": true }
],
- "ne_euint8_euint4": [
- { "inputs": ["145", "14"], "output": true },
+ "ne_euint4_euint128": [
+ { "inputs": ["13", "340282366920938463463368725666766226609"], "output": true },
+ { "inputs": ["9", "13"], "output": true },
+ { "inputs": ["13", "13"], "output": false },
+ { "inputs": ["13", "9"], "output": true }
+ ],
+ "ne_euint4_euint256": [
+ {
+ "inputs": ["14", "115792089237316195423570985008687907853269984665640564039457581114073806378677"],
+ "output": true
+ },
{ "inputs": ["10", "14"], "output": true },
{ "inputs": ["14", "14"], "output": false },
{ "inputs": ["14", "10"], "output": true }
],
+ "ne_euint8_euint4": [
+ { "inputs": ["27", "13"], "output": true },
+ { "inputs": ["9", "13"], "output": true },
+ { "inputs": ["13", "13"], "output": false },
+ { "inputs": ["13", "9"], "output": true }
+ ],
"ne_uint8_euint4": [
- { "inputs": ["3", "14"], "output": true },
- { "inputs": ["10", "14"], "output": true },
- { "inputs": ["14", "14"], "output": false },
- { "inputs": ["14", "10"], "output": true }
+ { "inputs": ["9", "13"], "output": true },
+ { "inputs": ["9", "13"], "output": true },
+ { "inputs": ["13", "13"], "output": false },
+ { "inputs": ["13", "9"], "output": true }
],
"ne_euint8_euint8": [
- { "inputs": ["236", "26"], "output": true },
- { "inputs": ["22", "26"], "output": true },
- { "inputs": ["26", "26"], "output": false },
- { "inputs": ["26", "22"], "output": true }
+ { "inputs": ["197", "245"], "output": true },
+ { "inputs": ["193", "197"], "output": true },
+ { "inputs": ["197", "197"], "output": false },
+ { "inputs": ["197", "193"], "output": true }
],
"ne_euint8_uint8": [
- { "inputs": ["236", "213"], "output": true },
- { "inputs": ["22", "26"], "output": true },
- { "inputs": ["26", "26"], "output": false },
- { "inputs": ["26", "22"], "output": true }
+ { "inputs": ["197", "40"], "output": true },
+ { "inputs": ["193", "197"], "output": true },
+ { "inputs": ["197", "197"], "output": false },
+ { "inputs": ["197", "193"], "output": true }
],
"ne_uint8_euint8": [
- { "inputs": ["66", "213"], "output": true },
- { "inputs": ["22", "26"], "output": true },
- { "inputs": ["26", "26"], "output": false },
- { "inputs": ["26", "22"], "output": true }
+ { "inputs": ["243", "40"], "output": true },
+ { "inputs": ["193", "197"], "output": true },
+ { "inputs": ["197", "197"], "output": false },
+ { "inputs": ["197", "193"], "output": true }
],
"ne_euint8_euint16": [
- { "inputs": ["201", "56595"], "output": true },
- { "inputs": ["197", "201"], "output": true },
- { "inputs": ["201", "201"], "output": false },
- { "inputs": ["201", "197"], "output": true }
+ { "inputs": ["128", "47128"], "output": true },
+ { "inputs": ["124", "128"], "output": true },
+ { "inputs": ["128", "128"], "output": false },
+ { "inputs": ["128", "124"], "output": true }
],
"ne_euint8_euint32": [
- { "inputs": ["189", "472792825"], "output": true },
- { "inputs": ["185", "189"], "output": true },
- { "inputs": ["189", "189"], "output": false },
- { "inputs": ["189", "185"], "output": true }
+ { "inputs": ["134", "943645708"], "output": true },
+ { "inputs": ["130", "134"], "output": true },
+ { "inputs": ["134", "134"], "output": false },
+ { "inputs": ["134", "130"], "output": true }
],
"ne_euint8_euint64": [
- { "inputs": ["174", "18439836363494569405"], "output": true },
- { "inputs": ["170", "174"], "output": true },
- { "inputs": ["174", "174"], "output": false },
- { "inputs": ["174", "170"], "output": true }
+ { "inputs": ["99", "18445356789087657925"], "output": true },
+ { "inputs": ["95", "99"], "output": true },
+ { "inputs": ["99", "99"], "output": false },
+ { "inputs": ["99", "95"], "output": true }
+ ],
+ "ne_euint8_euint128": [
+ { "inputs": ["226", "340282366920938463463366961237977601965"], "output": true },
+ { "inputs": ["222", "226"], "output": true },
+ { "inputs": ["226", "226"], "output": false },
+ { "inputs": ["226", "222"], "output": true }
+ ],
+ "ne_euint8_euint256": [
+ {
+ "inputs": ["214", "115792089237316195423570985008687907853269984665640564039457580955238657941683"],
+ "output": true
+ },
+ { "inputs": ["210", "214"], "output": true },
+ { "inputs": ["214", "214"], "output": false },
+ { "inputs": ["214", "210"], "output": true }
],
"ne_euint16_euint4": [
- { "inputs": ["24920", "3"], "output": true },
+ { "inputs": ["26709", "5"], "output": true },
{ "inputs": ["4", "8"], "output": true },
{ "inputs": ["8", "8"], "output": false },
{ "inputs": ["8", "4"], "output": true }
],
"ne_euint16_euint8": [
- { "inputs": ["59614", "149"], "output": true },
- { "inputs": ["145", "149"], "output": true },
- { "inputs": ["149", "149"], "output": false },
- { "inputs": ["149", "145"], "output": true }
+ { "inputs": ["13794", "3"], "output": true },
+ { "inputs": ["4", "8"], "output": true },
+ { "inputs": ["8", "8"], "output": false },
+ { "inputs": ["8", "4"], "output": true }
],
"ne_euint16_euint16": [
- { "inputs": ["27750", "23851"], "output": true },
- { "inputs": ["23847", "23851"], "output": true },
- { "inputs": ["23851", "23851"], "output": false },
- { "inputs": ["23851", "23847"], "output": true }
+ { "inputs": ["16378", "60161"], "output": true },
+ { "inputs": ["16374", "16378"], "output": true },
+ { "inputs": ["16378", "16378"], "output": false },
+ { "inputs": ["16378", "16374"], "output": true }
],
"ne_euint16_uint16": [
- { "inputs": ["27750", "3479"], "output": true },
- { "inputs": ["23847", "23851"], "output": true },
- { "inputs": ["23851", "23851"], "output": false },
- { "inputs": ["23851", "23847"], "output": true }
+ { "inputs": ["16378", "35706"], "output": true },
+ { "inputs": ["16374", "16378"], "output": true },
+ { "inputs": ["16378", "16378"], "output": false },
+ { "inputs": ["16378", "16374"], "output": true }
],
"ne_uint16_euint16": [
- { "inputs": ["20385", "3479"], "output": true },
- { "inputs": ["23847", "23851"], "output": true },
- { "inputs": ["23851", "23851"], "output": false },
- { "inputs": ["23851", "23847"], "output": true }
+ { "inputs": ["43595", "35706"], "output": true },
+ { "inputs": ["16374", "16378"], "output": true },
+ { "inputs": ["16378", "16378"], "output": false },
+ { "inputs": ["16378", "16374"], "output": true }
],
"ne_euint16_euint32": [
- { "inputs": ["4461", "3322499889"], "output": true },
- { "inputs": ["4457", "4461"], "output": true },
- { "inputs": ["4461", "4461"], "output": false },
- { "inputs": ["4461", "4457"], "output": true }
+ { "inputs": ["30095", "2933999842"], "output": true },
+ { "inputs": ["30091", "30095"], "output": true },
+ { "inputs": ["30095", "30095"], "output": false },
+ { "inputs": ["30095", "30091"], "output": true }
],
"ne_euint16_euint64": [
- { "inputs": ["6072", "18442627728041568827"], "output": true },
- { "inputs": ["6068", "6072"], "output": true },
- { "inputs": ["6072", "6072"], "output": false },
- { "inputs": ["6072", "6068"], "output": true }
+ { "inputs": ["9855", "18438572273104866201"], "output": true },
+ { "inputs": ["9851", "9855"], "output": true },
+ { "inputs": ["9855", "9855"], "output": false },
+ { "inputs": ["9855", "9851"], "output": true }
+ ],
+ "ne_euint16_euint128": [
+ { "inputs": ["58939", "340282366920938463463367826166753900405"], "output": true },
+ { "inputs": ["58935", "58939"], "output": true },
+ { "inputs": ["58939", "58939"], "output": false },
+ { "inputs": ["58939", "58935"], "output": true }
+ ],
+ "ne_euint16_euint256": [
+ {
+ "inputs": ["41071", "115792089237316195423570985008687907853269984665640564039457577958679700892209"],
+ "output": true
+ },
+ { "inputs": ["41067", "41071"], "output": true },
+ { "inputs": ["41071", "41071"], "output": false },
+ { "inputs": ["41071", "41067"], "output": true }
],
"ne_euint32_euint4": [
- { "inputs": ["2599901708", "3"], "output": true },
- { "inputs": ["4", "8"], "output": true },
- { "inputs": ["8", "8"], "output": false },
- { "inputs": ["8", "4"], "output": true }
+ { "inputs": ["2761853602", "13"], "output": true },
+ { "inputs": ["9", "13"], "output": true },
+ { "inputs": ["13", "13"], "output": false },
+ { "inputs": ["13", "9"], "output": true }
],
"ne_euint32_euint8": [
- { "inputs": ["3821365412", "152"], "output": true },
- { "inputs": ["148", "152"], "output": true },
- { "inputs": ["152", "152"], "output": false },
- { "inputs": ["152", "148"], "output": true }
+ { "inputs": ["1535914080", "80"], "output": true },
+ { "inputs": ["76", "80"], "output": true },
+ { "inputs": ["80", "80"], "output": false },
+ { "inputs": ["80", "76"], "output": true }
],
"ne_euint32_euint16": [
- { "inputs": ["3302913406", "10832"], "output": true },
- { "inputs": ["10828", "10832"], "output": true },
- { "inputs": ["10832", "10832"], "output": false },
- { "inputs": ["10832", "10828"], "output": true }
+ { "inputs": ["3735850389", "7960"], "output": true },
+ { "inputs": ["7956", "7960"], "output": true },
+ { "inputs": ["7960", "7960"], "output": false },
+ { "inputs": ["7960", "7956"], "output": true }
],
"ne_euint32_euint32": [
- { "inputs": ["221510600", "3939036059"], "output": true },
- { "inputs": ["221510596", "221510600"], "output": true },
- { "inputs": ["221510600", "221510600"], "output": false },
- { "inputs": ["221510600", "221510596"], "output": true }
+ { "inputs": ["440396727", "1222940316"], "output": true },
+ { "inputs": ["440396723", "440396727"], "output": true },
+ { "inputs": ["440396727", "440396727"], "output": false },
+ { "inputs": ["440396727", "440396723"], "output": true }
],
"ne_euint32_uint32": [
- { "inputs": ["221510600", "454323706"], "output": true },
- { "inputs": ["221510596", "221510600"], "output": true },
- { "inputs": ["221510600", "221510600"], "output": false },
- { "inputs": ["221510600", "221510596"], "output": true }
+ { "inputs": ["440396727", "826320072"], "output": true },
+ { "inputs": ["440396723", "440396727"], "output": true },
+ { "inputs": ["440396727", "440396727"], "output": false },
+ { "inputs": ["440396727", "440396723"], "output": true }
],
"ne_uint32_euint32": [
- { "inputs": ["2107136281", "454323706"], "output": true },
- { "inputs": ["221510596", "221510600"], "output": true },
- { "inputs": ["221510600", "221510600"], "output": false },
- { "inputs": ["221510600", "221510596"], "output": true }
+ { "inputs": ["3496297299", "826320072"], "output": true },
+ { "inputs": ["440396723", "440396727"], "output": true },
+ { "inputs": ["440396727", "440396727"], "output": false },
+ { "inputs": ["440396727", "440396723"], "output": true }
],
"ne_euint32_euint64": [
- { "inputs": ["897008808", "18446223426742336677"], "output": true },
- { "inputs": ["897008804", "897008808"], "output": true },
- { "inputs": ["897008808", "897008808"], "output": false },
- { "inputs": ["897008808", "897008804"], "output": true }
+ { "inputs": ["1132249413", "18438312419950369711"], "output": true },
+ { "inputs": ["1132249409", "1132249413"], "output": true },
+ { "inputs": ["1132249413", "1132249413"], "output": false },
+ { "inputs": ["1132249413", "1132249409"], "output": true }
+ ],
+ "ne_euint32_euint128": [
+ { "inputs": ["3303815983", "340282366920938463463373693800095408137"], "output": true },
+ { "inputs": ["3303815979", "3303815983"], "output": true },
+ { "inputs": ["3303815983", "3303815983"], "output": false },
+ { "inputs": ["3303815983", "3303815979"], "output": true }
+ ],
+ "ne_euint32_euint256": [
+ {
+ "inputs": ["3268569536", "115792089237316195423570985008687907853269984665640564039457577368549107012293"],
+ "output": true
+ },
+ { "inputs": ["3268569532", "3268569536"], "output": true },
+ { "inputs": ["3268569536", "3268569536"], "output": false },
+ { "inputs": ["3268569536", "3268569532"], "output": true }
],
"ne_euint64_euint4": [
- { "inputs": ["18446041636272307563", "8"], "output": true },
+ { "inputs": ["18443746789087798257", "2"], "output": true },
{ "inputs": ["4", "8"], "output": true },
{ "inputs": ["8", "8"], "output": false },
{ "inputs": ["8", "4"], "output": true }
],
"ne_euint64_euint8": [
- { "inputs": ["18445474251392791649", "41"], "output": true },
- { "inputs": ["37", "41"], "output": true },
- { "inputs": ["41", "41"], "output": false },
- { "inputs": ["41", "37"], "output": true }
+ { "inputs": ["18443274666908974803", "120"], "output": true },
+ { "inputs": ["116", "120"], "output": true },
+ { "inputs": ["120", "120"], "output": false },
+ { "inputs": ["120", "116"], "output": true }
],
"ne_euint64_euint16": [
- { "inputs": ["18440863971063577997", "29590"], "output": true },
- { "inputs": ["29586", "29590"], "output": true },
- { "inputs": ["29590", "29590"], "output": false },
- { "inputs": ["29590", "29586"], "output": true }
+ { "inputs": ["18446683880931020495", "9122"], "output": true },
+ { "inputs": ["9118", "9122"], "output": true },
+ { "inputs": ["9122", "9122"], "output": false },
+ { "inputs": ["9122", "9118"], "output": true }
],
"ne_euint64_euint32": [
- { "inputs": ["18446476368209552349", "3024704127"], "output": true },
- { "inputs": ["3024704123", "3024704127"], "output": true },
- { "inputs": ["3024704127", "3024704127"], "output": false },
- { "inputs": ["3024704127", "3024704123"], "output": true }
+ { "inputs": ["18443424543399945811", "2475089443"], "output": true },
+ { "inputs": ["2475089439", "2475089443"], "output": true },
+ { "inputs": ["2475089443", "2475089443"], "output": false },
+ { "inputs": ["2475089443", "2475089439"], "output": true }
],
"ne_euint64_euint64": [
- { "inputs": ["18442343533763371027", "18438477816592523453"], "output": true },
- { "inputs": ["18438477816592523449", "18438477816592523453"], "output": true },
- { "inputs": ["18438477816592523453", "18438477816592523453"], "output": false },
- { "inputs": ["18438477816592523453", "18438477816592523449"], "output": true }
+ { "inputs": ["18445289136242885897", "18441860560804132295"], "output": true },
+ { "inputs": ["18441860560804132291", "18441860560804132295"], "output": true },
+ { "inputs": ["18441860560804132295", "18441860560804132295"], "output": false },
+ { "inputs": ["18441860560804132295", "18441860560804132291"], "output": true }
],
"ne_euint64_uint64": [
- { "inputs": ["18442343533763371027", "18445982647402256701"], "output": true },
- { "inputs": ["18438477816592523449", "18438477816592523453"], "output": true },
- { "inputs": ["18438477816592523453", "18438477816592523453"], "output": false },
- { "inputs": ["18438477816592523453", "18438477816592523449"], "output": true }
+ { "inputs": ["18445289136242885897", "18440743017590143725"], "output": true },
+ { "inputs": ["18441860560804132291", "18441860560804132295"], "output": true },
+ { "inputs": ["18441860560804132295", "18441860560804132295"], "output": false },
+ { "inputs": ["18441860560804132295", "18441860560804132291"], "output": true }
],
"ne_uint64_euint64": [
- { "inputs": ["18440875682349733785", "18445982647402256701"], "output": true },
- { "inputs": ["18438477816592523449", "18438477816592523453"], "output": true },
- { "inputs": ["18438477816592523453", "18438477816592523453"], "output": false },
- { "inputs": ["18438477816592523453", "18438477816592523449"], "output": true }
+ { "inputs": ["18442171622930650065", "18440743017590143725"], "output": true },
+ { "inputs": ["18441860560804132291", "18441860560804132295"], "output": true },
+ { "inputs": ["18441860560804132295", "18441860560804132295"], "output": false },
+ { "inputs": ["18441860560804132295", "18441860560804132291"], "output": true }
+ ],
+ "ne_euint64_euint128": [
+ { "inputs": ["18439484097328106945", "340282366920938463463374251414120336649"], "output": true },
+ { "inputs": ["18439484097328106941", "18439484097328106945"], "output": true },
+ { "inputs": ["18439484097328106945", "18439484097328106945"], "output": false },
+ { "inputs": ["18439484097328106945", "18439484097328106941"], "output": true }
+ ],
+ "ne_euint64_euint256": [
+ {
+ "inputs": [
+ "18446211817960475589",
+ "115792089237316195423570985008687907853269984665640564039457576433191959532665"
+ ],
+ "output": true
+ },
+ { "inputs": ["18446211817960475585", "18446211817960475589"], "output": true },
+ { "inputs": ["18446211817960475589", "18446211817960475589"], "output": false },
+ { "inputs": ["18446211817960475589", "18446211817960475585"], "output": true }
+ ],
+ "ne_euint128_euint4": [
+ { "inputs": ["340282366920938463463371595006609590711", "5"], "output": true },
+ { "inputs": ["4", "8"], "output": true },
+ { "inputs": ["8", "8"], "output": false },
+ { "inputs": ["8", "4"], "output": true }
+ ],
+ "ne_euint128_euint8": [
+ { "inputs": ["340282366920938463463374264796523764465", "244"], "output": true },
+ { "inputs": ["240", "244"], "output": true },
+ { "inputs": ["244", "244"], "output": false },
+ { "inputs": ["244", "240"], "output": true }
+ ],
+ "ne_euint128_euint16": [
+ { "inputs": ["340282366920938463463370265865713339199", "54670"], "output": true },
+ { "inputs": ["54666", "54670"], "output": true },
+ { "inputs": ["54670", "54670"], "output": false },
+ { "inputs": ["54670", "54666"], "output": true }
+ ],
+ "ne_euint128_euint32": [
+ { "inputs": ["340282366920938463463374155295872552931", "1145053382"], "output": true },
+ { "inputs": ["1145053378", "1145053382"], "output": true },
+ { "inputs": ["1145053382", "1145053382"], "output": false },
+ { "inputs": ["1145053382", "1145053378"], "output": true }
+ ],
+ "ne_euint128_euint64": [
+ { "inputs": ["340282366920938463463367381041406724807", "18441880962783858343"], "output": true },
+ { "inputs": ["18441880962783858339", "18441880962783858343"], "output": true },
+ { "inputs": ["18441880962783858343", "18441880962783858343"], "output": false },
+ { "inputs": ["18441880962783858343", "18441880962783858339"], "output": true }
+ ],
+ "ne_euint128_euint128": [
+ {
+ "inputs": ["340282366920938463463366690564024700303", "340282366920938463463366105643215363065"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463366105643215363061", "340282366920938463463366105643215363065"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463366105643215363065", "340282366920938463463366105643215363065"],
+ "output": false
+ },
+ { "inputs": ["340282366920938463463366105643215363065", "340282366920938463463366105643215363061"], "output": true }
+ ],
+ "ne_euint128_uint128": [
+ {
+ "inputs": ["340282366920938463463366690564024700303", "340282366920938463463373212539976330723"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463366105643215363061", "340282366920938463463366105643215363065"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463366105643215363065", "340282366920938463463366105643215363065"],
+ "output": false
+ },
+ { "inputs": ["340282366920938463463366105643215363065", "340282366920938463463366105643215363061"], "output": true }
+ ],
+ "ne_uint128_euint128": [
+ {
+ "inputs": ["340282366920938463463372802578174510491", "340282366920938463463373212539976330723"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463366105643215363061", "340282366920938463463366105643215363065"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463366105643215363065", "340282366920938463463366105643215363065"],
+ "output": false
+ },
+ { "inputs": ["340282366920938463463366105643215363065", "340282366920938463463366105643215363061"], "output": true }
+ ],
+ "ne_euint128_euint256": [
+ {
+ "inputs": [
+ "340282366920938463463374144988236257799",
+ "115792089237316195423570985008687907853269984665640564039457582794848891263301"
+ ],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463374144988236257795", "340282366920938463463374144988236257799"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463374144988236257799", "340282366920938463463374144988236257799"],
+ "output": false
+ },
+ { "inputs": ["340282366920938463463374144988236257799", "340282366920938463463374144988236257795"], "output": true }
+ ],
+ "ne_euint256_euint4": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457577394215847356385", "12"],
+ "output": true
+ },
+ { "inputs": ["8", "12"], "output": true },
+ { "inputs": ["12", "12"], "output": false },
+ { "inputs": ["12", "8"], "output": true }
+ ],
+ "ne_euint256_euint8": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457577306800788645475", "79"],
+ "output": true
+ },
+ { "inputs": ["75", "79"], "output": true },
+ { "inputs": ["79", "79"], "output": false },
+ { "inputs": ["79", "75"], "output": true }
+ ],
+ "ne_euint256_euint16": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457575904968867077761", "30382"],
+ "output": true
+ },
+ { "inputs": ["30378", "30382"], "output": true },
+ { "inputs": ["30382", "30382"], "output": false },
+ { "inputs": ["30382", "30378"], "output": true }
+ ],
+ "ne_euint256_euint32": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457583230004924210357", "3013060698"],
+ "output": true
+ },
+ { "inputs": ["3013060694", "3013060698"], "output": true },
+ { "inputs": ["3013060698", "3013060698"], "output": false },
+ { "inputs": ["3013060698", "3013060694"], "output": true }
+ ],
+ "ne_euint256_euint64": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457578997655721966093",
+ "18437968835725654059"
+ ],
+ "output": true
+ },
+ { "inputs": ["18437968835725654055", "18437968835725654059"], "output": true },
+ { "inputs": ["18437968835725654059", "18437968835725654059"], "output": false },
+ { "inputs": ["18437968835725654059", "18437968835725654055"], "output": true }
+ ],
+ "ne_euint256_euint128": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457576673614745401783",
+ "340282366920938463463373230674573043227"
+ ],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463373230674573043223", "340282366920938463463373230674573043227"],
+ "output": true
+ },
+ {
+ "inputs": ["340282366920938463463373230674573043227", "340282366920938463463373230674573043227"],
+ "output": false
+ },
+ { "inputs": ["340282366920938463463373230674573043227", "340282366920938463463373230674573043223"], "output": true }
+ ],
+ "ne_euint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457581421114730215071",
+ "115792089237316195423570985008687907853269984665640564039457577745710288733723"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577745710288733719",
+ "115792089237316195423570985008687907853269984665640564039457577745710288733723"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577745710288733723",
+ "115792089237316195423570985008687907853269984665640564039457577745710288733723"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577745710288733723",
+ "115792089237316195423570985008687907853269984665640564039457577745710288733719"
+ ],
+ "output": true
+ }
+ ],
+ "ne_euint256_uint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457581421114730215071",
+ "115792089237316195423570985008687907853269984665640564039457583491257588609271"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577745710288733719",
+ "115792089237316195423570985008687907853269984665640564039457577745710288733723"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577745710288733723",
+ "115792089237316195423570985008687907853269984665640564039457577745710288733723"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577745710288733723",
+ "115792089237316195423570985008687907853269984665640564039457577745710288733719"
+ ],
+ "output": true
+ }
+ ],
+ "ne_uint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457583026693216867801",
+ "115792089237316195423570985008687907853269984665640564039457583491257588609271"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577745710288733719",
+ "115792089237316195423570985008687907853269984665640564039457577745710288733723"
+ ],
+ "output": true
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577745710288733723",
+ "115792089237316195423570985008687907853269984665640564039457577745710288733723"
+ ],
+ "output": false
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577745710288733723",
+ "115792089237316195423570985008687907853269984665640564039457577745710288733719"
+ ],
+ "output": true
+ }
],
"shl_euint4_uint8": [
- { "inputs": ["4", "1"], "output": "8" },
+ { "inputs": ["1", "2"], "output": "4" },
{ "inputs": ["4", "8"], "output": "4" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "8" }
],
"shl_euint8_euint8": [
- { "inputs": ["201", "7"], "output": "128" },
+ { "inputs": ["44", "4"], "output": "192" },
{ "inputs": ["4", "8"], "output": "4" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "128" }
],
"shl_euint8_uint8": [
- { "inputs": ["201", "7"], "output": "128" },
+ { "inputs": ["44", "4"], "output": "192" },
{ "inputs": ["4", "8"], "output": "4" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "128" }
],
"shl_euint16_euint8": [
- { "inputs": ["43733", "1"], "output": "21930" },
+ { "inputs": ["10029", "5"], "output": "58784" },
{ "inputs": ["4", "8"], "output": "1024" },
{ "inputs": ["8", "8"], "output": "2048" },
{ "inputs": ["8", "4"], "output": "128" }
],
"shl_euint16_uint8": [
- { "inputs": ["43733", "1"], "output": "21930" },
+ { "inputs": ["10029", "5"], "output": "58784" },
{ "inputs": ["4", "8"], "output": "1024" },
{ "inputs": ["8", "8"], "output": "2048" },
{ "inputs": ["8", "4"], "output": "128" }
],
"shl_euint32_euint8": [
- { "inputs": ["1317463952", "4"], "output": "3899554048" },
+ { "inputs": ["3189891720", "4"], "output": "3793627264" },
{ "inputs": ["4", "8"], "output": "1024" },
{ "inputs": ["8", "8"], "output": "2048" },
{ "inputs": ["8", "4"], "output": "128" }
],
"shl_euint32_uint8": [
- { "inputs": ["1317463952", "4"], "output": "3899554048" },
+ { "inputs": ["3189891720", "4"], "output": "3793627264" },
{ "inputs": ["4", "8"], "output": "1024" },
{ "inputs": ["8", "8"], "output": "2048" },
{ "inputs": ["8", "4"], "output": "128" }
],
"shl_euint64_euint8": [
- { "inputs": ["18445637206389853441", "6"], "output": "18375904565248868416" },
+ { "inputs": ["18438852048643145403", "6"], "output": "17941654469459553984" },
{ "inputs": ["4", "8"], "output": "1024" },
{ "inputs": ["8", "8"], "output": "2048" },
{ "inputs": ["8", "4"], "output": "128" }
],
"shl_euint64_uint8": [
- { "inputs": ["18445637206389853441", "6"], "output": "18375904565248868416" },
+ { "inputs": ["18438852048643145403", "6"], "output": "17941654469459553984" },
{ "inputs": ["4", "8"], "output": "1024" },
{ "inputs": ["8", "8"], "output": "2048" },
{ "inputs": ["8", "4"], "output": "128" }
],
- "shr_euint4_uint8": [
- { "inputs": ["7", "7"], "output": "0" },
- { "inputs": ["4", "8"], "output": "4" },
- { "inputs": ["8", "8"], "output": "8" },
- { "inputs": ["8", "4"], "output": "8" }
+ "shl_euint128_euint8": [
+ { "inputs": ["340282366920938463463366293596486217477", "5"], "output": "340282366920938463463108564702744404128" },
+ { "inputs": ["4", "8"], "output": "1024" },
+ { "inputs": ["8", "8"], "output": "2048" },
+ { "inputs": ["8", "4"], "output": "128" }
],
- "shr_euint8_euint8": [
- { "inputs": ["15", "4"], "output": "0" },
- { "inputs": ["4", "8"], "output": "4" },
+ "shl_euint128_uint8": [
+ { "inputs": ["340282366920938463463366293596486217477", "5"], "output": "340282366920938463463108564702744404128" },
+ { "inputs": ["4", "8"], "output": "1024" },
+ { "inputs": ["8", "8"], "output": "2048" },
+ { "inputs": ["8", "4"], "output": "128" }
+ ],
+ "shl_euint256_euint8": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457578572299000463425", "7"],
+ "output": "115792089237316195423570985008687907853269984665640564039456888249304595046528"
+ },
+ { "inputs": ["4", "8"], "output": "1024" },
+ { "inputs": ["8", "8"], "output": "2048" },
+ { "inputs": ["8", "4"], "output": "128" }
+ ],
+ "shl_euint256_uint8": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457578572299000463425", "7"],
+ "output": "115792089237316195423570985008687907853269984665640564039456888249304595046528"
+ },
+ { "inputs": ["4", "8"], "output": "1024" },
+ { "inputs": ["8", "8"], "output": "2048" },
+ { "inputs": ["8", "4"], "output": "128" }
+ ],
+ "shr_euint4_uint8": [
+ { "inputs": ["4", "7"], "output": "0" },
+ { "inputs": ["4", "8"], "output": "4" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "8" }
+ ],
+ "shr_euint8_euint8": [
+ { "inputs": ["160", "3"], "output": "20" },
+ { "inputs": ["4", "8"], "output": "4" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "0" }
],
"shr_euint8_uint8": [
- { "inputs": ["15", "4"], "output": "0" },
+ { "inputs": ["160", "3"], "output": "20" },
{ "inputs": ["4", "8"], "output": "4" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "0" }
],
"shr_euint16_euint8": [
- { "inputs": ["55114", "1"], "output": "27557" },
+ { "inputs": ["63034", "6"], "output": "984" },
{ "inputs": ["4", "8"], "output": "0" },
{ "inputs": ["8", "8"], "output": "0" },
{ "inputs": ["8", "4"], "output": "0" }
],
"shr_euint16_uint8": [
- { "inputs": ["55114", "1"], "output": "27557" },
+ { "inputs": ["63034", "6"], "output": "984" },
{ "inputs": ["4", "8"], "output": "0" },
{ "inputs": ["8", "8"], "output": "0" },
{ "inputs": ["8", "4"], "output": "0" }
],
"shr_euint32_euint8": [
- { "inputs": ["3048369776", "1"], "output": "1524184888" },
+ { "inputs": ["1720949149", "4"], "output": "107559321" },
{ "inputs": ["4", "8"], "output": "0" },
{ "inputs": ["8", "8"], "output": "0" },
{ "inputs": ["8", "4"], "output": "0" }
],
"shr_euint32_uint8": [
- { "inputs": ["3048369776", "1"], "output": "1524184888" },
+ { "inputs": ["1720949149", "4"], "output": "107559321" },
{ "inputs": ["4", "8"], "output": "0" },
{ "inputs": ["8", "8"], "output": "0" },
{ "inputs": ["8", "4"], "output": "0" }
],
"shr_euint64_euint8": [
- { "inputs": ["18438869893773583255", "5"], "output": "576214684180424476" },
+ { "inputs": ["18444486134915793097", "6"], "output": "288195095858059267" },
{ "inputs": ["4", "8"], "output": "0" },
{ "inputs": ["8", "8"], "output": "0" },
{ "inputs": ["8", "4"], "output": "0" }
],
"shr_euint64_uint8": [
- { "inputs": ["18438869893773583255", "5"], "output": "576214684180424476" },
+ { "inputs": ["18444486134915793097", "6"], "output": "288195095858059267" },
+ { "inputs": ["4", "8"], "output": "0" },
+ { "inputs": ["8", "8"], "output": "0" },
+ { "inputs": ["8", "4"], "output": "0" }
+ ],
+ "shr_euint128_euint8": [
+ { "inputs": ["340282366920938463463368208225205051841", "2"], "output": "85070591730234615865842052056301262960" },
+ { "inputs": ["4", "8"], "output": "0" },
+ { "inputs": ["8", "8"], "output": "0" },
+ { "inputs": ["8", "4"], "output": "0" }
+ ],
+ "shr_euint128_uint8": [
+ { "inputs": ["340282366920938463463368208225205051841", "2"], "output": "85070591730234615865842052056301262960" },
+ { "inputs": ["4", "8"], "output": "0" },
+ { "inputs": ["8", "8"], "output": "0" },
+ { "inputs": ["8", "4"], "output": "0" }
+ ],
+ "shr_euint256_euint8": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457578470671649972655", "2"],
+ "output": "28948022309329048855892746252171976963317496166410141009864394617667912493163"
+ },
+ { "inputs": ["4", "8"], "output": "0" },
+ { "inputs": ["8", "8"], "output": "0" },
+ { "inputs": ["8", "4"], "output": "0" }
+ ],
+ "shr_euint256_uint8": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457578470671649972655", "2"],
+ "output": "28948022309329048855892746252171976963317496166410141009864394617667912493163"
+ },
{ "inputs": ["4", "8"], "output": "0" },
{ "inputs": ["8", "8"], "output": "0" },
{ "inputs": ["8", "4"], "output": "0" }
],
"rotl_euint4_uint8": [
- { "inputs": ["14", "7"], "output": "7" },
+ { "inputs": ["1", "2"], "output": "4" },
{ "inputs": ["4", "8"], "output": "4" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "8" }
],
"rotl_euint8_euint8": [
- { "inputs": ["52", "1"], "output": "104" },
+ { "inputs": ["150", "4"], "output": "105" },
{ "inputs": ["4", "8"], "output": "4" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "128" }
],
"rotl_euint8_uint8": [
- { "inputs": ["52", "1"], "output": "104" },
+ { "inputs": ["150", "4"], "output": "105" },
{ "inputs": ["4", "8"], "output": "4" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "128" }
],
"rotl_euint16_euint8": [
- { "inputs": ["12143", "3"], "output": "31609" },
+ { "inputs": ["34007", "4"], "output": "19832" },
{ "inputs": ["4", "8"], "output": "1024" },
{ "inputs": ["8", "8"], "output": "2048" },
{ "inputs": ["8", "4"], "output": "128" }
],
"rotl_euint16_uint8": [
- { "inputs": ["12143", "3"], "output": "31609" },
+ { "inputs": ["34007", "4"], "output": "19832" },
{ "inputs": ["4", "8"], "output": "1024" },
{ "inputs": ["8", "8"], "output": "2048" },
{ "inputs": ["8", "4"], "output": "128" }
],
"rotl_euint32_euint8": [
- { "inputs": ["2219902125", "2"], "output": "289673910" },
+ { "inputs": ["10430463", "3"], "output": "83443704" },
{ "inputs": ["4", "8"], "output": "1024" },
{ "inputs": ["8", "8"], "output": "2048" },
{ "inputs": ["8", "4"], "output": "128" }
],
"rotl_euint32_uint8": [
- { "inputs": ["2219902125", "2"], "output": "289673910" },
+ { "inputs": ["10430463", "3"], "output": "83443704" },
{ "inputs": ["4", "8"], "output": "1024" },
{ "inputs": ["8", "8"], "output": "2048" },
{ "inputs": ["8", "4"], "output": "128" }
],
"rotl_euint64_euint8": [
- { "inputs": ["18442278686771288481", "1"], "output": "18437813299833025347" },
+ { "inputs": ["18440494415218168649", "7"], "output": "17646787786812531967" },
{ "inputs": ["4", "8"], "output": "1024" },
{ "inputs": ["8", "8"], "output": "2048" },
{ "inputs": ["8", "4"], "output": "128" }
],
"rotl_euint64_uint8": [
- { "inputs": ["18442278686771288481", "1"], "output": "18437813299833025347" },
+ { "inputs": ["18440494415218168649", "7"], "output": "17646787786812531967" },
+ { "inputs": ["4", "8"], "output": "1024" },
+ { "inputs": ["8", "8"], "output": "2048" },
+ { "inputs": ["8", "4"], "output": "128" }
+ ],
+ "rotl_euint128_euint8": [
+ { "inputs": ["340282366920938463463369231473752264653", "3"], "output": "340282366920938463463331599767640637039" },
+ { "inputs": ["4", "8"], "output": "1024" },
+ { "inputs": ["8", "8"], "output": "2048" },
+ { "inputs": ["8", "4"], "output": "128" }
+ ],
+ "rotl_euint128_uint8": [
+ { "inputs": ["340282366920938463463369231473752264653", "3"], "output": "340282366920938463463331599767640637039" },
+ { "inputs": ["4", "8"], "output": "1024" },
+ { "inputs": ["8", "8"], "output": "2048" },
+ { "inputs": ["8", "4"], "output": "128" }
+ ],
+ "rotl_euint256_euint8": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457582882208711886349", "7"],
+ "output": "115792089237316195423570985008687907853269984665640564039457439917747657180927"
+ },
+ { "inputs": ["4", "8"], "output": "1024" },
+ { "inputs": ["8", "8"], "output": "2048" },
+ { "inputs": ["8", "4"], "output": "128" }
+ ],
+ "rotl_euint256_uint8": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457582882208711886349", "7"],
+ "output": "115792089237316195423570985008687907853269984665640564039457439917747657180927"
+ },
{ "inputs": ["4", "8"], "output": "1024" },
{ "inputs": ["8", "8"], "output": "2048" },
{ "inputs": ["8", "4"], "output": "128" }
],
"rotr_euint4_uint8": [
- { "inputs": ["14", "7"], "output": "13" },
+ { "inputs": ["14", "1"], "output": "7" },
{ "inputs": ["4", "8"], "output": "4" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "8" }
],
"rotr_euint8_euint8": [
- { "inputs": ["50", "4"], "output": "35" },
+ { "inputs": ["52", "6"], "output": "208" },
{ "inputs": ["4", "8"], "output": "4" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "128" }
],
"rotr_euint8_uint8": [
- { "inputs": ["50", "4"], "output": "35" },
+ { "inputs": ["52", "6"], "output": "208" },
{ "inputs": ["4", "8"], "output": "4" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "128" }
],
"rotr_euint16_euint8": [
- { "inputs": ["63583", "1"], "output": "64559" },
+ { "inputs": ["32201", "3"], "output": "12217" },
{ "inputs": ["4", "8"], "output": "1024" },
{ "inputs": ["8", "8"], "output": "2048" },
{ "inputs": ["8", "4"], "output": "32768" }
],
"rotr_euint16_uint8": [
- { "inputs": ["63583", "1"], "output": "64559" },
+ { "inputs": ["32201", "3"], "output": "12217" },
{ "inputs": ["4", "8"], "output": "1024" },
{ "inputs": ["8", "8"], "output": "2048" },
{ "inputs": ["8", "4"], "output": "32768" }
],
"rotr_euint32_euint8": [
- { "inputs": ["4127207673", "5"], "output": "3484418439" },
+ { "inputs": ["3489309750", "7"], "output": "1839199560" },
{ "inputs": ["4", "8"], "output": "67108864" },
{ "inputs": ["8", "8"], "output": "134217728" },
{ "inputs": ["8", "4"], "output": "2147483648" }
],
"rotr_euint32_uint8": [
- { "inputs": ["4127207673", "5"], "output": "3484418439" },
+ { "inputs": ["3489309750", "7"], "output": "1839199560" },
{ "inputs": ["4", "8"], "output": "67108864" },
{ "inputs": ["8", "8"], "output": "134217728" },
{ "inputs": ["8", "4"], "output": "2147483648" }
],
"rotr_euint64_euint8": [
- { "inputs": ["18441051342909802901", "3"], "output": "13834346463932195122" },
+ { "inputs": ["18444475066789617897", "3"], "output": "4611402392562396189" },
{ "inputs": ["4", "8"], "output": "288230376151711744" },
{ "inputs": ["8", "8"], "output": "576460752303423488" },
{ "inputs": ["8", "4"], "output": "9223372036854775808" }
],
"rotr_euint64_uint8": [
- { "inputs": ["18441051342909802901", "3"], "output": "13834346463932195122" },
+ { "inputs": ["18444475066789617897", "3"], "output": "4611402392562396189" },
{ "inputs": ["4", "8"], "output": "288230376151711744" },
{ "inputs": ["8", "8"], "output": "576460752303423488" },
{ "inputs": ["8", "4"], "output": "9223372036854775808" }
],
+ "rotr_euint128_euint8": [
+ { "inputs": ["340282366920938463463366872490223703215", "2"], "output": "340282366920938463463372673696382084395" },
+ { "inputs": ["4", "8"], "output": "5316911983139663491615228241121378304" },
+ { "inputs": ["8", "8"], "output": "10633823966279326983230456482242756608" },
+ { "inputs": ["8", "4"], "output": "170141183460469231731687303715884105728" }
+ ],
+ "rotr_euint128_uint8": [
+ { "inputs": ["340282366920938463463366872490223703215", "2"], "output": "340282366920938463463372673696382084395" },
+ { "inputs": ["4", "8"], "output": "5316911983139663491615228241121378304" },
+ { "inputs": ["8", "8"], "output": "10633823966279326983230456482242756608" },
+ { "inputs": ["8", "4"], "output": "170141183460469231731687303715884105728" }
+ ],
+ "rotr_euint256_euint8": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457581545102921797223", "4"],
+ "output": "57896044618658097711785492504343953926634992332820282019728791850030926829798"
+ },
+ { "inputs": ["4", "8"], "output": "1809251394333065553493296640760748560207343510400633813116524750123642650624" },
+ { "inputs": ["8", "8"], "output": "3618502788666131106986593281521497120414687020801267626233049500247285301248" },
+ { "inputs": ["8", "4"], "output": "57896044618658097711785492504343953926634992332820282019728792003956564819968" }
+ ],
+ "rotr_euint256_uint8": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457581545102921797223", "4"],
+ "output": "57896044618658097711785492504343953926634992332820282019728791850030926829798"
+ },
+ { "inputs": ["4", "8"], "output": "1809251394333065553493296640760748560207343510400633813116524750123642650624" },
+ { "inputs": ["8", "8"], "output": "3618502788666131106986593281521497120414687020801267626233049500247285301248" },
+ { "inputs": ["8", "4"], "output": "57896044618658097711785492504343953926634992332820282019728792003956564819968" }
+ ],
"max_euint4_euint4": [
- { "inputs": ["3", "1"], "output": "3" },
- { "inputs": ["4", "8"], "output": "8" },
- { "inputs": ["8", "8"], "output": "8" },
- { "inputs": ["8", "4"], "output": "8" }
+ { "inputs": ["9", "13"], "output": "13" },
+ { "inputs": ["5", "9"], "output": "9" },
+ { "inputs": ["9", "9"], "output": "9" },
+ { "inputs": ["9", "5"], "output": "9" }
],
"max_euint4_euint8": [
- { "inputs": ["1", "157"], "output": "157" },
- { "inputs": ["4", "8"], "output": "8" },
- { "inputs": ["8", "8"], "output": "8" },
- { "inputs": ["8", "4"], "output": "8" }
+ { "inputs": ["14", "226"], "output": "226" },
+ { "inputs": ["10", "14"], "output": "14" },
+ { "inputs": ["14", "14"], "output": "14" },
+ { "inputs": ["14", "10"], "output": "14" }
],
"max_euint4_uint8": [
- { "inputs": ["1", "2"], "output": "2" },
- { "inputs": ["4", "8"], "output": "8" },
- { "inputs": ["8", "8"], "output": "8" },
- { "inputs": ["8", "4"], "output": "8" }
+ { "inputs": ["14", "7"], "output": "14" },
+ { "inputs": ["10", "14"], "output": "14" },
+ { "inputs": ["14", "14"], "output": "14" },
+ { "inputs": ["14", "10"], "output": "14" }
],
"max_euint4_euint16": [
- { "inputs": ["6", "62382"], "output": "62382" },
- { "inputs": ["4", "8"], "output": "8" },
- { "inputs": ["8", "8"], "output": "8" },
- { "inputs": ["8", "4"], "output": "8" }
+ { "inputs": ["14", "33411"], "output": "33411" },
+ { "inputs": ["10", "14"], "output": "14" },
+ { "inputs": ["14", "14"], "output": "14" },
+ { "inputs": ["14", "10"], "output": "14" }
],
"max_euint4_euint32": [
- { "inputs": ["12", "3887686486"], "output": "3887686486" },
+ { "inputs": ["12", "623453237"], "output": "623453237" },
{ "inputs": ["8", "12"], "output": "12" },
{ "inputs": ["12", "12"], "output": "12" },
{ "inputs": ["12", "8"], "output": "12" }
],
"max_euint4_euint64": [
- { "inputs": ["5", "18446478225770660877"], "output": "18446478225770660877" },
+ { "inputs": ["9", "18439762941056895609"], "output": "18439762941056895609" },
+ { "inputs": ["5", "9"], "output": "9" },
+ { "inputs": ["9", "9"], "output": "9" },
+ { "inputs": ["9", "5"], "output": "9" }
+ ],
+ "max_euint4_euint128": [
+ { "inputs": ["1", "340282366920938463463366284713062311837"], "output": "340282366920938463463366284713062311837" },
{ "inputs": ["4", "8"], "output": "8" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "8" }
],
+ "max_euint4_euint256": [
+ {
+ "inputs": ["9", "115792089237316195423570985008687907853269984665640564039457577693528211281505"],
+ "output": "115792089237316195423570985008687907853269984665640564039457577693528211281505"
+ },
+ { "inputs": ["5", "9"], "output": "9" },
+ { "inputs": ["9", "9"], "output": "9" },
+ { "inputs": ["9", "5"], "output": "9" }
+ ],
"max_euint8_euint4": [
- { "inputs": ["41", "11"], "output": "41" },
- { "inputs": ["7", "11"], "output": "11" },
- { "inputs": ["11", "11"], "output": "11" },
- { "inputs": ["11", "7"], "output": "11" }
+ { "inputs": ["62", "13"], "output": "62" },
+ { "inputs": ["9", "13"], "output": "13" },
+ { "inputs": ["13", "13"], "output": "13" },
+ { "inputs": ["13", "9"], "output": "13" }
],
"max_uint8_euint4": [
- { "inputs": ["10", "11"], "output": "11" },
- { "inputs": ["7", "11"], "output": "11" },
- { "inputs": ["11", "11"], "output": "11" },
- { "inputs": ["11", "7"], "output": "11" }
+ { "inputs": ["14", "13"], "output": "14" },
+ { "inputs": ["9", "13"], "output": "13" },
+ { "inputs": ["13", "13"], "output": "13" },
+ { "inputs": ["13", "9"], "output": "13" }
],
"max_euint8_euint8": [
- { "inputs": ["227", "29"], "output": "227" },
- { "inputs": ["25", "29"], "output": "29" },
- { "inputs": ["29", "29"], "output": "29" },
- { "inputs": ["29", "25"], "output": "29" }
+ { "inputs": ["17", "182"], "output": "182" },
+ { "inputs": ["13", "17"], "output": "17" },
+ { "inputs": ["17", "17"], "output": "17" },
+ { "inputs": ["17", "13"], "output": "17" }
],
"max_euint8_uint8": [
- { "inputs": ["227", "27"], "output": "227" },
- { "inputs": ["25", "29"], "output": "29" },
- { "inputs": ["29", "29"], "output": "29" },
- { "inputs": ["29", "25"], "output": "29" }
+ { "inputs": ["17", "83"], "output": "83" },
+ { "inputs": ["13", "17"], "output": "17" },
+ { "inputs": ["17", "17"], "output": "17" },
+ { "inputs": ["17", "13"], "output": "17" }
],
"max_uint8_euint8": [
- { "inputs": ["174", "27"], "output": "174" },
- { "inputs": ["25", "29"], "output": "29" },
- { "inputs": ["29", "29"], "output": "29" },
- { "inputs": ["29", "25"], "output": "29" }
+ { "inputs": ["46", "83"], "output": "83" },
+ { "inputs": ["13", "17"], "output": "17" },
+ { "inputs": ["17", "17"], "output": "17" },
+ { "inputs": ["17", "13"], "output": "17" }
],
"max_euint8_euint16": [
- { "inputs": ["76", "60931"], "output": "60931" },
- { "inputs": ["72", "76"], "output": "76" },
- { "inputs": ["76", "76"], "output": "76" },
- { "inputs": ["76", "72"], "output": "76" }
+ { "inputs": ["252", "21942"], "output": "21942" },
+ { "inputs": ["248", "252"], "output": "252" },
+ { "inputs": ["252", "252"], "output": "252" },
+ { "inputs": ["252", "248"], "output": "252" }
],
"max_euint8_euint32": [
- { "inputs": ["103", "990460263"], "output": "990460263" },
- { "inputs": ["99", "103"], "output": "103" },
- { "inputs": ["103", "103"], "output": "103" },
- { "inputs": ["103", "99"], "output": "103" }
+ { "inputs": ["31", "3976371021"], "output": "3976371021" },
+ { "inputs": ["27", "31"], "output": "31" },
+ { "inputs": ["31", "31"], "output": "31" },
+ { "inputs": ["31", "27"], "output": "31" }
],
"max_euint8_euint64": [
- { "inputs": ["180", "18445785341899355785"], "output": "18445785341899355785" },
- { "inputs": ["176", "180"], "output": "180" },
- { "inputs": ["180", "180"], "output": "180" },
- { "inputs": ["180", "176"], "output": "180" }
+ { "inputs": ["217", "18441870389911940983"], "output": "18441870389911940983" },
+ { "inputs": ["213", "217"], "output": "217" },
+ { "inputs": ["217", "217"], "output": "217" },
+ { "inputs": ["217", "213"], "output": "217" }
+ ],
+ "max_euint8_euint128": [
+ {
+ "inputs": ["109", "340282366920938463463369292859038505161"],
+ "output": "340282366920938463463369292859038505161"
+ },
+ { "inputs": ["105", "109"], "output": "109" },
+ { "inputs": ["109", "109"], "output": "109" },
+ { "inputs": ["109", "105"], "output": "109" }
+ ],
+ "max_euint8_euint256": [
+ {
+ "inputs": ["187", "115792089237316195423570985008687907853269984665640564039457583763268749719689"],
+ "output": "115792089237316195423570985008687907853269984665640564039457583763268749719689"
+ },
+ { "inputs": ["183", "187"], "output": "187" },
+ { "inputs": ["187", "187"], "output": "187" },
+ { "inputs": ["187", "183"], "output": "187" }
],
"max_euint16_euint4": [
- { "inputs": ["58569", "10"], "output": "58569" },
- { "inputs": ["6", "10"], "output": "10" },
- { "inputs": ["10", "10"], "output": "10" },
- { "inputs": ["10", "6"], "output": "10" }
+ { "inputs": ["22967", "8"], "output": "22967" },
+ { "inputs": ["4", "8"], "output": "8" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "8" }
],
"max_euint16_euint8": [
- { "inputs": ["46663", "31"], "output": "46663" },
- { "inputs": ["27", "31"], "output": "31" },
- { "inputs": ["31", "31"], "output": "31" },
- { "inputs": ["31", "27"], "output": "31" }
+ { "inputs": ["22246", "39"], "output": "22246" },
+ { "inputs": ["35", "39"], "output": "39" },
+ { "inputs": ["39", "39"], "output": "39" },
+ { "inputs": ["39", "35"], "output": "39" }
],
"max_euint16_euint16": [
- { "inputs": ["35722", "7688"], "output": "35722" },
- { "inputs": ["7684", "7688"], "output": "7688" },
- { "inputs": ["7688", "7688"], "output": "7688" },
- { "inputs": ["7688", "7684"], "output": "7688" }
+ { "inputs": ["37775", "22432"], "output": "37775" },
+ { "inputs": ["22428", "22432"], "output": "22432" },
+ { "inputs": ["22432", "22432"], "output": "22432" },
+ { "inputs": ["22432", "22428"], "output": "22432" }
],
"max_euint16_uint16": [
- { "inputs": ["35722", "5145"], "output": "35722" },
- { "inputs": ["7684", "7688"], "output": "7688" },
- { "inputs": ["7688", "7688"], "output": "7688" },
- { "inputs": ["7688", "7684"], "output": "7688" }
+ { "inputs": ["37775", "25405"], "output": "37775" },
+ { "inputs": ["22428", "22432"], "output": "22432" },
+ { "inputs": ["22432", "22432"], "output": "22432" },
+ { "inputs": ["22432", "22428"], "output": "22432" }
],
"max_uint16_euint16": [
- { "inputs": ["56359", "5145"], "output": "56359" },
- { "inputs": ["7684", "7688"], "output": "7688" },
- { "inputs": ["7688", "7688"], "output": "7688" },
- { "inputs": ["7688", "7684"], "output": "7688" }
+ { "inputs": ["1122", "25405"], "output": "25405" },
+ { "inputs": ["22428", "22432"], "output": "22432" },
+ { "inputs": ["22432", "22432"], "output": "22432" },
+ { "inputs": ["22432", "22428"], "output": "22432" }
],
"max_euint16_euint32": [
- { "inputs": ["34046", "3126513605"], "output": "3126513605" },
- { "inputs": ["34042", "34046"], "output": "34046" },
- { "inputs": ["34046", "34046"], "output": "34046" },
- { "inputs": ["34046", "34042"], "output": "34046" }
+ { "inputs": ["6434", "2918687585"], "output": "2918687585" },
+ { "inputs": ["6430", "6434"], "output": "6434" },
+ { "inputs": ["6434", "6434"], "output": "6434" },
+ { "inputs": ["6434", "6430"], "output": "6434" }
],
"max_euint16_euint64": [
- { "inputs": ["28367", "18440532375906129937"], "output": "18440532375906129937" },
- { "inputs": ["28363", "28367"], "output": "28367" },
- { "inputs": ["28367", "28367"], "output": "28367" },
- { "inputs": ["28367", "28363"], "output": "28367" }
+ { "inputs": ["43725", "18443087667786395005"], "output": "18443087667786395005" },
+ { "inputs": ["43721", "43725"], "output": "43725" },
+ { "inputs": ["43725", "43725"], "output": "43725" },
+ { "inputs": ["43725", "43721"], "output": "43725" }
+ ],
+ "max_euint16_euint128": [
+ {
+ "inputs": ["41694", "340282366920938463463370312817461607687"],
+ "output": "340282366920938463463370312817461607687"
+ },
+ { "inputs": ["41690", "41694"], "output": "41694" },
+ { "inputs": ["41694", "41694"], "output": "41694" },
+ { "inputs": ["41694", "41690"], "output": "41694" }
+ ],
+ "max_euint16_euint256": [
+ {
+ "inputs": ["35663", "115792089237316195423570985008687907853269984665640564039457581066242393293579"],
+ "output": "115792089237316195423570985008687907853269984665640564039457581066242393293579"
+ },
+ { "inputs": ["35659", "35663"], "output": "35663" },
+ { "inputs": ["35663", "35663"], "output": "35663" },
+ { "inputs": ["35663", "35659"], "output": "35663" }
],
"max_euint32_euint4": [
- { "inputs": ["1272584917", "14"], "output": "1272584917" },
- { "inputs": ["10", "14"], "output": "14" },
- { "inputs": ["14", "14"], "output": "14" },
- { "inputs": ["14", "10"], "output": "14" }
+ { "inputs": ["1089745104", "2"], "output": "1089745104" },
+ { "inputs": ["4", "8"], "output": "8" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "8" }
],
"max_euint32_euint8": [
- { "inputs": ["2001471362", "68"], "output": "2001471362" },
- { "inputs": ["64", "68"], "output": "68" },
- { "inputs": ["68", "68"], "output": "68" },
- { "inputs": ["68", "64"], "output": "68" }
+ { "inputs": ["2231185000", "65"], "output": "2231185000" },
+ { "inputs": ["61", "65"], "output": "65" },
+ { "inputs": ["65", "65"], "output": "65" },
+ { "inputs": ["65", "61"], "output": "65" }
],
"max_euint32_euint16": [
- { "inputs": ["4156714889", "5440"], "output": "4156714889" },
- { "inputs": ["5436", "5440"], "output": "5440" },
- { "inputs": ["5440", "5440"], "output": "5440" },
- { "inputs": ["5440", "5436"], "output": "5440" }
+ { "inputs": ["1606859063", "42684"], "output": "1606859063" },
+ { "inputs": ["42680", "42684"], "output": "42684" },
+ { "inputs": ["42684", "42684"], "output": "42684" },
+ { "inputs": ["42684", "42680"], "output": "42684" }
],
"max_euint32_euint32": [
- { "inputs": ["3535438432", "2851290845"], "output": "3535438432" },
- { "inputs": ["2851290841", "2851290845"], "output": "2851290845" },
- { "inputs": ["2851290845", "2851290845"], "output": "2851290845" },
- { "inputs": ["2851290845", "2851290841"], "output": "2851290845" }
+ { "inputs": ["1310408559", "1943659319"], "output": "1943659319" },
+ { "inputs": ["1310408555", "1310408559"], "output": "1310408559" },
+ { "inputs": ["1310408559", "1310408559"], "output": "1310408559" },
+ { "inputs": ["1310408559", "1310408555"], "output": "1310408559" }
],
"max_euint32_uint32": [
- { "inputs": ["3535438432", "1480992326"], "output": "3535438432" },
- { "inputs": ["2851290841", "2851290845"], "output": "2851290845" },
- { "inputs": ["2851290845", "2851290845"], "output": "2851290845" },
- { "inputs": ["2851290845", "2851290841"], "output": "2851290845" }
+ { "inputs": ["1310408559", "1676413628"], "output": "1676413628" },
+ { "inputs": ["1310408555", "1310408559"], "output": "1310408559" },
+ { "inputs": ["1310408559", "1310408559"], "output": "1310408559" },
+ { "inputs": ["1310408559", "1310408555"], "output": "1310408559" }
],
"max_uint32_euint32": [
- { "inputs": ["760733114", "1480992326"], "output": "1480992326" },
- { "inputs": ["2851290841", "2851290845"], "output": "2851290845" },
- { "inputs": ["2851290845", "2851290845"], "output": "2851290845" },
- { "inputs": ["2851290845", "2851290841"], "output": "2851290845" }
+ { "inputs": ["870136392", "1676413628"], "output": "1676413628" },
+ { "inputs": ["1310408555", "1310408559"], "output": "1310408559" },
+ { "inputs": ["1310408559", "1310408559"], "output": "1310408559" },
+ { "inputs": ["1310408559", "1310408555"], "output": "1310408559" }
],
"max_euint32_euint64": [
- { "inputs": ["821915788", "18441217303884363213"], "output": "18441217303884363213" },
- { "inputs": ["821915784", "821915788"], "output": "821915788" },
- { "inputs": ["821915788", "821915788"], "output": "821915788" },
- { "inputs": ["821915788", "821915784"], "output": "821915788" }
+ { "inputs": ["1980815436", "18446246159979986155"], "output": "18446246159979986155" },
+ { "inputs": ["1980815432", "1980815436"], "output": "1980815436" },
+ { "inputs": ["1980815436", "1980815436"], "output": "1980815436" },
+ { "inputs": ["1980815436", "1980815432"], "output": "1980815436" }
+ ],
+ "max_euint32_euint128": [
+ {
+ "inputs": ["731106649", "340282366920938463463370948491424745963"],
+ "output": "340282366920938463463370948491424745963"
+ },
+ { "inputs": ["731106645", "731106649"], "output": "731106649" },
+ { "inputs": ["731106649", "731106649"], "output": "731106649" },
+ { "inputs": ["731106649", "731106645"], "output": "731106649" }
+ ],
+ "max_euint32_euint256": [
+ {
+ "inputs": ["2079496081", "115792089237316195423570985008687907853269984665640564039457579470316273335423"],
+ "output": "115792089237316195423570985008687907853269984665640564039457579470316273335423"
+ },
+ { "inputs": ["2079496077", "2079496081"], "output": "2079496081" },
+ { "inputs": ["2079496081", "2079496081"], "output": "2079496081" },
+ { "inputs": ["2079496081", "2079496077"], "output": "2079496081" }
],
"max_euint64_euint4": [
- { "inputs": ["18445668950732298129", "5"], "output": "18445668950732298129" },
- { "inputs": ["4", "8"], "output": "8" },
- { "inputs": ["8", "8"], "output": "8" },
- { "inputs": ["8", "4"], "output": "8" }
+ { "inputs": ["18446600326518934469", "12"], "output": "18446600326518934469" },
+ { "inputs": ["8", "12"], "output": "12" },
+ { "inputs": ["12", "12"], "output": "12" },
+ { "inputs": ["12", "8"], "output": "12" }
],
"max_euint64_euint8": [
- { "inputs": ["18446007384031513667", "44"], "output": "18446007384031513667" },
- { "inputs": ["40", "44"], "output": "44" },
- { "inputs": ["44", "44"], "output": "44" },
- { "inputs": ["44", "40"], "output": "44" }
+ { "inputs": ["18437818308322976495", "86"], "output": "18437818308322976495" },
+ { "inputs": ["82", "86"], "output": "86" },
+ { "inputs": ["86", "86"], "output": "86" },
+ { "inputs": ["86", "82"], "output": "86" }
],
"max_euint64_euint16": [
- { "inputs": ["18444284510736997839", "51628"], "output": "18444284510736997839" },
- { "inputs": ["51624", "51628"], "output": "51628" },
- { "inputs": ["51628", "51628"], "output": "51628" },
- { "inputs": ["51628", "51624"], "output": "51628" }
+ { "inputs": ["18446109140882718991", "19434"], "output": "18446109140882718991" },
+ { "inputs": ["19430", "19434"], "output": "19434" },
+ { "inputs": ["19434", "19434"], "output": "19434" },
+ { "inputs": ["19434", "19430"], "output": "19434" }
],
"max_euint64_euint32": [
- { "inputs": ["18445662984886583599", "303914102"], "output": "18445662984886583599" },
- { "inputs": ["303914098", "303914102"], "output": "303914102" },
- { "inputs": ["303914102", "303914102"], "output": "303914102" },
- { "inputs": ["303914102", "303914098"], "output": "303914102" }
+ { "inputs": ["18438142521959169981", "4265760124"], "output": "18438142521959169981" },
+ { "inputs": ["4265760120", "4265760124"], "output": "4265760124" },
+ { "inputs": ["4265760124", "4265760124"], "output": "4265760124" },
+ { "inputs": ["4265760124", "4265760120"], "output": "4265760124" }
],
"max_euint64_euint64": [
- { "inputs": ["18438631683554897479", "18438807769877774597"], "output": "18438807769877774597" },
- { "inputs": ["18438631683554897475", "18438631683554897479"], "output": "18438631683554897479" },
- { "inputs": ["18438631683554897479", "18438631683554897479"], "output": "18438631683554897479" },
- { "inputs": ["18438631683554897479", "18438631683554897475"], "output": "18438631683554897479" }
+ { "inputs": ["18445852065991763771", "18440937538047974893"], "output": "18445852065991763771" },
+ { "inputs": ["18440937538047974889", "18440937538047974893"], "output": "18440937538047974893" },
+ { "inputs": ["18440937538047974893", "18440937538047974893"], "output": "18440937538047974893" },
+ { "inputs": ["18440937538047974893", "18440937538047974889"], "output": "18440937538047974893" }
],
"max_euint64_uint64": [
- { "inputs": ["18438631683554897479", "18445384533883180417"], "output": "18445384533883180417" },
- { "inputs": ["18438631683554897475", "18438631683554897479"], "output": "18438631683554897479" },
- { "inputs": ["18438631683554897479", "18438631683554897479"], "output": "18438631683554897479" },
- { "inputs": ["18438631683554897479", "18438631683554897475"], "output": "18438631683554897479" }
+ { "inputs": ["18445852065991763771", "18440623444591001569"], "output": "18445852065991763771" },
+ { "inputs": ["18440937538047974889", "18440937538047974893"], "output": "18440937538047974893" },
+ { "inputs": ["18440937538047974893", "18440937538047974893"], "output": "18440937538047974893" },
+ { "inputs": ["18440937538047974893", "18440937538047974889"], "output": "18440937538047974893" }
],
"max_uint64_euint64": [
- { "inputs": ["18440833161069655121", "18445384533883180417"], "output": "18445384533883180417" },
- { "inputs": ["18438631683554897475", "18438631683554897479"], "output": "18438631683554897479" },
- { "inputs": ["18438631683554897479", "18438631683554897479"], "output": "18438631683554897479" },
- { "inputs": ["18438631683554897479", "18438631683554897475"], "output": "18438631683554897479" }
+ { "inputs": ["18444013465281910433", "18440623444591001569"], "output": "18444013465281910433" },
+ { "inputs": ["18440937538047974889", "18440937538047974893"], "output": "18440937538047974893" },
+ { "inputs": ["18440937538047974893", "18440937538047974893"], "output": "18440937538047974893" },
+ { "inputs": ["18440937538047974893", "18440937538047974889"], "output": "18440937538047974893" }
+ ],
+ "max_euint64_euint128": [
+ {
+ "inputs": ["18444589551829336117", "340282366920938463463371310064926977589"],
+ "output": "340282366920938463463371310064926977589"
+ },
+ { "inputs": ["18444589551829336113", "18444589551829336117"], "output": "18444589551829336117" },
+ { "inputs": ["18444589551829336117", "18444589551829336117"], "output": "18444589551829336117" },
+ { "inputs": ["18444589551829336117", "18444589551829336113"], "output": "18444589551829336117" }
+ ],
+ "max_euint64_euint256": [
+ {
+ "inputs": [
+ "18437962634473522913",
+ "115792089237316195423570985008687907853269984665640564039457582464243297466475"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457582464243297466475"
+ },
+ { "inputs": ["18437962634473522909", "18437962634473522913"], "output": "18437962634473522913" },
+ { "inputs": ["18437962634473522913", "18437962634473522913"], "output": "18437962634473522913" },
+ { "inputs": ["18437962634473522913", "18437962634473522909"], "output": "18437962634473522913" }
+ ],
+ "max_euint128_euint4": [
+ { "inputs": ["340282366920938463463368883145053125641", "8"], "output": "340282366920938463463368883145053125641" },
+ { "inputs": ["4", "8"], "output": "8" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "8" }
],
- "min_euint4_euint4": [
- { "inputs": ["7", "10"], "output": "7" },
- { "inputs": ["4", "8"], "output": "4" },
+ "max_euint128_euint8": [
+ {
+ "inputs": ["340282366920938463463369691386082749829", "49"],
+ "output": "340282366920938463463369691386082749829"
+ },
+ { "inputs": ["45", "49"], "output": "49" },
+ { "inputs": ["49", "49"], "output": "49" },
+ { "inputs": ["49", "45"], "output": "49" }
+ ],
+ "max_euint128_euint16": [
+ {
+ "inputs": ["340282366920938463463370317782456018271", "38332"],
+ "output": "340282366920938463463370317782456018271"
+ },
+ { "inputs": ["38328", "38332"], "output": "38332" },
+ { "inputs": ["38332", "38332"], "output": "38332" },
+ { "inputs": ["38332", "38328"], "output": "38332" }
+ ],
+ "max_euint128_euint32": [
+ {
+ "inputs": ["340282366920938463463374411933353920761", "2226263511"],
+ "output": "340282366920938463463374411933353920761"
+ },
+ { "inputs": ["2226263507", "2226263511"], "output": "2226263511" },
+ { "inputs": ["2226263511", "2226263511"], "output": "2226263511" },
+ { "inputs": ["2226263511", "2226263507"], "output": "2226263511" }
+ ],
+ "max_euint128_euint64": [
+ {
+ "inputs": ["340282366920938463463373867307519267223", "18442144243272238465"],
+ "output": "340282366920938463463373867307519267223"
+ },
+ { "inputs": ["18442144243272238461", "18442144243272238465"], "output": "18442144243272238465" },
+ { "inputs": ["18442144243272238465", "18442144243272238465"], "output": "18442144243272238465" },
+ { "inputs": ["18442144243272238465", "18442144243272238461"], "output": "18442144243272238465" }
+ ],
+ "max_euint128_euint128": [
+ {
+ "inputs": ["340282366920938463463374311959896511759", "340282366920938463463367499312160836031"],
+ "output": "340282366920938463463374311959896511759"
+ },
+ {
+ "inputs": ["340282366920938463463367499312160836027", "340282366920938463463367499312160836031"],
+ "output": "340282366920938463463367499312160836031"
+ },
+ {
+ "inputs": ["340282366920938463463367499312160836031", "340282366920938463463367499312160836031"],
+ "output": "340282366920938463463367499312160836031"
+ },
+ {
+ "inputs": ["340282366920938463463367499312160836031", "340282366920938463463367499312160836027"],
+ "output": "340282366920938463463367499312160836031"
+ }
+ ],
+ "max_euint128_uint128": [
+ {
+ "inputs": ["340282366920938463463374311959896511759", "340282366920938463463371397781663603615"],
+ "output": "340282366920938463463374311959896511759"
+ },
+ {
+ "inputs": ["340282366920938463463367499312160836027", "340282366920938463463367499312160836031"],
+ "output": "340282366920938463463367499312160836031"
+ },
+ {
+ "inputs": ["340282366920938463463367499312160836031", "340282366920938463463367499312160836031"],
+ "output": "340282366920938463463367499312160836031"
+ },
+ {
+ "inputs": ["340282366920938463463367499312160836031", "340282366920938463463367499312160836027"],
+ "output": "340282366920938463463367499312160836031"
+ }
+ ],
+ "max_uint128_euint128": [
+ {
+ "inputs": ["340282366920938463463370589299931927619", "340282366920938463463371397781663603615"],
+ "output": "340282366920938463463371397781663603615"
+ },
+ {
+ "inputs": ["340282366920938463463367499312160836027", "340282366920938463463367499312160836031"],
+ "output": "340282366920938463463367499312160836031"
+ },
+ {
+ "inputs": ["340282366920938463463367499312160836031", "340282366920938463463367499312160836031"],
+ "output": "340282366920938463463367499312160836031"
+ },
+ {
+ "inputs": ["340282366920938463463367499312160836031", "340282366920938463463367499312160836027"],
+ "output": "340282366920938463463367499312160836031"
+ }
+ ],
+ "max_euint128_euint256": [
+ {
+ "inputs": [
+ "340282366920938463463373789765297113341",
+ "115792089237316195423570985008687907853269984665640564039457579894549860743867"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579894549860743867"
+ },
+ {
+ "inputs": ["340282366920938463463373789765297113337", "340282366920938463463373789765297113341"],
+ "output": "340282366920938463463373789765297113341"
+ },
+ {
+ "inputs": ["340282366920938463463373789765297113341", "340282366920938463463373789765297113341"],
+ "output": "340282366920938463463373789765297113341"
+ },
+ {
+ "inputs": ["340282366920938463463373789765297113341", "340282366920938463463373789765297113337"],
+ "output": "340282366920938463463373789765297113341"
+ }
+ ],
+ "max_euint256_euint4": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457577303760309863037", "1"],
+ "output": "115792089237316195423570985008687907853269984665640564039457577303760309863037"
+ },
+ { "inputs": ["4", "8"], "output": "8" },
{ "inputs": ["8", "8"], "output": "8" },
- { "inputs": ["8", "4"], "output": "4" }
+ { "inputs": ["8", "4"], "output": "8" }
+ ],
+ "max_euint256_euint8": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457581923844171729579", "237"],
+ "output": "115792089237316195423570985008687907853269984665640564039457581923844171729579"
+ },
+ { "inputs": ["233", "237"], "output": "237" },
+ { "inputs": ["237", "237"], "output": "237" },
+ { "inputs": ["237", "233"], "output": "237" }
+ ],
+ "max_euint256_euint16": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457580891899920920375", "31998"],
+ "output": "115792089237316195423570985008687907853269984665640564039457580891899920920375"
+ },
+ { "inputs": ["31994", "31998"], "output": "31998" },
+ { "inputs": ["31998", "31998"], "output": "31998" },
+ { "inputs": ["31998", "31994"], "output": "31998" }
+ ],
+ "max_euint256_euint32": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457581701635304814489", "4274177144"],
+ "output": "115792089237316195423570985008687907853269984665640564039457581701635304814489"
+ },
+ { "inputs": ["4274177140", "4274177144"], "output": "4274177144" },
+ { "inputs": ["4274177144", "4274177144"], "output": "4274177144" },
+ { "inputs": ["4274177144", "4274177140"], "output": "4274177144" }
+ ],
+ "max_euint256_euint64": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457583257576614099953",
+ "18438250957457099341"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457583257576614099953"
+ },
+ { "inputs": ["18438250957457099337", "18438250957457099341"], "output": "18438250957457099341" },
+ { "inputs": ["18438250957457099341", "18438250957457099341"], "output": "18438250957457099341" },
+ { "inputs": ["18438250957457099341", "18438250957457099337"], "output": "18438250957457099341" }
+ ],
+ "max_euint256_euint128": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457580295384680552043",
+ "340282366920938463463368511201134180813"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457580295384680552043"
+ },
+ {
+ "inputs": ["340282366920938463463368511201134180809", "340282366920938463463368511201134180813"],
+ "output": "340282366920938463463368511201134180813"
+ },
+ {
+ "inputs": ["340282366920938463463368511201134180813", "340282366920938463463368511201134180813"],
+ "output": "340282366920938463463368511201134180813"
+ },
+ {
+ "inputs": ["340282366920938463463368511201134180813", "340282366920938463463368511201134180809"],
+ "output": "340282366920938463463368511201134180813"
+ }
+ ],
+ "max_euint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577915867722108039",
+ "115792089237316195423570985008687907853269984665640564039457577809030115355409"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577915867722108039"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577809030115355405",
+ "115792089237316195423570985008687907853269984665640564039457577809030115355409"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577809030115355409"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577809030115355409",
+ "115792089237316195423570985008687907853269984665640564039457577809030115355409"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577809030115355409"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577809030115355409",
+ "115792089237316195423570985008687907853269984665640564039457577809030115355405"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577809030115355409"
+ }
+ ],
+ "max_euint256_uint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577915867722108039",
+ "115792089237316195423570985008687907853269984665640564039457582764130067775401"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457582764130067775401"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577809030115355405",
+ "115792089237316195423570985008687907853269984665640564039457577809030115355409"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577809030115355409"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577809030115355409",
+ "115792089237316195423570985008687907853269984665640564039457577809030115355409"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577809030115355409"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577809030115355409",
+ "115792089237316195423570985008687907853269984665640564039457577809030115355405"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577809030115355409"
+ }
+ ],
+ "max_uint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457582906409122638869",
+ "115792089237316195423570985008687907853269984665640564039457582764130067775401"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457582906409122638869"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577809030115355405",
+ "115792089237316195423570985008687907853269984665640564039457577809030115355409"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577809030115355409"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577809030115355409",
+ "115792089237316195423570985008687907853269984665640564039457577809030115355409"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577809030115355409"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577809030115355409",
+ "115792089237316195423570985008687907853269984665640564039457577809030115355405"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577809030115355409"
+ }
+ ],
+ "min_euint4_euint4": [
+ { "inputs": ["14", "13"], "output": "13" },
+ { "inputs": ["9", "13"], "output": "9" },
+ { "inputs": ["13", "13"], "output": "13" },
+ { "inputs": ["13", "9"], "output": "9" }
],
"min_euint4_euint8": [
- { "inputs": ["8", "124"], "output": "8" },
+ { "inputs": ["5", "254"], "output": "5" },
{ "inputs": ["4", "8"], "output": "4" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "4" }
],
"min_euint4_uint8": [
- { "inputs": ["8", "7"], "output": "7" },
+ { "inputs": ["5", "5"], "output": "5" },
{ "inputs": ["4", "8"], "output": "4" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "4" }
],
"min_euint4_euint16": [
- { "inputs": ["12", "47994"], "output": "12" },
- { "inputs": ["8", "12"], "output": "8" },
- { "inputs": ["12", "12"], "output": "12" },
- { "inputs": ["12", "8"], "output": "8" }
+ { "inputs": ["1", "50108"], "output": "1" },
+ { "inputs": ["4", "8"], "output": "4" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "4" }
],
"min_euint4_euint32": [
- { "inputs": ["10", "421626494"], "output": "10" },
- { "inputs": ["6", "10"], "output": "6" },
- { "inputs": ["10", "10"], "output": "10" },
- { "inputs": ["10", "6"], "output": "6" }
+ { "inputs": ["9", "2831156674"], "output": "9" },
+ { "inputs": ["5", "9"], "output": "5" },
+ { "inputs": ["9", "9"], "output": "9" },
+ { "inputs": ["9", "5"], "output": "5" }
],
"min_euint4_euint64": [
- { "inputs": ["12", "18438956406288597713"], "output": "12" },
+ { "inputs": ["12", "18440035039683442233"], "output": "12" },
{ "inputs": ["8", "12"], "output": "8" },
{ "inputs": ["12", "12"], "output": "12" },
{ "inputs": ["12", "8"], "output": "8" }
],
- "min_euint8_euint4": [
- { "inputs": ["55", "3"], "output": "3" },
+ "min_euint4_euint128": [
+ { "inputs": ["14", "340282366920938463463373484167219835469"], "output": "14" },
+ { "inputs": ["10", "14"], "output": "10" },
+ { "inputs": ["14", "14"], "output": "14" },
+ { "inputs": ["14", "10"], "output": "10" }
+ ],
+ "min_euint4_euint256": [
+ {
+ "inputs": ["1", "115792089237316195423570985008687907853269984665640564039457580584483222103041"],
+ "output": "1"
+ },
{ "inputs": ["4", "8"], "output": "4" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "4" }
],
+ "min_euint8_euint4": [
+ { "inputs": ["51", "11"], "output": "11" },
+ { "inputs": ["7", "11"], "output": "7" },
+ { "inputs": ["11", "11"], "output": "11" },
+ { "inputs": ["11", "7"], "output": "7" }
+ ],
"min_uint8_euint4": [
- { "inputs": ["5", "3"], "output": "3" },
- { "inputs": ["4", "8"], "output": "4" },
- { "inputs": ["8", "8"], "output": "8" },
- { "inputs": ["8", "4"], "output": "4" }
+ { "inputs": ["5", "11"], "output": "5" },
+ { "inputs": ["7", "11"], "output": "7" },
+ { "inputs": ["11", "11"], "output": "11" },
+ { "inputs": ["11", "7"], "output": "7" }
],
"min_euint8_euint8": [
- { "inputs": ["254", "73"], "output": "73" },
- { "inputs": ["69", "73"], "output": "69" },
- { "inputs": ["73", "73"], "output": "73" },
- { "inputs": ["73", "69"], "output": "69" }
+ { "inputs": ["183", "84"], "output": "84" },
+ { "inputs": ["80", "84"], "output": "80" },
+ { "inputs": ["84", "84"], "output": "84" },
+ { "inputs": ["84", "80"], "output": "80" }
],
"min_euint8_uint8": [
- { "inputs": ["254", "134"], "output": "134" },
- { "inputs": ["69", "73"], "output": "69" },
- { "inputs": ["73", "73"], "output": "73" },
- { "inputs": ["73", "69"], "output": "69" }
+ { "inputs": ["183", "152"], "output": "152" },
+ { "inputs": ["80", "84"], "output": "80" },
+ { "inputs": ["84", "84"], "output": "84" },
+ { "inputs": ["84", "80"], "output": "80" }
],
"min_uint8_euint8": [
- { "inputs": ["48", "134"], "output": "48" },
- { "inputs": ["69", "73"], "output": "69" },
- { "inputs": ["73", "73"], "output": "73" },
- { "inputs": ["73", "69"], "output": "69" }
+ { "inputs": ["22", "152"], "output": "22" },
+ { "inputs": ["80", "84"], "output": "80" },
+ { "inputs": ["84", "84"], "output": "84" },
+ { "inputs": ["84", "80"], "output": "80" }
],
"min_euint8_euint16": [
- { "inputs": ["59", "17033"], "output": "59" },
- { "inputs": ["55", "59"], "output": "55" },
- { "inputs": ["59", "59"], "output": "59" },
- { "inputs": ["59", "55"], "output": "55" }
+ { "inputs": ["83", "49187"], "output": "83" },
+ { "inputs": ["79", "83"], "output": "79" },
+ { "inputs": ["83", "83"], "output": "83" },
+ { "inputs": ["83", "79"], "output": "79" }
],
"min_euint8_euint32": [
- { "inputs": ["47", "1833760772"], "output": "47" },
- { "inputs": ["43", "47"], "output": "43" },
- { "inputs": ["47", "47"], "output": "47" },
- { "inputs": ["47", "43"], "output": "43" }
+ { "inputs": ["248", "4182541699"], "output": "248" },
+ { "inputs": ["244", "248"], "output": "244" },
+ { "inputs": ["248", "248"], "output": "248" },
+ { "inputs": ["248", "244"], "output": "244" }
],
"min_euint8_euint64": [
- { "inputs": ["240", "18439345293201198903"], "output": "240" },
- { "inputs": ["236", "240"], "output": "236" },
- { "inputs": ["240", "240"], "output": "240" },
- { "inputs": ["240", "236"], "output": "236" }
+ { "inputs": ["6", "18443833870782244811"], "output": "6" },
+ { "inputs": ["4", "8"], "output": "4" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "4" }
+ ],
+ "min_euint8_euint128": [
+ { "inputs": ["143", "340282366920938463463368314352737250889"], "output": "143" },
+ { "inputs": ["139", "143"], "output": "139" },
+ { "inputs": ["143", "143"], "output": "143" },
+ { "inputs": ["143", "139"], "output": "139" }
+ ],
+ "min_euint8_euint256": [
+ {
+ "inputs": ["227", "115792089237316195423570985008687907853269984665640564039457575642377411188527"],
+ "output": "227"
+ },
+ { "inputs": ["223", "227"], "output": "223" },
+ { "inputs": ["227", "227"], "output": "227" },
+ { "inputs": ["227", "223"], "output": "223" }
],
"min_euint16_euint4": [
- { "inputs": ["10884", "9"], "output": "9" },
- { "inputs": ["5", "9"], "output": "5" },
- { "inputs": ["9", "9"], "output": "9" },
- { "inputs": ["9", "5"], "output": "5" }
+ { "inputs": ["35993", "14"], "output": "14" },
+ { "inputs": ["10", "14"], "output": "10" },
+ { "inputs": ["14", "14"], "output": "14" },
+ { "inputs": ["14", "10"], "output": "10" }
],
"min_euint16_euint8": [
- { "inputs": ["29386", "59"], "output": "59" },
- { "inputs": ["55", "59"], "output": "55" },
- { "inputs": ["59", "59"], "output": "59" },
- { "inputs": ["59", "55"], "output": "55" }
+ { "inputs": ["16954", "238"], "output": "238" },
+ { "inputs": ["234", "238"], "output": "234" },
+ { "inputs": ["238", "238"], "output": "238" },
+ { "inputs": ["238", "234"], "output": "234" }
],
"min_euint16_euint16": [
- { "inputs": ["18209", "14696"], "output": "14696" },
- { "inputs": ["14692", "14696"], "output": "14692" },
- { "inputs": ["14696", "14696"], "output": "14696" },
- { "inputs": ["14696", "14692"], "output": "14692" }
+ { "inputs": ["32718", "8269"], "output": "8269" },
+ { "inputs": ["8265", "8269"], "output": "8265" },
+ { "inputs": ["8269", "8269"], "output": "8269" },
+ { "inputs": ["8269", "8265"], "output": "8265" }
],
"min_euint16_uint16": [
- { "inputs": ["18209", "9598"], "output": "9598" },
- { "inputs": ["14692", "14696"], "output": "14692" },
- { "inputs": ["14696", "14696"], "output": "14696" },
- { "inputs": ["14696", "14692"], "output": "14692" }
+ { "inputs": ["32718", "54097"], "output": "32718" },
+ { "inputs": ["8265", "8269"], "output": "8265" },
+ { "inputs": ["8269", "8269"], "output": "8269" },
+ { "inputs": ["8269", "8265"], "output": "8265" }
],
"min_uint16_euint16": [
- { "inputs": ["16454", "9598"], "output": "9598" },
- { "inputs": ["14692", "14696"], "output": "14692" },
- { "inputs": ["14696", "14696"], "output": "14696" },
- { "inputs": ["14696", "14692"], "output": "14692" }
+ { "inputs": ["24240", "54097"], "output": "24240" },
+ { "inputs": ["8265", "8269"], "output": "8265" },
+ { "inputs": ["8269", "8269"], "output": "8269" },
+ { "inputs": ["8269", "8265"], "output": "8265" }
],
"min_euint16_euint32": [
- { "inputs": ["5231", "2030449754"], "output": "5231" },
- { "inputs": ["5227", "5231"], "output": "5227" },
- { "inputs": ["5231", "5231"], "output": "5231" },
- { "inputs": ["5231", "5227"], "output": "5227" }
+ { "inputs": ["8199", "2465008600"], "output": "8199" },
+ { "inputs": ["8195", "8199"], "output": "8195" },
+ { "inputs": ["8199", "8199"], "output": "8199" },
+ { "inputs": ["8199", "8195"], "output": "8195" }
],
"min_euint16_euint64": [
- { "inputs": ["44251", "18443711845572494969"], "output": "44251" },
- { "inputs": ["44247", "44251"], "output": "44247" },
- { "inputs": ["44251", "44251"], "output": "44251" },
- { "inputs": ["44251", "44247"], "output": "44247" }
+ { "inputs": ["64768", "18439640713575288835"], "output": "64768" },
+ { "inputs": ["64764", "64768"], "output": "64764" },
+ { "inputs": ["64768", "64768"], "output": "64768" },
+ { "inputs": ["64768", "64764"], "output": "64764" }
+ ],
+ "min_euint16_euint128": [
+ { "inputs": ["47213", "340282366920938463463367215507048923025"], "output": "47213" },
+ { "inputs": ["47209", "47213"], "output": "47209" },
+ { "inputs": ["47213", "47213"], "output": "47213" },
+ { "inputs": ["47213", "47209"], "output": "47209" }
+ ],
+ "min_euint16_euint256": [
+ {
+ "inputs": ["56701", "115792089237316195423570985008687907853269984665640564039457576701213568693639"],
+ "output": "56701"
+ },
+ { "inputs": ["56697", "56701"], "output": "56697" },
+ { "inputs": ["56701", "56701"], "output": "56701" },
+ { "inputs": ["56701", "56697"], "output": "56697" }
],
"min_euint32_euint4": [
- { "inputs": ["2403125524", "11"], "output": "11" },
+ { "inputs": ["52471261", "11"], "output": "11" },
{ "inputs": ["7", "11"], "output": "7" },
{ "inputs": ["11", "11"], "output": "11" },
{ "inputs": ["11", "7"], "output": "7" }
],
"min_euint32_euint8": [
- { "inputs": ["2689679661", "114"], "output": "114" },
- { "inputs": ["110", "114"], "output": "110" },
- { "inputs": ["114", "114"], "output": "114" },
- { "inputs": ["114", "110"], "output": "110" }
+ { "inputs": ["2070023085", "28"], "output": "28" },
+ { "inputs": ["24", "28"], "output": "24" },
+ { "inputs": ["28", "28"], "output": "28" },
+ { "inputs": ["28", "24"], "output": "24" }
],
"min_euint32_euint16": [
- { "inputs": ["2355937467", "15361"], "output": "15361" },
- { "inputs": ["15357", "15361"], "output": "15357" },
- { "inputs": ["15361", "15361"], "output": "15361" },
- { "inputs": ["15361", "15357"], "output": "15357" }
+ { "inputs": ["3265803083", "25661"], "output": "25661" },
+ { "inputs": ["25657", "25661"], "output": "25657" },
+ { "inputs": ["25661", "25661"], "output": "25661" },
+ { "inputs": ["25661", "25657"], "output": "25657" }
],
"min_euint32_euint32": [
- { "inputs": ["4226618007", "2940808913"], "output": "2940808913" },
- { "inputs": ["2940808909", "2940808913"], "output": "2940808909" },
- { "inputs": ["2940808913", "2940808913"], "output": "2940808913" },
- { "inputs": ["2940808913", "2940808909"], "output": "2940808909" }
+ { "inputs": ["3167993396", "3198148813"], "output": "3167993396" },
+ { "inputs": ["3167993392", "3167993396"], "output": "3167993392" },
+ { "inputs": ["3167993396", "3167993396"], "output": "3167993396" },
+ { "inputs": ["3167993396", "3167993392"], "output": "3167993392" }
],
"min_euint32_uint32": [
- { "inputs": ["4226618007", "2039277146"], "output": "2039277146" },
- { "inputs": ["2940808909", "2940808913"], "output": "2940808909" },
- { "inputs": ["2940808913", "2940808913"], "output": "2940808913" },
- { "inputs": ["2940808913", "2940808909"], "output": "2940808909" }
+ { "inputs": ["3167993396", "1826176221"], "output": "1826176221" },
+ { "inputs": ["3167993392", "3167993396"], "output": "3167993392" },
+ { "inputs": ["3167993396", "3167993396"], "output": "3167993396" },
+ { "inputs": ["3167993396", "3167993392"], "output": "3167993392" }
],
"min_uint32_euint32": [
- { "inputs": ["1778120575", "2039277146"], "output": "1778120575" },
- { "inputs": ["2940808909", "2940808913"], "output": "2940808909" },
- { "inputs": ["2940808913", "2940808913"], "output": "2940808913" },
- { "inputs": ["2940808913", "2940808909"], "output": "2940808909" }
+ { "inputs": ["591129059", "1826176221"], "output": "591129059" },
+ { "inputs": ["3167993392", "3167993396"], "output": "3167993392" },
+ { "inputs": ["3167993396", "3167993396"], "output": "3167993396" },
+ { "inputs": ["3167993396", "3167993392"], "output": "3167993392" }
],
"min_euint32_euint64": [
- { "inputs": ["3364933042", "18443534177311383841"], "output": "3364933042" },
- { "inputs": ["3364933038", "3364933042"], "output": "3364933038" },
- { "inputs": ["3364933042", "3364933042"], "output": "3364933042" },
- { "inputs": ["3364933042", "3364933038"], "output": "3364933038" }
+ { "inputs": ["1841925700", "18442933982305840083"], "output": "1841925700" },
+ { "inputs": ["1841925696", "1841925700"], "output": "1841925696" },
+ { "inputs": ["1841925700", "1841925700"], "output": "1841925700" },
+ { "inputs": ["1841925700", "1841925696"], "output": "1841925696" }
+ ],
+ "min_euint32_euint128": [
+ { "inputs": ["4003399201", "340282366920938463463365902462339741051"], "output": "4003399201" },
+ { "inputs": ["4003399197", "4003399201"], "output": "4003399197" },
+ { "inputs": ["4003399201", "4003399201"], "output": "4003399201" },
+ { "inputs": ["4003399201", "4003399197"], "output": "4003399197" }
+ ],
+ "min_euint32_euint256": [
+ {
+ "inputs": ["3608929890", "115792089237316195423570985008687907853269984665640564039457579751481725336191"],
+ "output": "3608929890"
+ },
+ { "inputs": ["3608929886", "3608929890"], "output": "3608929886" },
+ { "inputs": ["3608929890", "3608929890"], "output": "3608929890" },
+ { "inputs": ["3608929890", "3608929886"], "output": "3608929886" }
],
"min_euint64_euint4": [
- { "inputs": ["18446705827641256747", "10"], "output": "10" },
- { "inputs": ["6", "10"], "output": "6" },
- { "inputs": ["10", "10"], "output": "10" },
- { "inputs": ["10", "6"], "output": "6" }
+ { "inputs": ["18440660497360576819", "14"], "output": "14" },
+ { "inputs": ["10", "14"], "output": "10" },
+ { "inputs": ["14", "14"], "output": "14" },
+ { "inputs": ["14", "10"], "output": "10" }
],
"min_euint64_euint8": [
- { "inputs": ["18440761228336909285", "170"], "output": "170" },
- { "inputs": ["166", "170"], "output": "166" },
- { "inputs": ["170", "170"], "output": "170" },
- { "inputs": ["170", "166"], "output": "166" }
+ { "inputs": ["18442702391560231447", "64"], "output": "64" },
+ { "inputs": ["60", "64"], "output": "60" },
+ { "inputs": ["64", "64"], "output": "64" },
+ { "inputs": ["64", "60"], "output": "60" }
],
"min_euint64_euint16": [
- { "inputs": ["18438622448280376415", "51692"], "output": "51692" },
- { "inputs": ["51688", "51692"], "output": "51688" },
- { "inputs": ["51692", "51692"], "output": "51692" },
- { "inputs": ["51692", "51688"], "output": "51688" }
+ { "inputs": ["18440389921895932333", "42816"], "output": "42816" },
+ { "inputs": ["42812", "42816"], "output": "42812" },
+ { "inputs": ["42816", "42816"], "output": "42816" },
+ { "inputs": ["42816", "42812"], "output": "42812" }
],
"min_euint64_euint32": [
- { "inputs": ["18440186743754430625", "4137891061"], "output": "4137891061" },
- { "inputs": ["4137891057", "4137891061"], "output": "4137891057" },
- { "inputs": ["4137891061", "4137891061"], "output": "4137891061" },
- { "inputs": ["4137891061", "4137891057"], "output": "4137891057" }
+ { "inputs": ["18439611592084278651", "1078993829"], "output": "1078993829" },
+ { "inputs": ["1078993825", "1078993829"], "output": "1078993825" },
+ { "inputs": ["1078993829", "1078993829"], "output": "1078993829" },
+ { "inputs": ["1078993829", "1078993825"], "output": "1078993825" }
],
"min_euint64_euint64": [
- { "inputs": ["18446277918636147641", "18439099819121701507"], "output": "18439099819121701507" },
- { "inputs": ["18439099819121701503", "18439099819121701507"], "output": "18439099819121701503" },
- { "inputs": ["18439099819121701507", "18439099819121701507"], "output": "18439099819121701507" },
- { "inputs": ["18439099819121701507", "18439099819121701503"], "output": "18439099819121701503" }
+ { "inputs": ["18438422972288340001", "18441615262395055283"], "output": "18438422972288340001" },
+ { "inputs": ["18438422972288339997", "18438422972288340001"], "output": "18438422972288339997" },
+ { "inputs": ["18438422972288340001", "18438422972288340001"], "output": "18438422972288340001" },
+ { "inputs": ["18438422972288340001", "18438422972288339997"], "output": "18438422972288339997" }
],
"min_euint64_uint64": [
- { "inputs": ["18446277918636147641", "18444361908116912137"], "output": "18444361908116912137" },
- { "inputs": ["18439099819121701503", "18439099819121701507"], "output": "18439099819121701503" },
- { "inputs": ["18439099819121701507", "18439099819121701507"], "output": "18439099819121701507" },
- { "inputs": ["18439099819121701507", "18439099819121701503"], "output": "18439099819121701503" }
+ { "inputs": ["18438422972288340001", "18439986643027034037"], "output": "18438422972288340001" },
+ { "inputs": ["18438422972288339997", "18438422972288340001"], "output": "18438422972288339997" },
+ { "inputs": ["18438422972288340001", "18438422972288340001"], "output": "18438422972288340001" },
+ { "inputs": ["18438422972288340001", "18438422972288339997"], "output": "18438422972288339997" }
],
"min_uint64_euint64": [
- { "inputs": ["18445356693251014369", "18444361908116912137"], "output": "18444361908116912137" },
- { "inputs": ["18439099819121701503", "18439099819121701507"], "output": "18439099819121701503" },
- { "inputs": ["18439099819121701507", "18439099819121701507"], "output": "18439099819121701507" },
- { "inputs": ["18439099819121701507", "18439099819121701503"], "output": "18439099819121701503" }
+ { "inputs": ["18443338893508802671", "18439986643027034037"], "output": "18439986643027034037" },
+ { "inputs": ["18438422972288339997", "18438422972288340001"], "output": "18438422972288339997" },
+ { "inputs": ["18438422972288340001", "18438422972288340001"], "output": "18438422972288340001" },
+ { "inputs": ["18438422972288340001", "18438422972288339997"], "output": "18438422972288339997" }
+ ],
+ "min_euint64_euint128": [
+ { "inputs": ["18444900314492723695", "340282366920938463463367540489775579127"], "output": "18444900314492723695" },
+ { "inputs": ["18444900314492723691", "18444900314492723695"], "output": "18444900314492723691" },
+ { "inputs": ["18444900314492723695", "18444900314492723695"], "output": "18444900314492723695" },
+ { "inputs": ["18444900314492723695", "18444900314492723691"], "output": "18444900314492723691" }
+ ],
+ "min_euint64_euint256": [
+ {
+ "inputs": [
+ "18446426094775234589",
+ "115792089237316195423570985008687907853269984665640564039457578688132986416989"
+ ],
+ "output": "18446426094775234589"
+ },
+ { "inputs": ["18446426094775234585", "18446426094775234589"], "output": "18446426094775234585" },
+ { "inputs": ["18446426094775234589", "18446426094775234589"], "output": "18446426094775234589" },
+ { "inputs": ["18446426094775234589", "18446426094775234585"], "output": "18446426094775234585" }
+ ],
+ "min_euint128_euint4": [
+ { "inputs": ["340282366920938463463373617043976262819", "6"], "output": "6" },
+ { "inputs": ["4", "8"], "output": "4" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "4" }
+ ],
+ "min_euint128_euint8": [
+ { "inputs": ["340282366920938463463366071622027178861", "33"], "output": "33" },
+ { "inputs": ["29", "33"], "output": "29" },
+ { "inputs": ["33", "33"], "output": "33" },
+ { "inputs": ["33", "29"], "output": "29" }
+ ],
+ "min_euint128_euint16": [
+ { "inputs": ["340282366920938463463368542801038101753", "9714"], "output": "9714" },
+ { "inputs": ["9710", "9714"], "output": "9710" },
+ { "inputs": ["9714", "9714"], "output": "9714" },
+ { "inputs": ["9714", "9710"], "output": "9710" }
+ ],
+ "min_euint128_euint32": [
+ { "inputs": ["340282366920938463463373948652081205153", "4076998775"], "output": "4076998775" },
+ { "inputs": ["4076998771", "4076998775"], "output": "4076998771" },
+ { "inputs": ["4076998775", "4076998775"], "output": "4076998775" },
+ { "inputs": ["4076998775", "4076998771"], "output": "4076998771" }
+ ],
+ "min_euint128_euint64": [
+ { "inputs": ["340282366920938463463372700048433567093", "18437970528445398453"], "output": "18437970528445398453" },
+ { "inputs": ["18437970528445398449", "18437970528445398453"], "output": "18437970528445398449" },
+ { "inputs": ["18437970528445398453", "18437970528445398453"], "output": "18437970528445398453" },
+ { "inputs": ["18437970528445398453", "18437970528445398449"], "output": "18437970528445398449" }
+ ],
+ "min_euint128_euint128": [
+ {
+ "inputs": ["340282366920938463463369507025632955721", "340282366920938463463371759125181075731"],
+ "output": "340282366920938463463369507025632955721"
+ },
+ {
+ "inputs": ["340282366920938463463369507025632955717", "340282366920938463463369507025632955721"],
+ "output": "340282366920938463463369507025632955717"
+ },
+ {
+ "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369507025632955721"],
+ "output": "340282366920938463463369507025632955721"
+ },
+ {
+ "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369507025632955717"],
+ "output": "340282366920938463463369507025632955717"
+ }
+ ],
+ "min_euint128_uint128": [
+ {
+ "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369479362880511843"],
+ "output": "340282366920938463463369479362880511843"
+ },
+ {
+ "inputs": ["340282366920938463463369507025632955717", "340282366920938463463369507025632955721"],
+ "output": "340282366920938463463369507025632955717"
+ },
+ {
+ "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369507025632955721"],
+ "output": "340282366920938463463369507025632955721"
+ },
+ {
+ "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369507025632955717"],
+ "output": "340282366920938463463369507025632955717"
+ }
+ ],
+ "min_uint128_euint128": [
+ {
+ "inputs": ["340282366920938463463367460119738968177", "340282366920938463463369479362880511843"],
+ "output": "340282366920938463463367460119738968177"
+ },
+ {
+ "inputs": ["340282366920938463463369507025632955717", "340282366920938463463369507025632955721"],
+ "output": "340282366920938463463369507025632955717"
+ },
+ {
+ "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369507025632955721"],
+ "output": "340282366920938463463369507025632955721"
+ },
+ {
+ "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369507025632955717"],
+ "output": "340282366920938463463369507025632955717"
+ }
+ ],
+ "min_euint128_euint256": [
+ {
+ "inputs": [
+ "340282366920938463463370734691749234713",
+ "115792089237316195423570985008687907853269984665640564039457579316332311519059"
+ ],
+ "output": "340282366920938463463370734691749234713"
+ },
+ {
+ "inputs": ["340282366920938463463370734691749234709", "340282366920938463463370734691749234713"],
+ "output": "340282366920938463463370734691749234709"
+ },
+ {
+ "inputs": ["340282366920938463463370734691749234713", "340282366920938463463370734691749234713"],
+ "output": "340282366920938463463370734691749234713"
+ },
+ {
+ "inputs": ["340282366920938463463370734691749234713", "340282366920938463463370734691749234709"],
+ "output": "340282366920938463463370734691749234709"
+ }
+ ],
+ "min_euint256_euint4": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457582664799758938101", "2"],
+ "output": "2"
+ },
+ { "inputs": ["4", "8"], "output": "4" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "4" }
+ ],
+ "min_euint256_euint8": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457577026640283682165", "103"],
+ "output": "103"
+ },
+ { "inputs": ["99", "103"], "output": "99" },
+ { "inputs": ["103", "103"], "output": "103" },
+ { "inputs": ["103", "99"], "output": "99" }
+ ],
+ "min_euint256_euint16": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457579076951559173157", "24679"],
+ "output": "24679"
+ },
+ { "inputs": ["24675", "24679"], "output": "24675" },
+ { "inputs": ["24679", "24679"], "output": "24679" },
+ { "inputs": ["24679", "24675"], "output": "24675" }
+ ],
+ "min_euint256_euint32": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457582240718630307135", "1248940496"],
+ "output": "1248940496"
+ },
+ { "inputs": ["1248940492", "1248940496"], "output": "1248940492" },
+ { "inputs": ["1248940496", "1248940496"], "output": "1248940496" },
+ { "inputs": ["1248940496", "1248940492"], "output": "1248940492" }
+ ],
+ "min_euint256_euint64": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579813847565218665",
+ "18443636668516069273"
+ ],
+ "output": "18443636668516069273"
+ },
+ { "inputs": ["18443636668516069269", "18443636668516069273"], "output": "18443636668516069269" },
+ { "inputs": ["18443636668516069273", "18443636668516069273"], "output": "18443636668516069273" },
+ { "inputs": ["18443636668516069273", "18443636668516069269"], "output": "18443636668516069269" }
+ ],
+ "min_euint256_euint128": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457578748486524440321",
+ "340282366920938463463370032475222092647"
+ ],
+ "output": "340282366920938463463370032475222092647"
+ },
+ {
+ "inputs": ["340282366920938463463370032475222092643", "340282366920938463463370032475222092647"],
+ "output": "340282366920938463463370032475222092643"
+ },
+ {
+ "inputs": ["340282366920938463463370032475222092647", "340282366920938463463370032475222092647"],
+ "output": "340282366920938463463370032475222092647"
+ },
+ {
+ "inputs": ["340282366920938463463370032475222092647", "340282366920938463463370032475222092643"],
+ "output": "340282366920938463463370032475222092643"
+ }
+ ],
+ "min_euint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579091097262441647",
+ "115792089237316195423570985008687907853269984665640564039457577447088911778291"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577447088911778291"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577447088911778287",
+ "115792089237316195423570985008687907853269984665640564039457577447088911778291"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577447088911778287"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577447088911778291",
+ "115792089237316195423570985008687907853269984665640564039457577447088911778291"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577447088911778291"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577447088911778291",
+ "115792089237316195423570985008687907853269984665640564039457577447088911778287"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577447088911778287"
+ }
+ ],
+ "min_euint256_uint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579091097262441647",
+ "115792089237316195423570985008687907853269984665640564039457576915935387349417"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457576915935387349417"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577447088911778287",
+ "115792089237316195423570985008687907853269984665640564039457577447088911778291"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577447088911778287"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577447088911778291",
+ "115792089237316195423570985008687907853269984665640564039457577447088911778291"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577447088911778291"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577447088911778291",
+ "115792089237316195423570985008687907853269984665640564039457577447088911778287"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577447088911778287"
+ }
+ ],
+ "min_uint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579127166009597401",
+ "115792089237316195423570985008687907853269984665640564039457576915935387349417"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457576915935387349417"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577447088911778287",
+ "115792089237316195423570985008687907853269984665640564039457577447088911778291"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577447088911778287"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577447088911778291",
+ "115792089237316195423570985008687907853269984665640564039457577447088911778291"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577447088911778291"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457577447088911778291",
+ "115792089237316195423570985008687907853269984665640564039457577447088911778287"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457577447088911778287"
+ }
],
"or_euint4_euint4": [
- { "inputs": ["7", "10"], "output": "15" },
+ { "inputs": ["10", "6"], "output": "14" },
{ "inputs": ["4", "8"], "output": "12" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "12" }
],
"or_euint4_euint8": [
- { "inputs": ["12", "18"], "output": "30" },
- { "inputs": ["8", "12"], "output": "12" },
- { "inputs": ["12", "12"], "output": "12" },
- { "inputs": ["12", "8"], "output": "12" }
+ { "inputs": ["8", "185"], "output": "185" },
+ { "inputs": ["4", "8"], "output": "12" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "12" }
+ ],
+ "or_euint4_uint8": [
+ { "inputs": ["8", "9"], "output": "9" },
+ { "inputs": ["4", "8"], "output": "12" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "12" }
],
"or_euint4_euint16": [
- { "inputs": ["12", "197"], "output": "205" },
- { "inputs": ["8", "12"], "output": "12" },
- { "inputs": ["12", "12"], "output": "12" },
- { "inputs": ["12", "8"], "output": "12" }
+ { "inputs": ["9", "28733"], "output": "28733" },
+ { "inputs": ["5", "9"], "output": "13" },
+ { "inputs": ["9", "9"], "output": "9" },
+ { "inputs": ["9", "5"], "output": "13" }
],
"or_euint4_euint32": [
- { "inputs": ["12", "3045135587"], "output": "3045135599" },
- { "inputs": ["8", "12"], "output": "12" },
- { "inputs": ["12", "12"], "output": "12" },
- { "inputs": ["12", "8"], "output": "12" }
+ { "inputs": ["13", "371092847"], "output": "371092847" },
+ { "inputs": ["9", "13"], "output": "13" },
+ { "inputs": ["13", "13"], "output": "13" },
+ { "inputs": ["13", "9"], "output": "13" }
],
"or_euint4_euint64": [
- { "inputs": ["5", "18439458059788568419"], "output": "18439458059788568423" },
+ { "inputs": ["14", "18440698678220010551"], "output": "18440698678220010559" },
+ { "inputs": ["10", "14"], "output": "14" },
+ { "inputs": ["14", "14"], "output": "14" },
+ { "inputs": ["14", "10"], "output": "14" }
+ ],
+ "or_euint4_euint128": [
+ { "inputs": ["4", "340282366920938463463366343089484611447"], "output": "340282366920938463463366343089484611447" },
+ { "inputs": ["4", "8"], "output": "12" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "12" }
+ ],
+ "or_euint4_euint256": [
+ {
+ "inputs": ["8", "115792089237316195423570985008687907853269984665640564039457583166606888282231"],
+ "output": "115792089237316195423570985008687907853269984665640564039457583166606888282239"
+ },
{ "inputs": ["4", "8"], "output": "12" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "12" }
],
"or_euint8_euint4": [
- { "inputs": ["37", "6"], "output": "39" },
+ { "inputs": ["189", "3"], "output": "191" },
+ { "inputs": ["4", "8"], "output": "12" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "12" }
+ ],
+ "or_uint8_euint4": [
+ { "inputs": ["13", "3"], "output": "15" },
{ "inputs": ["4", "8"], "output": "12" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "12" }
],
"or_euint8_euint8": [
- { "inputs": ["245", "47"], "output": "255" },
- { "inputs": ["43", "47"], "output": "47" },
- { "inputs": ["47", "47"], "output": "47" },
- { "inputs": ["47", "43"], "output": "47" }
+ { "inputs": ["189", "251"], "output": "255" },
+ { "inputs": ["185", "189"], "output": "189" },
+ { "inputs": ["189", "189"], "output": "189" },
+ { "inputs": ["189", "185"], "output": "189" }
+ ],
+ "or_euint8_uint8": [
+ { "inputs": ["189", "140"], "output": "189" },
+ { "inputs": ["185", "189"], "output": "189" },
+ { "inputs": ["189", "189"], "output": "189" },
+ { "inputs": ["189", "185"], "output": "189" }
+ ],
+ "or_uint8_euint8": [
+ { "inputs": ["139", "140"], "output": "143" },
+ { "inputs": ["185", "189"], "output": "189" },
+ { "inputs": ["189", "189"], "output": "189" },
+ { "inputs": ["189", "185"], "output": "189" }
],
"or_euint8_euint16": [
- { "inputs": ["140", "39215"], "output": "39343" },
- { "inputs": ["136", "140"], "output": "140" },
- { "inputs": ["140", "140"], "output": "140" },
- { "inputs": ["140", "136"], "output": "140" }
+ { "inputs": ["20", "28056"], "output": "28060" },
+ { "inputs": ["16", "20"], "output": "20" },
+ { "inputs": ["20", "20"], "output": "20" },
+ { "inputs": ["20", "16"], "output": "20" }
],
"or_euint8_euint32": [
- { "inputs": ["99", "1264632675"], "output": "1264632675" },
- { "inputs": ["95", "99"], "output": "127" },
- { "inputs": ["99", "99"], "output": "99" },
- { "inputs": ["99", "95"], "output": "127" }
+ { "inputs": ["64", "694910711"], "output": "694910711" },
+ { "inputs": ["60", "64"], "output": "124" },
+ { "inputs": ["64", "64"], "output": "64" },
+ { "inputs": ["64", "60"], "output": "124" }
],
"or_euint8_euint64": [
- { "inputs": ["66", "18439693911625769587"], "output": "18439693911625769587" },
- { "inputs": ["62", "66"], "output": "126" },
- { "inputs": ["66", "66"], "output": "66" },
- { "inputs": ["66", "62"], "output": "126" }
+ { "inputs": ["22", "18446578065470955215"], "output": "18446578065470955231" },
+ { "inputs": ["18", "22"], "output": "22" },
+ { "inputs": ["22", "22"], "output": "22" },
+ { "inputs": ["22", "18"], "output": "22" }
+ ],
+ "or_euint8_euint128": [
+ { "inputs": ["1", "340282366920938463463371478178042182733"], "output": "340282366920938463463371478178042182733" },
+ { "inputs": ["4", "8"], "output": "12" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "12" }
+ ],
+ "or_euint8_euint256": [
+ {
+ "inputs": ["46", "115792089237316195423570985008687907853269984665640564039457582375126935756687"],
+ "output": "115792089237316195423570985008687907853269984665640564039457582375126935756719"
+ },
+ { "inputs": ["42", "46"], "output": "46" },
+ { "inputs": ["46", "46"], "output": "46" },
+ { "inputs": ["46", "42"], "output": "46" }
],
"or_euint16_euint4": [
- { "inputs": ["40123", "11"], "output": "40123" },
- { "inputs": ["7", "11"], "output": "15" },
- { "inputs": ["11", "11"], "output": "11" },
- { "inputs": ["11", "7"], "output": "15" }
+ { "inputs": ["31310", "6"], "output": "31310" },
+ { "inputs": ["4", "8"], "output": "12" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "12" }
],
"or_euint16_euint8": [
- { "inputs": ["37227", "88"], "output": "37243" },
- { "inputs": ["84", "88"], "output": "92" },
- { "inputs": ["88", "88"], "output": "88" },
- { "inputs": ["88", "84"], "output": "92" }
+ { "inputs": ["20350", "200"], "output": "20478" },
+ { "inputs": ["196", "200"], "output": "204" },
+ { "inputs": ["200", "200"], "output": "200" },
+ { "inputs": ["200", "196"], "output": "204" }
],
"or_euint16_euint16": [
- { "inputs": ["33634", "27003"], "output": "60283" },
- { "inputs": ["26999", "27003"], "output": "27007" },
- { "inputs": ["27003", "27003"], "output": "27003" },
- { "inputs": ["27003", "26999"], "output": "27007" }
+ { "inputs": ["41436", "37567"], "output": "46079" },
+ { "inputs": ["37563", "37567"], "output": "37567" },
+ { "inputs": ["37567", "37567"], "output": "37567" },
+ { "inputs": ["37567", "37563"], "output": "37567" }
+ ],
+ "or_euint16_uint16": [
+ { "inputs": ["41436", "27184"], "output": "60412" },
+ { "inputs": ["37563", "37567"], "output": "37567" },
+ { "inputs": ["37567", "37567"], "output": "37567" },
+ { "inputs": ["37567", "37563"], "output": "37567" }
+ ],
+ "or_uint16_euint16": [
+ { "inputs": ["65174", "27184"], "output": "65206" },
+ { "inputs": ["37563", "37567"], "output": "37567" },
+ { "inputs": ["37567", "37567"], "output": "37567" },
+ { "inputs": ["37567", "37563"], "output": "37567" }
],
"or_euint16_euint32": [
- { "inputs": ["440", "1863142416"], "output": "1863142840" },
- { "inputs": ["436", "440"], "output": "444" },
- { "inputs": ["440", "440"], "output": "440" },
- { "inputs": ["440", "436"], "output": "444" }
+ { "inputs": ["36595", "3887874863"], "output": "3887910911" },
+ { "inputs": ["36591", "36595"], "output": "36607" },
+ { "inputs": ["36595", "36595"], "output": "36595" },
+ { "inputs": ["36595", "36591"], "output": "36607" }
],
"or_euint16_euint64": [
- { "inputs": ["12837", "18444850378165005521"], "output": "18444850378165010165" },
- { "inputs": ["12833", "12837"], "output": "12837" },
- { "inputs": ["12837", "12837"], "output": "12837" },
- { "inputs": ["12837", "12833"], "output": "12837" }
+ { "inputs": ["8318", "18443891473910549169"], "output": "18443891473910557439" },
+ { "inputs": ["8314", "8318"], "output": "8318" },
+ { "inputs": ["8318", "8318"], "output": "8318" },
+ { "inputs": ["8318", "8314"], "output": "8318" }
+ ],
+ "or_euint16_euint128": [
+ {
+ "inputs": ["65101", "340282366920938463463368378388212688025"],
+ "output": "340282366920938463463368378388212743901"
+ },
+ { "inputs": ["65097", "65101"], "output": "65101" },
+ { "inputs": ["65101", "65101"], "output": "65101" },
+ { "inputs": ["65101", "65097"], "output": "65101" }
+ ],
+ "or_euint16_euint256": [
+ {
+ "inputs": ["31079", "115792089237316195423570985008687907853269984665640564039457575275996784888971"],
+ "output": "115792089237316195423570985008687907853269984665640564039457575275996784917999"
+ },
+ { "inputs": ["31075", "31079"], "output": "31079" },
+ { "inputs": ["31079", "31079"], "output": "31079" },
+ { "inputs": ["31079", "31075"], "output": "31079" }
],
"or_euint32_euint4": [
- { "inputs": ["2761097401", "13"], "output": "2761097405" },
- { "inputs": ["9", "13"], "output": "13" },
- { "inputs": ["13", "13"], "output": "13" },
- { "inputs": ["13", "9"], "output": "13" }
+ { "inputs": ["1671920698", "3"], "output": "1671920699" },
+ { "inputs": ["4", "8"], "output": "12" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "12" }
],
"or_euint32_euint8": [
- { "inputs": ["1062322837", "212"], "output": "1062322901" },
- { "inputs": ["208", "212"], "output": "212" },
- { "inputs": ["212", "212"], "output": "212" },
- { "inputs": ["212", "208"], "output": "212" }
+ { "inputs": ["143668880", "184"], "output": "143668920" },
+ { "inputs": ["180", "184"], "output": "188" },
+ { "inputs": ["184", "184"], "output": "184" },
+ { "inputs": ["184", "180"], "output": "188" }
],
"or_euint32_euint16": [
- { "inputs": ["1914437939", "49825"], "output": "1914487731" },
- { "inputs": ["49821", "49825"], "output": "49853" },
- { "inputs": ["49825", "49825"], "output": "49825" },
- { "inputs": ["49825", "49821"], "output": "49853" }
+ { "inputs": ["68701034", "41103"], "output": "68742127" },
+ { "inputs": ["41099", "41103"], "output": "41103" },
+ { "inputs": ["41103", "41103"], "output": "41103" },
+ { "inputs": ["41103", "41099"], "output": "41103" }
],
"or_euint32_euint32": [
- { "inputs": ["1757798833", "311935858"], "output": "2060968947" },
- { "inputs": ["311935854", "311935858"], "output": "311935870" },
- { "inputs": ["311935858", "311935858"], "output": "311935858" },
- { "inputs": ["311935858", "311935854"], "output": "311935870" }
+ { "inputs": ["1707541891", "1244554527"], "output": "1877960095" },
+ { "inputs": ["1244554523", "1244554527"], "output": "1244554527" },
+ { "inputs": ["1244554527", "1244554527"], "output": "1244554527" },
+ { "inputs": ["1244554527", "1244554523"], "output": "1244554527" }
+ ],
+ "or_euint32_uint32": [
+ { "inputs": ["1707541891", "1007760424"], "output": "2111255979" },
+ { "inputs": ["1244554523", "1244554527"], "output": "1244554527" },
+ { "inputs": ["1244554527", "1244554527"], "output": "1244554527" },
+ { "inputs": ["1244554527", "1244554523"], "output": "1244554527" }
+ ],
+ "or_uint32_euint32": [
+ { "inputs": ["1405809228", "1007760424"], "output": "2145121900" },
+ { "inputs": ["1244554523", "1244554527"], "output": "1244554527" },
+ { "inputs": ["1244554527", "1244554527"], "output": "1244554527" },
+ { "inputs": ["1244554527", "1244554523"], "output": "1244554527" }
],
"or_euint32_euint64": [
- { "inputs": ["1312726121", "18440203558036734807"], "output": "18440203559245881215" },
- { "inputs": ["1312726117", "1312726121"], "output": "1312726125" },
- { "inputs": ["1312726121", "1312726121"], "output": "1312726121" },
- { "inputs": ["1312726121", "1312726117"], "output": "1312726125" }
+ { "inputs": ["1546853992", "18445417582546475671"], "output": "18445417583755615999" },
+ { "inputs": ["1546853988", "1546853992"], "output": "1546853996" },
+ { "inputs": ["1546853992", "1546853992"], "output": "1546853992" },
+ { "inputs": ["1546853992", "1546853988"], "output": "1546853996" }
+ ],
+ "or_euint32_euint128": [
+ {
+ "inputs": ["1775515615", "340282366920938463463365726409727391809"],
+ "output": "340282366920938463463365726409758064607"
+ },
+ { "inputs": ["1775515611", "1775515615"], "output": "1775515615" },
+ { "inputs": ["1775515615", "1775515615"], "output": "1775515615" },
+ { "inputs": ["1775515615", "1775515611"], "output": "1775515615" }
+ ],
+ "or_euint32_euint256": [
+ {
+ "inputs": ["2321952704", "115792089237316195423570985008687907853269984665640564039457581516412469896587"],
+ "output": "115792089237316195423570985008687907853269984665640564039457581516414655131595"
+ },
+ { "inputs": ["2321952700", "2321952704"], "output": "2321952764" },
+ { "inputs": ["2321952704", "2321952704"], "output": "2321952704" },
+ { "inputs": ["2321952704", "2321952700"], "output": "2321952764" }
],
"or_euint64_euint4": [
- { "inputs": ["18443742079082438219", "5"], "output": "18443742079082438223" },
- { "inputs": ["4", "8"], "output": "12" },
- { "inputs": ["8", "8"], "output": "8" },
- { "inputs": ["8", "4"], "output": "12" }
+ { "inputs": ["18443718017569117131", "9"], "output": "18443718017569117131" },
+ { "inputs": ["5", "9"], "output": "13" },
+ { "inputs": ["9", "9"], "output": "9" },
+ { "inputs": ["9", "5"], "output": "13" }
],
"or_euint64_euint8": [
- { "inputs": ["18442062213086556497", "168"], "output": "18442062213086556665" },
- { "inputs": ["164", "168"], "output": "172" },
- { "inputs": ["168", "168"], "output": "168" },
- { "inputs": ["168", "164"], "output": "172" }
+ { "inputs": ["18442034297780989323", "254"], "output": "18442034297780989439" },
+ { "inputs": ["250", "254"], "output": "254" },
+ { "inputs": ["254", "254"], "output": "254" },
+ { "inputs": ["254", "250"], "output": "254" }
],
"or_euint64_euint16": [
- { "inputs": ["18437769114436402597", "8954"], "output": "18437769114436403199" },
- { "inputs": ["8950", "8954"], "output": "8958" },
- { "inputs": ["8954", "8954"], "output": "8954" },
- { "inputs": ["8954", "8950"], "output": "8958" }
+ { "inputs": ["18445256696814040973", "63476"], "output": "18445256696814041085" },
+ { "inputs": ["63472", "63476"], "output": "63476" },
+ { "inputs": ["63476", "63476"], "output": "63476" },
+ { "inputs": ["63476", "63472"], "output": "63476" }
],
"or_euint64_euint32": [
- { "inputs": ["18438806940040470143", "729835566"], "output": "18438806940585754239" },
- { "inputs": ["729835562", "729835566"], "output": "729835566" },
- { "inputs": ["729835566", "729835566"], "output": "729835566" },
- { "inputs": ["729835566", "729835562"], "output": "729835566" }
+ { "inputs": ["18441305633946386479", "1651927522"], "output": "18441305635594103279" },
+ { "inputs": ["1651927518", "1651927522"], "output": "1651927550" },
+ { "inputs": ["1651927522", "1651927522"], "output": "1651927522" },
+ { "inputs": ["1651927522", "1651927518"], "output": "1651927550" }
],
"or_euint64_euint64": [
- { "inputs": ["18442105052999173891", "18440193626964063709"], "output": "18442168970778769375" },
- { "inputs": ["18440193626964063705", "18440193626964063709"], "output": "18440193626964063709" },
- { "inputs": ["18440193626964063709", "18440193626964063709"], "output": "18440193626964063709" },
- { "inputs": ["18440193626964063709", "18440193626964063705"], "output": "18440193626964063709" }
+ { "inputs": ["18445851190683093315", "18440297605680046453"], "output": "18446141532670781815" },
+ { "inputs": ["18440297605680046449", "18440297605680046453"], "output": "18440297605680046453" },
+ { "inputs": ["18440297605680046453", "18440297605680046453"], "output": "18440297605680046453" },
+ { "inputs": ["18440297605680046453", "18440297605680046449"], "output": "18440297605680046453" }
+ ],
+ "or_euint64_uint64": [
+ { "inputs": ["18445851190683093315", "18441158928097514419"], "output": "18445895250664217587" },
+ { "inputs": ["18440297605680046449", "18440297605680046453"], "output": "18440297605680046453" },
+ { "inputs": ["18440297605680046453", "18440297605680046453"], "output": "18440297605680046453" },
+ { "inputs": ["18440297605680046453", "18440297605680046449"], "output": "18440297605680046453" }
+ ],
+ "or_uint64_euint64": [
+ { "inputs": ["18444816838000851275", "18441158928097514419"], "output": "18445951836858858491" },
+ { "inputs": ["18440297605680046449", "18440297605680046453"], "output": "18440297605680046453" },
+ { "inputs": ["18440297605680046453", "18440297605680046453"], "output": "18440297605680046453" },
+ { "inputs": ["18440297605680046453", "18440297605680046449"], "output": "18440297605680046453" }
+ ],
+ "or_euint64_euint128": [
+ {
+ "inputs": ["18444253937643069461", "340282366920938463463369573351070308735"],
+ "output": "340282366920938463463374396049659246975"
+ },
+ { "inputs": ["18444253937643069457", "18444253937643069461"], "output": "18444253937643069461" },
+ { "inputs": ["18444253937643069461", "18444253937643069461"], "output": "18444253937643069461" },
+ { "inputs": ["18444253937643069461", "18444253937643069457"], "output": "18444253937643069461" }
+ ],
+ "or_euint64_euint256": [
+ {
+ "inputs": [
+ "18444891827197945405",
+ "115792089237316195423570985008687907853269984665640564039457581376324451236725"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457583990276981260157"
+ },
+ { "inputs": ["18444891827197945401", "18444891827197945405"], "output": "18444891827197945405" },
+ { "inputs": ["18444891827197945405", "18444891827197945405"], "output": "18444891827197945405" },
+ { "inputs": ["18444891827197945405", "18444891827197945401"], "output": "18444891827197945405" }
+ ],
+ "or_euint128_euint4": [
+ {
+ "inputs": ["340282366920938463463366694641055128577", "12"],
+ "output": "340282366920938463463366694641055128589"
+ },
+ { "inputs": ["8", "12"], "output": "12" },
+ { "inputs": ["12", "12"], "output": "12" },
+ { "inputs": ["12", "8"], "output": "12" }
+ ],
+ "or_euint128_euint8": [
+ {
+ "inputs": ["340282366920938463463374227521343598445", "112"],
+ "output": "340282366920938463463374227521343598461"
+ },
+ { "inputs": ["108", "112"], "output": "124" },
+ { "inputs": ["112", "112"], "output": "112" },
+ { "inputs": ["112", "108"], "output": "124" }
+ ],
+ "or_euint128_euint16": [
+ {
+ "inputs": ["340282366920938463463366623321205018087", "7136"],
+ "output": "340282366920938463463366623321205022695"
+ },
+ { "inputs": ["7132", "7136"], "output": "7164" },
+ { "inputs": ["7136", "7136"], "output": "7136" },
+ { "inputs": ["7136", "7132"], "output": "7164" }
+ ],
+ "or_euint128_euint32": [
+ {
+ "inputs": ["340282366920938463463370714852003960045", "1823556556"],
+ "output": "340282366920938463463370714853213034477"
+ },
+ { "inputs": ["1823556552", "1823556556"], "output": "1823556556" },
+ { "inputs": ["1823556556", "1823556556"], "output": "1823556556" },
+ { "inputs": ["1823556556", "1823556552"], "output": "1823556556" }
+ ],
+ "or_euint128_euint64": [
+ {
+ "inputs": ["340282366920938463463370949519145006273", "18439052795332501691"],
+ "output": "340282366920938463463372265437599364347"
+ },
+ { "inputs": ["18439052795332501687", "18439052795332501691"], "output": "18439052795332501695" },
+ { "inputs": ["18439052795332501691", "18439052795332501691"], "output": "18439052795332501691" },
+ { "inputs": ["18439052795332501691", "18439052795332501687"], "output": "18439052795332501695" }
+ ],
+ "or_euint128_euint128": [
+ {
+ "inputs": ["340282366920938463463367655063545859643", "340282366920938463463373469661379852713"],
+ "output": "340282366920938463463374605231434923963"
+ },
+ {
+ "inputs": ["340282366920938463463367655063545859639", "340282366920938463463367655063545859643"],
+ "output": "340282366920938463463367655063545859647"
+ },
+ {
+ "inputs": ["340282366920938463463367655063545859643", "340282366920938463463367655063545859643"],
+ "output": "340282366920938463463367655063545859643"
+ },
+ {
+ "inputs": ["340282366920938463463367655063545859643", "340282366920938463463367655063545859639"],
+ "output": "340282366920938463463367655063545859647"
+ }
+ ],
+ "or_euint128_uint128": [
+ {
+ "inputs": ["340282366920938463463367655063545859643", "340282366920938463463373853783183776929"],
+ "output": "340282366920938463463374430271410986683"
+ },
+ {
+ "inputs": ["340282366920938463463367655063545859639", "340282366920938463463367655063545859643"],
+ "output": "340282366920938463463367655063545859647"
+ },
+ {
+ "inputs": ["340282366920938463463367655063545859643", "340282366920938463463367655063545859643"],
+ "output": "340282366920938463463367655063545859643"
+ },
+ {
+ "inputs": ["340282366920938463463367655063545859643", "340282366920938463463367655063545859639"],
+ "output": "340282366920938463463367655063545859647"
+ }
+ ],
+ "or_uint128_euint128": [
+ {
+ "inputs": ["340282366920938463463370547981929977503", "340282366920938463463373853783183776929"],
+ "output": "340282366920938463463373996101960916671"
+ },
+ {
+ "inputs": ["340282366920938463463367655063545859639", "340282366920938463463367655063545859643"],
+ "output": "340282366920938463463367655063545859647"
+ },
+ {
+ "inputs": ["340282366920938463463367655063545859643", "340282366920938463463367655063545859643"],
+ "output": "340282366920938463463367655063545859643"
+ },
+ {
+ "inputs": ["340282366920938463463367655063545859643", "340282366920938463463367655063545859639"],
+ "output": "340282366920938463463367655063545859647"
+ }
+ ],
+ "or_euint128_euint256": [
+ {
+ "inputs": [
+ "340282366920938463463366429103695675815",
+ "115792089237316195423570985008687907853269984665640564039457583383018428109749"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457583999099276579767"
+ },
+ {
+ "inputs": ["340282366920938463463366429103695675811", "340282366920938463463366429103695675815"],
+ "output": "340282366920938463463366429103695675815"
+ },
+ {
+ "inputs": ["340282366920938463463366429103695675815", "340282366920938463463366429103695675815"],
+ "output": "340282366920938463463366429103695675815"
+ },
+ {
+ "inputs": ["340282366920938463463366429103695675815", "340282366920938463463366429103695675811"],
+ "output": "340282366920938463463366429103695675815"
+ }
+ ],
+ "or_euint256_euint4": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457579810763114124559", "14"],
+ "output": "115792089237316195423570985008687907853269984665640564039457579810763114124559"
+ },
+ { "inputs": ["10", "14"], "output": "14" },
+ { "inputs": ["14", "14"], "output": "14" },
+ { "inputs": ["14", "10"], "output": "14" }
+ ],
+ "or_euint256_euint8": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457579600697842114421", "25"],
+ "output": "115792089237316195423570985008687907853269984665640564039457579600697842114429"
+ },
+ { "inputs": ["21", "25"], "output": "29" },
+ { "inputs": ["25", "25"], "output": "25" },
+ { "inputs": ["25", "21"], "output": "29" }
+ ],
+ "or_euint256_euint16": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457582624616109811381", "9754"],
+ "output": "115792089237316195423570985008687907853269984665640564039457582624616109811391"
+ },
+ { "inputs": ["9750", "9754"], "output": "9758" },
+ { "inputs": ["9754", "9754"], "output": "9754" },
+ { "inputs": ["9754", "9750"], "output": "9758" }
+ ],
+ "or_euint256_euint32": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457577374322978195673", "2490018786"],
+ "output": "115792089237316195423570985008687907853269984665640564039457577374323247328251"
+ },
+ { "inputs": ["2490018782", "2490018786"], "output": "2490018814" },
+ { "inputs": ["2490018786", "2490018786"], "output": "2490018786" },
+ { "inputs": ["2490018786", "2490018782"], "output": "2490018814" }
+ ],
+ "or_euint256_euint64": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457575138878497255467",
+ "18441296418739792919"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457578657599316786239"
+ },
+ { "inputs": ["18441296418739792915", "18441296418739792919"], "output": "18441296418739792919" },
+ { "inputs": ["18441296418739792919", "18441296418739792919"], "output": "18441296418739792919" },
+ { "inputs": ["18441296418739792919", "18441296418739792915"], "output": "18441296418739792919" }
+ ],
+ "or_euint256_euint128": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457581776378743047187",
+ "340282366920938463463373551062299472959"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457582951827808547903"
+ },
+ {
+ "inputs": ["340282366920938463463373551062299472955", "340282366920938463463373551062299472959"],
+ "output": "340282366920938463463373551062299472959"
+ },
+ {
+ "inputs": ["340282366920938463463373551062299472959", "340282366920938463463373551062299472959"],
+ "output": "340282366920938463463373551062299472959"
+ },
+ {
+ "inputs": ["340282366920938463463373551062299472959", "340282366920938463463373551062299472955"],
+ "output": "340282366920938463463373551062299472959"
+ }
+ ],
+ "or_euint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579093390716184697",
+ "115792089237316195423570985008687907853269984665640564039457580393822758166581"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457583914753535699069"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579093390716184693",
+ "115792089237316195423570985008687907853269984665640564039457579093390716184697"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579093390716184701"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579093390716184697",
+ "115792089237316195423570985008687907853269984665640564039457579093390716184697"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579093390716184697"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579093390716184697",
+ "115792089237316195423570985008687907853269984665640564039457579093390716184693"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579093390716184701"
+ }
+ ],
+ "or_euint256_uint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579093390716184697",
+ "115792089237316195423570985008687907853269984665640564039457575617602160724601"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579147311516134009"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579093390716184693",
+ "115792089237316195423570985008687907853269984665640564039457579093390716184697"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579093390716184701"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579093390716184697",
+ "115792089237316195423570985008687907853269984665640564039457579093390716184697"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579093390716184697"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579093390716184697",
+ "115792089237316195423570985008687907853269984665640564039457579093390716184693"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579093390716184701"
+ }
+ ],
+ "or_uint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457580060042571469423",
+ "115792089237316195423570985008687907853269984665640564039457575617602160724601"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457580622993567439487"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579093390716184693",
+ "115792089237316195423570985008687907853269984665640564039457579093390716184697"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579093390716184701"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579093390716184697",
+ "115792089237316195423570985008687907853269984665640564039457579093390716184697"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579093390716184697"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579093390716184697",
+ "115792089237316195423570985008687907853269984665640564039457579093390716184693"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579093390716184701"
+ }
],
"and_euint4_euint4": [
- { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["14", "7"], "output": "6" },
{ "inputs": ["4", "8"], "output": "0" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "0" }
],
"and_euint4_euint8": [
- { "inputs": ["10", "6"], "output": "2" },
- { "inputs": ["4", "8"], "output": "0" },
- { "inputs": ["8", "8"], "output": "8" },
- { "inputs": ["8", "4"], "output": "0" }
+ { "inputs": ["10", "116"], "output": "0" },
+ { "inputs": ["6", "10"], "output": "2" },
+ { "inputs": ["10", "10"], "output": "10" },
+ { "inputs": ["10", "6"], "output": "2" }
],
- "and_euint4_euint16": [
- { "inputs": ["10", "28165"], "output": "0" },
+ "and_euint4_uint8": [
+ { "inputs": ["10", "4"], "output": "0" },
{ "inputs": ["6", "10"], "output": "2" },
{ "inputs": ["10", "10"], "output": "10" },
{ "inputs": ["10", "6"], "output": "2" }
],
+ "and_euint4_euint16": [
+ { "inputs": ["3", "65312"], "output": "0" },
+ { "inputs": ["4", "8"], "output": "0" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "0" }
+ ],
"and_euint4_euint32": [
- { "inputs": ["1", "1067388092"], "output": "0" },
+ { "inputs": ["6", "3666388192"], "output": "0" },
{ "inputs": ["4", "8"], "output": "0" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "0" }
],
"and_euint4_euint64": [
- { "inputs": ["11", "18444970625118669221"], "output": "1" },
- { "inputs": ["7", "11"], "output": "3" },
- { "inputs": ["11", "11"], "output": "11" },
- { "inputs": ["11", "7"], "output": "3" }
+ { "inputs": ["6", "18438764365497303935"], "output": "6" },
+ { "inputs": ["4", "8"], "output": "0" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "0" }
+ ],
+ "and_euint4_euint128": [
+ { "inputs": ["8", "340282366920938463463367802109078157213"], "output": "8" },
+ { "inputs": ["4", "8"], "output": "0" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "0" }
+ ],
+ "and_euint4_euint256": [
+ {
+ "inputs": ["3", "115792089237316195423570985008687907853269984665640564039457581650107790454269"],
+ "output": "1"
+ },
+ { "inputs": ["4", "8"], "output": "0" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "0" }
],
"and_euint8_euint4": [
- { "inputs": ["185", "9"], "output": "9" },
- { "inputs": ["5", "9"], "output": "1" },
- { "inputs": ["9", "9"], "output": "9" },
- { "inputs": ["9", "5"], "output": "1" }
+ { "inputs": ["118", "5"], "output": "4" },
+ { "inputs": ["4", "8"], "output": "0" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "0" }
+ ],
+ "and_uint8_euint4": [
+ { "inputs": ["12", "5"], "output": "4" },
+ { "inputs": ["4", "8"], "output": "0" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "0" }
],
"and_euint8_euint8": [
- { "inputs": ["68", "245"], "output": "68" },
- { "inputs": ["64", "68"], "output": "64" },
- { "inputs": ["68", "68"], "output": "68" },
- { "inputs": ["68", "64"], "output": "64" }
+ { "inputs": ["183", "135"], "output": "135" },
+ { "inputs": ["131", "135"], "output": "131" },
+ { "inputs": ["135", "135"], "output": "135" },
+ { "inputs": ["135", "131"], "output": "131" }
+ ],
+ "and_euint8_uint8": [
+ { "inputs": ["183", "70"], "output": "6" },
+ { "inputs": ["131", "135"], "output": "131" },
+ { "inputs": ["135", "135"], "output": "135" },
+ { "inputs": ["135", "131"], "output": "131" }
+ ],
+ "and_uint8_euint8": [
+ { "inputs": ["146", "70"], "output": "2" },
+ { "inputs": ["131", "135"], "output": "131" },
+ { "inputs": ["135", "135"], "output": "135" },
+ { "inputs": ["135", "131"], "output": "131" }
],
"and_euint8_euint16": [
- { "inputs": ["140", "15292"], "output": "140" },
- { "inputs": ["136", "140"], "output": "136" },
- { "inputs": ["140", "140"], "output": "140" },
- { "inputs": ["140", "136"], "output": "136" }
+ { "inputs": ["225", "29113"], "output": "161" },
+ { "inputs": ["221", "225"], "output": "193" },
+ { "inputs": ["225", "225"], "output": "225" },
+ { "inputs": ["225", "221"], "output": "193" }
],
"and_euint8_euint32": [
- { "inputs": ["39", "58691136"], "output": "0" },
- { "inputs": ["35", "39"], "output": "35" },
- { "inputs": ["39", "39"], "output": "39" },
- { "inputs": ["39", "35"], "output": "35" }
+ { "inputs": ["114", "3684671928"], "output": "48" },
+ { "inputs": ["110", "114"], "output": "98" },
+ { "inputs": ["114", "114"], "output": "114" },
+ { "inputs": ["114", "110"], "output": "98" }
],
"and_euint8_euint64": [
- { "inputs": ["62", "18441742416037218435"], "output": "2" },
- { "inputs": ["58", "62"], "output": "58" },
- { "inputs": ["62", "62"], "output": "62" },
- { "inputs": ["62", "58"], "output": "58" }
+ { "inputs": ["203", "18443868996555285517"], "output": "9" },
+ { "inputs": ["199", "203"], "output": "195" },
+ { "inputs": ["203", "203"], "output": "203" },
+ { "inputs": ["203", "199"], "output": "195" }
+ ],
+ "and_euint8_euint128": [
+ { "inputs": ["72", "340282366920938463463369134248162755643"], "output": "8" },
+ { "inputs": ["68", "72"], "output": "64" },
+ { "inputs": ["72", "72"], "output": "72" },
+ { "inputs": ["72", "68"], "output": "64" }
+ ],
+ "and_euint8_euint256": [
+ {
+ "inputs": ["180", "115792089237316195423570985008687907853269984665640564039457579349353950071771"],
+ "output": "144"
+ },
+ { "inputs": ["176", "180"], "output": "176" },
+ { "inputs": ["180", "180"], "output": "180" },
+ { "inputs": ["180", "176"], "output": "176" }
],
"and_euint16_euint4": [
- { "inputs": ["62185", "11"], "output": "9" },
- { "inputs": ["7", "11"], "output": "3" },
- { "inputs": ["11", "11"], "output": "11" },
- { "inputs": ["11", "7"], "output": "3" }
- ],
- "and_euint16_euint8": [
- { "inputs": ["19261", "5"], "output": "5" },
+ { "inputs": ["57634", "7"], "output": "2" },
{ "inputs": ["4", "8"], "output": "0" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "0" }
],
+ "and_euint16_euint8": [
+ { "inputs": ["41347", "138"], "output": "130" },
+ { "inputs": ["134", "138"], "output": "130" },
+ { "inputs": ["138", "138"], "output": "138" },
+ { "inputs": ["138", "134"], "output": "130" }
+ ],
"and_euint16_euint16": [
- { "inputs": ["3535", "5032"], "output": "392" },
- { "inputs": ["3531", "3535"], "output": "3531" },
- { "inputs": ["3535", "3535"], "output": "3535" },
- { "inputs": ["3535", "3531"], "output": "3531" }
+ { "inputs": ["25969", "38750"], "output": "1360" },
+ { "inputs": ["25965", "25969"], "output": "25953" },
+ { "inputs": ["25969", "25969"], "output": "25969" },
+ { "inputs": ["25969", "25965"], "output": "25953" }
+ ],
+ "and_euint16_uint16": [
+ { "inputs": ["25969", "39616"], "output": "64" },
+ { "inputs": ["25965", "25969"], "output": "25953" },
+ { "inputs": ["25969", "25969"], "output": "25969" },
+ { "inputs": ["25969", "25965"], "output": "25953" }
+ ],
+ "and_uint16_euint16": [
+ { "inputs": ["12551", "39616"], "output": "4096" },
+ { "inputs": ["25965", "25969"], "output": "25953" },
+ { "inputs": ["25969", "25969"], "output": "25969" },
+ { "inputs": ["25969", "25965"], "output": "25953" }
],
"and_euint16_euint32": [
- { "inputs": ["27862", "1736690738"], "output": "19474" },
- { "inputs": ["27858", "27862"], "output": "27858" },
- { "inputs": ["27862", "27862"], "output": "27862" },
- { "inputs": ["27862", "27858"], "output": "27858" }
+ { "inputs": ["10444", "4022047212"], "output": "204" },
+ { "inputs": ["10440", "10444"], "output": "10440" },
+ { "inputs": ["10444", "10444"], "output": "10444" },
+ { "inputs": ["10444", "10440"], "output": "10440" }
],
"and_euint16_euint64": [
- { "inputs": ["17953", "18443736631892089939"], "output": "1025" },
- { "inputs": ["17949", "17953"], "output": "17921" },
- { "inputs": ["17953", "17953"], "output": "17953" },
- { "inputs": ["17953", "17949"], "output": "17921" }
+ { "inputs": ["46498", "18443921867836499841"], "output": "9600" },
+ { "inputs": ["46494", "46498"], "output": "46466" },
+ { "inputs": ["46498", "46498"], "output": "46498" },
+ { "inputs": ["46498", "46494"], "output": "46466" }
+ ],
+ "and_euint16_euint128": [
+ { "inputs": ["10041", "340282366920938463463370138658990657653"], "output": "49" },
+ { "inputs": ["10037", "10041"], "output": "10033" },
+ { "inputs": ["10041", "10041"], "output": "10041" },
+ { "inputs": ["10041", "10037"], "output": "10033" }
+ ],
+ "and_euint16_euint256": [
+ {
+ "inputs": ["12579", "115792089237316195423570985008687907853269984665640564039457582458858424079051"],
+ "output": "4099"
+ },
+ { "inputs": ["12575", "12579"], "output": "12547" },
+ { "inputs": ["12579", "12579"], "output": "12579" },
+ { "inputs": ["12579", "12575"], "output": "12547" }
],
"and_euint32_euint4": [
- { "inputs": ["2599330540", "1"], "output": "0" },
+ { "inputs": ["3337809992", "2"], "output": "0" },
{ "inputs": ["4", "8"], "output": "0" },
{ "inputs": ["8", "8"], "output": "8" },
{ "inputs": ["8", "4"], "output": "0" }
],
"and_euint32_euint8": [
- { "inputs": ["2756559333", "33"], "output": "33" },
- { "inputs": ["29", "33"], "output": "1" },
- { "inputs": ["33", "33"], "output": "33" },
- { "inputs": ["33", "29"], "output": "1" }
+ { "inputs": ["2846739700", "34"], "output": "32" },
+ { "inputs": ["30", "34"], "output": "2" },
+ { "inputs": ["34", "34"], "output": "34" },
+ { "inputs": ["34", "30"], "output": "2" }
],
"and_euint32_euint16": [
- { "inputs": ["46593294", "4785"], "output": "4096" },
- { "inputs": ["4781", "4785"], "output": "4769" },
- { "inputs": ["4785", "4785"], "output": "4785" },
- { "inputs": ["4785", "4781"], "output": "4769" }
+ { "inputs": ["1681139161", "6880"], "output": "192" },
+ { "inputs": ["6876", "6880"], "output": "6848" },
+ { "inputs": ["6880", "6880"], "output": "6880" },
+ { "inputs": ["6880", "6876"], "output": "6848" }
],
"and_euint32_euint32": [
- { "inputs": ["2522719500", "2344855070"], "output": "2185339916" },
- { "inputs": ["2344855066", "2344855070"], "output": "2344855066" },
- { "inputs": ["2344855070", "2344855070"], "output": "2344855070" },
- { "inputs": ["2344855070", "2344855066"], "output": "2344855066" }
+ { "inputs": ["3317288822", "1342588191"], "output": "1073759510" },
+ { "inputs": ["1342588187", "1342588191"], "output": "1342588187" },
+ { "inputs": ["1342588191", "1342588191"], "output": "1342588191" },
+ { "inputs": ["1342588191", "1342588187"], "output": "1342588187" }
+ ],
+ "and_euint32_uint32": [
+ { "inputs": ["3317288822", "510484248"], "output": "69816080" },
+ { "inputs": ["1342588187", "1342588191"], "output": "1342588187" },
+ { "inputs": ["1342588191", "1342588191"], "output": "1342588191" },
+ { "inputs": ["1342588191", "1342588187"], "output": "1342588187" }
+ ],
+ "and_uint32_euint32": [
+ { "inputs": ["3731064608", "510484248"], "output": "509675264" },
+ { "inputs": ["1342588187", "1342588191"], "output": "1342588187" },
+ { "inputs": ["1342588191", "1342588191"], "output": "1342588191" },
+ { "inputs": ["1342588191", "1342588187"], "output": "1342588187" }
],
"and_euint32_euint64": [
- { "inputs": ["595906685", "18438632387690440007"], "output": "537133125" },
- { "inputs": ["595906681", "595906685"], "output": "595906681" },
- { "inputs": ["595906685", "595906685"], "output": "595906685" },
- { "inputs": ["595906685", "595906681"], "output": "595906681" }
+ { "inputs": ["1745478480", "18442616126135451977"], "output": "1208074560" },
+ { "inputs": ["1745478476", "1745478480"], "output": "1745478464" },
+ { "inputs": ["1745478480", "1745478480"], "output": "1745478480" },
+ { "inputs": ["1745478480", "1745478476"], "output": "1745478464" }
+ ],
+ "and_euint32_euint128": [
+ { "inputs": ["2659354872", "340282366920938463463373182215335994821"], "output": "2424307904" },
+ { "inputs": ["2659354868", "2659354872"], "output": "2659354864" },
+ { "inputs": ["2659354872", "2659354872"], "output": "2659354872" },
+ { "inputs": ["2659354872", "2659354868"], "output": "2659354864" }
+ ],
+ "and_euint32_euint256": [
+ {
+ "inputs": ["3994882895", "115792089237316195423570985008687907853269984665640564039457577397354470817443"],
+ "output": "1310528003"
+ },
+ { "inputs": ["3994882891", "3994882895"], "output": "3994882891" },
+ { "inputs": ["3994882895", "3994882895"], "output": "3994882895" },
+ { "inputs": ["3994882895", "3994882891"], "output": "3994882891" }
],
"and_euint64_euint4": [
- { "inputs": ["18444456172028398167", "8"], "output": "0" },
- { "inputs": ["4", "8"], "output": "0" },
- { "inputs": ["8", "8"], "output": "8" },
- { "inputs": ["8", "4"], "output": "0" }
+ { "inputs": ["18438614995227733505", "14"], "output": "0" },
+ { "inputs": ["10", "14"], "output": "10" },
+ { "inputs": ["14", "14"], "output": "14" },
+ { "inputs": ["14", "10"], "output": "10" }
],
"and_euint64_euint8": [
- { "inputs": ["18441413446268134663", "40"], "output": "0" },
- { "inputs": ["36", "40"], "output": "32" },
- { "inputs": ["40", "40"], "output": "40" },
- { "inputs": ["40", "36"], "output": "32" }
+ { "inputs": ["18443952274371967793", "221"], "output": "17" },
+ { "inputs": ["217", "221"], "output": "217" },
+ { "inputs": ["221", "221"], "output": "221" },
+ { "inputs": ["221", "217"], "output": "217" }
],
"and_euint64_euint16": [
- { "inputs": ["18446210605213941359", "52123"], "output": "51723" },
- { "inputs": ["52119", "52123"], "output": "52115" },
- { "inputs": ["52123", "52123"], "output": "52123" },
- { "inputs": ["52123", "52119"], "output": "52115" }
+ { "inputs": ["18443322659758757933", "48184"], "output": "6184" },
+ { "inputs": ["48180", "48184"], "output": "48176" },
+ { "inputs": ["48184", "48184"], "output": "48184" },
+ { "inputs": ["48184", "48180"], "output": "48176" }
],
"and_euint64_euint32": [
- { "inputs": ["18442857416785747441", "1547691532"], "output": "137446400" },
- { "inputs": ["1547691528", "1547691532"], "output": "1547691528" },
- { "inputs": ["1547691532", "1547691532"], "output": "1547691532" },
- { "inputs": ["1547691532", "1547691528"], "output": "1547691528" }
+ { "inputs": ["18439406521573141853", "840706883"], "output": "33564993" },
+ { "inputs": ["840706879", "840706883"], "output": "840706819" },
+ { "inputs": ["840706883", "840706883"], "output": "840706883" },
+ { "inputs": ["840706883", "840706879"], "output": "840706819" }
],
"and_euint64_euint64": [
- { "inputs": ["18444924635377016941", "18446173308524975411"], "output": "18444923419899985953" },
- { "inputs": ["18444924635377016937", "18444924635377016941"], "output": "18444924635377016937" },
- { "inputs": ["18444924635377016941", "18444924635377016941"], "output": "18444924635377016941" },
- { "inputs": ["18444924635377016941", "18444924635377016937"], "output": "18444924635377016937" }
+ { "inputs": ["18444124970074897317", "18442657213736743287"], "output": "18442294351260348709" },
+ { "inputs": ["18442657213736743283", "18442657213736743287"], "output": "18442657213736743283" },
+ { "inputs": ["18442657213736743287", "18442657213736743287"], "output": "18442657213736743287" },
+ { "inputs": ["18442657213736743287", "18442657213736743283"], "output": "18442657213736743283" }
+ ],
+ "and_euint64_uint64": [
+ { "inputs": ["18444124970074897317", "18444452212053822561"], "output": "18444089373216524321" },
+ { "inputs": ["18442657213736743283", "18442657213736743287"], "output": "18442657213736743283" },
+ { "inputs": ["18442657213736743287", "18442657213736743287"], "output": "18442657213736743287" },
+ { "inputs": ["18442657213736743287", "18442657213736743283"], "output": "18442657213736743283" }
+ ],
+ "and_uint64_euint64": [
+ { "inputs": ["18445812436048048525", "18444452212053822561"], "output": "18443525253958221825" },
+ { "inputs": ["18442657213736743283", "18442657213736743287"], "output": "18442657213736743283" },
+ { "inputs": ["18442657213736743287", "18442657213736743287"], "output": "18442657213736743287" },
+ { "inputs": ["18442657213736743287", "18442657213736743283"], "output": "18442657213736743283" }
+ ],
+ "and_euint64_euint128": [
+ { "inputs": ["18438964653643998977", "340282366920938463463371580179294281733"], "output": "18438894284827860993" },
+ { "inputs": ["18438964653643998973", "18438964653643998977"], "output": "18438964653643998721" },
+ { "inputs": ["18438964653643998977", "18438964653643998977"], "output": "18438964653643998977" },
+ { "inputs": ["18438964653643998977", "18438964653643998973"], "output": "18438964653643998721" }
+ ],
+ "and_euint64_euint256": [
+ {
+ "inputs": [
+ "18443960605514453875",
+ "115792089237316195423570985008687907853269984665640564039457575145704576396421"
+ ],
+ "output": "18437737227820728321"
+ },
+ { "inputs": ["18443960605514453871", "18443960605514453875"], "output": "18443960605514453859" },
+ { "inputs": ["18443960605514453875", "18443960605514453875"], "output": "18443960605514453875" },
+ { "inputs": ["18443960605514453875", "18443960605514453871"], "output": "18443960605514453859" }
+ ],
+ "and_euint128_euint4": [
+ { "inputs": ["340282366920938463463372547368360839357", "10"], "output": "8" },
+ { "inputs": ["6", "10"], "output": "2" },
+ { "inputs": ["10", "10"], "output": "10" },
+ { "inputs": ["10", "6"], "output": "2" }
],
- "xor_euint4_euint4": [
- { "inputs": ["13", "14"], "output": "3" },
- { "inputs": ["9", "13"], "output": "4" },
- { "inputs": ["13", "13"], "output": "0" },
- { "inputs": ["13", "9"], "output": "4" }
+ "and_euint128_euint8": [
+ { "inputs": ["340282366920938463463366313789187731763", "114"], "output": "50" },
+ { "inputs": ["110", "114"], "output": "98" },
+ { "inputs": ["114", "114"], "output": "114" },
+ { "inputs": ["114", "110"], "output": "98" }
+ ],
+ "and_euint128_euint16": [
+ { "inputs": ["340282366920938463463371274545487982339", "11460"], "output": "11264" },
+ { "inputs": ["11456", "11460"], "output": "11456" },
+ { "inputs": ["11460", "11460"], "output": "11460" },
+ { "inputs": ["11460", "11456"], "output": "11456" }
+ ],
+ "and_euint128_euint32": [
+ { "inputs": ["340282366920938463463372796408614652419", "1038177724"], "output": "272629760" },
+ { "inputs": ["1038177720", "1038177724"], "output": "1038177720" },
+ { "inputs": ["1038177724", "1038177724"], "output": "1038177724" },
+ { "inputs": ["1038177724", "1038177720"], "output": "1038177720" }
+ ],
+ "and_euint128_euint64": [
+ { "inputs": ["340282366920938463463368706571541146173", "18442558600081086197"], "output": "18438019519441568309" },
+ { "inputs": ["18442558600081086193", "18442558600081086197"], "output": "18442558600081086193" },
+ { "inputs": ["18442558600081086197", "18442558600081086197"], "output": "18442558600081086197" },
+ { "inputs": ["18442558600081086197", "18442558600081086193"], "output": "18442558600081086193" }
+ ],
+ "and_euint128_euint128": [
+ {
+ "inputs": ["340282366920938463463365754576278416105", "340282366920938463463366665489173165177"],
+ "output": "340282366920938463463365750145734418537"
+ },
+ {
+ "inputs": ["340282366920938463463365754576278416101", "340282366920938463463365754576278416105"],
+ "output": "340282366920938463463365754576278416097"
+ },
+ {
+ "inputs": ["340282366920938463463365754576278416105", "340282366920938463463365754576278416105"],
+ "output": "340282366920938463463365754576278416105"
+ },
+ {
+ "inputs": ["340282366920938463463365754576278416105", "340282366920938463463365754576278416101"],
+ "output": "340282366920938463463365754576278416097"
+ }
+ ],
+ "and_euint128_uint128": [
+ {
+ "inputs": ["340282366920938463463365754576278416105", "340282366920938463463366410191459861233"],
+ "output": "340282366920938463463365741001161851617"
+ },
+ {
+ "inputs": ["340282366920938463463365754576278416101", "340282366920938463463365754576278416105"],
+ "output": "340282366920938463463365754576278416097"
+ },
+ {
+ "inputs": ["340282366920938463463365754576278416105", "340282366920938463463365754576278416105"],
+ "output": "340282366920938463463365754576278416105"
+ },
+ {
+ "inputs": ["340282366920938463463365754576278416105", "340282366920938463463365754576278416101"],
+ "output": "340282366920938463463365754576278416097"
+ }
+ ],
+ "and_uint128_euint128": [
+ {
+ "inputs": ["340282366920938463463371836375477224759", "340282366920938463463366410191459861233"],
+ "output": "340282366920938463463366199075542663217"
+ },
+ {
+ "inputs": ["340282366920938463463365754576278416101", "340282366920938463463365754576278416105"],
+ "output": "340282366920938463463365754576278416097"
+ },
+ {
+ "inputs": ["340282366920938463463365754576278416105", "340282366920938463463365754576278416105"],
+ "output": "340282366920938463463365754576278416105"
+ },
+ {
+ "inputs": ["340282366920938463463365754576278416105", "340282366920938463463365754576278416101"],
+ "output": "340282366920938463463365754576278416097"
+ }
+ ],
+ "and_euint128_euint256": [
+ {
+ "inputs": [
+ "340282366920938463463366718158519885511",
+ "115792089237316195423570985008687907853269984665640564039457581748247155679323"
+ ],
+ "output": "340282366920938463463366717989234606147"
+ },
+ {
+ "inputs": ["340282366920938463463366718158519885507", "340282366920938463463366718158519885511"],
+ "output": "340282366920938463463366718158519885507"
+ },
+ {
+ "inputs": ["340282366920938463463366718158519885511", "340282366920938463463366718158519885511"],
+ "output": "340282366920938463463366718158519885511"
+ },
+ {
+ "inputs": ["340282366920938463463366718158519885511", "340282366920938463463366718158519885507"],
+ "output": "340282366920938463463366718158519885507"
+ }
+ ],
+ "and_euint256_euint4": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457579364828919798977", "5"],
+ "output": "1"
+ },
+ { "inputs": ["4", "8"], "output": "0" },
+ { "inputs": ["8", "8"], "output": "8" },
+ { "inputs": ["8", "4"], "output": "0" }
],
- "xor_euint4_euint8": [
- { "inputs": ["5", "19"], "output": "22" },
+ "and_euint256_euint8": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457580200311934752389", "160"],
+ "output": "128"
+ },
+ { "inputs": ["156", "160"], "output": "128" },
+ { "inputs": ["160", "160"], "output": "160" },
+ { "inputs": ["160", "156"], "output": "128" }
+ ],
+ "and_euint256_euint16": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457581238581042328907", "21842"],
+ "output": "5442"
+ },
+ { "inputs": ["21838", "21842"], "output": "21826" },
+ { "inputs": ["21842", "21842"], "output": "21842" },
+ { "inputs": ["21842", "21838"], "output": "21826" }
+ ],
+ "and_euint256_euint32": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457579114687562092581", "2312861009"],
+ "output": "1642497"
+ },
+ { "inputs": ["2312861005", "2312861009"], "output": "2312860993" },
+ { "inputs": ["2312861009", "2312861009"], "output": "2312861009" },
+ { "inputs": ["2312861009", "2312861005"], "output": "2312860993" }
+ ],
+ "and_euint256_euint64": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457578396814970518645",
+ "18439393076952901085"
+ ],
+ "output": "18438862826454918229"
+ },
+ { "inputs": ["18439393076952901081", "18439393076952901085"], "output": "18439393076952901081" },
+ { "inputs": ["18439393076952901085", "18439393076952901085"], "output": "18439393076952901085" },
+ { "inputs": ["18439393076952901085", "18439393076952901081"], "output": "18439393076952901081" }
+ ],
+ "and_euint256_euint128": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457582929951159672455",
+ "340282366920938463463365847322826293787"
+ ],
+ "output": "340282366920938463463365636070292242947"
+ },
+ {
+ "inputs": ["340282366920938463463365847322826293783", "340282366920938463463365847322826293787"],
+ "output": "340282366920938463463365847322826293779"
+ },
+ {
+ "inputs": ["340282366920938463463365847322826293787", "340282366920938463463365847322826293787"],
+ "output": "340282366920938463463365847322826293787"
+ },
+ {
+ "inputs": ["340282366920938463463365847322826293787", "340282366920938463463365847322826293783"],
+ "output": "340282366920938463463365847322826293779"
+ }
+ ],
+ "and_euint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457580473854578773963",
+ "115792089237316195423570985008687907853269984665640564039457579064265044491325"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457575671150140541961"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579064265044491321",
+ "115792089237316195423570985008687907853269984665640564039457579064265044491325"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579064265044491321"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579064265044491325",
+ "115792089237316195423570985008687907853269984665640564039457579064265044491325"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579064265044491325"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579064265044491325",
+ "115792089237316195423570985008687907853269984665640564039457579064265044491321"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579064265044491321"
+ }
+ ],
+ "and_euint256_uint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457580473854578773963",
+ "115792089237316195423570985008687907853269984665640564039457581816489991853517"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579557951374476745"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579064265044491321",
+ "115792089237316195423570985008687907853269984665640564039457579064265044491325"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579064265044491321"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579064265044491325",
+ "115792089237316195423570985008687907853269984665640564039457579064265044491325"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579064265044491325"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579064265044491325",
+ "115792089237316195423570985008687907853269984665640564039457579064265044491321"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579064265044491321"
+ }
+ ],
+ "and_uint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457576516611416206839",
+ "115792089237316195423570985008687907853269984665640564039457581816489991853517"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457575038788798842309"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579064265044491321",
+ "115792089237316195423570985008687907853269984665640564039457579064265044491325"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579064265044491321"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579064265044491325",
+ "115792089237316195423570985008687907853269984665640564039457579064265044491325"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579064265044491325"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579064265044491325",
+ "115792089237316195423570985008687907853269984665640564039457579064265044491321"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039457579064265044491321"
+ }
+ ],
+ "xor_euint4_euint4": [
+ { "inputs": ["9", "4"], "output": "13" },
{ "inputs": ["4", "8"], "output": "12" },
{ "inputs": ["8", "8"], "output": "0" },
{ "inputs": ["8", "4"], "output": "12" }
],
- "xor_euint4_euint16": [
- { "inputs": ["10", "13907"], "output": "13913" },
+ "xor_euint4_euint8": [
+ { "inputs": ["10", "103"], "output": "109" },
{ "inputs": ["6", "10"], "output": "12" },
{ "inputs": ["10", "10"], "output": "0" },
{ "inputs": ["10", "6"], "output": "12" }
],
+ "xor_euint4_uint8": [
+ { "inputs": ["10", "12"], "output": "6" },
+ { "inputs": ["6", "10"], "output": "12" },
+ { "inputs": ["10", "10"], "output": "0" },
+ { "inputs": ["10", "6"], "output": "12" }
+ ],
+ "xor_euint4_euint16": [
+ { "inputs": ["14", "11463"], "output": "11465" },
+ { "inputs": ["10", "14"], "output": "4" },
+ { "inputs": ["14", "14"], "output": "0" },
+ { "inputs": ["14", "10"], "output": "4" }
+ ],
"xor_euint4_euint32": [
- { "inputs": ["6", "1855370868"], "output": "1855370866" },
+ { "inputs": ["1", "1939413163"], "output": "1939413162" },
{ "inputs": ["4", "8"], "output": "12" },
{ "inputs": ["8", "8"], "output": "0" },
{ "inputs": ["8", "4"], "output": "12" }
],
"xor_euint4_euint64": [
- { "inputs": ["2", "18446366816185499095"], "output": "18446366816185499093" },
+ { "inputs": ["2", "18438078325844207475"], "output": "18438078325844207473" },
{ "inputs": ["4", "8"], "output": "12" },
{ "inputs": ["8", "8"], "output": "0" },
{ "inputs": ["8", "4"], "output": "12" }
],
- "xor_euint8_euint4": [
- { "inputs": ["253", "3"], "output": "254" },
+ "xor_euint4_euint128": [
+ {
+ "inputs": ["13", "340282366920938463463366123999290070707"],
+ "output": "340282366920938463463366123999290070718"
+ },
+ { "inputs": ["9", "13"], "output": "4" },
+ { "inputs": ["13", "13"], "output": "0" },
+ { "inputs": ["13", "9"], "output": "4" }
+ ],
+ "xor_euint4_euint256": [
+ {
+ "inputs": ["5", "115792089237316195423570985008687907853269984665640564039457578855535245251769"],
+ "output": "115792089237316195423570985008687907853269984665640564039457578855535245251772"
+ },
{ "inputs": ["4", "8"], "output": "12" },
{ "inputs": ["8", "8"], "output": "0" },
{ "inputs": ["8", "4"], "output": "12" }
],
- "xor_euint8_euint8": [
- { "inputs": ["213", "62"], "output": "235" },
- { "inputs": ["58", "62"], "output": "4" },
- { "inputs": ["62", "62"], "output": "0" },
- { "inputs": ["62", "58"], "output": "4" }
+ "xor_euint8_euint4": [
+ { "inputs": ["104", "4"], "output": "108" },
+ { "inputs": ["4", "8"], "output": "12" },
+ { "inputs": ["8", "8"], "output": "0" },
+ { "inputs": ["8", "4"], "output": "12" }
],
- "xor_euint8_euint16": [
- { "inputs": ["2", "64716"], "output": "64718" },
+ "xor_uint8_euint4": [
+ { "inputs": ["1", "4"], "output": "5" },
{ "inputs": ["4", "8"], "output": "12" },
{ "inputs": ["8", "8"], "output": "0" },
{ "inputs": ["8", "4"], "output": "12" }
],
+ "xor_euint8_euint8": [
+ { "inputs": ["234", "150"], "output": "124" },
+ { "inputs": ["146", "150"], "output": "4" },
+ { "inputs": ["150", "150"], "output": "0" },
+ { "inputs": ["150", "146"], "output": "4" }
+ ],
+ "xor_euint8_uint8": [
+ { "inputs": ["234", "201"], "output": "35" },
+ { "inputs": ["146", "150"], "output": "4" },
+ { "inputs": ["150", "150"], "output": "0" },
+ { "inputs": ["150", "146"], "output": "4" }
+ ],
+ "xor_uint8_euint8": [
+ { "inputs": ["181", "201"], "output": "124" },
+ { "inputs": ["146", "150"], "output": "4" },
+ { "inputs": ["150", "150"], "output": "0" },
+ { "inputs": ["150", "146"], "output": "4" }
+ ],
+ "xor_euint8_euint16": [
+ { "inputs": ["233", "6463"], "output": "6614" },
+ { "inputs": ["229", "233"], "output": "12" },
+ { "inputs": ["233", "233"], "output": "0" },
+ { "inputs": ["233", "229"], "output": "12" }
+ ],
"xor_euint8_euint32": [
- { "inputs": ["184", "3590065955"], "output": "3590066075" },
- { "inputs": ["180", "184"], "output": "12" },
- { "inputs": ["184", "184"], "output": "0" },
- { "inputs": ["184", "180"], "output": "12" }
+ { "inputs": ["200", "3474428988"], "output": "3474429172" },
+ { "inputs": ["196", "200"], "output": "12" },
+ { "inputs": ["200", "200"], "output": "0" },
+ { "inputs": ["200", "196"], "output": "12" }
],
"xor_euint8_euint64": [
- { "inputs": ["212", "18437987864856647089"], "output": "18437987864856647013" },
- { "inputs": ["208", "212"], "output": "4" },
- { "inputs": ["212", "212"], "output": "0" },
- { "inputs": ["212", "208"], "output": "4" }
+ { "inputs": ["250", "18438760776575021013"], "output": "18438760776575020847" },
+ { "inputs": ["246", "250"], "output": "12" },
+ { "inputs": ["250", "250"], "output": "0" },
+ { "inputs": ["250", "246"], "output": "12" }
+ ],
+ "xor_euint8_euint128": [
+ {
+ "inputs": ["142", "340282366920938463463373089327559876459"],
+ "output": "340282366920938463463373089327559876581"
+ },
+ { "inputs": ["138", "142"], "output": "4" },
+ { "inputs": ["142", "142"], "output": "0" },
+ { "inputs": ["142", "138"], "output": "4" }
+ ],
+ "xor_euint8_euint256": [
+ {
+ "inputs": ["244", "115792089237316195423570985008687907853269984665640564039457578624058101395789"],
+ "output": "115792089237316195423570985008687907853269984665640564039457578624058101395897"
+ },
+ { "inputs": ["240", "244"], "output": "4" },
+ { "inputs": ["244", "244"], "output": "0" },
+ { "inputs": ["244", "240"], "output": "4" }
],
"xor_euint16_euint4": [
- { "inputs": ["34235", "7"], "output": "34236" },
- { "inputs": ["4", "8"], "output": "12" },
- { "inputs": ["8", "8"], "output": "0" },
- { "inputs": ["8", "4"], "output": "12" }
+ { "inputs": ["57076", "14"], "output": "57082" },
+ { "inputs": ["10", "14"], "output": "4" },
+ { "inputs": ["14", "14"], "output": "0" },
+ { "inputs": ["14", "10"], "output": "4" }
],
"xor_euint16_euint8": [
- { "inputs": ["43168", "233"], "output": "43081" },
- { "inputs": ["229", "233"], "output": "12" },
- { "inputs": ["233", "233"], "output": "0" },
- { "inputs": ["233", "229"], "output": "12" }
+ { "inputs": ["14933", "231"], "output": "15026" },
+ { "inputs": ["227", "231"], "output": "4" },
+ { "inputs": ["231", "231"], "output": "0" },
+ { "inputs": ["231", "227"], "output": "4" }
],
"xor_euint16_euint16": [
- { "inputs": ["64619", "2520"], "output": "62899" },
- { "inputs": ["2516", "2520"], "output": "12" },
- { "inputs": ["2520", "2520"], "output": "0" },
- { "inputs": ["2520", "2516"], "output": "12" }
+ { "inputs": ["65327", "25546"], "output": "40165" },
+ { "inputs": ["25542", "25546"], "output": "12" },
+ { "inputs": ["25546", "25546"], "output": "0" },
+ { "inputs": ["25546", "25542"], "output": "12" }
+ ],
+ "xor_euint16_uint16": [
+ { "inputs": ["65327", "31297"], "output": "34158" },
+ { "inputs": ["25542", "25546"], "output": "12" },
+ { "inputs": ["25546", "25546"], "output": "0" },
+ { "inputs": ["25546", "25542"], "output": "12" }
+ ],
+ "xor_uint16_euint16": [
+ { "inputs": ["33651", "31297"], "output": "63794" },
+ { "inputs": ["25542", "25546"], "output": "12" },
+ { "inputs": ["25546", "25546"], "output": "0" },
+ { "inputs": ["25546", "25542"], "output": "12" }
],
"xor_euint16_euint32": [
- { "inputs": ["51717", "501889469"], "output": "501937080" },
- { "inputs": ["51713", "51717"], "output": "4" },
- { "inputs": ["51717", "51717"], "output": "0" },
- { "inputs": ["51717", "51713"], "output": "4" }
+ { "inputs": ["23121", "1351735572"], "output": "1351713605" },
+ { "inputs": ["23117", "23121"], "output": "28" },
+ { "inputs": ["23121", "23121"], "output": "0" },
+ { "inputs": ["23121", "23117"], "output": "28" }
],
"xor_euint16_euint64": [
- { "inputs": ["12673", "18438027026491597713"], "output": "18438027026491593232" },
- { "inputs": ["12669", "12673"], "output": "252" },
- { "inputs": ["12673", "12673"], "output": "0" },
- { "inputs": ["12673", "12669"], "output": "252" }
+ { "inputs": ["47675", "18446725910384356169"], "output": "18446725910384382322" },
+ { "inputs": ["47671", "47675"], "output": "12" },
+ { "inputs": ["47675", "47675"], "output": "0" },
+ { "inputs": ["47675", "47671"], "output": "12" }
+ ],
+ "xor_euint16_euint128": [
+ {
+ "inputs": ["57137", "340282366920938463463372706296613530555"],
+ "output": "340282366920938463463372706296613549194"
+ },
+ { "inputs": ["57133", "57137"], "output": "28" },
+ { "inputs": ["57137", "57137"], "output": "0" },
+ { "inputs": ["57137", "57133"], "output": "28" }
+ ],
+ "xor_euint16_euint256": [
+ {
+ "inputs": ["21805", "115792089237316195423570985008687907853269984665640564039457581252703610907733"],
+ "output": "115792089237316195423570985008687907853269984665640564039457581252703610927480"
+ },
+ { "inputs": ["21801", "21805"], "output": "4" },
+ { "inputs": ["21805", "21805"], "output": "0" },
+ { "inputs": ["21805", "21801"], "output": "4" }
],
"xor_euint32_euint4": [
- { "inputs": ["2588014920", "3"], "output": "2588014923" },
+ { "inputs": ["4009369108", "6"], "output": "4009369106" },
{ "inputs": ["4", "8"], "output": "12" },
{ "inputs": ["8", "8"], "output": "0" },
{ "inputs": ["8", "4"], "output": "12" }
],
"xor_euint32_euint8": [
- { "inputs": ["2442028658", "23"], "output": "2442028645" },
- { "inputs": ["19", "23"], "output": "4" },
- { "inputs": ["23", "23"], "output": "0" },
- { "inputs": ["23", "19"], "output": "4" }
+ { "inputs": ["1756250914", "211"], "output": "1756251121" },
+ { "inputs": ["207", "211"], "output": "28" },
+ { "inputs": ["211", "211"], "output": "0" },
+ { "inputs": ["211", "207"], "output": "28" }
],
"xor_euint32_euint16": [
- { "inputs": ["4035221230", "58371"], "output": "4035212013" },
- { "inputs": ["58367", "58371"], "output": "2044" },
- { "inputs": ["58371", "58371"], "output": "0" },
- { "inputs": ["58371", "58367"], "output": "2044" }
+ { "inputs": ["3818112177", "23871"], "output": "3818101134" },
+ { "inputs": ["23867", "23871"], "output": "4" },
+ { "inputs": ["23871", "23871"], "output": "0" },
+ { "inputs": ["23871", "23867"], "output": "4" }
],
"xor_euint32_euint32": [
- { "inputs": ["3321450403", "449148535"], "output": "3745266132" },
- { "inputs": ["449148531", "449148535"], "output": "4" },
- { "inputs": ["449148535", "449148535"], "output": "0" },
- { "inputs": ["449148535", "449148531"], "output": "4" }
+ { "inputs": ["3766539452", "3557659859"], "output": "881672303" },
+ { "inputs": ["3557659855", "3557659859"], "output": "28" },
+ { "inputs": ["3557659859", "3557659859"], "output": "0" },
+ { "inputs": ["3557659859", "3557659855"], "output": "28" }
+ ],
+ "xor_euint32_uint32": [
+ { "inputs": ["3766539452", "3890491814"], "output": "124052762" },
+ { "inputs": ["3557659855", "3557659859"], "output": "28" },
+ { "inputs": ["3557659859", "3557659859"], "output": "0" },
+ { "inputs": ["3557659859", "3557659855"], "output": "28" }
+ ],
+ "xor_uint32_euint32": [
+ { "inputs": ["1940474497", "3890491814"], "output": "2488105767" },
+ { "inputs": ["3557659855", "3557659859"], "output": "28" },
+ { "inputs": ["3557659859", "3557659859"], "output": "0" },
+ { "inputs": ["3557659859", "3557659855"], "output": "28" }
],
"xor_euint32_euint64": [
- { "inputs": ["3933920874", "18441384818446198365"], "output": "18441384821297952823" },
- { "inputs": ["3933920870", "3933920874"], "output": "12" },
- { "inputs": ["3933920874", "3933920874"], "output": "0" },
- { "inputs": ["3933920874", "3933920870"], "output": "12" }
+ { "inputs": ["390302983", "18441970713749353087"], "output": "18441970713904316280" },
+ { "inputs": ["390302979", "390302983"], "output": "4" },
+ { "inputs": ["390302983", "390302983"], "output": "0" },
+ { "inputs": ["390302983", "390302979"], "output": "4" }
+ ],
+ "xor_euint32_euint128": [
+ {
+ "inputs": ["3049009589", "340282366920938463463368216078619273371"],
+ "output": "340282366920938463463368216080538425646"
+ },
+ { "inputs": ["3049009585", "3049009589"], "output": "4" },
+ { "inputs": ["3049009589", "3049009589"], "output": "0" },
+ { "inputs": ["3049009589", "3049009585"], "output": "4" }
+ ],
+ "xor_euint32_euint256": [
+ {
+ "inputs": ["3706671686", "115792089237316195423570985008687907853269984665640564039457578090382088595177"],
+ "output": "115792089237316195423570985008687907853269984665640564039457578090383101310127"
+ },
+ { "inputs": ["3706671682", "3706671686"], "output": "4" },
+ { "inputs": ["3706671686", "3706671686"], "output": "0" },
+ { "inputs": ["3706671686", "3706671682"], "output": "4" }
],
"xor_euint64_euint4": [
- { "inputs": ["18442015029052104347", "10"], "output": "18442015029052104337" },
- { "inputs": ["6", "10"], "output": "12" },
- { "inputs": ["10", "10"], "output": "0" },
- { "inputs": ["10", "6"], "output": "12" }
+ { "inputs": ["18442021950386427623", "8"], "output": "18442021950386427631" },
+ { "inputs": ["4", "8"], "output": "12" },
+ { "inputs": ["8", "8"], "output": "0" },
+ { "inputs": ["8", "4"], "output": "12" }
],
"xor_euint64_euint8": [
- { "inputs": ["18443626965217997733", "213"], "output": "18443626965217997680" },
- { "inputs": ["209", "213"], "output": "4" },
- { "inputs": ["213", "213"], "output": "0" },
- { "inputs": ["213", "209"], "output": "4" }
+ { "inputs": ["18439050232368801565", "12"], "output": "18439050232368801553" },
+ { "inputs": ["8", "12"], "output": "4" },
+ { "inputs": ["12", "12"], "output": "0" },
+ { "inputs": ["12", "8"], "output": "4" }
],
"xor_euint64_euint16": [
- { "inputs": ["18442272025927693303", "37790"], "output": "18442272025927721065" },
- { "inputs": ["37786", "37790"], "output": "4" },
- { "inputs": ["37790", "37790"], "output": "0" },
- { "inputs": ["37790", "37786"], "output": "4" }
+ { "inputs": ["18446196219353056271", "45319"], "output": "18446196219353101576" },
+ { "inputs": ["45315", "45319"], "output": "4" },
+ { "inputs": ["45319", "45319"], "output": "0" },
+ { "inputs": ["45319", "45315"], "output": "4" }
],
"xor_euint64_euint32": [
- { "inputs": ["18444516407156523745", "3421158537"], "output": "18444516404054425192" },
- { "inputs": ["3421158533", "3421158537"], "output": "12" },
- { "inputs": ["3421158537", "3421158537"], "output": "0" },
- { "inputs": ["3421158537", "3421158533"], "output": "12" }
+ { "inputs": ["18440012895744339301", "1085979490"], "output": "18440012896823678471" },
+ { "inputs": ["1085979486", "1085979490"], "output": "60" },
+ { "inputs": ["1085979490", "1085979490"], "output": "0" },
+ { "inputs": ["1085979490", "1085979486"], "output": "60" }
],
"xor_euint64_euint64": [
- { "inputs": ["18440379911699358599", "18444259094994538125"], "output": "8523658389368074" },
- { "inputs": ["18440379911699358595", "18440379911699358599"], "output": "4" },
- { "inputs": ["18440379911699358599", "18440379911699358599"], "output": "0" },
- { "inputs": ["18440379911699358599", "18440379911699358595"], "output": "4" }
+ { "inputs": ["18439520894560746701", "18440669858368892063"], "output": "3444795783188562" },
+ { "inputs": ["18439520894560746697", "18439520894560746701"], "output": "4" },
+ { "inputs": ["18439520894560746701", "18439520894560746701"], "output": "0" },
+ { "inputs": ["18439520894560746701", "18439520894560746697"], "output": "4" }
+ ],
+ "xor_euint64_uint64": [
+ { "inputs": ["18439520894560746701", "18445914762272407037"], "output": "7700087946789168" },
+ { "inputs": ["18439520894560746697", "18439520894560746701"], "output": "4" },
+ { "inputs": ["18439520894560746701", "18439520894560746701"], "output": "0" },
+ { "inputs": ["18439520894560746701", "18439520894560746697"], "output": "4" }
+ ],
+ "xor_uint64_euint64": [
+ { "inputs": ["18446426713533628951", "18445914762272407037"], "output": "1076293857951722" },
+ { "inputs": ["18439520894560746697", "18439520894560746701"], "output": "4" },
+ { "inputs": ["18439520894560746701", "18439520894560746701"], "output": "0" },
+ { "inputs": ["18439520894560746701", "18439520894560746697"], "output": "4" }
+ ],
+ "xor_euint64_euint128": [
+ {
+ "inputs": ["18445744178466976977", "340282366920938463463371486789808692655"],
+ "output": "340282366920938463444930285940062611838"
+ },
+ { "inputs": ["18445744178466976973", "18445744178466976977"], "output": "28" },
+ { "inputs": ["18445744178466976977", "18445744178466976977"], "output": "0" },
+ { "inputs": ["18445744178466976977", "18445744178466976973"], "output": "28" }
+ ],
+ "xor_euint64_euint256": [
+ {
+ "inputs": [
+ "18438921176678700429",
+ "115792089237316195423570985008687907853269984665640564039457575984328616481271"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039439139317222450136186"
+ },
+ { "inputs": ["18438921176678700425", "18438921176678700429"], "output": "4" },
+ { "inputs": ["18438921176678700429", "18438921176678700429"], "output": "0" },
+ { "inputs": ["18438921176678700429", "18438921176678700425"], "output": "4" }
+ ],
+ "xor_euint128_euint4": [
+ {
+ "inputs": ["340282366920938463463370996799476031467", "13"],
+ "output": "340282366920938463463370996799476031462"
+ },
+ { "inputs": ["9", "13"], "output": "4" },
+ { "inputs": ["13", "13"], "output": "0" },
+ { "inputs": ["13", "9"], "output": "4" }
+ ],
+ "xor_euint128_euint8": [
+ {
+ "inputs": ["340282366920938463463373857001835170765", "82"],
+ "output": "340282366920938463463373857001835170719"
+ },
+ { "inputs": ["78", "82"], "output": "28" },
+ { "inputs": ["82", "82"], "output": "0" },
+ { "inputs": ["82", "78"], "output": "28" }
+ ],
+ "xor_euint128_euint16": [
+ {
+ "inputs": ["340282366920938463463371581047560381685", "64364"],
+ "output": "340282366920938463463371581047560363929"
+ },
+ { "inputs": ["64360", "64364"], "output": "4" },
+ { "inputs": ["64364", "64364"], "output": "0" },
+ { "inputs": ["64364", "64360"], "output": "4" }
+ ],
+ "xor_euint128_euint32": [
+ {
+ "inputs": ["340282366920938463463372336872535218607", "2309231003"],
+ "output": "340282366920938463463372336874538256436"
+ },
+ { "inputs": ["2309230999", "2309231003"], "output": "12" },
+ { "inputs": ["2309231003", "2309231003"], "output": "0" },
+ { "inputs": ["2309231003", "2309230999"], "output": "12" }
+ ],
+ "xor_euint128_euint64": [
+ {
+ "inputs": ["340282366920938463463368977308831072123", "18442960701720483125"],
+ "output": "340282366920938463444935023814972271182"
+ },
+ { "inputs": ["18442960701720483121", "18442960701720483125"], "output": "4" },
+ { "inputs": ["18442960701720483125", "18442960701720483125"], "output": "0" },
+ { "inputs": ["18442960701720483125", "18442960701720483121"], "output": "4" }
+ ],
+ "xor_euint128_euint128": [
+ {
+ "inputs": ["340282366920938463463372080691181989981", "340282366920938463463368941059346865329"],
+ "output": "8122674366786796"
+ },
+ {
+ "inputs": ["340282366920938463463368941059346865325", "340282366920938463463368941059346865329"],
+ "output": "28"
+ },
+ { "inputs": ["340282366920938463463368941059346865329", "340282366920938463463368941059346865329"], "output": "0" },
+ { "inputs": ["340282366920938463463368941059346865329", "340282366920938463463368941059346865325"], "output": "28" }
+ ],
+ "xor_euint128_uint128": [
+ {
+ "inputs": ["340282366920938463463372080691181989981", "340282366920938463463368386031692563719"],
+ "output": "8690927368893786"
+ },
+ {
+ "inputs": ["340282366920938463463368941059346865325", "340282366920938463463368941059346865329"],
+ "output": "28"
+ },
+ { "inputs": ["340282366920938463463368941059346865329", "340282366920938463463368941059346865329"], "output": "0" },
+ { "inputs": ["340282366920938463463368941059346865329", "340282366920938463463368941059346865325"], "output": "28" }
+ ],
+ "xor_uint128_euint128": [
+ {
+ "inputs": ["340282366920938463463374269120313762865", "340282366920938463463368386031692563719"],
+ "output": "6519991538245942"
+ },
+ {
+ "inputs": ["340282366920938463463368941059346865325", "340282366920938463463368941059346865329"],
+ "output": "28"
+ },
+ { "inputs": ["340282366920938463463368941059346865329", "340282366920938463463368941059346865329"], "output": "0" },
+ { "inputs": ["340282366920938463463368941059346865329", "340282366920938463463368941059346865325"], "output": "28" }
+ ],
+ "xor_euint128_euint256": [
+ {
+ "inputs": [
+ "340282366920938463463370357504982561043",
+ "115792089237316195423570985008687907853269984665640564039457576209743222065387"
+ ],
+ "output": "115792089237316195423570985008687907852929702298719625575994215220393361046008"
+ },
+ {
+ "inputs": ["340282366920938463463370357504982561039", "340282366920938463463370357504982561043"],
+ "output": "28"
+ },
+ { "inputs": ["340282366920938463463370357504982561043", "340282366920938463463370357504982561043"], "output": "0" },
+ { "inputs": ["340282366920938463463370357504982561043", "340282366920938463463370357504982561039"], "output": "28" }
+ ],
+ "xor_euint256_euint4": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457582453903191902895", "12"],
+ "output": "115792089237316195423570985008687907853269984665640564039457582453903191902883"
+ },
+ { "inputs": ["8", "12"], "output": "4" },
+ { "inputs": ["12", "12"], "output": "0" },
+ { "inputs": ["12", "8"], "output": "4" }
+ ],
+ "xor_euint256_euint8": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457576224347045805665", "175"],
+ "output": "115792089237316195423570985008687907853269984665640564039457576224347045805774"
+ },
+ { "inputs": ["171", "175"], "output": "4" },
+ { "inputs": ["175", "175"], "output": "0" },
+ { "inputs": ["175", "171"], "output": "4" }
+ ],
+ "xor_euint256_euint16": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457583698273346637887", "24298"],
+ "output": "115792089237316195423570985008687907853269984665640564039457583698273346621141"
+ },
+ { "inputs": ["24294", "24298"], "output": "12" },
+ { "inputs": ["24298", "24298"], "output": "0" },
+ { "inputs": ["24298", "24294"], "output": "12" }
+ ],
+ "xor_euint256_euint32": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457575870021368542809", "1137098251"],
+ "output": "115792089237316195423570985008687907853269984665640564039457575870020349413458"
+ },
+ { "inputs": ["1137098247", "1137098251"], "output": "12" },
+ { "inputs": ["1137098251", "1137098251"], "output": "0" },
+ { "inputs": ["1137098251", "1137098247"], "output": "12" }
+ ],
+ "xor_euint256_euint64": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457581449682348833995",
+ "18444753228810258299"
+ ],
+ "output": "115792089237316195423570985008687907853269984665640564039439141209004043664304"
+ },
+ { "inputs": ["18444753228810258295", "18444753228810258299"], "output": "12" },
+ { "inputs": ["18444753228810258299", "18444753228810258299"], "output": "0" },
+ { "inputs": ["18444753228810258299", "18444753228810258295"], "output": "12" }
+ ],
+ "xor_euint256_euint128": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457582608158223098943",
+ "340282366920938463463373070389452427715"
+ ],
+ "output": "115792089237316195423570985008687907852929702298719625575994209836984672105980"
+ },
+ {
+ "inputs": ["340282366920938463463373070389452427711", "340282366920938463463373070389452427715"],
+ "output": "124"
+ },
+ { "inputs": ["340282366920938463463373070389452427715", "340282366920938463463373070389452427715"], "output": "0" },
+ {
+ "inputs": ["340282366920938463463373070389452427715", "340282366920938463463373070389452427711"],
+ "output": "124"
+ }
+ ],
+ "xor_euint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457582495469225451093",
+ "115792089237316195423570985008687907853269984665640564039457581801761034193859"
+ ],
+ "output": "714633272808854"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457581801761034193855",
+ "115792089237316195423570985008687907853269984665640564039457581801761034193859"
+ ],
+ "output": "124"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457581801761034193859",
+ "115792089237316195423570985008687907853269984665640564039457581801761034193859"
+ ],
+ "output": "0"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457581801761034193859",
+ "115792089237316195423570985008687907853269984665640564039457581801761034193855"
+ ],
+ "output": "124"
+ }
+ ],
+ "xor_euint256_uint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457582495469225451093",
+ "115792089237316195423570985008687907853269984665640564039457579143464719512889"
+ ],
+ "output": "5655612635835244"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457581801761034193855",
+ "115792089237316195423570985008687907853269984665640564039457581801761034193859"
+ ],
+ "output": "124"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457581801761034193859",
+ "115792089237316195423570985008687907853269984665640564039457581801761034193859"
+ ],
+ "output": "0"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457581801761034193859",
+ "115792089237316195423570985008687907853269984665640564039457581801761034193855"
+ ],
+ "output": "124"
+ }
+ ],
+ "xor_uint256_euint256": [
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457579014577469369511",
+ "115792089237316195423570985008687907853269984665640564039457579143464719512889"
+ ],
+ "output": "269763301726622"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457581801761034193855",
+ "115792089237316195423570985008687907853269984665640564039457581801761034193859"
+ ],
+ "output": "124"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457581801761034193859",
+ "115792089237316195423570985008687907853269984665640564039457581801761034193859"
+ ],
+ "output": "0"
+ },
+ {
+ "inputs": [
+ "115792089237316195423570985008687907853269984665640564039457581801761034193859",
+ "115792089237316195423570985008687907853269984665640564039457581801761034193855"
+ ],
+ "output": "124"
+ }
],
"not_euint4": [{ "inputs": ["4"], "output": "11" }],
- "not_euint8": [{ "inputs": ["29"], "output": "226" }],
- "not_euint16": [{ "inputs": ["47885"], "output": "17650" }],
- "not_euint32": [{ "inputs": ["3731607282"], "output": "563360013" }],
- "not_euint64": [{ "inputs": ["18443812023863287611"], "output": "2932049846264004" }],
- "neg_euint4": [{ "inputs": ["6"], "output": "10" }],
- "neg_euint8": [{ "inputs": ["186"], "output": "70" }],
- "neg_euint16": [{ "inputs": ["3993"], "output": "61543" }],
- "neg_euint32": [{ "inputs": ["2747701293"], "output": "1547266003" }],
- "neg_euint64": [{ "inputs": ["18446646312005372999"], "output": "97761704178617" }]
+ "not_euint8": [{ "inputs": ["221"], "output": "34" }],
+ "not_euint16": [{ "inputs": ["1813"], "output": "63722" }],
+ "not_euint32": [{ "inputs": ["2456808918"], "output": "1838158377" }],
+ "not_euint64": [{ "inputs": ["18438471929660169839"], "output": "8272144049381776" }],
+ "not_euint128": [{ "inputs": ["340282366920938463463374264817331350741"], "output": "342614436860714" }],
+ "not_euint256": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457581938347870429377"],
+ "output": "2069565259210558"
+ }
+ ],
+ "neg_euint4": [{ "inputs": ["7"], "output": "9" }],
+ "neg_euint8": [{ "inputs": ["211"], "output": "45" }],
+ "neg_euint16": [{ "inputs": ["26686"], "output": "38850" }],
+ "neg_euint32": [{ "inputs": ["3401457377"], "output": "893509919" }],
+ "neg_euint64": [{ "inputs": ["18441984683925217775"], "output": "4759389784333841" }],
+ "neg_euint128": [{ "inputs": ["340282366920938463463373162594455712433"], "output": "1444837312499023" }],
+ "neg_euint256": [
+ {
+ "inputs": ["115792089237316195423570985008687907853269984665640564039457578680357072424439"],
+ "output": "5327556057215497"
+ }
+ ]
}
diff --git a/codegen/payments.ts b/codegen/payments.ts
index 875ff024..9556fda8 100644
--- a/codegen/payments.ts
+++ b/codegen/payments.ts
@@ -18,9 +18,9 @@ export function generateFHEPayment(priceData: PriceData): string {
import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
error FHEGasBlockLimitExceeded();
+ error UnsupportedOperation();
error CallerMustBeTFHEExecutorContract();
error OnlyScalarOperationsAreSupported();
- error OnlyNonScalarOperationsAreSupported();
error RecoveryFailed();
error WithdrawalFailed();
error AccountNotEnoughFunded();
@@ -62,7 +62,8 @@ export function generateFHEPayment(priceData: PriceData): string {
$.slot := FHEPaymentStorageLocation
}
}
-
+
+ /// @notice Getter function for the TFHEExecutor contract address
function getTFHEExecutorAddress() public view virtual returns (address) {
return tfheExecutorAddress;
}
@@ -194,7 +195,7 @@ export function generateFHEPayment(priceData: PriceData): string {
function checkIfNewBlock() internal virtual {
FHEPaymentStorage storage $ = _getFHEPaymentStorage();
uint256 lastBlock_ = block.number;
- if (block.number > $.lastBlock) {
+ if (lastBlock_ > $.lastBlock) {
$.lastBlock = lastBlock_;
$.currentBlockConsumption = 0;
}
@@ -215,6 +216,7 @@ export function generateFHEPayment(priceData: PriceData): string {
} else {
output += ` function ${functionName}(address payer, uint8 resultType) external virtual {
if(msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract();
+ checkIfNewBlock();
`;
}
@@ -261,11 +263,13 @@ ${generatePriceChecks(data.nonScalar)}
}
function generatePriceChecks(prices: { [key: string]: number }): string {
- return Object.entries(prices)
- .map(
- ([resultType, price]) => ` if (resultType == ${resultType}) {
+ return (
+ Object.entries(prices)
+ .map(
+ ([resultType, price]) => ` if (resultType == ${resultType}) {
updateFunding(payer, ${price});
}`,
- )
- .join(' else ');
+ )
+ .join(' else ') + 'else { revert UnsupportedOperation();}'
+ );
}
diff --git a/codegen/templates.ts b/codegen/templates.ts
index 20cb372c..8fe74ee5 100644
--- a/codegen/templates.ts
+++ b/codegen/templates.ts
@@ -1,6 +1,6 @@
import { assert } from 'console';
-import { CodegenContext, Operator, OperatorArguments, ReturnType } from './common';
+import { Operator, OperatorArguments, ReturnType } from './common';
import { ArgumentType, OverloadSignature } from './testgen';
import { getUint } from './utils';
@@ -12,7 +12,11 @@ type euint8 is uint256;
type euint16 is uint256;
type euint32 is uint256;
type euint64 is uint256;
+type euint128 is uint256;
+type euint256 is uint256;
type eaddress is uint256;
+type ebytes64 is uint256;
+type ebytes128 is uint256;
type ebytes256 is uint256;
type einput is bytes32;
@@ -57,7 +61,7 @@ function binaryOperatorImpl(op: Operator): string {
);
}
-export function implSol(ctx: CodegenContext, operators: Operator[]): string {
+export function implSol(operators: Operator[]): string {
const res: string[] = [];
const coprocessorInterface = generateImplCoprocessorInterface(operators);
@@ -105,7 +109,7 @@ library Impl {
}
});
- res.push(implCustomMethods(ctx));
+ res.push(implCustomMethods());
res.push('}\n');
@@ -190,6 +194,9 @@ function coprocessorInterfaceCustomFunctions(): string {
function verifyCiphertext(bytes32 inputHandle, address callerAddress, bytes memory inputProof, bytes1 inputType) external returns (uint256 result);
function cast(uint256 ct, bytes1 toType) external returns (uint256 result);
function trivialEncrypt(uint256 ct, bytes1 toType) external returns (uint256 result);
+ function trivialEncrypt(bytes memory ct, bytes1 toType) external returns (uint256 result);
+ function fheEq(uint256 lhs, bytes memory rhs, bytes1 scalarByte) external returns (uint256 result);
+ function fheNe(uint256 lhs, bytes memory rhs, bytes1 scalarByte) external returns (uint256 result);
function fheIfThenElse(uint256 control, uint256 ifTrue, uint256 ifFalse) external returns (uint256 result);
function fheRand(bytes1 randType) external returns (uint256 result);
function fheRandBounded(uint256 upperBound, bytes1 randType) external returns (uint256 result);
@@ -209,7 +216,6 @@ function generateACLInterface(): string {
}
export function tfheSol(
- ctx: CodegenContext,
operators: Operator[],
supportedBits: number[],
mocked: boolean,
@@ -298,7 +304,7 @@ library TFHE {
supportedBits.forEach((bits) => res.push(tfheUnaryOperators(bits, operators, signatures)));
supportedBits.forEach((bits) => res.push(tfheCustomUnaryOperators(bits, signatures, mocked)));
- res.push(tfheCustomMethods(ctx, mocked));
+ res.push(tfheCustomMethods());
res.push(tfheAclMethods(supportedBits));
@@ -588,17 +594,47 @@ function tfheAsEboolUnaryCast(bits: number): string {
// Evaluate and(a, b) and return the result.
function and(ebool a, ebool b) internal returns (ebool) {
- return ebool.wrap(Impl.and(ebool.unwrap(a), ebool.unwrap(b)));
+ return ebool.wrap(Impl.and(ebool.unwrap(a), ebool.unwrap(b), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(ebool a, bool b) internal returns (ebool) {
+ return ebool.wrap(Impl.and(ebool.unwrap(a), b?1:0, true));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(bool a, ebool b) internal returns (ebool) {
+ return ebool.wrap(Impl.and(ebool.unwrap(b), a?1:0, true));
}
// Evaluate or(a, b) and return the result.
function or(ebool a, ebool b) internal returns (ebool) {
- return ebool.wrap(Impl.or(ebool.unwrap(a), ebool.unwrap(b)));
+ return ebool.wrap(Impl.or(ebool.unwrap(a), ebool.unwrap(b), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(ebool a, bool b) internal returns (ebool) {
+ return ebool.wrap(Impl.or(ebool.unwrap(a), b?1:0, true));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(bool a, ebool b) internal returns (ebool) {
+ return ebool.wrap(Impl.or(ebool.unwrap(b), a?1:0, true));
}
// Evaluate xor(a, b) and return the result.
function xor(ebool a, ebool b) internal returns (ebool) {
- return ebool.wrap(Impl.xor(ebool.unwrap(a), ebool.unwrap(b)));
+ return ebool.wrap(Impl.xor(ebool.unwrap(a), ebool.unwrap(b), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(ebool a, bool b) internal returns (ebool) {
+ return ebool.wrap(Impl.xor(ebool.unwrap(a), b?1:0, true));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(bool a, ebool b) internal returns (ebool) {
+ return ebool.wrap(Impl.xor(ebool.unwrap(b), a?1:0, true));
}
function not(ebool a) internal returns (ebool) {
@@ -762,6 +798,22 @@ function tfheAclMethods(supportedBits: number[]): string {
Impl.allow(eaddress.unwrap(value), address(this));
}
+ function allow(ebytes64 value, address account) internal {
+ Impl.allow(ebytes64.unwrap(value), account);
+ }
+
+ function allowThis(ebytes64 value) internal {
+ Impl.allow(ebytes64.unwrap(value), address(this));
+ }
+
+ function allow(ebytes128 value, address account) internal {
+ Impl.allow(ebytes128.unwrap(value), account);
+ }
+
+ function allowThis(ebytes128 value) internal {
+ Impl.allow(ebytes128.unwrap(value), address(this));
+ }
+
function allow(ebytes256 value, address account) internal {
Impl.allow(ebytes256.unwrap(value), account);
}
@@ -805,85 +857,266 @@ function tfheAclMethods(supportedBits: number[]): string {
return res.join('');
}
-function tfheCustomMethods(ctx: CodegenContext, mocked: boolean): string {
+function tfheCustomMethods(): string {
let result = `
+ // Generates a random encrypted boolean.
+ function randEbool() internal returns (ebool) {
+ return ebool.wrap(Impl.rand(Common.ebool_t));
+ }
+
+ // Generates a random encrypted 4-bit unsigned integer.
+ function randEuint4() internal returns (euint4) {
+ return euint4.wrap(Impl.rand(Common.euint4_t));
+ }
+
+ // Generates a random encrypted 4-bit unsigned integer in the [0, upperBound) range.
+ // The upperBound must be a power of 2.
+ function randEuint4(uint8 upperBound) internal returns (euint4) {
+ return euint4.wrap(Impl.randBounded(upperBound, Common.euint4_t));
+ }
+
// Generates a random encrypted 8-bit unsigned integer.
- // Important: The random integer is generated in the plain! An FHE-based version is coming soon.
function randEuint8() internal returns (euint8) {
return euint8.wrap(Impl.rand(Common.euint8_t));
}
// Generates a random encrypted 8-bit unsigned integer in the [0, upperBound) range.
// The upperBound must be a power of 2.
- // Important: The random integer is generated in the plain! An FHE-based version is coming soon.
function randEuint8(uint8 upperBound) internal returns (euint8) {
return euint8.wrap(Impl.randBounded(upperBound, Common.euint8_t));
}
// Generates a random encrypted 16-bit unsigned integer.
- // Important: The random integer is generated in the plain! An FHE-based version is coming soon.
function randEuint16() internal returns (euint16) {
return euint16.wrap(Impl.rand(Common.euint16_t));
}
// Generates a random encrypted 16-bit unsigned integer in the [0, upperBound) range.
// The upperBound must be a power of 2.
- // Important: The random integer is generated in the plain! An FHE-based version is coming soon.
function randEuint16(uint16 upperBound) internal returns (euint16) {
return euint16.wrap(Impl.randBounded(upperBound, Common.euint16_t));
}
// Generates a random encrypted 32-bit unsigned integer.
- // Important: The random integer is generated in the plain! An FHE-based version is coming soon.
function randEuint32() internal returns (euint32) {
return euint32.wrap(Impl.rand(Common.euint32_t));
}
// Generates a random encrypted 32-bit unsigned integer in the [0, upperBound) range.
// The upperBound must be a power of 2.
- // Important: The random integer is generated in the plain! An FHE-based version is coming soon.
function randEuint32(uint32 upperBound) internal returns (euint32) {
return euint32.wrap(Impl.randBounded(upperBound, Common.euint32_t));
}
// Generates a random encrypted 64-bit unsigned integer.
- // Important: The random integer is generated in the plain! An FHE-based version is coming soon.
function randEuint64() internal returns (euint64) {
return euint64.wrap(Impl.rand(Common.euint64_t));
}
// Generates a random encrypted 64-bit unsigned integer in the [0, upperBound) range.
// The upperBound must be a power of 2.
- // Important: The random integer is generated in the plain! An FHE-based version is coming soon.
function randEuint64(uint64 upperBound) internal returns (euint64) {
return euint64.wrap(Impl.randBounded(upperBound, Common.euint64_t));
}
+ // Generates a random encrypted 128-bit unsigned integer.
+ function randEuint128() internal returns (euint128) {
+ return euint128.wrap(Impl.rand(Common.euint128_t));
+ }
+
+ // Generates a random encrypted 128-bit unsigned integer in the [0, upperBound) range.
+ // The upperBound must be a power of 2.
+ function randEuint128(uint128 upperBound) internal returns (euint128) {
+ return euint128.wrap(Impl.randBounded(upperBound, Common.euint128_t));
+ }
+
+ // Generates a random encrypted 256-bit unsigned integer.
+ function randEuint256() internal returns (euint256) {
+ return euint256.wrap(Impl.rand(Common.euint256_t));
+ }
+
+ // Generates a random encrypted 256-bit unsigned integer in the [0, upperBound) range.
+ // The upperBound must be a power of 2.
+ function randEuint256(uint256 upperBound) internal returns (euint256) {
+ return euint256.wrap(Impl.randBounded(upperBound, Common.euint256_t));
+ }
+
+ // Generates a random encrypted 512-bit unsigned integer.
+ function randEbytes64() internal returns (ebytes64) {
+ return ebytes64.wrap(Impl.rand(Common.ebytes64_t));
+ }
+
+ // Generates a random encrypted 1024-bit unsigned integer.
+ function randEbytes128() internal returns (ebytes128) {
+ return ebytes128.wrap(Impl.rand(Common.ebytes128_t));
+ }
+
+ // Generates a random encrypted 2048-bit unsigned integer.
+ function randEbytes256() internal returns (ebytes256) {
+ return ebytes256.wrap(Impl.rand(Common.ebytes256_t));
+ }
+
// Convert an inputHandle with corresponding inputProof to an encrypted eaddress.
function asEaddress(einput inputHandle, bytes memory inputProof) internal returns (eaddress) {
return eaddress.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint160_t));
}
- // Convert a plaintext value to an encrypted asEaddress.
+ // Convert a plaintext value to an encrypted address.
function asEaddress(address value) internal returns (eaddress) {
return eaddress.wrap(Impl.trivialEncrypt(uint160(value), Common.euint160_t));
}
+
+
+ // Convert the given inputHandle and inputProof to an encrypted ebytes64 value.
+ function asEbytes64(einput inputHandle, bytes memory inputProof) internal returns (ebytes64) {
+ return ebytes64.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebytes64_t));
+ }
+
+ // Left-pad a bytes array with zeros such that it becomes of length 64.
+ function padToBytes64(bytes memory input) internal pure returns (bytes memory) {
+ require(input.length <= 64, "Input exceeds 64 bytes");
+ bytes memory result = new bytes(64);
+ uint256 paddingLength = 64 - input.length;
+ for (uint256 i = 0; i < paddingLength; i++) {
+ result[i] = 0;
+ }
+ for (uint256 i = 0; i < input.length; i++) {
+ result[paddingLength + i] = input[i];
+ }
+ return result;
+ }
+
+ // Convert a plaintext value - must be a bytes array of size 64 - to an encrypted Bytes64.
+ function asEbytes64(bytes memory value) internal returns (ebytes64) {
+ return ebytes64.wrap(Impl.trivialEncrypt(value, Common.ebytes64_t));
+ }
+
+ // Convert the given inputHandle and inputProof to an encrypted ebytes128 value.
+ function asEbytes128(einput inputHandle, bytes memory inputProof) internal returns (ebytes128) {
+ return ebytes128.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebytes128_t));
+ }
+
+ // Left-pad a bytes array with zeros such that it becomes of length 128.
+ function padToBytes128(bytes memory input) internal pure returns (bytes memory) {
+ require(input.length <= 128, "Input exceeds 128 bytes");
+ bytes memory result = new bytes(128);
+ uint256 paddingLength = 128 - input.length;
+ for (uint256 i = 0; i < paddingLength; i++) {
+ result[i] = 0;
+ }
+ for (uint256 i = 0; i < input.length; i++) {
+ result[paddingLength + i] = input[i];
+ }
+ return result;
+ }
+
+ // Convert a plaintext value - must be a bytes array of size 128 - to an encrypted Bytes128.
+ function asEbytes128(bytes memory value) internal returns (ebytes128) {
+ return ebytes128.wrap(Impl.trivialEncrypt(value, Common.ebytes128_t));
+ }
// Convert the given inputHandle and inputProof to an encrypted ebytes256 value.
function asEbytes256(einput inputHandle, bytes memory inputProof) internal returns (ebytes256) {
return ebytes256.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebytes256_t));
}
+ // Left-pad a bytes array with zeros such that it becomes of length 256.
+ function padToBytes256(bytes memory input) internal pure returns (bytes memory) {
+ require(input.length <= 256, "Input exceeds 256 bytes");
+ bytes memory result = new bytes(256);
+ uint256 paddingLength = 256 - input.length;
+ for (uint256 i = 0; i < paddingLength; i++) {
+ result[i] = 0;
+ }
+ for (uint256 i = 0; i < input.length; i++) {
+ result[paddingLength + i] = input[i];
+ }
+ return result;
+ }
+
+ // Convert a plaintext value - must be a bytes array of size 256 - to an encrypted Bytes256.
+ function asEbytes256(bytes memory value) internal returns (ebytes256) {
+ return ebytes256.wrap(Impl.trivialEncrypt(value, Common.ebytes256_t));
+ }
+
// Return true if the enrypted address is initialized and false otherwise.
function isInitialized(eaddress v) internal pure returns (bool) {
return eaddress.unwrap(v) != 0;
}
+
+ // Return true if the enrypted value is initialized and false otherwise.
+ function isInitialized(ebytes64 v) internal pure returns (bool) {
+ return ebytes64.unwrap(v) != 0;
+ }
+
+ // Return true if the enrypted value is initialized and false otherwise.
+ function isInitialized(ebytes128 v) internal pure returns (bool) {
+ return ebytes128.unwrap(v) != 0;
+ }
// Return true if the enrypted value is initialized and false otherwise.
function isInitialized(ebytes256 v) internal pure returns (bool) {
return ebytes256.unwrap(v) != 0;
}
+ // Evaluate eq(a, b) and return the result.
+ function eq(ebool a, ebool b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbool(false);
+ }
+ if (!isInitialized(b)) {
+ b = asEbool(false);
+ }
+ return ebool.wrap(Impl.eq(ebool.unwrap(a), ebool.unwrap(b), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(ebool a, ebool b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbool(false);
+ }
+ if (!isInitialized(b)) {
+ b = asEbool(false);
+ }
+ return ebool.wrap(Impl.ne(ebool.unwrap(a), ebool.unwrap(b), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(ebool a, bool b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbool(false);
+ }
+ uint256 bProc = b?1:0;
+ return ebool.wrap(Impl.eq(ebool.unwrap(a), bProc, true));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(bool b, ebool a) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbool(false);
+ }
+ uint256 bProc = b?1:0;
+ return ebool.wrap(Impl.eq(ebool.unwrap(a), bProc, true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(ebool a, bool b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbool(false);
+ }
+ uint256 bProc = b?1:0;
+ return ebool.wrap(Impl.ne(ebool.unwrap(a), bProc, true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(bool b, ebool a) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbool(false);
+ }
+ uint256 bProc = b?1:0;
+ return ebool.wrap(Impl.ne(ebool.unwrap(a), bProc, true));
+ }
+
// Evaluate eq(a, b) and return the result.
function eq(eaddress a, eaddress b) internal returns (ebool) {
if (!isInitialized(a)) {
@@ -942,30 +1175,202 @@ function tfheCustomMethods(ctx: CodegenContext, mocked: boolean): string {
return ebool.wrap(Impl.ne(eaddress.unwrap(a), bProc, true));
}
+ // If 'control''s value is 'true', the result has the same value as 'a'.
+ // If 'control''s value is 'false', the result has the same value as 'b'.
+ function select(ebool control, ebool a, ebool b) internal returns (ebool) {
+ return ebool.wrap(Impl.select(ebool.unwrap(control), ebool.unwrap(a), ebool.unwrap(b)));
+ }
+
// If 'control''s value is 'true', the result has the same value as 'a'.
// If 'control''s value is 'false', the result has the same value as 'b'.
function select(ebool control, eaddress a, eaddress b) internal returns (eaddress) {
return eaddress.wrap(Impl.select(ebool.unwrap(control), eaddress.unwrap(a), eaddress.unwrap(b)));
}
+ // If 'control''s value is 'true', the result has the same value as 'a'.
+ // If 'control''s value is 'false', the result has the same value as 'b'.
+ function select(ebool control, ebytes64 a, ebytes64 b) internal returns (ebytes64) {
+ return ebytes64.wrap(Impl.select(ebool.unwrap(control), ebytes64.unwrap(a), ebytes64.unwrap(b)));
+ }
+
+ // If 'control''s value is 'true', the result has the same value as 'a'.
+ // If 'control''s value is 'false', the result has the same value as 'b'.
+ function select(ebool control, ebytes128 a, ebytes128 b) internal returns (ebytes128) {
+ return ebytes128.wrap(Impl.select(ebool.unwrap(control), ebytes128.unwrap(a), ebytes128.unwrap(b)));
+ }
+
+ // If 'control''s value is 'true', the result has the same value as 'a'.
+ // If 'control''s value is 'false', the result has the same value as 'b'.
+ function select(ebool control, ebytes256 a, ebytes256 b) internal returns (ebytes256) {
+ return ebytes256.wrap(Impl.select(ebool.unwrap(control), ebytes256.unwrap(a), ebytes256.unwrap(b)));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(ebytes64 a, ebytes64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbytes64(padToBytes64(hex''));
+ }
+ if (!isInitialized(b)) {
+ b = asEbytes64(padToBytes64(hex''));
+ }
+ return ebool.wrap(Impl.eq(ebytes64.unwrap(a), ebytes64.unwrap(b), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(ebytes64 a, bytes memory b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbytes64(padToBytes64(hex''));
+ }
+ return ebool.wrap(Impl.eq(ebytes64.unwrap(a), b, true));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(bytes memory a, ebytes64 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEbytes64(padToBytes64(hex''));
+ }
+ return ebool.wrap(Impl.eq(ebytes64.unwrap(b), a, true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(ebytes64 a, ebytes64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbytes64(padToBytes64(hex''));
+ }
+ if (!isInitialized(b)) {
+ b = asEbytes64(padToBytes64(hex''));
+ }
+ return ebool.wrap(Impl.ne(ebytes64.unwrap(a), ebytes64.unwrap(b), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(ebytes64 a, bytes memory b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbytes64(padToBytes64(hex''));
+ }
+ return ebool.wrap(Impl.ne(ebytes64.unwrap(a), b, true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(bytes memory a, ebytes64 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEbytes64(padToBytes64(hex''));
+ }
+ return ebool.wrap(Impl.ne(ebytes64.unwrap(b), a, true));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(ebytes128 a, ebytes128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbytes128(padToBytes128(hex''));
+ }
+ if (!isInitialized(b)) {
+ b = asEbytes128(padToBytes128(hex''));
+ }
+ return ebool.wrap(Impl.eq(ebytes128.unwrap(a), ebytes128.unwrap(b), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(ebytes128 a, bytes memory b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbytes128(padToBytes128(hex''));
+ }
+ return ebool.wrap(Impl.eq(ebytes128.unwrap(a), b, true));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(bytes memory a, ebytes128 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEbytes128(padToBytes128(hex''));
+ }
+ return ebool.wrap(Impl.eq(ebytes128.unwrap(b), a, true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(ebytes128 a, ebytes128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbytes128(padToBytes128(hex''));
+ }
+ if (!isInitialized(b)) {
+ b = asEbytes128(padToBytes128(hex''));
+ }
+ return ebool.wrap(Impl.ne(ebytes128.unwrap(a), ebytes128.unwrap(b), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(ebytes128 a, bytes memory b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbytes128(padToBytes128(hex''));
+ }
+ return ebool.wrap(Impl.ne(ebytes128.unwrap(a), b, true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(bytes memory a, ebytes128 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEbytes128(padToBytes128(hex''));
+ }
+ return ebool.wrap(Impl.ne(ebytes128.unwrap(b), a, true));
+ }
+
// Evaluate eq(a, b) and return the result.
function eq(ebytes256 a, ebytes256 b) internal returns (ebool) {
- require(isInitialized(a), "a is uninitialized");
- require(isInitialized(b), "b is uninitialized");
+ if (!isInitialized(a)) {
+ a = asEbytes256(padToBytes256(hex''));
+ }
+ if (!isInitialized(b)) {
+ b = asEbytes256(padToBytes256(hex''));
+ }
return ebool.wrap(Impl.eq(ebytes256.unwrap(a), ebytes256.unwrap(b), false));
}
+ // Evaluate eq(a, b) and return the result.
+ function eq(ebytes256 a, bytes memory b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbytes256(padToBytes256(hex''));
+ }
+ return ebool.wrap(Impl.eq(ebytes256.unwrap(a), b, true));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(bytes memory a, ebytes256 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEbytes256(padToBytes256(hex''));
+ }
+ return ebool.wrap(Impl.eq(ebytes256.unwrap(b), a, true));
+ }
+
// Evaluate ne(a, b) and return the result.
function ne(ebytes256 a, ebytes256 b) internal returns (ebool) {
- require(isInitialized(a), "a is uninitialized");
- require(isInitialized(b), "b is uninitialized");
+ if (!isInitialized(a)) {
+ a = asEbytes256(padToBytes256(hex''));
+ }
+ if (!isInitialized(b)) {
+ b = asEbytes256(padToBytes256(hex''));
+ }
return ebool.wrap(Impl.ne(ebytes256.unwrap(a), ebytes256.unwrap(b), false));
}
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(ebytes256 a, bytes memory b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbytes256(padToBytes256(hex''));
+ }
+ return ebool.wrap(Impl.ne(ebytes256.unwrap(a), b, true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(bytes memory a, ebytes256 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEbytes256(padToBytes256(hex''));
+ }
+ return ebool.wrap(Impl.ne(ebytes256.unwrap(b), a, true));
+ }
`;
return result;
}
-function implCustomMethods(ctx: CodegenContext): string {
+function implCustomMethods(): string {
return `
// If 'control's value is 'true', the result has the same value as 'ifTrue'.
// If 'control's value is 'false', the result has the same value as 'ifFalse'.
@@ -1000,6 +1405,36 @@ function implCustomMethods(ctx: CodegenContext): string {
result = ITFHEExecutor($.TFHEExecutorAddress).trivialEncrypt(value, bytes1(toType));
}
+ function trivialEncrypt(
+ bytes memory value,
+ uint8 toType
+ ) internal returns (uint256 result) {
+ FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig();
+ result = ITFHEExecutor($.TFHEExecutorAddress).trivialEncrypt(value, bytes1(toType));
+ }
+
+ function eq(uint256 lhs, bytes memory rhs, bool scalar) internal returns (uint256 result) {
+ bytes1 scalarByte;
+ if (scalar) {
+ scalarByte = 0x01;
+ } else {
+ scalarByte = 0x00;
+ }
+ FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig();
+ result = ITFHEExecutor($.TFHEExecutorAddress).fheEq(lhs, rhs, scalarByte);
+ }
+
+ function ne(uint256 lhs, bytes memory rhs, bool scalar) internal returns (uint256 result) {
+ bytes1 scalarByte;
+ if (scalar) {
+ scalarByte = 0x01;
+ } else {
+ scalarByte = 0x00;
+ }
+ FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig();
+ result = ITFHEExecutor($.TFHEExecutorAddress).fheNe(lhs, rhs, scalarByte);
+ }
+
function rand(uint8 randType) internal returns(uint256 result) {
FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig();
result = ITFHEExecutor($.TFHEExecutorAddress).fheRand(bytes1(randType));
diff --git a/codegen/testgen.ts b/codegen/testgen.ts
index 088a3fd3..1e4ca03b 100644
--- a/codegen/testgen.ts
+++ b/codegen/testgen.ts
@@ -32,7 +32,7 @@ export type OverloadShard = {
* of a smart contract you can deploy
*/
export function splitOverloadsToShards(overloads: OverloadSignature[]): OverloadShard[] {
- const MAX_SHARD_SIZE = 100;
+ const MAX_SHARD_SIZE = 90;
const res: OverloadShard[] = [];
var shardNo = 1;
@@ -64,7 +64,7 @@ function generateIntroTestCode(shards: OverloadShard[], idxSplit: number): strin
intro.push(`
import { expect } from 'chai';
import { ethers } from 'hardhat';
- import { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance';
+ import { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decrypt128, decrypt256, decryptBool } from '../instance';
import { getSigners, initSigners } from '../signers';
`);
@@ -212,12 +212,18 @@ function ensureNumberAcceptableInBitRange(bits: number, input: number | bigint)
case 64:
ensureNumberInRange(bits, input, 0x00, 0xffffffffffffffff);
break;
+ case 128:
+ ensureNumberInRange(bits, input, 0n, BigInt(0xffffffffffffffffffffffffffffffff));
+ break;
+ case 256:
+ ensureNumberInRange(bits, input, 0n, BigInt(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff));
+ break;
default:
assert(false, `TODO: add support for ${bits} numbers`);
}
}
-function ensureNumberInRange(bits: number, input: number | bigint, min: number, max: number) {
+function ensureNumberInRange(bits: number, input: number | bigint, min: number | bigint, max: number | bigint) {
assert(input >= min && input <= max, `${bits} bit number ${input} doesn't fall into expected [${min}; ${max}] range`);
}
@@ -237,6 +243,8 @@ export function generateSmartContract(os: OverloadShard): string {
euint16 public res16;
euint32 public res32;
euint64 public res64;
+ euint128 public res128;
+ euint256 public res256;
constructor() {
TFHE.setFHEVM(FHEVMConfig.defaultConfig());
@@ -260,6 +268,8 @@ const stateVar = {
euint16: 'res16',
euint32: 'res32',
euint64: 'res64',
+ euint128: 'res128',
+ euint256: 'res256',
};
function generateLibCallTest(os: OverloadShard, res: string[]) {
diff --git a/docs/guides/decrypt.md b/docs/guides/decrypt.md
index c3ba5423..842f95fb 100644
--- a/docs/guides/decrypt.md
+++ b/docs/guides/decrypt.md
@@ -180,17 +180,17 @@ event ResultCallback(uint256 indexed requestID, bool success, bytes result);
The first argument is the `requestID` of the corresponding decryption request, `success` is a boolean assessing if the call to the callback succeeded, and `result` is the bytes array corresponding the to return data from the callback.
-In your hardhat tests, if you sent some transactions which are requesting one or several decryptions and you wish to await the fulfilment of those decryptions, you should import the two helper methods `asyncDecrypt` and `awaitAllDecryptionResults` from the `asyncDecrypt.ts` utility file. This would work both when testing on an fhEVM node or in mocked mode. Here is a simple hardhat test for the previous `TestAsyncDecrypt` contract (more examples can be seen [here](../../test/gatewayDecrypt/testAsyncDecrypt.ts)):
+In your hardhat tests, if you sent some transactions which are requesting one or several decryptions and you wish to await the fulfilment of those decryptions, you should import the two helper methods `initGateway` and `awaitAllDecryptionResults` from the `asyncDecrypt.ts` utility file. This would work both when testing on an fhEVM node or in mocked mode. Here is a simple hardhat test for the previous `TestAsyncDecrypt` contract (more examples can be seen [here](../../test/gatewayDecrypt/testAsyncDecrypt.ts)):
```js
-import { asyncDecrypt, awaitAllDecryptionResults } from "../asyncDecrypt";
+import { initGateway, awaitAllDecryptionResults } from "../asyncDecrypt";
import { getSigners, initSigners } from "../signers";
import { expect } from "chai";
import { ethers } from "hardhat";
describe("TestAsyncDecrypt", function () {
before(async function () {
- await asyncDecrypt();
+ await initGateway();
await initSigners(3);
this.signers = await getSigners();
});
@@ -210,5 +210,5 @@ describe("TestAsyncDecrypt", function () {
});
```
-You should setup the gateway handler by calling `asyncDecrypt` at the top of the `before` block.
-Notice that when testing on the fhEVM, a decryption is fulfilled usually 2 blocks after the request, while in mocked mode the fulfilment will always happen as soon as you call the `awaitAllDecryptionResults` helper function. A good way to standardize hardhat tests is hence to always call`awaitAllDecryptionResults` which will ensure that all pending decryptions are fulfilled in both modes.
+You should initialize the gateway by calling `initGateway` at the top of the `before` block - more specifically, before doing any transaction which could involve a decryption request.
+Notice that when testing on the fhEVM, a decryption is fulfilled usually 2 blocks after the request, while in mocked mode the fulfilment will always happen as soon as you call the `awaitAllDecryptionResults` helper function. A good way to standardize hardhat tests is hence to always call the `awaitAllDecryptionResults` function which will ensure that all pending decryptions are fulfilled in both modes.
diff --git a/examples/Rand.sol b/examples/Rand.sol
index d84e62be..a02f118a 100644
--- a/examples/Rand.sol
+++ b/examples/Rand.sol
@@ -5,16 +5,38 @@ pragma solidity ^0.8.24;
import "../lib/TFHE.sol";
contract Rand {
+ ebool public valueb;
+ euint4 public value4;
euint8 public value8;
euint16 public value16;
euint32 public value32;
euint64 public value64;
euint64 public value64Bounded;
+ euint128 public value128;
+ euint256 public value256;
+ ebytes64 public value512;
+ ebytes128 public value1024;
+ ebytes256 public value2048;
constructor() {
TFHE.setFHEVM(FHEVMConfig.defaultConfig());
}
+ function generateBool() public {
+ valueb = TFHE.randEbool();
+ TFHE.allowThis(valueb);
+ }
+
+ function generate4() public {
+ value4 = TFHE.randEuint4();
+ TFHE.allowThis(value4);
+ }
+
+ function generate4UpperBound(uint8 upperBound) public {
+ value4 = TFHE.randEuint4(upperBound);
+ TFHE.allowThis(value4);
+ }
+
function generate8() public {
value8 = TFHE.randEuint8();
TFHE.allowThis(value8);
@@ -50,7 +72,7 @@ contract Rand {
TFHE.allowThis(value64);
}
- function generate64UpperBound(uint32 upperBound) public {
+ function generate64UpperBound(uint64 upperBound) public {
value64 = TFHE.randEuint64(upperBound);
TFHE.allowThis(value64);
}
@@ -66,4 +88,39 @@ contract Rand {
TFHE.allowThis(value64);
revert();
}
+
+ function generate128() public {
+ value128 = TFHE.randEuint128();
+ TFHE.allowThis(value128);
+ }
+
+ function generate128UpperBound(uint128 upperBound) public {
+ value128 = TFHE.randEuint128(upperBound);
+ TFHE.allowThis(value128);
+ }
+
+ function generate256() public {
+ value256 = TFHE.randEuint256();
+ TFHE.allowThis(value256);
+ }
+
+ function generate256UpperBound(uint256 upperBound) public {
+ value256 = TFHE.randEuint256(upperBound);
+ TFHE.allowThis(value256);
+ }
+
+ function generate512() public {
+ value512 = TFHE.randEbytes64();
+ TFHE.allowThis(value512);
+ }
+
+ function generate1024() public {
+ value1024 = TFHE.randEbytes128();
+ TFHE.allowThis(value1024);
+ }
+
+ function generate2048() public {
+ value2048 = TFHE.randEbytes256();
+ TFHE.allowThis(value2048);
+ }
}
diff --git a/examples/Reencrypt.sol b/examples/Reencrypt.sol
index 44e7ace3..1c6175a3 100644
--- a/examples/Reencrypt.sol
+++ b/examples/Reencrypt.sol
@@ -11,7 +11,11 @@ contract Reencrypt {
euint16 public xUint16;
euint32 public xUint32;
euint64 public xUint64;
+ euint128 public xUint128;
eaddress public xAddress;
+ euint256 public xUint256;
+ ebytes64 public yBytes64;
+ ebytes128 public yBytes128;
ebytes256 public yBytes256;
constructor() {
@@ -41,13 +45,39 @@ contract Reencrypt {
TFHE.allowThis(xUint64);
TFHE.allow(xUint64, msg.sender);
+ xUint128 = TFHE.asEuint128(145275933516363203950142179850024740765);
+ TFHE.allowThis(xUint128);
+ TFHE.allow(xUint128, msg.sender);
+
xAddress = TFHE.asEaddress(0x8ba1f109551bD432803012645Ac136ddd64DBA72);
TFHE.allowThis(xAddress);
TFHE.allow(xAddress, msg.sender);
- }
- function setEBytes256(einput inputHandleEBytes256, bytes memory inputProofEBytes256) external {
- yBytes256 = TFHE.asEbytes256(inputHandleEBytes256, inputProofEBytes256);
+ xUint256 = TFHE.asEuint256(74285495974541385002137713624115238327312291047062397922780925695323480915729);
+ TFHE.allowThis(xUint256);
+ TFHE.allow(xUint256, msg.sender);
+
+ yBytes64 = TFHE.asEbytes64(
+ TFHE.padToBytes64(
+ hex"19d179e0cc7e816dc944582ed4f5652f5951900098fc2e0a15a7ea4dc8cfa4e3b6c54beea5ee95e56b728762f659347ce1d4aa1b05fcc5"
+ )
+ );
+ TFHE.allowThis(yBytes64);
+ TFHE.allow(yBytes64, msg.sender);
+
+ yBytes128 = TFHE.asEbytes128(
+ TFHE.padToBytes128(
+ hex"13e7819123de6e2870c7e83bb764508e22d7c3ab8a5aee6bdfb26355ef0d3f1977d651b83bf5f78634fa360aa14debdc3daa6a587b5c2fb1710ab4d6677e62a8577f2d9fecc190ad8b11c9f0a5ec3138b27da1f055437af8c90a9495dad230"
+ )
+ );
+ TFHE.allowThis(yBytes128);
+ TFHE.allow(yBytes128, msg.sender);
+
+ yBytes256 = TFHE.asEbytes256(
+ TFHE.padToBytes256(
+ hex"d179e0cc7e816dc944582ed4f5652f5951900098fc2e0a15a7ea4dc8cfa4e3b6c54beea5ee95e56b728762f659347ce1d4aa1b05fcc513e7819123de6e2870c7e83bb764508e22d7c3ab8a5aee6bdfb26355ef0d3f1977d651b83bf5f78634fa360aa14debdc3daa6a587b5c2fb1710ab4d6677e62a8577f2d9fecc190ad8b11c9f0a5ec3138b27da1f055437af8c90a9495dad230"
+ )
+ );
TFHE.allowThis(yBytes256);
TFHE.allow(yBytes256, msg.sender);
}
diff --git a/examples/TestAsyncDecrypt.sol b/examples/TestAsyncDecrypt.sol
index 6d81b9ec..a393863f 100644
--- a/examples/TestAsyncDecrypt.sol
+++ b/examples/TestAsyncDecrypt.sol
@@ -14,8 +14,10 @@ contract TestAsyncDecrypt is GatewayCaller {
euint64 xUint64;
euint64 xUint64_2;
euint64 xUint64_3;
+ euint128 xUint128;
eaddress xAddress;
eaddress xAddress2;
+ euint256 xUint256;
bool public yBool;
uint8 public yUint4;
@@ -25,8 +27,12 @@ contract TestAsyncDecrypt is GatewayCaller {
uint64 public yUint64;
uint64 public yUint64_2;
uint64 public yUint64_3;
+ uint128 public yUint128;
address public yAddress;
address public yAddress2;
+ uint256 public yUint256;
+ bytes public yBytes64;
+ bytes public yBytes128;
bytes public yBytes256;
uint256 public latestRequestID;
@@ -50,6 +56,10 @@ contract TestAsyncDecrypt is GatewayCaller {
TFHE.allowThis(xUint64_2);
xUint64_3 = TFHE.asEuint64(6400);
TFHE.allowThis(xUint64_3);
+ xUint128 = TFHE.asEuint128(1267650600228229401496703205443);
+ TFHE.allowThis(xUint128);
+ xUint256 = TFHE.asEuint256(27606985387162255149739023449108101809804435888681546220650096895197251);
+ TFHE.allowThis(xUint256);
xAddress = TFHE.asEaddress(0x8ba1f109551bD432803012645Ac136ddd64DBA72);
TFHE.allowThis(xAddress);
xAddress2 = TFHE.asEaddress(0xf48b8840387ba3809DAE990c930F3b4766A86ca3);
@@ -226,6 +236,87 @@ contract TestAsyncDecrypt is GatewayCaller {
return decryptedInput;
}
+ function requestUint128() public {
+ uint256[] memory cts = new uint256[](1);
+ cts[0] = Gateway.toUint256(xUint128);
+ Gateway.requestDecryption(cts, this.callbackUint128.selector, 0, block.timestamp + 100, false);
+ }
+
+ function requestUint128NonTrivial(einput inputHandle, bytes calldata inputProof) public {
+ euint128 inputNonTrivial = TFHE.asEuint128(inputHandle, inputProof);
+ uint256[] memory cts = new uint256[](1);
+ cts[0] = Gateway.toUint256(inputNonTrivial);
+ Gateway.requestDecryption(cts, this.callbackUint128.selector, 0, block.timestamp + 100, false);
+ }
+
+ function callbackUint128(uint256, uint128 decryptedInput) public onlyGateway returns (uint128) {
+ yUint128 = decryptedInput;
+ return decryptedInput;
+ }
+
+ function requestUint256() public {
+ uint256[] memory cts = new uint256[](1);
+ cts[0] = Gateway.toUint256(xUint256);
+ Gateway.requestDecryption(cts, this.callbackUint256.selector, 0, block.timestamp + 100, false);
+ }
+
+ function requestUint256NonTrivial(einput inputHandle, bytes calldata inputProof) public {
+ euint256 inputNonTrivial = TFHE.asEuint256(inputHandle, inputProof);
+ uint256[] memory cts = new uint256[](1);
+ cts[0] = Gateway.toUint256(inputNonTrivial);
+ Gateway.requestDecryption(cts, this.callbackUint256.selector, 0, block.timestamp + 100, false);
+ }
+
+ function callbackUint256(uint256, uint256 decryptedInput) public onlyGateway returns (uint256) {
+ yUint256 = decryptedInput;
+ return decryptedInput;
+ }
+
+ function requestEbytes64NonTrivial(einput inputHandle, bytes calldata inputProof) public {
+ ebytes64 inputNonTrivial = TFHE.asEbytes64(inputHandle, inputProof);
+ uint256[] memory cts = new uint256[](1);
+ cts[0] = Gateway.toUint256(inputNonTrivial);
+ Gateway.requestDecryption(cts, this.callbackBytes64.selector, 0, block.timestamp + 100, false);
+ }
+
+ function requestEbytes64Trivial(bytes calldata value) public {
+ ebytes64 inputTrivial = TFHE.asEbytes64(TFHE.padToBytes64(value));
+ uint256[] memory cts = new uint256[](1);
+ cts[0] = Gateway.toUint256(inputTrivial);
+ Gateway.requestDecryption(cts, this.callbackBytes64.selector, 0, block.timestamp + 100, false);
+ }
+
+ function callbackBytes64(uint256, bytes calldata decryptedInput) public onlyGateway returns (bytes memory) {
+ yBytes64 = decryptedInput;
+ return decryptedInput;
+ }
+
+ function requestEbytes128NonTrivial(einput inputHandle, bytes calldata inputProof) public {
+ ebytes128 inputNonTrivial = TFHE.asEbytes128(inputHandle, inputProof);
+ uint256[] memory cts = new uint256[](1);
+ cts[0] = Gateway.toUint256(inputNonTrivial);
+ Gateway.requestDecryption(cts, this.callbackBytes128.selector, 0, block.timestamp + 100, false);
+ }
+
+ function requestEbytes128Trivial(bytes calldata value) public {
+ ebytes128 inputTrivial = TFHE.asEbytes128(TFHE.padToBytes128(value));
+ uint256[] memory cts = new uint256[](1);
+ cts[0] = Gateway.toUint256(inputTrivial);
+ Gateway.requestDecryption(cts, this.callbackBytes128.selector, 0, block.timestamp + 100, false);
+ }
+
+ function callbackBytes128(uint256, bytes calldata decryptedInput) public onlyGateway returns (bytes memory) {
+ yBytes128 = decryptedInput;
+ return decryptedInput;
+ }
+
+ function requestEbytes256Trivial(bytes calldata value) public {
+ ebytes256 inputTrivial = TFHE.asEbytes256(TFHE.padToBytes256(value));
+ uint256[] memory cts = new uint256[](1);
+ cts[0] = Gateway.toUint256(inputTrivial);
+ Gateway.requestDecryption(cts, this.callbackBytes256.selector, 0, block.timestamp + 100, false);
+ }
+
function requestEbytes256NonTrivial(einput inputHandle, bytes calldata inputProof) public {
ebytes256 inputNonTrivial = TFHE.asEbytes256(inputHandle, inputProof);
uint256[] memory cts = new uint256[](1);
@@ -326,10 +417,12 @@ contract TestAsyncDecrypt is GatewayCaller {
function requestMixedBytes256(einput inputHandle, bytes calldata inputProof) public {
ebytes256 xBytes256 = TFHE.asEbytes256(inputHandle, inputProof);
- uint256[] memory cts = new uint256[](3);
+ uint256[] memory cts = new uint256[](4);
cts[0] = Gateway.toUint256(xBool);
cts[1] = Gateway.toUint256(xAddress);
cts[2] = Gateway.toUint256(xBytes256);
+ ebytes64 input64Bytes = TFHE.asEbytes64(TFHE.padToBytes64(hex"aaff42"));
+ cts[3] = Gateway.toUint256(input64Bytes);
Gateway.requestDecryption(cts, this.callbackMixedBytes256.selector, 0, block.timestamp + 100, false);
}
@@ -337,11 +430,13 @@ contract TestAsyncDecrypt is GatewayCaller {
uint256,
bool decBool,
address decAddress,
- bytes memory bytesRes
+ bytes memory bytesRes,
+ bytes memory bytesRes2
) public onlyGateway {
yBool = decBool;
yAddress = decAddress;
yBytes256 = bytesRes;
+ yBytes64 = bytesRes2;
}
function requestEbytes256NonTrivialTrustless(einput inputHandle, bytes calldata inputProof) public {
diff --git a/examples/tests/TFHEManualTestSuite.sol b/examples/tests/TFHEManualTestSuite.sol
index 4a7eb45d..7721ac9d 100644
--- a/examples/tests/TFHEManualTestSuite.sol
+++ b/examples/tests/TFHEManualTestSuite.sol
@@ -10,12 +10,61 @@ contract TFHEManualTestSuite {
euint16 public res16;
euint32 public res32;
euint64 public res64;
+ euint128 public res128;
+ euint256 public res256;
eaddress public resAdd;
+ ebytes64 public resB64;
+ ebytes128 public resB128;
+ ebytes256 public resB256;
constructor() {
TFHE.setFHEVM(FHEVMConfig.defaultConfig());
}
+ function eqEbool(bool a, bool b) external {
+ ebool input1 = TFHE.asEbool(a);
+ ebool input2 = TFHE.asEbool(b);
+ ebool result = TFHE.eq(input1, input2);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function eqEboolScalarL(bool a, bool b) external {
+ ebool input2 = TFHE.asEbool(b);
+ ebool result = TFHE.eq(a, input2);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function eqEboolScalarR(bool a, bool b) external {
+ ebool input1 = TFHE.asEbool(a);
+ ebool result = TFHE.eq(input1, b);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function neEbool(bool a, bool b) external {
+ ebool input1 = TFHE.asEbool(a);
+ ebool input2 = TFHE.asEbool(b);
+ ebool result = TFHE.ne(input1, input2);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function neEboolScalarL(bool a, bool b) external {
+ ebool input2 = TFHE.asEbool(b);
+ ebool result = TFHE.ne(a, input2);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function neEboolScalarR(bool a, bool b) external {
+ ebool input1 = TFHE.asEbool(a);
+ ebool result = TFHE.ne(input1, b);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
function eqEbytes256(einput inp1, bytes calldata inputProof1, einput inp2, bytes calldata inputProof2) external {
ebytes256 input1 = TFHE.asEbytes256(inp1, inputProof1);
ebytes256 input2 = TFHE.asEbytes256(inp2, inputProof2);
@@ -32,6 +81,170 @@ contract TFHEManualTestSuite {
resb = result;
}
+ function eqEbytes64(bytes memory a, bytes memory b) external {
+ ebytes64 input1 = TFHE.asEbytes64(TFHE.padToBytes64(a));
+ ebytes64 input2 = TFHE.asEbytes64(TFHE.padToBytes64(b));
+ ebool result = TFHE.eq(input1, input2);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function eqEbytes64ScalarL(bytes memory a, bytes memory b) external {
+ bytes memory input1 = TFHE.padToBytes64(a);
+ ebytes64 input2 = TFHE.asEbytes64(TFHE.padToBytes64(b));
+ ebool result = TFHE.eq(input1, input2);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function eqEbytes64ScalarR(bytes memory a, bytes memory b) external {
+ ebytes64 input1 = TFHE.asEbytes64(TFHE.padToBytes64(a));
+ bytes memory input2 = TFHE.padToBytes64(b);
+ ebool result = TFHE.eq(input1, input2);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function neEbytes64(bytes memory a, bytes memory b) external {
+ ebytes64 input1 = TFHE.asEbytes64(TFHE.padToBytes64(a));
+ ebytes64 input2 = TFHE.asEbytes64(TFHE.padToBytes64(b));
+ ebool result = TFHE.ne(input1, input2);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function neEbytes64ScalarL(bytes memory a, bytes memory b) external {
+ bytes memory input1 = TFHE.padToBytes64(a);
+ ebytes64 input2 = TFHE.asEbytes64(TFHE.padToBytes64(b));
+ ebool result = TFHE.ne(input1, input2);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function neEbytes64ScalarR(bytes memory a, bytes memory b) external {
+ ebytes64 input1 = TFHE.asEbytes64(TFHE.padToBytes64(a));
+ bytes memory input2 = TFHE.padToBytes64(b);
+ ebool result = TFHE.ne(input1, input2);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function eqEbytes128(bytes memory a, bytes memory b) external {
+ ebytes128 input1 = TFHE.asEbytes128(TFHE.padToBytes128(a));
+ ebytes128 input2 = TFHE.asEbytes128(TFHE.padToBytes128(b));
+ ebool result = TFHE.eq(input1, input2);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function eqEbytes128ScalarL(bytes memory a, bytes memory b) external {
+ bytes memory input1 = TFHE.padToBytes128(a);
+ ebytes128 input2 = TFHE.asEbytes128(TFHE.padToBytes128(b));
+ ebool result = TFHE.eq(input1, input2);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function eqEbytes128ScalarR(bytes memory a, bytes memory b) external {
+ ebytes128 input1 = TFHE.asEbytes128(TFHE.padToBytes128(a));
+ bytes memory input2 = TFHE.padToBytes128(b);
+ ebool result = TFHE.eq(input1, input2);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function neEbytes128(bytes memory a, bytes memory b) external {
+ ebytes128 input1 = TFHE.asEbytes128(TFHE.padToBytes128(a));
+ ebytes128 input2 = TFHE.asEbytes128(TFHE.padToBytes128(b));
+ ebool result = TFHE.ne(input1, input2);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function neEbytes128ScalarL(bytes memory a, bytes memory b) external {
+ bytes memory input1 = TFHE.padToBytes128(a);
+ ebytes128 input2 = TFHE.asEbytes128(TFHE.padToBytes128(b));
+ ebool result = TFHE.ne(input1, input2);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function neEbytes128ScalarR(bytes memory a, bytes memory b) external {
+ ebytes128 input1 = TFHE.asEbytes128(TFHE.padToBytes128(a));
+ bytes memory input2 = TFHE.padToBytes128(b);
+ ebool result = TFHE.ne(input1, input2);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function eqEbytes256ScalarL(bytes memory a, bytes memory b) external {
+ bytes memory input1 = TFHE.padToBytes256(a);
+ ebytes256 input2 = TFHE.asEbytes256(TFHE.padToBytes256(b));
+ ebool result = TFHE.eq(input1, input2);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function eqEbytes256ScalarR(bytes memory a, bytes memory b) external {
+ ebytes256 input1 = TFHE.asEbytes256(TFHE.padToBytes256(a));
+ bytes memory input2 = TFHE.padToBytes256(b);
+ ebool result = TFHE.eq(input1, input2);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function neEbytes256ScalarL(bytes memory a, bytes memory b) external {
+ bytes memory input1 = TFHE.padToBytes256(a);
+ ebytes256 input2 = TFHE.asEbytes256(TFHE.padToBytes256(b));
+ ebool result = TFHE.ne(input1, input2);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function neEbytes256ScalarR(bytes memory a, bytes memory b) external {
+ ebytes256 input1 = TFHE.asEbytes256(TFHE.padToBytes256(a));
+ bytes memory input2 = TFHE.padToBytes256(b);
+ ebool result = TFHE.ne(input1, input2);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function test_select_ebool(bool control, bool ifTrue, bool ifFalse) public {
+ ebool controlProc = TFHE.asEbool(control);
+ ebool ifTrueProc = TFHE.asEbool(ifTrue);
+ ebool ifFalseProc = TFHE.asEbool(ifFalse);
+ ebool result = TFHE.select(controlProc, ifTrueProc, ifFalseProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+
+ function test_select_ebytes64(bool control, bytes memory ifTrue, bytes memory ifFalse) public {
+ ebool controlProc = TFHE.asEbool(control);
+ ebytes64 ifTrueProc = TFHE.asEbytes64(TFHE.padToBytes64(ifTrue));
+ ebytes64 ifFalseProc = TFHE.asEbytes64(TFHE.padToBytes64(ifFalse));
+ ebytes64 result = TFHE.select(controlProc, ifTrueProc, ifFalseProc);
+ TFHE.allowThis(result);
+ resB64 = result;
+ }
+
+ function test_select_ebytes128(bool control, bytes memory ifTrue, bytes memory ifFalse) public {
+ ebool controlProc = TFHE.asEbool(control);
+ ebytes128 ifTrueProc = TFHE.asEbytes128(TFHE.padToBytes128(ifTrue));
+ ebytes128 ifFalseProc = TFHE.asEbytes128(TFHE.padToBytes128(ifFalse));
+ ebytes128 result = TFHE.select(controlProc, ifTrueProc, ifFalseProc);
+ TFHE.allowThis(result);
+ resB128 = result;
+ }
+
+ function test_select_ebytes256(bool control, bytes memory ifTrue, bytes memory ifFalse) public {
+ ebool controlProc = TFHE.asEbool(control);
+ ebytes256 ifTrueProc = TFHE.asEbytes256(TFHE.padToBytes256(ifTrue));
+ ebytes256 ifFalseProc = TFHE.asEbytes256(TFHE.padToBytes256(ifFalse));
+ ebytes256 result = TFHE.select(controlProc, ifTrueProc, ifFalseProc);
+ TFHE.allowThis(result);
+ resB256 = result;
+ }
+
function test_select(einput control, einput ifTrue, einput ifFalse, bytes calldata inputProof) public {
ebool controlProc = TFHE.asEbool(control, inputProof);
euint32 ifTrueProc = TFHE.asEuint32(ifTrue, inputProof);
@@ -114,6 +327,22 @@ contract TFHEManualTestSuite {
res64 = TFHE.asEuint64(TFHE.asEbool(input));
}
+ function test_ebool_to_euint128_cast(bool input) public {
+ res128 = TFHE.asEuint128(TFHE.asEbool(input));
+ }
+
+ function test_ebool_to_euint256_cast(bool input) public {
+ res256 = TFHE.asEuint256(TFHE.asEbool(input));
+ }
+
+ function test_euint4_to_euint256_cast(uint8 input) public {
+ res256 = TFHE.asEuint256(TFHE.asEuint4(input));
+ }
+
+ function test_euint128_to_euint8_cast(uint128 input) public {
+ res8 = TFHE.asEuint8(TFHE.asEuint128(input));
+ }
+
function test_ebool_not(bool input) public {
resb = TFHE.not(TFHE.asEbool(input));
}
@@ -122,11 +351,35 @@ contract TFHEManualTestSuite {
resb = TFHE.and(TFHE.asEbool(a), TFHE.asEbool(b));
}
+ function test_ebool_and_scalarL(bool a, bool b) public {
+ resb = TFHE.and(a, TFHE.asEbool(b));
+ }
+
+ function test_ebool_and_scalarR(bool a, bool b) public {
+ resb = TFHE.and(TFHE.asEbool(a), b);
+ }
+
function test_ebool_or(bool a, bool b) public {
resb = TFHE.or(TFHE.asEbool(a), TFHE.asEbool(b));
}
+ function test_ebool_or_scalarL(bool a, bool b) public {
+ resb = TFHE.or(a, TFHE.asEbool(b));
+ }
+
+ function test_ebool_or_scalarR(bool a, bool b) public {
+ resb = TFHE.or(TFHE.asEbool(a), b);
+ }
+
function test_ebool_xor(bool a, bool b) public {
resb = TFHE.xor(TFHE.asEbool(a), TFHE.asEbool(b));
}
+
+ function test_ebool_xor_scalarL(bool a, bool b) public {
+ resb = TFHE.xor(a, TFHE.asEbool(b));
+ }
+
+ function test_ebool_xor_scalarR(bool a, bool b) public {
+ resb = TFHE.xor(TFHE.asEbool(a), b);
+ }
}
diff --git a/examples/tests/TFHETestSuite1.sol b/examples/tests/TFHETestSuite1.sol
index 9ddd40aa..3f4ba493 100644
--- a/examples/tests/TFHETestSuite1.sol
+++ b/examples/tests/TFHETestSuite1.sol
@@ -10,6 +10,8 @@ contract TFHETestSuite1 {
euint16 public res16;
euint32 public res32;
euint64 public res64;
+ euint128 public res128;
+ euint256 public res256;
constructor() {
TFHE.setFHEVM(FHEVMConfig.defaultConfig());
@@ -505,214 +507,144 @@ contract TFHETestSuite1 {
TFHE.allowThis(result);
res64 = result;
}
- function add_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ function add_euint4_euint128(einput a, einput b, bytes calldata inputProof) public {
euint4 aProc = TFHE.asEuint4(a, inputProof);
- uint8 bProc = b;
- euint4 result = TFHE.add(aProc, bProc);
- TFHE.allowThis(result);
- res4 = result;
- }
- function add_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint4 result = TFHE.add(aProc, bProc);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
- res4 = result;
+ res128 = result;
}
- function sub_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ function sub_euint4_euint128(einput a, einput b, bytes calldata inputProof) public {
euint4 aProc = TFHE.asEuint4(a, inputProof);
- uint8 bProc = b;
- euint4 result = TFHE.sub(aProc, bProc);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
- res4 = result;
+ res128 = result;
}
- function sub_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint4 result = TFHE.sub(aProc, bProc);
- TFHE.allowThis(result);
- res4 = result;
- }
- function mul_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ function mul_euint4_euint128(einput a, einput b, bytes calldata inputProof) public {
euint4 aProc = TFHE.asEuint4(a, inputProof);
- uint8 bProc = b;
- euint4 result = TFHE.mul(aProc, bProc);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
- res4 = result;
+ res128 = result;
}
- function mul_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint4 result = TFHE.mul(aProc, bProc);
- TFHE.allowThis(result);
- res4 = result;
- }
- function div_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ function and_euint4_euint128(einput a, einput b, bytes calldata inputProof) public {
euint4 aProc = TFHE.asEuint4(a, inputProof);
- uint8 bProc = b;
- euint4 result = TFHE.div(aProc, bProc);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
- res4 = result;
+ res128 = result;
}
- function rem_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ function or_euint4_euint128(einput a, einput b, bytes calldata inputProof) public {
euint4 aProc = TFHE.asEuint4(a, inputProof);
- uint8 bProc = b;
- euint4 result = TFHE.rem(aProc, bProc);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
- res4 = result;
+ res128 = result;
}
- function eq_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ function xor_euint4_euint128(einput a, einput b, bytes calldata inputProof) public {
euint4 aProc = TFHE.asEuint4(a, inputProof);
- uint8 bProc = b;
- ebool result = TFHE.eq(aProc, bProc);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.xor(aProc, bProc);
TFHE.allowThis(result);
- resb = result;
+ res128 = result;
}
- function eq_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint4 bProc = TFHE.asEuint4(b, inputProof);
+ function eq_euint4_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ne_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ function ne_euint4_euint128(einput a, einput b, bytes calldata inputProof) public {
euint4 aProc = TFHE.asEuint4(a, inputProof);
- uint8 bProc = b;
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
ebool result = TFHE.ne(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ne_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- ebool result = TFHE.ne(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function ge_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ function ge_euint4_euint128(einput a, einput b, bytes calldata inputProof) public {
euint4 aProc = TFHE.asEuint4(a, inputProof);
- uint8 bProc = b;
- ebool result = TFHE.ge(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function ge_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
ebool result = TFHE.ge(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function gt_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ function gt_euint4_euint128(einput a, einput b, bytes calldata inputProof) public {
euint4 aProc = TFHE.asEuint4(a, inputProof);
- uint8 bProc = b;
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
ebool result = TFHE.gt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function gt_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- ebool result = TFHE.gt(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function le_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ function le_euint4_euint128(einput a, einput b, bytes calldata inputProof) public {
euint4 aProc = TFHE.asEuint4(a, inputProof);
- uint8 bProc = b;
- ebool result = TFHE.le(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function le_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
ebool result = TFHE.le(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function lt_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ function lt_euint4_euint128(einput a, einput b, bytes calldata inputProof) public {
euint4 aProc = TFHE.asEuint4(a, inputProof);
- uint8 bProc = b;
- ebool result = TFHE.lt(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function lt_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
ebool result = TFHE.lt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function min_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ function min_euint4_euint128(einput a, einput b, bytes calldata inputProof) public {
euint4 aProc = TFHE.asEuint4(a, inputProof);
- uint8 bProc = b;
- euint4 result = TFHE.min(aProc, bProc);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.min(aProc, bProc);
TFHE.allowThis(result);
- res4 = result;
+ res128 = result;
}
- function min_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint4 result = TFHE.min(aProc, bProc);
- TFHE.allowThis(result);
- res4 = result;
- }
- function max_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ function max_euint4_euint128(einput a, einput b, bytes calldata inputProof) public {
euint4 aProc = TFHE.asEuint4(a, inputProof);
- uint8 bProc = b;
- euint4 result = TFHE.max(aProc, bProc);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.max(aProc, bProc);
TFHE.allowThis(result);
- res4 = result;
+ res128 = result;
}
- function max_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint4 result = TFHE.max(aProc, bProc);
- TFHE.allowThis(result);
- res4 = result;
- }
- function add_euint8_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint8 result = TFHE.add(aProc, bProc);
+ function add_euint4_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
- res8 = result;
+ res256 = result;
}
- function sub_euint8_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint8 result = TFHE.sub(aProc, bProc);
+ function sub_euint4_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
- res8 = result;
+ res256 = result;
}
- function mul_euint8_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint8 result = TFHE.mul(aProc, bProc);
+ function mul_euint4_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
- res8 = result;
+ res256 = result;
}
- function and_euint8_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint8 result = TFHE.and(aProc, bProc);
+ function and_euint4_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
- res8 = result;
+ res256 = result;
}
- function or_euint8_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint8 result = TFHE.or(aProc, bProc);
+ function or_euint4_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
- res8 = result;
+ res256 = result;
}
- function xor_euint8_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint8 result = TFHE.xor(aProc, bProc);
+ function xor_euint4_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.xor(aProc, bProc);
TFHE.allowThis(result);
- res8 = result;
+ res256 = result;
}
}
diff --git a/examples/tests/TFHETestSuite10.sol b/examples/tests/TFHETestSuite10.sol
new file mode 100644
index 00000000..e1f9f8b0
--- /dev/null
+++ b/examples/tests/TFHETestSuite10.sol
@@ -0,0 +1,650 @@
+// SPDX-License-Identifier: BSD-3-Clause-Clear
+pragma solidity ^0.8.24;
+
+import "../../lib/TFHE.sol";
+
+contract TFHETestSuite10 {
+ ebool public resb;
+ euint4 public res4;
+ euint8 public res8;
+ euint16 public res16;
+ euint32 public res32;
+ euint64 public res64;
+ euint128 public res128;
+ euint256 public res256;
+
+ constructor() {
+ TFHE.setFHEVM(FHEVMConfig.defaultConfig());
+ }
+
+ function add_euint256_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint256 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function sub_euint256_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint256 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function mul_euint256_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint256 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function and_euint256_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint256 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function or_euint256_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint256 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function xor_euint256_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint256 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function eq_euint256_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint256_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint256_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint256_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint256_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint256_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint256_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint256 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function max_euint256_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint256 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function add_euint256_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint256 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function sub_euint256_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint256 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function mul_euint256_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint256 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function and_euint256_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint256 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function or_euint256_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint256 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function xor_euint256_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint256 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function eq_euint256_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint256_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint256_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint256_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint256_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint256_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint256_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint256 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function max_euint256_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint256 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function add_euint256_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint256 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function sub_euint256_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint256 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function mul_euint256_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint256 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function and_euint256_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint256 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function or_euint256_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint256 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function xor_euint256_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint256 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function eq_euint256_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint256_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint256_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint256_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint256_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint256_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint256_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint256 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function max_euint256_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint256 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function add_euint256_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function sub_euint256_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function mul_euint256_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function and_euint256_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function or_euint256_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function xor_euint256_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function eq_euint256_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint256_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint256_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint256_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint256_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint256_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint256_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function max_euint256_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function add_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ uint256 bProc = b;
+ euint256 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function add_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public {
+ uint256 aProc = a;
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function sub_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ uint256 bProc = b;
+ euint256 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function sub_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public {
+ uint256 aProc = a;
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function mul_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ uint256 bProc = b;
+ euint256 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function mul_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public {
+ uint256 aProc = a;
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function div_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ uint256 bProc = b;
+ euint256 result = TFHE.div(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function rem_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ uint256 bProc = b;
+ euint256 result = TFHE.rem(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function and_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ uint256 bProc = b;
+ euint256 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function and_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public {
+ uint256 aProc = a;
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function or_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ uint256 bProc = b;
+ euint256 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function or_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public {
+ uint256 aProc = a;
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function xor_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ uint256 bProc = b;
+ euint256 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function xor_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public {
+ uint256 aProc = a;
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function eq_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ uint256 bProc = b;
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function eq_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public {
+ uint256 aProc = a;
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ uint256 bProc = b;
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public {
+ uint256 aProc = a;
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ uint256 bProc = b;
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public {
+ uint256 aProc = a;
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ uint256 bProc = b;
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public {
+ uint256 aProc = a;
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ uint256 bProc = b;
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public {
+ uint256 aProc = a;
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ uint256 bProc = b;
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public {
+ uint256 aProc = a;
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ uint256 bProc = b;
+ euint256 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function min_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public {
+ uint256 aProc = a;
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function max_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ uint256 bProc = b;
+ euint256 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function max_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public {
+ uint256 aProc = a;
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function shl_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ uint8 bProc = b;
+ euint4 result = TFHE.shl(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function shr_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ uint8 bProc = b;
+ euint4 result = TFHE.shr(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function rotl_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ uint8 bProc = b;
+ euint4 result = TFHE.rotl(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function rotr_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ uint8 bProc = b;
+ euint4 result = TFHE.rotr(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+}
diff --git a/examples/tests/TFHETestSuite11.sol b/examples/tests/TFHETestSuite11.sol
new file mode 100644
index 00000000..d036a281
--- /dev/null
+++ b/examples/tests/TFHETestSuite11.sol
@@ -0,0 +1,440 @@
+// SPDX-License-Identifier: BSD-3-Clause-Clear
+pragma solidity ^0.8.24;
+
+import "../../lib/TFHE.sol";
+
+contract TFHETestSuite11 {
+ ebool public resb;
+ euint4 public res4;
+ euint8 public res8;
+ euint16 public res16;
+ euint32 public res32;
+ euint64 public res64;
+ euint128 public res128;
+ euint256 public res256;
+
+ constructor() {
+ TFHE.setFHEVM(FHEVMConfig.defaultConfig());
+ }
+
+ function shl_euint8_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint8 result = TFHE.shl(aProc, bProc);
+ TFHE.allowThis(result);
+ res8 = result;
+ }
+ function shl_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ uint8 bProc = b;
+ euint8 result = TFHE.shl(aProc, bProc);
+ TFHE.allowThis(result);
+ res8 = result;
+ }
+ function shr_euint8_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint8 result = TFHE.shr(aProc, bProc);
+ TFHE.allowThis(result);
+ res8 = result;
+ }
+ function shr_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ uint8 bProc = b;
+ euint8 result = TFHE.shr(aProc, bProc);
+ TFHE.allowThis(result);
+ res8 = result;
+ }
+ function rotl_euint8_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint8 result = TFHE.rotl(aProc, bProc);
+ TFHE.allowThis(result);
+ res8 = result;
+ }
+ function rotl_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ uint8 bProc = b;
+ euint8 result = TFHE.rotl(aProc, bProc);
+ TFHE.allowThis(result);
+ res8 = result;
+ }
+ function rotr_euint8_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint8 result = TFHE.rotr(aProc, bProc);
+ TFHE.allowThis(result);
+ res8 = result;
+ }
+ function rotr_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ uint8 bProc = b;
+ euint8 result = TFHE.rotr(aProc, bProc);
+ TFHE.allowThis(result);
+ res8 = result;
+ }
+ function shl_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint16 result = TFHE.shl(aProc, bProc);
+ TFHE.allowThis(result);
+ res16 = result;
+ }
+ function shl_euint16_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ uint8 bProc = b;
+ euint16 result = TFHE.shl(aProc, bProc);
+ TFHE.allowThis(result);
+ res16 = result;
+ }
+ function shr_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint16 result = TFHE.shr(aProc, bProc);
+ TFHE.allowThis(result);
+ res16 = result;
+ }
+ function shr_euint16_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ uint8 bProc = b;
+ euint16 result = TFHE.shr(aProc, bProc);
+ TFHE.allowThis(result);
+ res16 = result;
+ }
+ function rotl_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint16 result = TFHE.rotl(aProc, bProc);
+ TFHE.allowThis(result);
+ res16 = result;
+ }
+ function rotl_euint16_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ uint8 bProc = b;
+ euint16 result = TFHE.rotl(aProc, bProc);
+ TFHE.allowThis(result);
+ res16 = result;
+ }
+ function rotr_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint16 result = TFHE.rotr(aProc, bProc);
+ TFHE.allowThis(result);
+ res16 = result;
+ }
+ function rotr_euint16_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ uint8 bProc = b;
+ euint16 result = TFHE.rotr(aProc, bProc);
+ TFHE.allowThis(result);
+ res16 = result;
+ }
+ function shl_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint32 result = TFHE.shl(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function shl_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ uint8 bProc = b;
+ euint32 result = TFHE.shl(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function shr_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint32 result = TFHE.shr(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function shr_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ uint8 bProc = b;
+ euint32 result = TFHE.shr(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function rotl_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint32 result = TFHE.rotl(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function rotl_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ uint8 bProc = b;
+ euint32 result = TFHE.rotl(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function rotr_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint32 result = TFHE.rotr(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function rotr_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ uint8 bProc = b;
+ euint32 result = TFHE.rotr(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function shl_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint64 result = TFHE.shl(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function shl_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ uint8 bProc = b;
+ euint64 result = TFHE.shl(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function shr_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint64 result = TFHE.shr(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function shr_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ uint8 bProc = b;
+ euint64 result = TFHE.shr(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function rotl_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint64 result = TFHE.rotl(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function rotl_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ uint8 bProc = b;
+ euint64 result = TFHE.rotl(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function rotr_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint64 result = TFHE.rotr(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function rotr_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ uint8 bProc = b;
+ euint64 result = TFHE.rotr(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function shl_euint128_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint128 result = TFHE.shl(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function shl_euint128_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ uint8 bProc = b;
+ euint128 result = TFHE.shl(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function shr_euint128_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint128 result = TFHE.shr(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function shr_euint128_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ uint8 bProc = b;
+ euint128 result = TFHE.shr(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function rotl_euint128_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint128 result = TFHE.rotl(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function rotl_euint128_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ uint8 bProc = b;
+ euint128 result = TFHE.rotl(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function rotr_euint128_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint128 result = TFHE.rotr(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function rotr_euint128_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ uint8 bProc = b;
+ euint128 result = TFHE.rotr(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function shl_euint256_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint256 result = TFHE.shl(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function shl_euint256_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ uint8 bProc = b;
+ euint256 result = TFHE.shl(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function shr_euint256_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint256 result = TFHE.shr(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function shr_euint256_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ uint8 bProc = b;
+ euint256 result = TFHE.shr(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function rotl_euint256_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint256 result = TFHE.rotl(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function rotl_euint256_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ uint8 bProc = b;
+ euint256 result = TFHE.rotl(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function rotr_euint256_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint256 result = TFHE.rotr(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function rotr_euint256_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ uint8 bProc = b;
+ euint256 result = TFHE.rotr(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function neg_euint4(einput a, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ euint4 result = TFHE.neg(aProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function not_euint4(einput a, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ euint4 result = TFHE.not(aProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function neg_euint8(einput a, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint8 result = TFHE.neg(aProc);
+ TFHE.allowThis(result);
+ res8 = result;
+ }
+ function not_euint8(einput a, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint8 result = TFHE.not(aProc);
+ TFHE.allowThis(result);
+ res8 = result;
+ }
+ function neg_euint16(einput a, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint16 result = TFHE.neg(aProc);
+ TFHE.allowThis(result);
+ res16 = result;
+ }
+ function not_euint16(einput a, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint16 result = TFHE.not(aProc);
+ TFHE.allowThis(result);
+ res16 = result;
+ }
+ function neg_euint32(einput a, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint32 result = TFHE.neg(aProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function not_euint32(einput a, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint32 result = TFHE.not(aProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function neg_euint64(einput a, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint64 result = TFHE.neg(aProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function not_euint64(einput a, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint64 result = TFHE.not(aProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function neg_euint128(einput a, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint128 result = TFHE.neg(aProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function not_euint128(einput a, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint128 result = TFHE.not(aProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function neg_euint256(einput a, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint256 result = TFHE.neg(aProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function not_euint256(einput a, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint256 result = TFHE.not(aProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+}
diff --git a/examples/tests/TFHETestSuite2.sol b/examples/tests/TFHETestSuite2.sol
index 715d8caa..f0871a7a 100644
--- a/examples/tests/TFHETestSuite2.sol
+++ b/examples/tests/TFHETestSuite2.sol
@@ -10,11 +10,321 @@ contract TFHETestSuite2 {
euint16 public res16;
euint32 public res32;
euint64 public res64;
+ euint128 public res128;
+ euint256 public res256;
constructor() {
TFHE.setFHEVM(FHEVMConfig.defaultConfig());
}
+ function eq_euint4_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint4_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint4_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint4_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint4_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint4_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint4_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function max_euint4_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function add_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ uint8 bProc = b;
+ euint4 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function add_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint4 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function sub_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ uint8 bProc = b;
+ euint4 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function sub_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint4 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function mul_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ uint8 bProc = b;
+ euint4 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function mul_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint4 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function div_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ uint8 bProc = b;
+ euint4 result = TFHE.div(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function rem_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ uint8 bProc = b;
+ euint4 result = TFHE.rem(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function and_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ uint8 bProc = b;
+ euint4 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function and_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint4 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function or_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ uint8 bProc = b;
+ euint4 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function or_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint4 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function xor_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ uint8 bProc = b;
+ euint4 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function xor_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint4 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function eq_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ uint8 bProc = b;
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function eq_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ uint8 bProc = b;
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ uint8 bProc = b;
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ uint8 bProc = b;
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ uint8 bProc = b;
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ uint8 bProc = b;
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ uint8 bProc = b;
+ euint4 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function min_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint4 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function max_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint4 aProc = TFHE.asEuint4(a, inputProof);
+ uint8 bProc = b;
+ euint4 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function max_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint4 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res4 = result;
+ }
+ function add_euint8_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint8 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res8 = result;
+ }
+ function sub_euint8_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint8 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res8 = result;
+ }
+ function mul_euint8_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint8 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res8 = result;
+ }
+ function and_euint8_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint8 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res8 = result;
+ }
+ function or_euint8_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint8 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res8 = result;
+ }
+ function xor_euint8_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint8 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res8 = result;
+ }
function eq_euint8_euint4(einput a, einput b, bytes calldata inputProof) public {
euint8 aProc = TFHE.asEuint8(a, inputProof);
euint4 bProc = TFHE.asEuint4(b, inputProof);
@@ -337,382 +647,4 @@ contract TFHETestSuite2 {
TFHE.allowThis(result);
resb = result;
}
- function le_euint8_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- ebool result = TFHE.le(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function lt_euint8_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- ebool result = TFHE.lt(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function min_euint8_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint32 result = TFHE.min(aProc, bProc);
- TFHE.allowThis(result);
- res32 = result;
- }
- function max_euint8_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint32 result = TFHE.max(aProc, bProc);
- TFHE.allowThis(result);
- res32 = result;
- }
- function add_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.add(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function sub_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.sub(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function mul_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.mul(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function and_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.and(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function or_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.or(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function xor_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.xor(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function eq_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- ebool result = TFHE.eq(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function ne_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- ebool result = TFHE.ne(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function ge_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- ebool result = TFHE.ge(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function gt_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- ebool result = TFHE.gt(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function le_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- ebool result = TFHE.le(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function lt_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- ebool result = TFHE.lt(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function min_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.min(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function max_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.max(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function add_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- uint8 bProc = b;
- euint8 result = TFHE.add(aProc, bProc);
- TFHE.allowThis(result);
- res8 = result;
- }
- function add_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint8 result = TFHE.add(aProc, bProc);
- TFHE.allowThis(result);
- res8 = result;
- }
- function sub_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- uint8 bProc = b;
- euint8 result = TFHE.sub(aProc, bProc);
- TFHE.allowThis(result);
- res8 = result;
- }
- function sub_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint8 result = TFHE.sub(aProc, bProc);
- TFHE.allowThis(result);
- res8 = result;
- }
- function mul_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- uint8 bProc = b;
- euint8 result = TFHE.mul(aProc, bProc);
- TFHE.allowThis(result);
- res8 = result;
- }
- function mul_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint8 result = TFHE.mul(aProc, bProc);
- TFHE.allowThis(result);
- res8 = result;
- }
- function div_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- uint8 bProc = b;
- euint8 result = TFHE.div(aProc, bProc);
- TFHE.allowThis(result);
- res8 = result;
- }
- function rem_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- uint8 bProc = b;
- euint8 result = TFHE.rem(aProc, bProc);
- TFHE.allowThis(result);
- res8 = result;
- }
- function eq_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- uint8 bProc = b;
- ebool result = TFHE.eq(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function eq_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- ebool result = TFHE.eq(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function ne_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- uint8 bProc = b;
- ebool result = TFHE.ne(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function ne_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- ebool result = TFHE.ne(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function ge_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- uint8 bProc = b;
- ebool result = TFHE.ge(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function ge_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- ebool result = TFHE.ge(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function gt_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- uint8 bProc = b;
- ebool result = TFHE.gt(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function gt_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- ebool result = TFHE.gt(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function le_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- uint8 bProc = b;
- ebool result = TFHE.le(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function le_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- ebool result = TFHE.le(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function lt_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- uint8 bProc = b;
- ebool result = TFHE.lt(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function lt_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- ebool result = TFHE.lt(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function min_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- uint8 bProc = b;
- euint8 result = TFHE.min(aProc, bProc);
- TFHE.allowThis(result);
- res8 = result;
- }
- function min_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint8 result = TFHE.min(aProc, bProc);
- TFHE.allowThis(result);
- res8 = result;
- }
- function max_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- uint8 bProc = b;
- euint8 result = TFHE.max(aProc, bProc);
- TFHE.allowThis(result);
- res8 = result;
- }
- function max_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
- uint8 aProc = a;
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint8 result = TFHE.max(aProc, bProc);
- TFHE.allowThis(result);
- res8 = result;
- }
- function add_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint16 result = TFHE.add(aProc, bProc);
- TFHE.allowThis(result);
- res16 = result;
- }
- function sub_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint16 result = TFHE.sub(aProc, bProc);
- TFHE.allowThis(result);
- res16 = result;
- }
- function mul_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint16 result = TFHE.mul(aProc, bProc);
- TFHE.allowThis(result);
- res16 = result;
- }
- function and_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint16 result = TFHE.and(aProc, bProc);
- TFHE.allowThis(result);
- res16 = result;
- }
- function or_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint16 result = TFHE.or(aProc, bProc);
- TFHE.allowThis(result);
- res16 = result;
- }
- function xor_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint16 result = TFHE.xor(aProc, bProc);
- TFHE.allowThis(result);
- res16 = result;
- }
- function eq_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- ebool result = TFHE.eq(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function ne_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- ebool result = TFHE.ne(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function ge_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- ebool result = TFHE.ge(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function gt_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- ebool result = TFHE.gt(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function le_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- ebool result = TFHE.le(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function lt_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- ebool result = TFHE.lt(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
}
diff --git a/examples/tests/TFHETestSuite3.sol b/examples/tests/TFHETestSuite3.sol
index c3836358..cd2a3825 100644
--- a/examples/tests/TFHETestSuite3.sol
+++ b/examples/tests/TFHETestSuite3.sol
@@ -10,709 +10,641 @@ contract TFHETestSuite3 {
euint16 public res16;
euint32 public res32;
euint64 public res64;
+ euint128 public res128;
+ euint256 public res256;
constructor() {
TFHE.setFHEVM(FHEVMConfig.defaultConfig());
}
- function min_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint16 result = TFHE.min(aProc, bProc);
+ function le_euint8_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ resb = result;
}
- function max_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint16 result = TFHE.max(aProc, bProc);
+ function lt_euint8_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ resb = result;
}
- function add_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint16 result = TFHE.add(aProc, bProc);
+ function min_euint8_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint32 result = TFHE.min(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res32 = result;
}
- function sub_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint16 result = TFHE.sub(aProc, bProc);
+ function max_euint8_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint32 result = TFHE.max(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res32 = result;
}
- function mul_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint16 result = TFHE.mul(aProc, bProc);
+ function add_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res64 = result;
}
- function and_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint16 result = TFHE.and(aProc, bProc);
+ function sub_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res64 = result;
}
- function or_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint16 result = TFHE.or(aProc, bProc);
+ function mul_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res64 = result;
}
- function xor_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint16 result = TFHE.xor(aProc, bProc);
+ function and_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res64 = result;
}
- function eq_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
+ function or_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function xor_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function eq_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ne_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
+ function ne_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
ebool result = TFHE.ne(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ge_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
+ function ge_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
ebool result = TFHE.ge(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function gt_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
+ function gt_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
ebool result = TFHE.gt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function le_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
+ function le_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
ebool result = TFHE.le(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function lt_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
+ function lt_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
ebool result = TFHE.lt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function min_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint16 result = TFHE.min(aProc, bProc);
+ function min_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.min(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res64 = result;
}
- function max_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint16 result = TFHE.max(aProc, bProc);
+ function max_euint8_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.max(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res64 = result;
}
- function add_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint16 result = TFHE.add(aProc, bProc);
+ function add_euint8_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res128 = result;
}
- function sub_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint16 result = TFHE.sub(aProc, bProc);
+ function sub_euint8_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res128 = result;
}
- function mul_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint16 result = TFHE.mul(aProc, bProc);
+ function mul_euint8_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res128 = result;
}
- function and_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint16 result = TFHE.and(aProc, bProc);
+ function and_euint8_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res128 = result;
}
- function or_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint16 result = TFHE.or(aProc, bProc);
+ function or_euint8_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res128 = result;
}
- function xor_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint16 result = TFHE.xor(aProc, bProc);
+ function xor_euint8_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.xor(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res128 = result;
}
- function eq_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint16 bProc = TFHE.asEuint16(b, inputProof);
+ function eq_euint8_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ne_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint16 bProc = TFHE.asEuint16(b, inputProof);
+ function ne_euint8_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
ebool result = TFHE.ne(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ge_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint16 bProc = TFHE.asEuint16(b, inputProof);
+ function ge_euint8_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
ebool result = TFHE.ge(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function gt_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint16 bProc = TFHE.asEuint16(b, inputProof);
+ function gt_euint8_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
ebool result = TFHE.gt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function le_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint16 bProc = TFHE.asEuint16(b, inputProof);
+ function le_euint8_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
ebool result = TFHE.le(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function lt_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint16 bProc = TFHE.asEuint16(b, inputProof);
+ function lt_euint8_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
ebool result = TFHE.lt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function min_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint16 result = TFHE.min(aProc, bProc);
+ function min_euint8_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.min(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res128 = result;
}
- function max_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint16 result = TFHE.max(aProc, bProc);
+ function max_euint8_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.max(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res128 = result;
}
- function add_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint32 result = TFHE.add(aProc, bProc);
+ function add_euint8_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res256 = result;
}
- function sub_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint32 result = TFHE.sub(aProc, bProc);
+ function sub_euint8_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res256 = result;
}
- function mul_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint32 result = TFHE.mul(aProc, bProc);
+ function mul_euint8_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res256 = result;
}
- function and_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint32 result = TFHE.and(aProc, bProc);
+ function and_euint8_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res256 = result;
}
- function or_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint32 result = TFHE.or(aProc, bProc);
+ function or_euint8_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res256 = result;
}
- function xor_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint32 result = TFHE.xor(aProc, bProc);
+ function xor_euint8_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.xor(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res256 = result;
}
- function eq_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
+ function eq_euint8_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ne_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
+ function ne_euint8_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
ebool result = TFHE.ne(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ge_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
+ function ge_euint8_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
ebool result = TFHE.ge(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function gt_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
+ function gt_euint8_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
ebool result = TFHE.gt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function le_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
+ function le_euint8_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
ebool result = TFHE.le(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function lt_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
+ function lt_euint8_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
ebool result = TFHE.lt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function min_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint32 result = TFHE.min(aProc, bProc);
+ function min_euint8_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.min(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res256 = result;
}
- function max_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint32 result = TFHE.max(aProc, bProc);
+ function max_euint8_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.max(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res256 = result;
}
- function add_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.add(aProc, bProc);
+ function add_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ uint8 bProc = b;
+ euint8 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res8 = result;
}
- function sub_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.sub(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function mul_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.mul(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function and_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.and(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function or_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.or(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function xor_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.xor(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function eq_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- ebool result = TFHE.eq(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function ne_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- ebool result = TFHE.ne(aProc, bProc);
+ function add_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint8 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
- resb = result;
+ res8 = result;
}
- function ge_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- ebool result = TFHE.ge(aProc, bProc);
+ function sub_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ uint8 bProc = b;
+ euint8 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
- resb = result;
+ res8 = result;
}
- function gt_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- ebool result = TFHE.gt(aProc, bProc);
+ function sub_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint8 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
- resb = result;
+ res8 = result;
}
- function le_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- ebool result = TFHE.le(aProc, bProc);
+ function mul_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ uint8 bProc = b;
+ euint8 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
- resb = result;
+ res8 = result;
}
- function lt_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- ebool result = TFHE.lt(aProc, bProc);
+ function mul_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint8 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
- resb = result;
+ res8 = result;
}
- function min_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.min(aProc, bProc);
+ function div_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ uint8 bProc = b;
+ euint8 result = TFHE.div(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res8 = result;
}
- function max_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.max(aProc, bProc);
+ function rem_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ uint8 bProc = b;
+ euint8 result = TFHE.rem(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res8 = result;
}
- function add_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- uint16 bProc = b;
- euint16 result = TFHE.add(aProc, bProc);
+ function and_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ uint8 bProc = b;
+ euint8 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res8 = result;
}
- function add_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
- uint16 aProc = a;
- euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint16 result = TFHE.add(aProc, bProc);
+ function and_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint8 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res8 = result;
}
- function sub_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- uint16 bProc = b;
- euint16 result = TFHE.sub(aProc, bProc);
+ function or_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ uint8 bProc = b;
+ euint8 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res8 = result;
}
- function sub_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
- uint16 aProc = a;
- euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint16 result = TFHE.sub(aProc, bProc);
- TFHE.allowThis(result);
- res16 = result;
- }
- function mul_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- uint16 bProc = b;
- euint16 result = TFHE.mul(aProc, bProc);
+ function or_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint8 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res8 = result;
}
- function mul_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
- uint16 aProc = a;
- euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint16 result = TFHE.mul(aProc, bProc);
+ function xor_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ uint8 bProc = b;
+ euint8 result = TFHE.xor(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res8 = result;
}
- function div_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- uint16 bProc = b;
- euint16 result = TFHE.div(aProc, bProc);
- TFHE.allowThis(result);
- res16 = result;
- }
- function rem_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- uint16 bProc = b;
- euint16 result = TFHE.rem(aProc, bProc);
+ function xor_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint8 result = TFHE.xor(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res8 = result;
}
- function eq_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- uint16 bProc = b;
+ function eq_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ uint8 bProc = b;
ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function eq_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
- uint16 aProc = a;
- euint16 bProc = TFHE.asEuint16(b, inputProof);
+ function eq_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ne_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- uint16 bProc = b;
+ function ne_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ uint8 bProc = b;
ebool result = TFHE.ne(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ne_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
- uint16 aProc = a;
- euint16 bProc = TFHE.asEuint16(b, inputProof);
+ function ne_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
ebool result = TFHE.ne(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ge_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- uint16 bProc = b;
+ function ge_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ uint8 bProc = b;
ebool result = TFHE.ge(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ge_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
- uint16 aProc = a;
- euint16 bProc = TFHE.asEuint16(b, inputProof);
+ function ge_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
ebool result = TFHE.ge(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function gt_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- uint16 bProc = b;
+ function gt_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ uint8 bProc = b;
ebool result = TFHE.gt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function gt_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
- uint16 aProc = a;
- euint16 bProc = TFHE.asEuint16(b, inputProof);
+ function gt_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
ebool result = TFHE.gt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function le_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- uint16 bProc = b;
+ function le_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ uint8 bProc = b;
ebool result = TFHE.le(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function le_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
- uint16 aProc = a;
- euint16 bProc = TFHE.asEuint16(b, inputProof);
+ function le_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
ebool result = TFHE.le(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function lt_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- uint16 bProc = b;
+ function lt_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ uint8 bProc = b;
ebool result = TFHE.lt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function lt_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
- uint16 aProc = a;
- euint16 bProc = TFHE.asEuint16(b, inputProof);
+ function lt_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
ebool result = TFHE.lt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function min_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- uint16 bProc = b;
- euint16 result = TFHE.min(aProc, bProc);
+ function min_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ uint8 bProc = b;
+ euint8 result = TFHE.min(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res8 = result;
}
- function min_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
- uint16 aProc = a;
- euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint16 result = TFHE.min(aProc, bProc);
+ function min_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint8 result = TFHE.min(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res8 = result;
}
- function max_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- uint16 bProc = b;
- euint16 result = TFHE.max(aProc, bProc);
+ function max_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ euint8 aProc = TFHE.asEuint8(a, inputProof);
+ uint8 bProc = b;
+ euint8 result = TFHE.max(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res8 = result;
}
- function max_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
- uint16 aProc = a;
- euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint16 result = TFHE.max(aProc, bProc);
+ function max_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public {
+ uint8 aProc = a;
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint8 result = TFHE.max(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res8 = result;
}
- function add_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function add_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint32 result = TFHE.add(aProc, bProc);
+ euint16 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res16 = result;
}
- function sub_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function sub_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint32 result = TFHE.sub(aProc, bProc);
+ euint16 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res16 = result;
}
- function mul_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function mul_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint32 result = TFHE.mul(aProc, bProc);
+ euint16 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res16 = result;
}
- function and_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function and_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint32 result = TFHE.and(aProc, bProc);
+ euint16 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res16 = result;
}
- function or_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function or_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint32 result = TFHE.or(aProc, bProc);
+ euint16 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res16 = result;
}
- function xor_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function xor_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint32 result = TFHE.xor(aProc, bProc);
+ euint16 result = TFHE.xor(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res16 = result;
}
- function eq_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function eq_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint4 bProc = TFHE.asEuint4(b, inputProof);
ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ne_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function ne_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint4 bProc = TFHE.asEuint4(b, inputProof);
ebool result = TFHE.ne(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ge_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function ge_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint4 bProc = TFHE.asEuint4(b, inputProof);
ebool result = TFHE.ge(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function gt_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function gt_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint4 bProc = TFHE.asEuint4(b, inputProof);
ebool result = TFHE.gt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function le_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function le_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint4 bProc = TFHE.asEuint4(b, inputProof);
ebool result = TFHE.le(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function lt_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function lt_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint4 bProc = TFHE.asEuint4(b, inputProof);
ebool result = TFHE.lt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function min_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function min_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint32 result = TFHE.min(aProc, bProc);
+ euint16 result = TFHE.min(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res16 = result;
}
- function max_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function max_euint16_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint32 result = TFHE.max(aProc, bProc);
- TFHE.allowThis(result);
- res32 = result;
- }
- function add_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint32 result = TFHE.add(aProc, bProc);
- TFHE.allowThis(result);
- res32 = result;
- }
- function sub_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint32 result = TFHE.sub(aProc, bProc);
- TFHE.allowThis(result);
- res32 = result;
- }
- function mul_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint32 result = TFHE.mul(aProc, bProc);
- TFHE.allowThis(result);
- res32 = result;
- }
- function and_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint32 result = TFHE.and(aProc, bProc);
+ euint16 result = TFHE.max(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res16 = result;
}
}
diff --git a/examples/tests/TFHETestSuite4.sol b/examples/tests/TFHETestSuite4.sol
index 9224da21..d4def3c5 100644
--- a/examples/tests/TFHETestSuite4.sol
+++ b/examples/tests/TFHETestSuite4.sol
@@ -10,709 +10,641 @@ contract TFHETestSuite4 {
euint16 public res16;
euint32 public res32;
euint64 public res64;
+ euint128 public res128;
+ euint256 public res256;
constructor() {
TFHE.setFHEVM(FHEVMConfig.defaultConfig());
}
- function or_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function add_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint32 result = TFHE.or(aProc, bProc);
+ euint16 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res16 = result;
}
- function xor_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function sub_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint32 result = TFHE.xor(aProc, bProc);
+ euint16 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res16 = result;
+ }
+ function mul_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint16 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res16 = result;
+ }
+ function and_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint16 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res16 = result;
}
- function eq_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function or_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint16 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res16 = result;
+ }
+ function xor_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint16 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res16 = result;
+ }
+ function eq_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint8 bProc = TFHE.asEuint8(b, inputProof);
ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ne_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function ne_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint8 bProc = TFHE.asEuint8(b, inputProof);
ebool result = TFHE.ne(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ge_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function ge_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint8 bProc = TFHE.asEuint8(b, inputProof);
ebool result = TFHE.ge(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function gt_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function gt_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint8 bProc = TFHE.asEuint8(b, inputProof);
ebool result = TFHE.gt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function le_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function le_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint8 bProc = TFHE.asEuint8(b, inputProof);
ebool result = TFHE.le(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function lt_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function lt_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint8 bProc = TFHE.asEuint8(b, inputProof);
ebool result = TFHE.lt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function min_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function min_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint32 result = TFHE.min(aProc, bProc);
+ euint16 result = TFHE.min(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res16 = result;
}
- function max_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function max_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint32 result = TFHE.max(aProc, bProc);
+ euint16 result = TFHE.max(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res16 = result;
}
- function add_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function add_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint32 result = TFHE.add(aProc, bProc);
+ euint16 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res16 = result;
}
- function sub_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function sub_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint32 result = TFHE.sub(aProc, bProc);
+ euint16 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res16 = result;
}
- function mul_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function mul_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint32 result = TFHE.mul(aProc, bProc);
+ euint16 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res16 = result;
}
- function and_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function and_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint32 result = TFHE.and(aProc, bProc);
+ euint16 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res16 = result;
}
- function or_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function or_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint32 result = TFHE.or(aProc, bProc);
+ euint16 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res16 = result;
}
- function xor_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function xor_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint32 result = TFHE.xor(aProc, bProc);
+ euint16 result = TFHE.xor(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res16 = result;
}
- function eq_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function eq_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint16 bProc = TFHE.asEuint16(b, inputProof);
ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ne_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function ne_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint16 bProc = TFHE.asEuint16(b, inputProof);
ebool result = TFHE.ne(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ge_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function ge_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint16 bProc = TFHE.asEuint16(b, inputProof);
ebool result = TFHE.ge(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function gt_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function gt_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint16 bProc = TFHE.asEuint16(b, inputProof);
ebool result = TFHE.gt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function le_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function le_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint16 bProc = TFHE.asEuint16(b, inputProof);
ebool result = TFHE.le(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function lt_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function lt_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint16 bProc = TFHE.asEuint16(b, inputProof);
ebool result = TFHE.lt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function min_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function min_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint32 result = TFHE.min(aProc, bProc);
+ euint16 result = TFHE.min(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res16 = result;
}
- function max_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function max_euint16_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint32 result = TFHE.max(aProc, bProc);
+ euint16 result = TFHE.max(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res16 = result;
}
- function add_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function add_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint32 bProc = TFHE.asEuint32(b, inputProof);
euint32 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
res32 = result;
}
- function sub_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function sub_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint32 bProc = TFHE.asEuint32(b, inputProof);
euint32 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
res32 = result;
}
- function mul_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function mul_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint32 bProc = TFHE.asEuint32(b, inputProof);
euint32 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
res32 = result;
}
- function and_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function and_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint32 bProc = TFHE.asEuint32(b, inputProof);
euint32 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
res32 = result;
}
- function or_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function or_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint32 bProc = TFHE.asEuint32(b, inputProof);
euint32 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
res32 = result;
}
- function xor_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function xor_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint32 bProc = TFHE.asEuint32(b, inputProof);
euint32 result = TFHE.xor(aProc, bProc);
TFHE.allowThis(result);
res32 = result;
}
- function eq_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function eq_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint32 bProc = TFHE.asEuint32(b, inputProof);
ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ne_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function ne_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint32 bProc = TFHE.asEuint32(b, inputProof);
ebool result = TFHE.ne(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ge_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function ge_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint32 bProc = TFHE.asEuint32(b, inputProof);
ebool result = TFHE.ge(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function gt_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function gt_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint32 bProc = TFHE.asEuint32(b, inputProof);
ebool result = TFHE.gt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function le_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function le_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint32 bProc = TFHE.asEuint32(b, inputProof);
ebool result = TFHE.le(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function lt_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function lt_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint32 bProc = TFHE.asEuint32(b, inputProof);
ebool result = TFHE.lt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function min_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function min_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint32 bProc = TFHE.asEuint32(b, inputProof);
euint32 result = TFHE.min(aProc, bProc);
TFHE.allowThis(result);
res32 = result;
}
- function max_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function max_euint16_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint32 bProc = TFHE.asEuint32(b, inputProof);
euint32 result = TFHE.max(aProc, bProc);
TFHE.allowThis(result);
res32 = result;
}
- function add_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function add_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint64 bProc = TFHE.asEuint64(b, inputProof);
euint64 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
res64 = result;
}
- function sub_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function sub_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint64 bProc = TFHE.asEuint64(b, inputProof);
euint64 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
res64 = result;
}
- function mul_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function mul_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint64 bProc = TFHE.asEuint64(b, inputProof);
euint64 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
res64 = result;
}
- function and_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function and_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint64 bProc = TFHE.asEuint64(b, inputProof);
euint64 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
res64 = result;
}
- function or_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function or_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint64 bProc = TFHE.asEuint64(b, inputProof);
euint64 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
res64 = result;
}
- function xor_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function xor_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint64 bProc = TFHE.asEuint64(b, inputProof);
euint64 result = TFHE.xor(aProc, bProc);
TFHE.allowThis(result);
res64 = result;
}
- function eq_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function eq_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint64 bProc = TFHE.asEuint64(b, inputProof);
ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ne_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function ne_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint64 bProc = TFHE.asEuint64(b, inputProof);
ebool result = TFHE.ne(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ge_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function ge_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint64 bProc = TFHE.asEuint64(b, inputProof);
ebool result = TFHE.ge(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function gt_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function gt_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint64 bProc = TFHE.asEuint64(b, inputProof);
ebool result = TFHE.gt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function le_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function le_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint64 bProc = TFHE.asEuint64(b, inputProof);
ebool result = TFHE.le(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function lt_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function lt_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint64 bProc = TFHE.asEuint64(b, inputProof);
ebool result = TFHE.lt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function min_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function min_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint64 bProc = TFHE.asEuint64(b, inputProof);
euint64 result = TFHE.min(aProc, bProc);
TFHE.allowThis(result);
res64 = result;
}
- function max_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
+ function max_euint16_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
euint64 bProc = TFHE.asEuint64(b, inputProof);
euint64 result = TFHE.max(aProc, bProc);
TFHE.allowThis(result);
res64 = result;
}
- function add_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
- uint32 bProc = b;
- euint32 result = TFHE.add(aProc, bProc);
+ function add_euint16_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res128 = result;
}
- function add_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
- uint32 aProc = a;
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint32 result = TFHE.add(aProc, bProc);
+ function sub_euint16_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
- }
- function sub_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
- uint32 bProc = b;
- euint32 result = TFHE.sub(aProc, bProc);
- TFHE.allowThis(result);
- res32 = result;
- }
- function sub_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
- uint32 aProc = a;
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint32 result = TFHE.sub(aProc, bProc);
- TFHE.allowThis(result);
- res32 = result;
+ res128 = result;
}
- function mul_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
- uint32 bProc = b;
- euint32 result = TFHE.mul(aProc, bProc);
+ function mul_euint16_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res128 = result;
}
- function mul_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
- uint32 aProc = a;
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint32 result = TFHE.mul(aProc, bProc);
+ function and_euint16_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res128 = result;
}
- function div_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
- uint32 bProc = b;
- euint32 result = TFHE.div(aProc, bProc);
+ function or_euint16_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res128 = result;
}
- function rem_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
- uint32 bProc = b;
- euint32 result = TFHE.rem(aProc, bProc);
+ function xor_euint16_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.xor(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res128 = result;
}
- function eq_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
- uint32 bProc = b;
+ function eq_euint16_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function eq_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
- uint32 aProc = a;
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- ebool result = TFHE.eq(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function ne_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
- uint32 bProc = b;
- ebool result = TFHE.ne(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function ne_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
- uint32 aProc = a;
- euint32 bProc = TFHE.asEuint32(b, inputProof);
+ function ne_euint16_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
ebool result = TFHE.ne(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ge_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
- uint32 bProc = b;
+ function ge_euint16_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
ebool result = TFHE.ge(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ge_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
- uint32 aProc = a;
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- ebool result = TFHE.ge(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function gt_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
- uint32 bProc = b;
+ function gt_euint16_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
ebool result = TFHE.gt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function gt_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
- uint32 aProc = a;
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- ebool result = TFHE.gt(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function le_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
- uint32 bProc = b;
- ebool result = TFHE.le(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function le_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
- uint32 aProc = a;
- euint32 bProc = TFHE.asEuint32(b, inputProof);
+ function le_euint16_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
ebool result = TFHE.le(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function lt_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
- uint32 bProc = b;
- ebool result = TFHE.lt(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function lt_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
- uint32 aProc = a;
- euint32 bProc = TFHE.asEuint32(b, inputProof);
+ function lt_euint16_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
ebool result = TFHE.lt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function min_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
- uint32 bProc = b;
- euint32 result = TFHE.min(aProc, bProc);
- TFHE.allowThis(result);
- res32 = result;
- }
- function min_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
- uint32 aProc = a;
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint32 result = TFHE.min(aProc, bProc);
- TFHE.allowThis(result);
- res32 = result;
- }
- function max_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
- uint32 bProc = b;
- euint32 result = TFHE.max(aProc, bProc);
+ function min_euint16_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.min(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res128 = result;
}
- function max_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
- uint32 aProc = a;
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint32 result = TFHE.max(aProc, bProc);
+ function max_euint16_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.max(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res128 = result;
}
- function add_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint64 result = TFHE.add(aProc, bProc);
+ function add_euint16_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res256 = result;
}
- function sub_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint64 result = TFHE.sub(aProc, bProc);
+ function sub_euint16_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res256 = result;
}
- function mul_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint64 result = TFHE.mul(aProc, bProc);
+ function mul_euint16_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res256 = result;
}
- function and_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint64 result = TFHE.and(aProc, bProc);
+ function and_euint16_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res256 = result;
}
- function or_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint64 result = TFHE.or(aProc, bProc);
+ function or_euint16_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res256 = result;
}
- function xor_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint64 result = TFHE.xor(aProc, bProc);
+ function xor_euint16_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.xor(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res256 = result;
}
- function eq_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
+ function eq_euint16_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ne_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
+ function ne_euint16_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
ebool result = TFHE.ne(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ge_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
+ function ge_euint16_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
ebool result = TFHE.ge(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function gt_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
+ function gt_euint16_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
ebool result = TFHE.gt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function le_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
+ function le_euint16_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
ebool result = TFHE.le(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function lt_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
+ function lt_euint16_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
ebool result = TFHE.lt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function min_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint64 result = TFHE.min(aProc, bProc);
+ function min_euint16_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.min(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res256 = result;
}
- function max_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint4 bProc = TFHE.asEuint4(b, inputProof);
- euint64 result = TFHE.max(aProc, bProc);
+ function max_euint16_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.max(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res256 = result;
}
- function add_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint64 result = TFHE.add(aProc, bProc);
+ function add_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ uint16 bProc = b;
+ euint16 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
- }
- function sub_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint64 result = TFHE.sub(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function mul_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint64 result = TFHE.mul(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function and_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint64 result = TFHE.and(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
+ res16 = result;
}
- function or_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint64 result = TFHE.or(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function xor_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint64 result = TFHE.xor(aProc, bProc);
+ function add_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
+ uint16 aProc = a;
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint16 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res16 = result;
}
- function eq_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- ebool result = TFHE.eq(aProc, bProc);
+ function sub_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ uint16 bProc = b;
+ euint16 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
- resb = result;
+ res16 = result;
}
- function ne_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- ebool result = TFHE.ne(aProc, bProc);
+ function sub_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
+ uint16 aProc = a;
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint16 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
- resb = result;
+ res16 = result;
}
- function ge_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- ebool result = TFHE.ge(aProc, bProc);
+ function mul_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ uint16 bProc = b;
+ euint16 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
- resb = result;
+ res16 = result;
}
- function gt_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- ebool result = TFHE.gt(aProc, bProc);
+ function mul_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
+ uint16 aProc = a;
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint16 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
- resb = result;
+ res16 = result;
}
}
diff --git a/examples/tests/TFHETestSuite5.sol b/examples/tests/TFHETestSuite5.sol
index e1782ede..0947c208 100644
--- a/examples/tests/TFHETestSuite5.sol
+++ b/examples/tests/TFHETestSuite5.sol
@@ -10,709 +10,641 @@ contract TFHETestSuite5 {
euint16 public res16;
euint32 public res32;
euint64 public res64;
+ euint128 public res128;
+ euint256 public res256;
constructor() {
TFHE.setFHEVM(FHEVMConfig.defaultConfig());
}
- function le_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- ebool result = TFHE.le(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function lt_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- ebool result = TFHE.lt(aProc, bProc);
+ function div_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ uint16 bProc = b;
+ euint16 result = TFHE.div(aProc, bProc);
TFHE.allowThis(result);
- resb = result;
+ res16 = result;
}
- function min_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint64 result = TFHE.min(aProc, bProc);
+ function rem_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ uint16 bProc = b;
+ euint16 result = TFHE.rem(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res16 = result;
}
- function max_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint64 result = TFHE.max(aProc, bProc);
+ function and_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ uint16 bProc = b;
+ euint16 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res16 = result;
}
- function add_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
+ function and_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
+ uint16 aProc = a;
euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint64 result = TFHE.add(aProc, bProc);
+ euint16 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res16 = result;
}
- function sub_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint64 result = TFHE.sub(aProc, bProc);
+ function or_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ uint16 bProc = b;
+ euint16 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res16 = result;
}
- function mul_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
+ function or_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
+ uint16 aProc = a;
euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint64 result = TFHE.mul(aProc, bProc);
+ euint16 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res16 = result;
}
- function and_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint64 result = TFHE.and(aProc, bProc);
+ function xor_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ uint16 bProc = b;
+ euint16 result = TFHE.xor(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res16 = result;
}
- function or_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
+ function xor_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
+ uint16 aProc = a;
euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint64 result = TFHE.or(aProc, bProc);
+ euint16 result = TFHE.xor(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res16 = result;
}
- function xor_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint64 result = TFHE.xor(aProc, bProc);
+ function eq_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ uint16 bProc = b;
+ ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ resb = result;
}
- function eq_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
+ function eq_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
+ uint16 aProc = a;
euint16 bProc = TFHE.asEuint16(b, inputProof);
ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ne_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
+ function ne_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ uint16 bProc = b;
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
+ uint16 aProc = a;
euint16 bProc = TFHE.asEuint16(b, inputProof);
ebool result = TFHE.ne(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ge_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
+ function ge_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ uint16 bProc = b;
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
+ uint16 aProc = a;
euint16 bProc = TFHE.asEuint16(b, inputProof);
ebool result = TFHE.ge(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function gt_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
+ function gt_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ uint16 bProc = b;
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
+ uint16 aProc = a;
euint16 bProc = TFHE.asEuint16(b, inputProof);
ebool result = TFHE.gt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function le_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
+ function le_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ uint16 bProc = b;
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
+ uint16 aProc = a;
euint16 bProc = TFHE.asEuint16(b, inputProof);
ebool result = TFHE.le(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function lt_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
+ function lt_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ uint16 bProc = b;
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
+ uint16 aProc = a;
euint16 bProc = TFHE.asEuint16(b, inputProof);
ebool result = TFHE.lt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function min_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
+ function min_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ uint16 bProc = b;
+ euint16 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res16 = result;
+ }
+ function min_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
+ uint16 aProc = a;
euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint64 result = TFHE.min(aProc, bProc);
+ euint16 result = TFHE.min(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res16 = result;
}
- function max_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
+ function max_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public {
+ euint16 aProc = TFHE.asEuint16(a, inputProof);
+ uint16 bProc = b;
+ euint16 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res16 = result;
+ }
+ function max_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public {
+ uint16 aProc = a;
euint16 bProc = TFHE.asEuint16(b, inputProof);
- euint64 result = TFHE.max(aProc, bProc);
+ euint16 result = TFHE.max(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res16 = result;
}
- function add_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint64 result = TFHE.add(aProc, bProc);
+ function add_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint32 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function sub_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint64 result = TFHE.sub(aProc, bProc);
+ function sub_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint32 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function mul_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint64 result = TFHE.mul(aProc, bProc);
+ function mul_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint32 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function and_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint64 result = TFHE.and(aProc, bProc);
+ function and_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint32 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function or_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint64 result = TFHE.or(aProc, bProc);
+ function or_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint32 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function xor_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint64 result = TFHE.xor(aProc, bProc);
+ function xor_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint32 result = TFHE.xor(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function eq_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
+ function eq_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ne_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
+ function ne_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
ebool result = TFHE.ne(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ge_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
+ function ge_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
ebool result = TFHE.ge(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function gt_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
+ function gt_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
ebool result = TFHE.gt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function le_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
+ function le_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
ebool result = TFHE.le(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function lt_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
+ function lt_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
ebool result = TFHE.lt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function min_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint64 result = TFHE.min(aProc, bProc);
+ function min_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint32 result = TFHE.min(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function max_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint32 bProc = TFHE.asEuint32(b, inputProof);
- euint64 result = TFHE.max(aProc, bProc);
+ function max_euint32_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint32 result = TFHE.max(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function add_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.add(aProc, bProc);
+ function add_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint32 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function sub_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.sub(aProc, bProc);
+ function sub_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint32 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function mul_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.mul(aProc, bProc);
+ function mul_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint32 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function and_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.and(aProc, bProc);
+ function and_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint32 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function or_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.or(aProc, bProc);
+ function or_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint32 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function xor_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.xor(aProc, bProc);
+ function xor_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint32 result = TFHE.xor(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function eq_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
+ function eq_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ne_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
+ function ne_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
ebool result = TFHE.ne(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ge_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
+ function ge_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
ebool result = TFHE.ge(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function gt_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
+ function gt_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
ebool result = TFHE.gt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function le_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
+ function le_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
ebool result = TFHE.le(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function lt_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
+ function lt_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
ebool result = TFHE.lt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function min_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.min(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function max_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.max(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function add_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- uint64 bProc = b;
- euint64 result = TFHE.add(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function add_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
- uint64 aProc = a;
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.add(aProc, bProc);
+ function min_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint32 result = TFHE.min(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function sub_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- uint64 bProc = b;
- euint64 result = TFHE.sub(aProc, bProc);
+ function max_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint32 result = TFHE.max(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function sub_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
- uint64 aProc = a;
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.sub(aProc, bProc);
+ function add_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint32 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function mul_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- uint64 bProc = b;
- euint64 result = TFHE.mul(aProc, bProc);
+ function sub_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint32 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function mul_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
- uint64 aProc = a;
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.mul(aProc, bProc);
+ function mul_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint32 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function div_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- uint64 bProc = b;
- euint64 result = TFHE.div(aProc, bProc);
+ function and_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint32 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function rem_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- uint64 bProc = b;
- euint64 result = TFHE.rem(aProc, bProc);
+ function or_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint32 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ res32 = result;
}
- function eq_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- uint64 bProc = b;
- ebool result = TFHE.eq(aProc, bProc);
+ function xor_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint32 result = TFHE.xor(aProc, bProc);
TFHE.allowThis(result);
- resb = result;
+ res32 = result;
}
- function eq_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
- uint64 aProc = a;
- euint64 bProc = TFHE.asEuint64(b, inputProof);
+ function eq_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ne_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- uint64 bProc = b;
- ebool result = TFHE.ne(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function ne_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
- uint64 aProc = a;
- euint64 bProc = TFHE.asEuint64(b, inputProof);
+ function ne_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
ebool result = TFHE.ne(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function ge_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- uint64 bProc = b;
- ebool result = TFHE.ge(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function ge_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
- uint64 aProc = a;
- euint64 bProc = TFHE.asEuint64(b, inputProof);
+ function ge_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
ebool result = TFHE.ge(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function gt_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- uint64 bProc = b;
- ebool result = TFHE.gt(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function gt_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
- uint64 aProc = a;
- euint64 bProc = TFHE.asEuint64(b, inputProof);
+ function gt_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
ebool result = TFHE.gt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function le_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- uint64 bProc = b;
- ebool result = TFHE.le(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function le_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
- uint64 aProc = a;
- euint64 bProc = TFHE.asEuint64(b, inputProof);
+ function le_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
ebool result = TFHE.le(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function lt_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- uint64 bProc = b;
- ebool result = TFHE.lt(aProc, bProc);
- TFHE.allowThis(result);
- resb = result;
- }
- function lt_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
- uint64 aProc = a;
- euint64 bProc = TFHE.asEuint64(b, inputProof);
+ function lt_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
ebool result = TFHE.lt(aProc, bProc);
TFHE.allowThis(result);
resb = result;
}
- function min_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- uint64 bProc = b;
- euint64 result = TFHE.min(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function min_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
- uint64 aProc = a;
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.min(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function max_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- uint64 bProc = b;
- euint64 result = TFHE.max(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function max_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
- uint64 aProc = a;
- euint64 bProc = TFHE.asEuint64(b, inputProof);
- euint64 result = TFHE.max(aProc, bProc);
- TFHE.allowThis(result);
- res64 = result;
- }
- function shl_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint4 aProc = TFHE.asEuint4(a, inputProof);
- uint8 bProc = b;
- euint4 result = TFHE.shl(aProc, bProc);
- TFHE.allowThis(result);
- res4 = result;
- }
- function shr_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint4 aProc = TFHE.asEuint4(a, inputProof);
- uint8 bProc = b;
- euint4 result = TFHE.shr(aProc, bProc);
- TFHE.allowThis(result);
- res4 = result;
- }
- function rotl_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint4 aProc = TFHE.asEuint4(a, inputProof);
- uint8 bProc = b;
- euint4 result = TFHE.rotl(aProc, bProc);
- TFHE.allowThis(result);
- res4 = result;
- }
- function rotr_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint4 aProc = TFHE.asEuint4(a, inputProof);
- uint8 bProc = b;
- euint4 result = TFHE.rotr(aProc, bProc);
- TFHE.allowThis(result);
- res4 = result;
- }
- function shl_euint8_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint8 result = TFHE.shl(aProc, bProc);
+ function min_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint32 result = TFHE.min(aProc, bProc);
TFHE.allowThis(result);
- res8 = result;
+ res32 = result;
}
- function shl_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- uint8 bProc = b;
- euint8 result = TFHE.shl(aProc, bProc);
+ function max_euint32_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint32 result = TFHE.max(aProc, bProc);
TFHE.allowThis(result);
- res8 = result;
+ res32 = result;
}
- function shr_euint8_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint8 result = TFHE.shr(aProc, bProc);
+ function add_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint32 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
- res8 = result;
+ res32 = result;
}
- function shr_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- uint8 bProc = b;
- euint8 result = TFHE.shr(aProc, bProc);
+ function sub_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint32 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
- res8 = result;
+ res32 = result;
}
- function rotl_euint8_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint8 result = TFHE.rotl(aProc, bProc);
+ function mul_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint32 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
- res8 = result;
+ res32 = result;
}
- function rotl_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- uint8 bProc = b;
- euint8 result = TFHE.rotl(aProc, bProc);
+ function and_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint32 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
- res8 = result;
+ res32 = result;
}
- function rotr_euint8_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint8 result = TFHE.rotr(aProc, bProc);
+ function or_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint32 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
- res8 = result;
+ res32 = result;
}
- function rotr_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- uint8 bProc = b;
- euint8 result = TFHE.rotr(aProc, bProc);
+ function xor_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint32 result = TFHE.xor(aProc, bProc);
TFHE.allowThis(result);
- res8 = result;
+ res32 = result;
}
- function shl_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint16 result = TFHE.shl(aProc, bProc);
+ function eq_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ resb = result;
}
- function shl_euint16_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- uint8 bProc = b;
- euint16 result = TFHE.shl(aProc, bProc);
+ function ne_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ resb = result;
}
- function shr_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint16 result = TFHE.shr(aProc, bProc);
+ function ge_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ resb = result;
}
- function shr_euint16_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- uint8 bProc = b;
- euint16 result = TFHE.shr(aProc, bProc);
+ function gt_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ resb = result;
}
- function rotl_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint16 result = TFHE.rotl(aProc, bProc);
+ function le_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ resb = result;
}
- function rotl_euint16_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- uint8 bProc = b;
- euint16 result = TFHE.rotl(aProc, bProc);
+ function lt_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ resb = result;
}
- function rotr_euint16_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint16 result = TFHE.rotr(aProc, bProc);
+ function min_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint32 result = TFHE.min(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res32 = result;
}
- function rotr_euint16_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- uint8 bProc = b;
- euint16 result = TFHE.rotr(aProc, bProc);
+ function max_euint32_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint32 result = TFHE.max(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ res32 = result;
}
- function shl_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ function add_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
euint32 aProc = TFHE.asEuint32(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint32 result = TFHE.shl(aProc, bProc);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res64 = result;
}
- function shl_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ function sub_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
euint32 aProc = TFHE.asEuint32(a, inputProof);
- uint8 bProc = b;
- euint32 result = TFHE.shl(aProc, bProc);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res64 = result;
}
- function shr_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ function mul_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
euint32 aProc = TFHE.asEuint32(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint32 result = TFHE.shr(aProc, bProc);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res64 = result;
}
- function shr_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ function and_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
euint32 aProc = TFHE.asEuint32(a, inputProof);
- uint8 bProc = b;
- euint32 result = TFHE.shr(aProc, bProc);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res64 = result;
}
- function rotl_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ function or_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
euint32 aProc = TFHE.asEuint32(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint32 result = TFHE.rotl(aProc, bProc);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res64 = result;
}
- function rotl_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ function xor_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
euint32 aProc = TFHE.asEuint32(a, inputProof);
- uint8 bProc = b;
- euint32 result = TFHE.rotl(aProc, bProc);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.xor(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ res64 = result;
}
- function rotr_euint32_euint8(einput a, einput b, bytes calldata inputProof) public {
+ function eq_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
euint32 aProc = TFHE.asEuint32(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint32 result = TFHE.rotr(aProc, bProc);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ resb = result;
}
- function rotr_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ function ne_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
euint32 aProc = TFHE.asEuint32(a, inputProof);
- uint8 bProc = b;
- euint32 result = TFHE.rotr(aProc, bProc);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ resb = result;
}
- function shl_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint64 result = TFHE.shl(aProc, bProc);
+ function ge_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ resb = result;
}
- function shl_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public {
- euint64 aProc = TFHE.asEuint64(a, inputProof);
- uint8 bProc = b;
- euint64 result = TFHE.shl(aProc, bProc);
+ function gt_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
TFHE.allowThis(result);
- res64 = result;
+ resb = result;
}
}
diff --git a/examples/tests/TFHETestSuite6.sol b/examples/tests/TFHETestSuite6.sol
index cca9b1eb..4180b5f5 100644
--- a/examples/tests/TFHETestSuite6.sol
+++ b/examples/tests/TFHETestSuite6.sol
@@ -10,110 +10,640 @@ contract TFHETestSuite6 {
euint16 public res16;
euint32 public res32;
euint64 public res64;
+ euint128 public res128;
+ euint256 public res256;
constructor() {
TFHE.setFHEVM(FHEVMConfig.defaultConfig());
}
- function shr_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
+ function le_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function max_euint32_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function add_euint32_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function sub_euint32_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function mul_euint32_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function and_euint32_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function or_euint32_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function xor_euint32_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function eq_euint32_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint32_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint32_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint32_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint32_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint32_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint32_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function max_euint32_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function add_euint32_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function sub_euint32_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function mul_euint32_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function and_euint32_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function or_euint32_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function xor_euint32_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function eq_euint32_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint32_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint32_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint32_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint32_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint32_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint32_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function max_euint32_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function add_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ uint32 bProc = b;
+ euint32 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function add_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
+ uint32 aProc = a;
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint32 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function sub_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ uint32 bProc = b;
+ euint32 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function sub_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
+ uint32 aProc = a;
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint32 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function mul_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ uint32 bProc = b;
+ euint32 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function mul_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
+ uint32 aProc = a;
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint32 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function div_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ uint32 bProc = b;
+ euint32 result = TFHE.div(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function rem_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ uint32 bProc = b;
+ euint32 result = TFHE.rem(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function and_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ uint32 bProc = b;
+ euint32 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function and_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
+ uint32 aProc = a;
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint32 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function or_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ uint32 bProc = b;
+ euint32 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function or_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
+ uint32 aProc = a;
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint32 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function xor_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ uint32 bProc = b;
+ euint32 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function xor_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
+ uint32 aProc = a;
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint32 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function eq_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ uint32 bProc = b;
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function eq_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
+ uint32 aProc = a;
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ uint32 bProc = b;
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
+ uint32 aProc = a;
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ uint32 bProc = b;
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
+ uint32 aProc = a;
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ uint32 bProc = b;
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
+ uint32 aProc = a;
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ uint32 bProc = b;
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
+ uint32 aProc = a;
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ uint32 bProc = b;
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
+ uint32 aProc = a;
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ uint32 bProc = b;
+ euint32 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function min_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
+ uint32 aProc = a;
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint32 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function max_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public {
+ euint32 aProc = TFHE.asEuint32(a, inputProof);
+ uint32 bProc = b;
+ euint32 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function max_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public {
+ uint32 aProc = a;
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint32 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res32 = result;
+ }
+ function add_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint64 result = TFHE.shr(aProc, bProc);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint64 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function sub_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint64 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function mul_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint64 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function and_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint64 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
res64 = result;
}
- function shr_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ function or_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
euint64 aProc = TFHE.asEuint64(a, inputProof);
- uint8 bProc = b;
- euint64 result = TFHE.shr(aProc, bProc);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint64 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
res64 = result;
}
- function rotl_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
+ function xor_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint64 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function eq_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint64 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function max_euint64_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint64 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function add_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
euint64 aProc = TFHE.asEuint64(a, inputProof);
euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint64 result = TFHE.rotl(aProc, bProc);
+ euint64 result = TFHE.add(aProc, bProc);
TFHE.allowThis(result);
res64 = result;
}
- function rotl_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ function sub_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
euint64 aProc = TFHE.asEuint64(a, inputProof);
- uint8 bProc = b;
- euint64 result = TFHE.rotl(aProc, bProc);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint64 result = TFHE.sub(aProc, bProc);
TFHE.allowThis(result);
res64 = result;
}
- function rotr_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
+ function mul_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
euint64 aProc = TFHE.asEuint64(a, inputProof);
euint8 bProc = TFHE.asEuint8(b, inputProof);
- euint64 result = TFHE.rotr(aProc, bProc);
+ euint64 result = TFHE.mul(aProc, bProc);
TFHE.allowThis(result);
res64 = result;
}
- function rotr_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public {
+ function and_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
euint64 aProc = TFHE.asEuint64(a, inputProof);
- uint8 bProc = b;
- euint64 result = TFHE.rotr(aProc, bProc);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint64 result = TFHE.and(aProc, bProc);
TFHE.allowThis(result);
res64 = result;
}
- function neg_euint4(einput a, bytes calldata inputProof) public {
- euint4 aProc = TFHE.asEuint4(a, inputProof);
- euint4 result = TFHE.neg(aProc);
+ function or_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint64 result = TFHE.or(aProc, bProc);
TFHE.allowThis(result);
- res4 = result;
+ res64 = result;
}
- function not_euint4(einput a, bytes calldata inputProof) public {
- euint4 aProc = TFHE.asEuint4(a, inputProof);
- euint4 result = TFHE.not(aProc);
+ function xor_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint64 result = TFHE.xor(aProc, bProc);
TFHE.allowThis(result);
- res4 = result;
+ res64 = result;
}
- function neg_euint8(einput a, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint8 result = TFHE.neg(aProc);
+ function eq_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
TFHE.allowThis(result);
- res8 = result;
+ resb = result;
}
- function not_euint8(einput a, bytes calldata inputProof) public {
- euint8 aProc = TFHE.asEuint8(a, inputProof);
- euint8 result = TFHE.not(aProc);
+ function ne_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
TFHE.allowThis(result);
- res8 = result;
+ resb = result;
}
- function neg_euint16(einput a, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint16 result = TFHE.neg(aProc);
+ function ge_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ resb = result;
}
- function not_euint16(einput a, bytes calldata inputProof) public {
- euint16 aProc = TFHE.asEuint16(a, inputProof);
- euint16 result = TFHE.not(aProc);
+ function gt_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
TFHE.allowThis(result);
- res16 = result;
+ resb = result;
}
- function neg_euint32(einput a, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
- euint32 result = TFHE.neg(aProc);
+ function le_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ resb = result;
}
- function not_euint32(einput a, bytes calldata inputProof) public {
- euint32 aProc = TFHE.asEuint32(a, inputProof);
- euint32 result = TFHE.not(aProc);
+ function lt_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
TFHE.allowThis(result);
- res32 = result;
+ resb = result;
}
- function neg_euint64(einput a, bytes calldata inputProof) public {
+ function min_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint64 result = TFHE.neg(aProc);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint64 result = TFHE.min(aProc, bProc);
TFHE.allowThis(result);
res64 = result;
}
- function not_euint64(einput a, bytes calldata inputProof) public {
+ function max_euint64_euint8(einput a, einput b, bytes calldata inputProof) public {
euint64 aProc = TFHE.asEuint64(a, inputProof);
- euint64 result = TFHE.not(aProc);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint64 result = TFHE.max(aProc, bProc);
TFHE.allowThis(result);
res64 = result;
}
diff --git a/examples/tests/TFHETestSuite7.sol b/examples/tests/TFHETestSuite7.sol
new file mode 100644
index 00000000..824a52f8
--- /dev/null
+++ b/examples/tests/TFHETestSuite7.sol
@@ -0,0 +1,650 @@
+// SPDX-License-Identifier: BSD-3-Clause-Clear
+pragma solidity ^0.8.24;
+
+import "../../lib/TFHE.sol";
+
+contract TFHETestSuite7 {
+ ebool public resb;
+ euint4 public res4;
+ euint8 public res8;
+ euint16 public res16;
+ euint32 public res32;
+ euint64 public res64;
+ euint128 public res128;
+ euint256 public res256;
+
+ constructor() {
+ TFHE.setFHEVM(FHEVMConfig.defaultConfig());
+ }
+
+ function add_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint64 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function sub_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint64 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function mul_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint64 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function and_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint64 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function or_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint64 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function xor_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint64 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function eq_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint64 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function max_euint64_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint64 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function add_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint64 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function sub_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint64 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function mul_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint64 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function and_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint64 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function or_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint64 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function xor_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint64 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function eq_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint64 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function max_euint64_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint64 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function add_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function sub_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function mul_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function and_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function or_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function xor_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function eq_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function max_euint64_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function add_euint64_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function sub_euint64_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function mul_euint64_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function and_euint64_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function or_euint64_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function xor_euint64_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function eq_euint64_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint64_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint64_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint64_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint64_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint64_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint64_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function max_euint64_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function add_euint64_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function sub_euint64_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function mul_euint64_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function and_euint64_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function or_euint64_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function xor_euint64_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function eq_euint64_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint64_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint64_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint64_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint64_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint64_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint64_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function max_euint64_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function add_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ uint64 bProc = b;
+ euint64 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function add_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
+ uint64 aProc = a;
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function sub_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ uint64 bProc = b;
+ euint64 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function sub_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
+ uint64 aProc = a;
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function mul_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ uint64 bProc = b;
+ euint64 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function mul_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
+ uint64 aProc = a;
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function div_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ uint64 bProc = b;
+ euint64 result = TFHE.div(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function rem_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ uint64 bProc = b;
+ euint64 result = TFHE.rem(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function and_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ uint64 bProc = b;
+ euint64 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function and_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
+ uint64 aProc = a;
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function or_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ uint64 bProc = b;
+ euint64 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function or_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
+ uint64 aProc = a;
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function xor_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ uint64 bProc = b;
+ euint64 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function xor_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
+ uint64 aProc = a;
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function eq_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ uint64 bProc = b;
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function eq_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
+ uint64 aProc = a;
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ uint64 bProc = b;
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
+ uint64 aProc = a;
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ uint64 bProc = b;
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
+ uint64 aProc = a;
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+}
diff --git a/examples/tests/TFHETestSuite8.sol b/examples/tests/TFHETestSuite8.sol
new file mode 100644
index 00000000..078c49bf
--- /dev/null
+++ b/examples/tests/TFHETestSuite8.sol
@@ -0,0 +1,650 @@
+// SPDX-License-Identifier: BSD-3-Clause-Clear
+pragma solidity ^0.8.24;
+
+import "../../lib/TFHE.sol";
+
+contract TFHETestSuite8 {
+ ebool public resb;
+ euint4 public res4;
+ euint8 public res8;
+ euint16 public res16;
+ euint32 public res32;
+ euint64 public res64;
+ euint128 public res128;
+ euint256 public res256;
+
+ constructor() {
+ TFHE.setFHEVM(FHEVMConfig.defaultConfig());
+ }
+
+ function gt_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ uint64 bProc = b;
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
+ uint64 aProc = a;
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ uint64 bProc = b;
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
+ uint64 aProc = a;
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ uint64 bProc = b;
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
+ uint64 aProc = a;
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ uint64 bProc = b;
+ euint64 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function min_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
+ uint64 aProc = a;
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function max_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public {
+ euint64 aProc = TFHE.asEuint64(a, inputProof);
+ uint64 bProc = b;
+ euint64 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function max_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public {
+ uint64 aProc = a;
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint64 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res64 = result;
+ }
+ function add_euint128_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint128 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function sub_euint128_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint128 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function mul_euint128_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint128 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function and_euint128_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint128 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function or_euint128_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint128 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function xor_euint128_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint128 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function eq_euint128_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint128_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint128_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint128_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint128_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint128_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint128_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint128 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function max_euint128_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint128 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function add_euint128_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint128 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function sub_euint128_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint128 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function mul_euint128_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint128 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function and_euint128_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint128 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function or_euint128_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint128 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function xor_euint128_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint128 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function eq_euint128_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint128_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint128_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint128_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint128_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint128_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint128_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint128 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function max_euint128_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint128 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function add_euint128_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint128 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function sub_euint128_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint128 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function mul_euint128_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint128 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function and_euint128_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint128 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function or_euint128_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint128 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function xor_euint128_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint128 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function eq_euint128_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint128_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint128_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint128_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint128_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint128_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint128_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint128 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function max_euint128_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint128 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function add_euint128_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint128 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function sub_euint128_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint128 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function mul_euint128_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint128 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function and_euint128_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint128 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function or_euint128_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint128 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function xor_euint128_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint128 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function eq_euint128_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint128_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint128_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint128_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint128_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint128_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint128_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint128 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function max_euint128_euint32(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint32 bProc = TFHE.asEuint32(b, inputProof);
+ euint128 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function add_euint128_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint128 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function sub_euint128_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint128 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function mul_euint128_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint128 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function and_euint128_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint128 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function or_euint128_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint128 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function xor_euint128_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint128 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function eq_euint128_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint128_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint128_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint128_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint128_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint128_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint128_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint128 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function max_euint128_euint64(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint64 bProc = TFHE.asEuint64(b, inputProof);
+ euint128 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function add_euint128_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function sub_euint128_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function mul_euint128_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function and_euint128_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function or_euint128_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function xor_euint128_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function eq_euint128_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint128_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint128_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint128_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+}
diff --git a/examples/tests/TFHETestSuite9.sol b/examples/tests/TFHETestSuite9.sol
new file mode 100644
index 00000000..4a1f7137
--- /dev/null
+++ b/examples/tests/TFHETestSuite9.sol
@@ -0,0 +1,650 @@
+// SPDX-License-Identifier: BSD-3-Clause-Clear
+pragma solidity ^0.8.24;
+
+import "../../lib/TFHE.sol";
+
+contract TFHETestSuite9 {
+ ebool public resb;
+ euint4 public res4;
+ euint8 public res8;
+ euint16 public res16;
+ euint32 public res32;
+ euint64 public res64;
+ euint128 public res128;
+ euint256 public res256;
+
+ constructor() {
+ TFHE.setFHEVM(FHEVMConfig.defaultConfig());
+ }
+
+ function le_euint128_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint128_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint128_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function max_euint128_euint128(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function add_euint128_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function sub_euint128_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function mul_euint128_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function and_euint128_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function or_euint128_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function xor_euint128_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function eq_euint128_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint128_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint128_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint128_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint128_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint128_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint128_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function max_euint128_euint256(einput a, einput b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ euint256 bProc = TFHE.asEuint256(b, inputProof);
+ euint256 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function add_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ uint128 bProc = b;
+ euint128 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function add_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public {
+ uint128 aProc = a;
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function sub_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ uint128 bProc = b;
+ euint128 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function sub_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public {
+ uint128 aProc = a;
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function mul_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ uint128 bProc = b;
+ euint128 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function mul_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public {
+ uint128 aProc = a;
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function div_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ uint128 bProc = b;
+ euint128 result = TFHE.div(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function rem_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ uint128 bProc = b;
+ euint128 result = TFHE.rem(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function and_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ uint128 bProc = b;
+ euint128 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function and_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public {
+ uint128 aProc = a;
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function or_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ uint128 bProc = b;
+ euint128 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function or_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public {
+ uint128 aProc = a;
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function xor_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ uint128 bProc = b;
+ euint128 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function xor_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public {
+ uint128 aProc = a;
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function eq_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ uint128 bProc = b;
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function eq_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public {
+ uint128 aProc = a;
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ uint128 bProc = b;
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public {
+ uint128 aProc = a;
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ uint128 bProc = b;
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public {
+ uint128 aProc = a;
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ uint128 bProc = b;
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public {
+ uint128 aProc = a;
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ uint128 bProc = b;
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public {
+ uint128 aProc = a;
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ uint128 bProc = b;
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public {
+ uint128 aProc = a;
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ uint128 bProc = b;
+ euint128 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function min_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public {
+ uint128 aProc = a;
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function max_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public {
+ euint128 aProc = TFHE.asEuint128(a, inputProof);
+ uint128 bProc = b;
+ euint128 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function max_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public {
+ uint128 aProc = a;
+ euint128 bProc = TFHE.asEuint128(b, inputProof);
+ euint128 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res128 = result;
+ }
+ function add_euint256_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint256 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function sub_euint256_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint256 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function mul_euint256_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint256 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function and_euint256_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint256 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function or_euint256_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint256 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function xor_euint256_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint256 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function eq_euint256_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint256_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint256_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint256_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint256_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint256_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint256_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint256 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function max_euint256_euint4(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint4 bProc = TFHE.asEuint4(b, inputProof);
+ euint256 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function add_euint256_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint256 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function sub_euint256_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint256 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function mul_euint256_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint256 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function and_euint256_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint256 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function or_euint256_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint256 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function xor_euint256_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint256 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function eq_euint256_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint256_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint256_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint256_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint256_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint256_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint256_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint256 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function max_euint256_euint8(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint8 bProc = TFHE.asEuint8(b, inputProof);
+ euint256 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function add_euint256_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint256 result = TFHE.add(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function sub_euint256_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint256 result = TFHE.sub(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function mul_euint256_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint256 result = TFHE.mul(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function and_euint256_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint256 result = TFHE.and(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function or_euint256_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint256 result = TFHE.or(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function xor_euint256_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint256 result = TFHE.xor(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function eq_euint256_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ ebool result = TFHE.eq(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ne_euint256_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ ebool result = TFHE.ne(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function ge_euint256_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ ebool result = TFHE.ge(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function gt_euint256_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ ebool result = TFHE.gt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function le_euint256_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ ebool result = TFHE.le(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function lt_euint256_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ ebool result = TFHE.lt(aProc, bProc);
+ TFHE.allowThis(result);
+ resb = result;
+ }
+ function min_euint256_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint256 result = TFHE.min(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+ function max_euint256_euint16(einput a, einput b, bytes calldata inputProof) public {
+ euint256 aProc = TFHE.asEuint256(a, inputProof);
+ euint16 bProc = TFHE.asEuint16(b, inputProof);
+ euint256 result = TFHE.max(aProc, bProc);
+ TFHE.allowThis(result);
+ res256 = result;
+ }
+}
diff --git a/gateway/GatewayContract.sol b/gateway/GatewayContract.sol
index 485fc8e7..d78995c8 100644
--- a/gateway/GatewayContract.sol
+++ b/gateway/GatewayContract.sol
@@ -43,9 +43,9 @@ contract GatewayContract is UUPSUpgradeable, Ownable2StepUpgradeable {
bool passSignaturesToCaller
);
- event AddedRelayer(address indexed realyer);
+ event AddedRelayer(address indexed relayer);
- event RemovedRelayer(address indexed realyer);
+ event RemovedRelayer(address indexed relayer);
event ResultCallback(uint256 indexed requestID, bool success, bytes result);
diff --git a/gateway/lib/Gateway.sol b/gateway/lib/Gateway.sol
index 738db915..8d15e296 100644
--- a/gateway/lib/Gateway.sol
+++ b/gateway/lib/Gateway.sol
@@ -69,10 +69,26 @@ library Gateway {
ct = euint64.unwrap(newCT);
}
+ function toUint256(euint128 newCT) internal pure returns (uint256 ct) {
+ ct = euint128.unwrap(newCT);
+ }
+
function toUint256(eaddress newCT) internal pure returns (uint256 ct) {
ct = eaddress.unwrap(newCT);
}
+ function toUint256(euint256 newCT) internal pure returns (uint256 ct) {
+ ct = euint256.unwrap(newCT);
+ }
+
+ function toUint256(ebytes64 newCT) internal pure returns (uint256 ct) {
+ ct = ebytes64.unwrap(newCT);
+ }
+
+ function toUint256(ebytes128 newCT) internal pure returns (uint256 ct) {
+ ct = ebytes128.unwrap(newCT);
+ }
+
function toUint256(ebytes256 newCT) internal pure returns (uint256 ct) {
ct = ebytes256.unwrap(newCT);
}
diff --git a/lib/FHEPayment.sol b/lib/FHEPayment.sol
index 92c8caca..d71c5575 100644
--- a/lib/FHEPayment.sol
+++ b/lib/FHEPayment.sol
@@ -8,9 +8,9 @@ import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
error FHEGasBlockLimitExceeded();
+error UnsupportedOperation();
error CallerMustBeTFHEExecutorContract();
error OnlyScalarOperationsAreSupported();
-error OnlyNonScalarOperationsAreSupported();
error RecoveryFailed();
error WithdrawalFailed();
error AccountNotEnoughFunded();
@@ -185,7 +185,7 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
function checkIfNewBlock() internal virtual {
FHEPaymentStorage storage $ = _getFHEPaymentStorage();
uint256 lastBlock_ = block.number;
- if (block.number > $.lastBlock) {
+ if (lastBlock_ > $.lastBlock) {
$.lastBlock = lastBlock_;
$.currentBlockConsumption = 0;
}
@@ -210,6 +210,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 162000);
} else if (resultType == 5) {
updateFunding(payer, 188000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 218000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 253000);
+ } else {
+ revert UnsupportedOperation();
}
} else {
if (resultType == 1) {
@@ -222,6 +228,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 162000);
} else if (resultType == 5) {
updateFunding(payer, 188000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 218000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 253000);
+ } else {
+ revert UnsupportedOperation();
}
}
checkFHEGasBlockLimit();
@@ -241,6 +253,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 162000);
} else if (resultType == 5) {
updateFunding(payer, 188000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 218000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 253000);
+ } else {
+ revert UnsupportedOperation();
}
} else {
if (resultType == 1) {
@@ -253,6 +271,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 162000);
} else if (resultType == 5) {
updateFunding(payer, 188000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 218000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 253000);
+ } else {
+ revert UnsupportedOperation();
}
}
checkFHEGasBlockLimit();
@@ -272,6 +296,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 264000);
} else if (resultType == 5) {
updateFunding(payer, 356000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 480000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 647000);
+ } else {
+ revert UnsupportedOperation();
}
} else {
if (resultType == 1) {
@@ -284,6 +314,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 359000);
} else if (resultType == 5) {
updateFunding(payer, 641000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 1145000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 2045000);
+ } else {
+ revert UnsupportedOperation();
}
}
checkFHEGasBlockLimit();
@@ -303,6 +339,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 398000);
} else if (resultType == 5) {
updateFunding(payer, 584000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 857000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 1258000);
+ } else {
+ revert UnsupportedOperation();
}
checkFHEGasBlockLimit();
}
@@ -321,6 +363,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 805000);
} else if (resultType == 5) {
updateFunding(payer, 1095000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 1499000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 2052000);
+ } else {
+ revert UnsupportedOperation();
}
checkFHEGasBlockLimit();
}
@@ -328,19 +376,46 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
function payForFheBitAnd(address payer, uint8 resultType, bytes1 scalarByte) external virtual {
if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract();
checkIfNewBlock();
- if (scalarByte != 0x00) revert OnlyNonScalarOperationsAreSupported();
- if (resultType == 0) {
- updateFunding(payer, 26000);
- } else if (resultType == 1) {
- updateFunding(payer, 32000);
- } else if (resultType == 2) {
- updateFunding(payer, 34000);
- } else if (resultType == 3) {
- updateFunding(payer, 34000);
- } else if (resultType == 4) {
- updateFunding(payer, 35000);
- } else if (resultType == 5) {
- updateFunding(payer, 38000);
+ if (scalarByte == 0x01) {
+ if (resultType == 0) {
+ updateFunding(payer, 26000);
+ } else if (resultType == 1) {
+ updateFunding(payer, 32000);
+ } else if (resultType == 2) {
+ updateFunding(payer, 34000);
+ } else if (resultType == 3) {
+ updateFunding(payer, 34000);
+ } else if (resultType == 4) {
+ updateFunding(payer, 35000);
+ } else if (resultType == 5) {
+ updateFunding(payer, 38000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 41000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 44000);
+ } else {
+ revert UnsupportedOperation();
+ }
+ } else {
+ if (resultType == 0) {
+ updateFunding(payer, 26000);
+ } else if (resultType == 1) {
+ updateFunding(payer, 32000);
+ } else if (resultType == 2) {
+ updateFunding(payer, 34000);
+ } else if (resultType == 3) {
+ updateFunding(payer, 34000);
+ } else if (resultType == 4) {
+ updateFunding(payer, 35000);
+ } else if (resultType == 5) {
+ updateFunding(payer, 38000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 41000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 44000);
+ } else {
+ revert UnsupportedOperation();
+ }
}
checkFHEGasBlockLimit();
}
@@ -348,19 +423,46 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
function payForFheBitOr(address payer, uint8 resultType, bytes1 scalarByte) external virtual {
if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract();
checkIfNewBlock();
- if (scalarByte != 0x00) revert OnlyNonScalarOperationsAreSupported();
- if (resultType == 0) {
- updateFunding(payer, 26000);
- } else if (resultType == 1) {
- updateFunding(payer, 32000);
- } else if (resultType == 2) {
- updateFunding(payer, 34000);
- } else if (resultType == 3) {
- updateFunding(payer, 34000);
- } else if (resultType == 4) {
- updateFunding(payer, 35000);
- } else if (resultType == 5) {
- updateFunding(payer, 38000);
+ if (scalarByte == 0x01) {
+ if (resultType == 0) {
+ updateFunding(payer, 26000);
+ } else if (resultType == 1) {
+ updateFunding(payer, 32000);
+ } else if (resultType == 2) {
+ updateFunding(payer, 34000);
+ } else if (resultType == 3) {
+ updateFunding(payer, 34000);
+ } else if (resultType == 4) {
+ updateFunding(payer, 35000);
+ } else if (resultType == 5) {
+ updateFunding(payer, 38000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 41000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 44000);
+ } else {
+ revert UnsupportedOperation();
+ }
+ } else {
+ if (resultType == 0) {
+ updateFunding(payer, 26000);
+ } else if (resultType == 1) {
+ updateFunding(payer, 32000);
+ } else if (resultType == 2) {
+ updateFunding(payer, 34000);
+ } else if (resultType == 3) {
+ updateFunding(payer, 34000);
+ } else if (resultType == 4) {
+ updateFunding(payer, 35000);
+ } else if (resultType == 5) {
+ updateFunding(payer, 38000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 41000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 44000);
+ } else {
+ revert UnsupportedOperation();
+ }
}
checkFHEGasBlockLimit();
}
@@ -368,19 +470,46 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
function payForFheBitXor(address payer, uint8 resultType, bytes1 scalarByte) external virtual {
if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract();
checkIfNewBlock();
- if (scalarByte != 0x00) revert OnlyNonScalarOperationsAreSupported();
- if (resultType == 0) {
- updateFunding(payer, 26000);
- } else if (resultType == 1) {
- updateFunding(payer, 32000);
- } else if (resultType == 2) {
- updateFunding(payer, 34000);
- } else if (resultType == 3) {
- updateFunding(payer, 34000);
- } else if (resultType == 4) {
- updateFunding(payer, 35000);
- } else if (resultType == 5) {
- updateFunding(payer, 38000);
+ if (scalarByte == 0x01) {
+ if (resultType == 0) {
+ updateFunding(payer, 26000);
+ } else if (resultType == 1) {
+ updateFunding(payer, 32000);
+ } else if (resultType == 2) {
+ updateFunding(payer, 34000);
+ } else if (resultType == 3) {
+ updateFunding(payer, 34000);
+ } else if (resultType == 4) {
+ updateFunding(payer, 35000);
+ } else if (resultType == 5) {
+ updateFunding(payer, 38000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 41000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 44000);
+ } else {
+ revert UnsupportedOperation();
+ }
+ } else {
+ if (resultType == 0) {
+ updateFunding(payer, 26000);
+ } else if (resultType == 1) {
+ updateFunding(payer, 32000);
+ } else if (resultType == 2) {
+ updateFunding(payer, 34000);
+ } else if (resultType == 3) {
+ updateFunding(payer, 34000);
+ } else if (resultType == 4) {
+ updateFunding(payer, 35000);
+ } else if (resultType == 5) {
+ updateFunding(payer, 38000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 41000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 44000);
+ } else {
+ revert UnsupportedOperation();
+ }
}
checkFHEGasBlockLimit();
}
@@ -399,6 +528,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 35000);
} else if (resultType == 5) {
updateFunding(payer, 38000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 41000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 44000);
+ } else {
+ revert UnsupportedOperation();
}
} else {
if (resultType == 1) {
@@ -411,6 +546,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 183000);
} else if (resultType == 5) {
updateFunding(payer, 227000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 282000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 350000);
+ } else {
+ revert UnsupportedOperation();
}
}
checkFHEGasBlockLimit();
@@ -430,6 +571,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 35000);
} else if (resultType == 5) {
updateFunding(payer, 38000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 41000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 44000);
+ } else {
+ revert UnsupportedOperation();
}
} else {
if (resultType == 1) {
@@ -442,6 +589,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 183000);
} else if (resultType == 5) {
updateFunding(payer, 227000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 282000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 350000);
+ } else {
+ revert UnsupportedOperation();
}
}
checkFHEGasBlockLimit();
@@ -461,6 +614,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 35000);
} else if (resultType == 5) {
updateFunding(payer, 38000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 41000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 44000);
+ } else {
+ revert UnsupportedOperation();
}
} else {
if (resultType == 1) {
@@ -473,6 +632,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 183000);
} else if (resultType == 5) {
updateFunding(payer, 227000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 282000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 350000);
+ } else {
+ revert UnsupportedOperation();
}
}
checkFHEGasBlockLimit();
@@ -492,6 +657,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 35000);
} else if (resultType == 5) {
updateFunding(payer, 38000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 41000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 44000);
+ } else {
+ revert UnsupportedOperation();
}
} else {
if (resultType == 1) {
@@ -504,6 +675,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 183000);
} else if (resultType == 5) {
updateFunding(payer, 227000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 282000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 350000);
+ } else {
+ revert UnsupportedOperation();
}
}
checkFHEGasBlockLimit();
@@ -513,7 +690,9 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract();
checkIfNewBlock();
if (scalarByte == 0x01) {
- if (resultType == 1) {
+ if (resultType == 0) {
+ updateFunding(payer, 49000);
+ } else if (resultType == 1) {
updateFunding(payer, 51000);
} else if (resultType == 2) {
updateFunding(payer, 53000);
@@ -523,13 +702,25 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 82000);
} else if (resultType == 5) {
updateFunding(payer, 86000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 88000);
} else if (resultType == 7) {
updateFunding(payer, 90000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 100000);
+ } else if (resultType == 9) {
+ updateFunding(payer, 150000);
+ } else if (resultType == 10) {
+ updateFunding(payer, 200000);
} else if (resultType == 11) {
updateFunding(payer, 300000);
+ } else {
+ revert UnsupportedOperation();
}
} else {
- if (resultType == 1) {
+ if (resultType == 0) {
+ updateFunding(payer, 49000);
+ } else if (resultType == 1) {
updateFunding(payer, 51000);
} else if (resultType == 2) {
updateFunding(payer, 53000);
@@ -539,10 +730,20 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 82000);
} else if (resultType == 5) {
updateFunding(payer, 86000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 88000);
} else if (resultType == 7) {
updateFunding(payer, 90000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 100000);
+ } else if (resultType == 9) {
+ updateFunding(payer, 150000);
+ } else if (resultType == 10) {
+ updateFunding(payer, 200000);
} else if (resultType == 11) {
updateFunding(payer, 300000);
+ } else {
+ revert UnsupportedOperation();
}
}
checkFHEGasBlockLimit();
@@ -552,7 +753,9 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract();
checkIfNewBlock();
if (scalarByte == 0x01) {
- if (resultType == 1) {
+ if (resultType == 0) {
+ updateFunding(payer, 49000);
+ } else if (resultType == 1) {
updateFunding(payer, 51000);
} else if (resultType == 2) {
updateFunding(payer, 53000);
@@ -562,13 +765,25 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 82000);
} else if (resultType == 5) {
updateFunding(payer, 86000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 88000);
} else if (resultType == 7) {
updateFunding(payer, 90000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 100000);
+ } else if (resultType == 9) {
+ updateFunding(payer, 150000);
+ } else if (resultType == 10) {
+ updateFunding(payer, 200000);
} else if (resultType == 11) {
updateFunding(payer, 300000);
+ } else {
+ revert UnsupportedOperation();
}
} else {
- if (resultType == 1) {
+ if (resultType == 0) {
+ updateFunding(payer, 49000);
+ } else if (resultType == 1) {
updateFunding(payer, 51000);
} else if (resultType == 2) {
updateFunding(payer, 53000);
@@ -578,10 +793,20 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 82000);
} else if (resultType == 5) {
updateFunding(payer, 86000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 88000);
} else if (resultType == 7) {
updateFunding(payer, 90000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 100000);
+ } else if (resultType == 9) {
+ updateFunding(payer, 150000);
+ } else if (resultType == 10) {
+ updateFunding(payer, 200000);
} else if (resultType == 11) {
updateFunding(payer, 300000);
+ } else {
+ revert UnsupportedOperation();
}
}
checkFHEGasBlockLimit();
@@ -601,6 +826,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 128000);
} else if (resultType == 5) {
updateFunding(payer, 156000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 190000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 231000);
+ } else {
+ revert UnsupportedOperation();
}
} else {
if (resultType == 1) {
@@ -613,6 +844,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 128000);
} else if (resultType == 5) {
updateFunding(payer, 156000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 190000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 231000);
+ } else {
+ revert UnsupportedOperation();
}
}
checkFHEGasBlockLimit();
@@ -632,6 +869,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 128000);
} else if (resultType == 5) {
updateFunding(payer, 156000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 190000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 231000);
+ } else {
+ revert UnsupportedOperation();
}
} else {
if (resultType == 1) {
@@ -644,6 +887,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 128000);
} else if (resultType == 5) {
updateFunding(payer, 156000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 190000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 231000);
+ } else {
+ revert UnsupportedOperation();
}
}
checkFHEGasBlockLimit();
@@ -663,6 +912,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 128000);
} else if (resultType == 5) {
updateFunding(payer, 156000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 190000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 231000);
+ } else {
+ revert UnsupportedOperation();
}
} else {
if (resultType == 1) {
@@ -675,6 +930,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 128000);
} else if (resultType == 5) {
updateFunding(payer, 156000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 190000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 231000);
+ } else {
+ revert UnsupportedOperation();
}
}
checkFHEGasBlockLimit();
@@ -694,6 +955,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 128000);
} else if (resultType == 5) {
updateFunding(payer, 156000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 190000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 231000);
+ } else {
+ revert UnsupportedOperation();
}
} else {
if (resultType == 1) {
@@ -706,6 +973,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 128000);
} else if (resultType == 5) {
updateFunding(payer, 156000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 190000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 231000);
+ } else {
+ revert UnsupportedOperation();
}
}
checkFHEGasBlockLimit();
@@ -725,6 +998,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 164000);
} else if (resultType == 5) {
updateFunding(payer, 192000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 225000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 264000);
+ } else {
+ revert UnsupportedOperation();
}
} else {
if (resultType == 1) {
@@ -737,6 +1016,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 183000);
} else if (resultType == 5) {
updateFunding(payer, 210000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 241000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 277000);
+ } else {
+ revert UnsupportedOperation();
}
}
checkFHEGasBlockLimit();
@@ -756,6 +1041,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 164000);
} else if (resultType == 5) {
updateFunding(payer, 192000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 225000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 264000);
+ } else {
+ revert UnsupportedOperation();
}
} else {
if (resultType == 1) {
@@ -768,6 +1059,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 183000);
} else if (resultType == 5) {
updateFunding(payer, 210000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 241000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 277000);
+ } else {
+ revert UnsupportedOperation();
}
}
checkFHEGasBlockLimit();
@@ -775,6 +1072,7 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
function payForFheNeg(address payer, uint8 resultType) external virtual {
if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract();
+ checkIfNewBlock();
if (resultType == 1) {
updateFunding(payer, 60000);
} else if (resultType == 2) {
@@ -785,12 +1083,19 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 160000);
} else if (resultType == 5) {
updateFunding(payer, 199000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 248000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 309000);
+ } else {
+ revert UnsupportedOperation();
}
checkFHEGasBlockLimit();
}
function payForFheNot(address payer, uint8 resultType) external virtual {
if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract();
+ checkIfNewBlock();
if (resultType == 0) {
updateFunding(payer, 30000);
} else if (resultType == 1) {
@@ -803,13 +1108,22 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 36000);
} else if (resultType == 5) {
updateFunding(payer, 37000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 38000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 39000);
+ } else {
+ revert UnsupportedOperation();
}
checkFHEGasBlockLimit();
}
function payForCast(address payer, uint8 resultType) external virtual {
if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract();
- if (resultType == 1) {
+ checkIfNewBlock();
+ if (resultType == 0) {
+ updateFunding(payer, 200);
+ } else if (resultType == 1) {
updateFunding(payer, 200);
} else if (resultType == 2) {
updateFunding(payer, 200);
@@ -819,12 +1133,19 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 200);
} else if (resultType == 5) {
updateFunding(payer, 200);
+ } else if (resultType == 6) {
+ updateFunding(payer, 200);
+ } else if (resultType == 8) {
+ updateFunding(payer, 200);
+ } else {
+ revert UnsupportedOperation();
}
checkFHEGasBlockLimit();
}
function payForTrivialEncrypt(address payer, uint8 resultType) external virtual {
if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract();
+ checkIfNewBlock();
if (resultType == 0) {
updateFunding(payer, 100);
} else if (resultType == 1) {
@@ -837,15 +1158,30 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 300);
} else if (resultType == 5) {
updateFunding(payer, 600);
+ } else if (resultType == 6) {
+ updateFunding(payer, 650);
} else if (resultType == 7) {
updateFunding(payer, 700);
+ } else if (resultType == 8) {
+ updateFunding(payer, 800);
+ } else if (resultType == 9) {
+ updateFunding(payer, 1600);
+ } else if (resultType == 10) {
+ updateFunding(payer, 3200);
+ } else if (resultType == 11) {
+ updateFunding(payer, 6400);
+ } else {
+ revert UnsupportedOperation();
}
checkFHEGasBlockLimit();
}
function payForIfThenElse(address payer, uint8 resultType) external virtual {
if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract();
- if (resultType == 1) {
+ checkIfNewBlock();
+ if (resultType == 0) {
+ updateFunding(payer, 43000);
+ } else if (resultType == 1) {
updateFunding(payer, 45000);
} else if (resultType == 2) {
updateFunding(payer, 47000);
@@ -855,15 +1191,32 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 50000);
} else if (resultType == 5) {
updateFunding(payer, 53000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 70000);
} else if (resultType == 7) {
updateFunding(payer, 80000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 90000);
+ } else if (resultType == 9) {
+ updateFunding(payer, 150000);
+ } else if (resultType == 10) {
+ updateFunding(payer, 200000);
+ } else if (resultType == 11) {
+ updateFunding(payer, 300000);
+ } else {
+ revert UnsupportedOperation();
}
checkFHEGasBlockLimit();
}
function payForFheRand(address payer, uint8 resultType) external virtual {
if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract();
- if (resultType == 2) {
+ checkIfNewBlock();
+ if (resultType == 0) {
+ updateFunding(payer, 100000);
+ } else if (resultType == 1) {
+ updateFunding(payer, 100000);
+ } else if (resultType == 2) {
updateFunding(payer, 100000);
} else if (resultType == 3) {
updateFunding(payer, 100000);
@@ -871,13 +1224,28 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 100000);
} else if (resultType == 5) {
updateFunding(payer, 100000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 100000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 100000);
+ } else if (resultType == 9) {
+ updateFunding(payer, 200000);
+ } else if (resultType == 10) {
+ updateFunding(payer, 300000);
+ } else if (resultType == 11) {
+ updateFunding(payer, 400000);
+ } else {
+ revert UnsupportedOperation();
}
checkFHEGasBlockLimit();
}
function payForFheRandBounded(address payer, uint8 resultType) external virtual {
if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract();
- if (resultType == 2) {
+ checkIfNewBlock();
+ if (resultType == 1) {
+ updateFunding(payer, 100000);
+ } else if (resultType == 2) {
updateFunding(payer, 100000);
} else if (resultType == 3) {
updateFunding(payer, 100000);
@@ -885,6 +1253,12 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable {
updateFunding(payer, 100000);
} else if (resultType == 5) {
updateFunding(payer, 100000);
+ } else if (resultType == 6) {
+ updateFunding(payer, 100000);
+ } else if (resultType == 8) {
+ updateFunding(payer, 100000);
+ } else {
+ revert UnsupportedOperation();
}
checkFHEGasBlockLimit();
}
diff --git a/lib/Impl.sol b/lib/Impl.sol
index f95499f1..cf1183db 100644
--- a/lib/Impl.sol
+++ b/lib/Impl.sol
@@ -36,6 +36,9 @@ interface ITFHEExecutor {
) external returns (uint256 result);
function cast(uint256 ct, bytes1 toType) external returns (uint256 result);
function trivialEncrypt(uint256 ct, bytes1 toType) external returns (uint256 result);
+ function trivialEncrypt(bytes memory ct, bytes1 toType) external returns (uint256 result);
+ function fheEq(uint256 lhs, bytes memory rhs, bytes1 scalarByte) external returns (uint256 result);
+ function fheNe(uint256 lhs, bytes memory rhs, bytes1 scalarByte) external returns (uint256 result);
function fheIfThenElse(uint256 control, uint256 ifTrue, uint256 ifFalse) external returns (uint256 result);
function fheRand(bytes1 randType) external returns (uint256 result);
function fheRandBounded(uint256 upperBound, bytes1 randType) external returns (uint256 result);
@@ -112,20 +115,35 @@ library Impl {
result = ITFHEExecutor($.TFHEExecutorAddress).fheRem(lhs, rhs, scalarByte);
}
- function and(uint256 lhs, uint256 rhs) internal returns (uint256 result) {
- bytes1 scalarByte = 0x00;
+ function and(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) {
+ bytes1 scalarByte;
+ if (scalar) {
+ scalarByte = 0x01;
+ } else {
+ scalarByte = 0x00;
+ }
FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig();
result = ITFHEExecutor($.TFHEExecutorAddress).fheBitAnd(lhs, rhs, scalarByte);
}
- function or(uint256 lhs, uint256 rhs) internal returns (uint256 result) {
- bytes1 scalarByte = 0x00;
+ function or(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) {
+ bytes1 scalarByte;
+ if (scalar) {
+ scalarByte = 0x01;
+ } else {
+ scalarByte = 0x00;
+ }
FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig();
result = ITFHEExecutor($.TFHEExecutorAddress).fheBitOr(lhs, rhs, scalarByte);
}
- function xor(uint256 lhs, uint256 rhs) internal returns (uint256 result) {
- bytes1 scalarByte = 0x00;
+ function xor(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) {
+ bytes1 scalarByte;
+ if (scalar) {
+ scalarByte = 0x01;
+ } else {
+ scalarByte = 0x00;
+ }
FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig();
result = ITFHEExecutor($.TFHEExecutorAddress).fheBitXor(lhs, rhs, scalarByte);
}
@@ -300,6 +318,33 @@ library Impl {
result = ITFHEExecutor($.TFHEExecutorAddress).trivialEncrypt(value, bytes1(toType));
}
+ function trivialEncrypt(bytes memory value, uint8 toType) internal returns (uint256 result) {
+ FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig();
+ result = ITFHEExecutor($.TFHEExecutorAddress).trivialEncrypt(value, bytes1(toType));
+ }
+
+ function eq(uint256 lhs, bytes memory rhs, bool scalar) internal returns (uint256 result) {
+ bytes1 scalarByte;
+ if (scalar) {
+ scalarByte = 0x01;
+ } else {
+ scalarByte = 0x00;
+ }
+ FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig();
+ result = ITFHEExecutor($.TFHEExecutorAddress).fheEq(lhs, rhs, scalarByte);
+ }
+
+ function ne(uint256 lhs, bytes memory rhs, bool scalar) internal returns (uint256 result) {
+ bytes1 scalarByte;
+ if (scalar) {
+ scalarByte = 0x01;
+ } else {
+ scalarByte = 0x00;
+ }
+ FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig();
+ result = ITFHEExecutor($.TFHEExecutorAddress).fheNe(lhs, rhs, scalarByte);
+ }
+
function rand(uint8 randType) internal returns (uint256 result) {
FHEVMConfig.FHEVMConfigStruct storage $ = getFHEVMConfig();
result = ITFHEExecutor($.TFHEExecutorAddress).fheRand(bytes1(randType));
diff --git a/lib/TFHE.sol b/lib/TFHE.sol
index e99eed48..cf10186c 100644
--- a/lib/TFHE.sol
+++ b/lib/TFHE.sol
@@ -11,7 +11,11 @@ type euint8 is uint256;
type euint16 is uint256;
type euint32 is uint256;
type euint64 is uint256;
+type euint128 is uint256;
+type euint256 is uint256;
type eaddress is uint256;
+type ebytes64 is uint256;
+type ebytes128 is uint256;
type ebytes256 is uint256;
type einput is bytes32;
@@ -66,6 +70,16 @@ library TFHE {
return euint64.unwrap(v) != 0;
}
+ // Return true if the enrypted integer is initialized and false otherwise.
+ function isInitialized(euint128 v) internal pure returns (bool) {
+ return euint128.unwrap(v) != 0;
+ }
+
+ // Return true if the enrypted integer is initialized and false otherwise.
+ function isInitialized(euint256 v) internal pure returns (bool) {
+ return euint256.unwrap(v) != 0;
+ }
+
// Evaluate add(a, b) and return the result.
function add(euint4 a, euint4 b) internal returns (euint4) {
if (!isInitialized(a)) {
@@ -107,7 +121,7 @@ library TFHE {
if (!isInitialized(b)) {
b = asEuint4(0);
}
- return euint4.wrap(Impl.and(euint4.unwrap(a), euint4.unwrap(b)));
+ return euint4.wrap(Impl.and(euint4.unwrap(a), euint4.unwrap(b), false));
}
// Evaluate or(a, b) and return the result.
@@ -118,7 +132,7 @@ library TFHE {
if (!isInitialized(b)) {
b = asEuint4(0);
}
- return euint4.wrap(Impl.or(euint4.unwrap(a), euint4.unwrap(b)));
+ return euint4.wrap(Impl.or(euint4.unwrap(a), euint4.unwrap(b), false));
}
// Evaluate xor(a, b) and return the result.
@@ -129,7 +143,7 @@ library TFHE {
if (!isInitialized(b)) {
b = asEuint4(0);
}
- return euint4.wrap(Impl.xor(euint4.unwrap(a), euint4.unwrap(b)));
+ return euint4.wrap(Impl.xor(euint4.unwrap(a), euint4.unwrap(b), false));
}
// Evaluate eq(a, b) and return the result.
@@ -261,7 +275,7 @@ library TFHE {
if (!isInitialized(b)) {
b = asEuint8(0);
}
- return euint8.wrap(Impl.and(euint8.unwrap(asEuint8(a)), euint8.unwrap(b)));
+ return euint8.wrap(Impl.and(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false));
}
// Evaluate or(a, b) and return the result.
@@ -272,7 +286,7 @@ library TFHE {
if (!isInitialized(b)) {
b = asEuint8(0);
}
- return euint8.wrap(Impl.or(euint8.unwrap(asEuint8(a)), euint8.unwrap(b)));
+ return euint8.wrap(Impl.or(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false));
}
// Evaluate xor(a, b) and return the result.
@@ -283,7 +297,7 @@ library TFHE {
if (!isInitialized(b)) {
b = asEuint8(0);
}
- return euint8.wrap(Impl.xor(euint8.unwrap(asEuint8(a)), euint8.unwrap(b)));
+ return euint8.wrap(Impl.xor(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false));
}
// Evaluate eq(a, b) and return the result.
@@ -415,7 +429,7 @@ library TFHE {
if (!isInitialized(b)) {
b = asEuint16(0);
}
- return euint16.wrap(Impl.and(euint16.unwrap(asEuint16(a)), euint16.unwrap(b)));
+ return euint16.wrap(Impl.and(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
// Evaluate or(a, b) and return the result.
@@ -426,7 +440,7 @@ library TFHE {
if (!isInitialized(b)) {
b = asEuint16(0);
}
- return euint16.wrap(Impl.or(euint16.unwrap(asEuint16(a)), euint16.unwrap(b)));
+ return euint16.wrap(Impl.or(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
// Evaluate xor(a, b) and return the result.
@@ -437,7 +451,7 @@ library TFHE {
if (!isInitialized(b)) {
b = asEuint16(0);
}
- return euint16.wrap(Impl.xor(euint16.unwrap(asEuint16(a)), euint16.unwrap(b)));
+ return euint16.wrap(Impl.xor(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
// Evaluate eq(a, b) and return the result.
@@ -569,7 +583,7 @@ library TFHE {
if (!isInitialized(b)) {
b = asEuint32(0);
}
- return euint32.wrap(Impl.and(euint32.unwrap(asEuint32(a)), euint32.unwrap(b)));
+ return euint32.wrap(Impl.and(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
// Evaluate or(a, b) and return the result.
@@ -580,7 +594,7 @@ library TFHE {
if (!isInitialized(b)) {
b = asEuint32(0);
}
- return euint32.wrap(Impl.or(euint32.unwrap(asEuint32(a)), euint32.unwrap(b)));
+ return euint32.wrap(Impl.or(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
// Evaluate xor(a, b) and return the result.
@@ -591,7 +605,7 @@ library TFHE {
if (!isInitialized(b)) {
b = asEuint32(0);
}
- return euint32.wrap(Impl.xor(euint32.unwrap(asEuint32(a)), euint32.unwrap(b)));
+ return euint32.wrap(Impl.xor(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
// Evaluate eq(a, b) and return the result.
@@ -723,7 +737,7 @@ library TFHE {
if (!isInitialized(b)) {
b = asEuint64(0);
}
- return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b)));
+ return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
// Evaluate or(a, b) and return the result.
@@ -734,7 +748,7 @@ library TFHE {
if (!isInitialized(b)) {
b = asEuint64(0);
}
- return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b)));
+ return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
// Evaluate xor(a, b) and return the result.
@@ -745,7 +759,7 @@ library TFHE {
if (!isInitialized(b)) {
b = asEuint64(0);
}
- return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b)));
+ return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
// Evaluate eq(a, b) and return the result.
@@ -837,4048 +851,8466 @@ library TFHE {
}
// Evaluate add(a, b) and return the result.
- function add(euint4 a, uint8 b) internal returns (euint4) {
+ function add(euint4 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint4(0);
}
- return euint4.wrap(Impl.add(euint4.unwrap(a), uint256(b), true));
- }
-
- // Evaluate add(a, b) and return the result.
- function add(uint8 a, euint4 b) internal returns (euint4) {
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return euint4.wrap(Impl.add(euint4.unwrap(b), uint256(a), true));
+ return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint4 a, uint8 b) internal returns (euint4) {
+ function sub(euint4 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint4(0);
}
- return euint4.wrap(Impl.sub(euint4.unwrap(a), uint256(b), true));
- }
-
- // Evaluate sub(a, b) and return the result.
- function sub(uint8 a, euint4 b) internal returns (euint4) {
- euint4 aEnc = asEuint4(a);
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return euint4.wrap(Impl.sub(euint4.unwrap(aEnc), euint4.unwrap(b), false));
+ return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint4 a, uint8 b) internal returns (euint4) {
+ function mul(euint4 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint4(0);
}
- return euint4.wrap(Impl.mul(euint4.unwrap(a), uint256(b), true));
- }
-
- // Evaluate mul(a, b) and return the result.
- function mul(uint8 a, euint4 b) internal returns (euint4) {
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return euint4.wrap(Impl.mul(euint4.unwrap(b), uint256(a), true));
+ return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
- // Evaluate div(a, b) and return the result.
- function div(euint4 a, uint8 b) internal returns (euint4) {
+ // Evaluate and(a, b) and return the result.
+ function and(euint4 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint4(0);
}
- return euint4.wrap(Impl.div(euint4.unwrap(a), uint256(b)));
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
- // Evaluate rem(a, b) and return the result.
- function rem(euint4 a, uint8 b) internal returns (euint4) {
+ // Evaluate or(a, b) and return the result.
+ function or(euint4 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint4(0);
}
- return euint4.wrap(Impl.rem(euint4.unwrap(a), uint256(b)));
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
- // Evaluate eq(a, b) and return the result.
- function eq(euint4 a, uint8 b) internal returns (ebool) {
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint4 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint4(0);
}
- return ebool.wrap(Impl.eq(euint4.unwrap(a), uint256(b), true));
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(uint8 a, euint4 b) internal returns (ebool) {
+ function eq(euint4 a, euint128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint4(0);
+ }
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.eq(euint4.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint4 a, uint8 b) internal returns (ebool) {
+ function ne(euint4 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint4(0);
}
- return ebool.wrap(Impl.ne(euint4.unwrap(a), uint256(b), true));
- }
-
- // Evaluate ne(a, b) and return the result.
- function ne(uint8 a, euint4 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.ne(euint4.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint4 a, uint8 b) internal returns (ebool) {
+ function ge(euint4 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint4(0);
}
- return ebool.wrap(Impl.ge(euint4.unwrap(a), uint256(b), true));
- }
-
- // Evaluate ge(a, b) and return the result.
- function ge(uint8 a, euint4 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.le(euint4.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint4 a, uint8 b) internal returns (ebool) {
+ function gt(euint4 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint4(0);
}
- return ebool.wrap(Impl.gt(euint4.unwrap(a), uint256(b), true));
- }
-
- // Evaluate gt(a, b) and return the result.
- function gt(uint8 a, euint4 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.lt(euint4.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint4 a, uint8 b) internal returns (ebool) {
+ function le(euint4 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint4(0);
}
- return ebool.wrap(Impl.le(euint4.unwrap(a), uint256(b), true));
- }
-
- // Evaluate le(a, b) and return the result.
- function le(uint8 a, euint4 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.ge(euint4.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint4 a, uint8 b) internal returns (ebool) {
+ function lt(euint4 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint4(0);
}
- return ebool.wrap(Impl.lt(euint4.unwrap(a), uint256(b), true));
- }
-
- // Evaluate lt(a, b) and return the result.
- function lt(uint8 a, euint4 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.gt(euint4.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint4 a, uint8 b) internal returns (euint4) {
+ function min(euint4 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint4(0);
}
- return euint4.wrap(Impl.min(euint4.unwrap(a), uint256(b), true));
- }
-
- // Evaluate min(a, b) and return the result.
- function min(uint8 a, euint4 b) internal returns (euint4) {
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return euint4.wrap(Impl.min(euint4.unwrap(b), uint256(a), true));
+ return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint4 a, uint8 b) internal returns (euint4) {
+ function max(euint4 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
a = asEuint4(0);
}
- return euint4.wrap(Impl.max(euint4.unwrap(a), uint256(b), true));
- }
-
- // Evaluate max(a, b) and return the result.
- function max(uint8 a, euint4 b) internal returns (euint4) {
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return euint4.wrap(Impl.max(euint4.unwrap(b), uint256(a), true));
+ return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint8 a, euint4 b) internal returns (euint8) {
+ function add(euint4 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint256(0);
}
- return euint8.wrap(Impl.add(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
+ return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint8 a, euint4 b) internal returns (euint8) {
+ function sub(euint4 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint256(0);
}
- return euint8.wrap(Impl.sub(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
+ return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint8 a, euint4 b) internal returns (euint8) {
+ function mul(euint4 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint256(0);
}
- return euint8.wrap(Impl.mul(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
+ return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate and(a, b) and return the result.
- function and(euint8 a, euint4 b) internal returns (euint8) {
+ function and(euint4 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint256(0);
}
- return euint8.wrap(Impl.and(euint8.unwrap(a), euint8.unwrap(asEuint8(b))));
+ return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate or(a, b) and return the result.
- function or(euint8 a, euint4 b) internal returns (euint8) {
+ function or(euint4 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint256(0);
}
- return euint8.wrap(Impl.or(euint8.unwrap(a), euint8.unwrap(asEuint8(b))));
+ return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate xor(a, b) and return the result.
- function xor(euint8 a, euint4 b) internal returns (euint8) {
+ function xor(euint4 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint256(0);
}
- return euint8.wrap(Impl.xor(euint8.unwrap(a), euint8.unwrap(asEuint8(b))));
+ return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint8 a, euint4 b) internal returns (ebool) {
+ function eq(euint4 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.eq(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
+ return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint8 a, euint4 b) internal returns (ebool) {
+ function ne(euint4 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.ne(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
+ return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint8 a, euint4 b) internal returns (ebool) {
+ function ge(euint4 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.ge(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
+ return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint8 a, euint4 b) internal returns (ebool) {
+ function gt(euint4 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.gt(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
+ return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint8 a, euint4 b) internal returns (ebool) {
+ function le(euint4 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.le(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
+ return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint8 a, euint4 b) internal returns (ebool) {
+ function lt(euint4 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.lt(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
+ return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint8 a, euint4 b) internal returns (euint8) {
+ function min(euint4 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint256(0);
}
- return euint8.wrap(Impl.min(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
+ return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint8 a, euint4 b) internal returns (euint8) {
+ function max(euint4 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint256(0);
}
- return euint8.wrap(Impl.max(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
+ return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint8 a, euint8 b) internal returns (euint8) {
+ function add(euint4 a, uint8 b) internal returns (euint4) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
+ return euint4.wrap(Impl.add(euint4.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(uint8 a, euint4 b) internal returns (euint4) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint4(0);
}
- return euint8.wrap(Impl.add(euint8.unwrap(a), euint8.unwrap(b), false));
+ return euint4.wrap(Impl.add(euint4.unwrap(b), uint256(a), true));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint8 a, euint8 b) internal returns (euint8) {
+ function sub(euint4 a, uint8 b) internal returns (euint4) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
+ return euint4.wrap(Impl.sub(euint4.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(uint8 a, euint4 b) internal returns (euint4) {
+ euint4 aEnc = asEuint4(a);
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint4(0);
}
- return euint8.wrap(Impl.sub(euint8.unwrap(a), euint8.unwrap(b), false));
+ return euint4.wrap(Impl.sub(euint4.unwrap(aEnc), euint4.unwrap(b), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint8 a, euint8 b) internal returns (euint8) {
+ function mul(euint4 a, uint8 b) internal returns (euint4) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
+ return euint4.wrap(Impl.mul(euint4.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(uint8 a, euint4 b) internal returns (euint4) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint4(0);
}
- return euint8.wrap(Impl.mul(euint8.unwrap(a), euint8.unwrap(b), false));
+ return euint4.wrap(Impl.mul(euint4.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate div(a, b) and return the result.
+ function div(euint4 a, uint8 b) internal returns (euint4) {
+ if (!isInitialized(a)) {
+ a = asEuint4(0);
+ }
+ return euint4.wrap(Impl.div(euint4.unwrap(a), uint256(b)));
+ }
+
+ // Evaluate rem(a, b) and return the result.
+ function rem(euint4 a, uint8 b) internal returns (euint4) {
+ if (!isInitialized(a)) {
+ a = asEuint4(0);
+ }
+ return euint4.wrap(Impl.rem(euint4.unwrap(a), uint256(b)));
}
// Evaluate and(a, b) and return the result.
- function and(euint8 a, euint8 b) internal returns (euint8) {
+ function and(euint4 a, uint8 b) internal returns (euint4) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
+ return euint4.wrap(Impl.and(euint4.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(uint8 a, euint4 b) internal returns (euint4) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint4(0);
}
- return euint8.wrap(Impl.and(euint8.unwrap(a), euint8.unwrap(b)));
+ return euint4.wrap(Impl.and(euint4.unwrap(b), uint256(a), true));
}
// Evaluate or(a, b) and return the result.
- function or(euint8 a, euint8 b) internal returns (euint8) {
+ function or(euint4 a, uint8 b) internal returns (euint4) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
+ return euint4.wrap(Impl.or(euint4.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(uint8 a, euint4 b) internal returns (euint4) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint4(0);
}
- return euint8.wrap(Impl.or(euint8.unwrap(a), euint8.unwrap(b)));
+ return euint4.wrap(Impl.or(euint4.unwrap(b), uint256(a), true));
}
// Evaluate xor(a, b) and return the result.
- function xor(euint8 a, euint8 b) internal returns (euint8) {
+ function xor(euint4 a, uint8 b) internal returns (euint4) {
if (!isInitialized(a)) {
- a = asEuint8(0);
- }
- if (!isInitialized(b)) {
- b = asEuint8(0);
+ a = asEuint4(0);
}
- return euint8.wrap(Impl.xor(euint8.unwrap(a), euint8.unwrap(b)));
+ return euint4.wrap(Impl.xor(euint4.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(uint8 a, euint4 b) internal returns (euint4) {
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint4.wrap(Impl.xor(euint4.unwrap(b), uint256(a), true));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint8 a, euint8 b) internal returns (ebool) {
+ function eq(euint4 a, uint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
+ return ebool.wrap(Impl.eq(euint4.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(uint8 a, euint4 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.eq(euint8.unwrap(a), euint8.unwrap(b), false));
+ return ebool.wrap(Impl.eq(euint4.unwrap(b), uint256(a), true));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint8 a, euint8 b) internal returns (ebool) {
+ function ne(euint4 a, uint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
+ return ebool.wrap(Impl.ne(euint4.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(uint8 a, euint4 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.ne(euint8.unwrap(a), euint8.unwrap(b), false));
+ return ebool.wrap(Impl.ne(euint4.unwrap(b), uint256(a), true));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint8 a, euint8 b) internal returns (ebool) {
+ function ge(euint4 a, uint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
+ return ebool.wrap(Impl.ge(euint4.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(uint8 a, euint4 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.ge(euint8.unwrap(a), euint8.unwrap(b), false));
+ return ebool.wrap(Impl.le(euint4.unwrap(b), uint256(a), true));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint8 a, euint8 b) internal returns (ebool) {
+ function gt(euint4 a, uint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
+ return ebool.wrap(Impl.gt(euint4.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(uint8 a, euint4 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.gt(euint8.unwrap(a), euint8.unwrap(b), false));
+ return ebool.wrap(Impl.lt(euint4.unwrap(b), uint256(a), true));
}
// Evaluate le(a, b) and return the result.
- function le(euint8 a, euint8 b) internal returns (ebool) {
+ function le(euint4 a, uint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
+ return ebool.wrap(Impl.le(euint4.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(uint8 a, euint4 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.le(euint8.unwrap(a), euint8.unwrap(b), false));
+ return ebool.wrap(Impl.ge(euint4.unwrap(b), uint256(a), true));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint8 a, euint8 b) internal returns (ebool) {
+ function lt(euint4 a, uint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
+ return ebool.wrap(Impl.lt(euint4.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(uint8 a, euint4 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.lt(euint8.unwrap(a), euint8.unwrap(b), false));
+ return ebool.wrap(Impl.gt(euint4.unwrap(b), uint256(a), true));
}
// Evaluate min(a, b) and return the result.
- function min(euint8 a, euint8 b) internal returns (euint8) {
+ function min(euint4 a, uint8 b) internal returns (euint4) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
+ return euint4.wrap(Impl.min(euint4.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(uint8 a, euint4 b) internal returns (euint4) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint4(0);
}
- return euint8.wrap(Impl.min(euint8.unwrap(a), euint8.unwrap(b), false));
+ return euint4.wrap(Impl.min(euint4.unwrap(b), uint256(a), true));
}
// Evaluate max(a, b) and return the result.
- function max(euint8 a, euint8 b) internal returns (euint8) {
+ function max(euint4 a, uint8 b) internal returns (euint4) {
if (!isInitialized(a)) {
- a = asEuint8(0);
+ a = asEuint4(0);
}
+ return euint4.wrap(Impl.max(euint4.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(uint8 a, euint4 b) internal returns (euint4) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint4(0);
}
- return euint8.wrap(Impl.max(euint8.unwrap(a), euint8.unwrap(b), false));
+ return euint4.wrap(Impl.max(euint4.unwrap(b), uint256(a), true));
}
// Evaluate add(a, b) and return the result.
- function add(euint8 a, euint16 b) internal returns (euint16) {
+ function add(euint8 a, euint4 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return euint16.wrap(Impl.add(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
+ return euint8.wrap(Impl.add(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint8 a, euint16 b) internal returns (euint16) {
+ function sub(euint8 a, euint4 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return euint16.wrap(Impl.sub(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
+ return euint8.wrap(Impl.sub(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint8 a, euint16 b) internal returns (euint16) {
+ function mul(euint8 a, euint4 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return euint16.wrap(Impl.mul(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
+ return euint8.wrap(Impl.mul(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
}
// Evaluate and(a, b) and return the result.
- function and(euint8 a, euint16 b) internal returns (euint16) {
+ function and(euint8 a, euint4 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return euint16.wrap(Impl.and(euint16.unwrap(asEuint16(a)), euint16.unwrap(b)));
+ return euint8.wrap(Impl.and(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
}
// Evaluate or(a, b) and return the result.
- function or(euint8 a, euint16 b) internal returns (euint16) {
+ function or(euint8 a, euint4 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return euint16.wrap(Impl.or(euint16.unwrap(asEuint16(a)), euint16.unwrap(b)));
+ return euint8.wrap(Impl.or(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
}
// Evaluate xor(a, b) and return the result.
- function xor(euint8 a, euint16 b) internal returns (euint16) {
+ function xor(euint8 a, euint4 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return euint16.wrap(Impl.xor(euint16.unwrap(asEuint16(a)), euint16.unwrap(b)));
+ return euint8.wrap(Impl.xor(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint8 a, euint16 b) internal returns (ebool) {
+ function eq(euint8 a, euint4 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.eq(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
+ return ebool.wrap(Impl.eq(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint8 a, euint16 b) internal returns (ebool) {
+ function ne(euint8 a, euint4 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.ne(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
+ return ebool.wrap(Impl.ne(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint8 a, euint16 b) internal returns (ebool) {
+ function ge(euint8 a, euint4 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.ge(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
+ return ebool.wrap(Impl.ge(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint8 a, euint16 b) internal returns (ebool) {
+ function gt(euint8 a, euint4 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.gt(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
+ return ebool.wrap(Impl.gt(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint8 a, euint16 b) internal returns (ebool) {
+ function le(euint8 a, euint4 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.le(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
+ return ebool.wrap(Impl.le(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint8 a, euint16 b) internal returns (ebool) {
+ function lt(euint8 a, euint4 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.lt(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
+ return ebool.wrap(Impl.lt(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint8 a, euint16 b) internal returns (euint16) {
+ function min(euint8 a, euint4 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return euint16.wrap(Impl.min(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
+ return euint8.wrap(Impl.min(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint8 a, euint16 b) internal returns (euint16) {
+ function max(euint8 a, euint4 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return euint16.wrap(Impl.max(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
+ return euint8.wrap(Impl.max(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint8 a, euint32 b) internal returns (euint32) {
+ function add(euint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.add(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return euint8.wrap(Impl.add(euint8.unwrap(a), euint8.unwrap(b), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint8 a, euint32 b) internal returns (euint32) {
+ function sub(euint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.sub(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return euint8.wrap(Impl.sub(euint8.unwrap(a), euint8.unwrap(b), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint8 a, euint32 b) internal returns (euint32) {
+ function mul(euint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.mul(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return euint8.wrap(Impl.mul(euint8.unwrap(a), euint8.unwrap(b), false));
}
// Evaluate and(a, b) and return the result.
- function and(euint8 a, euint32 b) internal returns (euint32) {
+ function and(euint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.and(euint32.unwrap(asEuint32(a)), euint32.unwrap(b)));
+ return euint8.wrap(Impl.and(euint8.unwrap(a), euint8.unwrap(b), false));
}
// Evaluate or(a, b) and return the result.
- function or(euint8 a, euint32 b) internal returns (euint32) {
+ function or(euint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.or(euint32.unwrap(asEuint32(a)), euint32.unwrap(b)));
+ return euint8.wrap(Impl.or(euint8.unwrap(a), euint8.unwrap(b), false));
}
// Evaluate xor(a, b) and return the result.
- function xor(euint8 a, euint32 b) internal returns (euint32) {
+ function xor(euint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.xor(euint32.unwrap(asEuint32(a)), euint32.unwrap(b)));
+ return euint8.wrap(Impl.xor(euint8.unwrap(a), euint8.unwrap(b), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint8 a, euint32 b) internal returns (ebool) {
+ function eq(euint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return ebool.wrap(Impl.eq(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return ebool.wrap(Impl.eq(euint8.unwrap(a), euint8.unwrap(b), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint8 a, euint32 b) internal returns (ebool) {
+ function ne(euint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return ebool.wrap(Impl.ne(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return ebool.wrap(Impl.ne(euint8.unwrap(a), euint8.unwrap(b), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint8 a, euint32 b) internal returns (ebool) {
+ function ge(euint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return ebool.wrap(Impl.ge(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return ebool.wrap(Impl.ge(euint8.unwrap(a), euint8.unwrap(b), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint8 a, euint32 b) internal returns (ebool) {
+ function gt(euint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return ebool.wrap(Impl.gt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return ebool.wrap(Impl.gt(euint8.unwrap(a), euint8.unwrap(b), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint8 a, euint32 b) internal returns (ebool) {
+ function le(euint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return ebool.wrap(Impl.le(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return ebool.wrap(Impl.le(euint8.unwrap(a), euint8.unwrap(b), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint8 a, euint32 b) internal returns (ebool) {
+ function lt(euint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return ebool.wrap(Impl.lt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return ebool.wrap(Impl.lt(euint8.unwrap(a), euint8.unwrap(b), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint8 a, euint32 b) internal returns (euint32) {
+ function min(euint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.min(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return euint8.wrap(Impl.min(euint8.unwrap(a), euint8.unwrap(b), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint8 a, euint32 b) internal returns (euint32) {
+ function max(euint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.max(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return euint8.wrap(Impl.max(euint8.unwrap(a), euint8.unwrap(b), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint8 a, euint64 b) internal returns (euint64) {
+ function add(euint8 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return euint16.wrap(Impl.add(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint8 a, euint64 b) internal returns (euint64) {
+ function sub(euint8 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return euint16.wrap(Impl.sub(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint8 a, euint64 b) internal returns (euint64) {
+ function mul(euint8 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return euint16.wrap(Impl.mul(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
// Evaluate and(a, b) and return the result.
- function and(euint8 a, euint64 b) internal returns (euint64) {
+ function and(euint8 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b)));
+ return euint16.wrap(Impl.and(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
// Evaluate or(a, b) and return the result.
- function or(euint8 a, euint64 b) internal returns (euint64) {
+ function or(euint8 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b)));
+ return euint16.wrap(Impl.or(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
// Evaluate xor(a, b) and return the result.
- function xor(euint8 a, euint64 b) internal returns (euint64) {
+ function xor(euint8 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b)));
+ return euint16.wrap(Impl.xor(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint8 a, euint64 b) internal returns (ebool) {
+ function eq(euint8 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.eq(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint8 a, euint64 b) internal returns (ebool) {
+ function ne(euint8 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.ne(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint8 a, euint64 b) internal returns (ebool) {
+ function ge(euint8 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.ge(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint8 a, euint64 b) internal returns (ebool) {
+ function gt(euint8 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.gt(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint8 a, euint64 b) internal returns (ebool) {
+ function le(euint8 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.le(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint8 a, euint64 b) internal returns (ebool) {
+ function lt(euint8 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.lt(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint8 a, euint64 b) internal returns (euint64) {
+ function min(euint8 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return euint16.wrap(Impl.min(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint8 a, euint64 b) internal returns (euint64) {
+ function max(euint8 a, euint16 b) internal returns (euint16) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return euint16.wrap(Impl.max(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint8 a, uint8 b) internal returns (euint8) {
+ function add(euint8 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
- return euint8.wrap(Impl.add(euint8.unwrap(a), uint256(b), true));
- }
-
- // Evaluate add(a, b) and return the result.
- function add(uint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return euint8.wrap(Impl.add(euint8.unwrap(b), uint256(a), true));
+ return euint32.wrap(Impl.add(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint8 a, uint8 b) internal returns (euint8) {
+ function sub(euint8 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
- return euint8.wrap(Impl.sub(euint8.unwrap(a), uint256(b), true));
- }
-
- // Evaluate sub(a, b) and return the result.
- function sub(uint8 a, euint8 b) internal returns (euint8) {
- euint8 aEnc = asEuint8(a);
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return euint8.wrap(Impl.sub(euint8.unwrap(aEnc), euint8.unwrap(b), false));
+ return euint32.wrap(Impl.sub(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint8 a, uint8 b) internal returns (euint8) {
+ function mul(euint8 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
- return euint8.wrap(Impl.mul(euint8.unwrap(a), uint256(b), true));
- }
-
- // Evaluate mul(a, b) and return the result.
- function mul(uint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return euint8.wrap(Impl.mul(euint8.unwrap(b), uint256(a), true));
+ return euint32.wrap(Impl.mul(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
- // Evaluate div(a, b) and return the result.
- function div(euint8 a, uint8 b) internal returns (euint8) {
+ // Evaluate and(a, b) and return the result.
+ function and(euint8 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
- return euint8.wrap(Impl.div(euint8.unwrap(a), uint256(b)));
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.and(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
- // Evaluate rem(a, b) and return the result.
- function rem(euint8 a, uint8 b) internal returns (euint8) {
+ // Evaluate or(a, b) and return the result.
+ function or(euint8 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
- return euint8.wrap(Impl.rem(euint8.unwrap(a), uint256(b)));
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.or(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
- // Evaluate eq(a, b) and return the result.
- function eq(euint8 a, uint8 b) internal returns (ebool) {
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint8 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
- return ebool.wrap(Impl.eq(euint8.unwrap(a), uint256(b), true));
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.xor(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(uint8 a, euint8 b) internal returns (ebool) {
+ function eq(euint8 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return ebool.wrap(Impl.eq(euint8.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.eq(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint8 a, uint8 b) internal returns (ebool) {
+ function ne(euint8 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
- return ebool.wrap(Impl.ne(euint8.unwrap(a), uint256(b), true));
- }
-
- // Evaluate ne(a, b) and return the result.
- function ne(uint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return ebool.wrap(Impl.ne(euint8.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.ne(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint8 a, uint8 b) internal returns (ebool) {
+ function ge(euint8 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
- return ebool.wrap(Impl.ge(euint8.unwrap(a), uint256(b), true));
- }
-
- // Evaluate ge(a, b) and return the result.
- function ge(uint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return ebool.wrap(Impl.le(euint8.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.ge(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint8 a, uint8 b) internal returns (ebool) {
+ function gt(euint8 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
- return ebool.wrap(Impl.gt(euint8.unwrap(a), uint256(b), true));
- }
-
- // Evaluate gt(a, b) and return the result.
- function gt(uint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return ebool.wrap(Impl.lt(euint8.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.gt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint8 a, uint8 b) internal returns (ebool) {
+ function le(euint8 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
- return ebool.wrap(Impl.le(euint8.unwrap(a), uint256(b), true));
- }
-
- // Evaluate le(a, b) and return the result.
- function le(uint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return ebool.wrap(Impl.ge(euint8.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.le(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint8 a, uint8 b) internal returns (ebool) {
+ function lt(euint8 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
- return ebool.wrap(Impl.lt(euint8.unwrap(a), uint256(b), true));
- }
-
- // Evaluate lt(a, b) and return the result.
- function lt(uint8 a, euint8 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return ebool.wrap(Impl.gt(euint8.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.lt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint8 a, uint8 b) internal returns (euint8) {
+ function min(euint8 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
- return euint8.wrap(Impl.min(euint8.unwrap(a), uint256(b), true));
- }
-
- // Evaluate min(a, b) and return the result.
- function min(uint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return euint8.wrap(Impl.min(euint8.unwrap(b), uint256(a), true));
+ return euint32.wrap(Impl.min(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint8 a, uint8 b) internal returns (euint8) {
+ function max(euint8 a, euint32 b) internal returns (euint32) {
if (!isInitialized(a)) {
a = asEuint8(0);
}
- return euint8.wrap(Impl.max(euint8.unwrap(a), uint256(b), true));
- }
-
- // Evaluate max(a, b) and return the result.
- function max(uint8 a, euint8 b) internal returns (euint8) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return euint8.wrap(Impl.max(euint8.unwrap(b), uint256(a), true));
+ return euint32.wrap(Impl.max(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint16 a, euint4 b) internal returns (euint16) {
+ function add(euint8 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint64(0);
}
- return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint16 a, euint4 b) internal returns (euint16) {
+ function sub(euint8 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint64(0);
}
- return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint16 a, euint4 b) internal returns (euint16) {
+ function mul(euint8 a, euint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint8(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint64(0);
}
- return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint8 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint8 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint8 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint8 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint8 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint8 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint8 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint8 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint8 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint8 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint8 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint8 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint8 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint8 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint8 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint8 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint8 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint8 a, euint128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint8 a, euint128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint8 a, euint128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint8 a, euint128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint8 a, euint128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint8 a, euint128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint8 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint8 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint8 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint8 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint8 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint8 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint8 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint8 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint8 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint8 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint8 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint8 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint8 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint8 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint8 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint8 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint8 a, uint8 b) internal returns (euint8) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ return euint8.wrap(Impl.add(euint8.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(uint8 a, euint8 b) internal returns (euint8) {
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint8.wrap(Impl.add(euint8.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint8 a, uint8 b) internal returns (euint8) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ return euint8.wrap(Impl.sub(euint8.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(uint8 a, euint8 b) internal returns (euint8) {
+ euint8 aEnc = asEuint8(a);
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint8.wrap(Impl.sub(euint8.unwrap(aEnc), euint8.unwrap(b), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint8 a, uint8 b) internal returns (euint8) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ return euint8.wrap(Impl.mul(euint8.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(uint8 a, euint8 b) internal returns (euint8) {
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint8.wrap(Impl.mul(euint8.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate div(a, b) and return the result.
+ function div(euint8 a, uint8 b) internal returns (euint8) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ return euint8.wrap(Impl.div(euint8.unwrap(a), uint256(b)));
+ }
+
+ // Evaluate rem(a, b) and return the result.
+ function rem(euint8 a, uint8 b) internal returns (euint8) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ return euint8.wrap(Impl.rem(euint8.unwrap(a), uint256(b)));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint8 a, uint8 b) internal returns (euint8) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ return euint8.wrap(Impl.and(euint8.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(uint8 a, euint8 b) internal returns (euint8) {
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint8.wrap(Impl.and(euint8.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint8 a, uint8 b) internal returns (euint8) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ return euint8.wrap(Impl.or(euint8.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(uint8 a, euint8 b) internal returns (euint8) {
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint8.wrap(Impl.or(euint8.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint8 a, uint8 b) internal returns (euint8) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ return euint8.wrap(Impl.xor(euint8.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(uint8 a, euint8 b) internal returns (euint8) {
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint8.wrap(Impl.xor(euint8.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint8 a, uint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ return ebool.wrap(Impl.eq(euint8.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(uint8 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.eq(euint8.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint8 a, uint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ return ebool.wrap(Impl.ne(euint8.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(uint8 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.ne(euint8.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint8 a, uint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ return ebool.wrap(Impl.ge(euint8.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(uint8 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.le(euint8.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint8 a, uint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ return ebool.wrap(Impl.gt(euint8.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(uint8 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.lt(euint8.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint8 a, uint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ return ebool.wrap(Impl.le(euint8.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(uint8 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.ge(euint8.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint8 a, uint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ return ebool.wrap(Impl.lt(euint8.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(uint8 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.gt(euint8.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint8 a, uint8 b) internal returns (euint8) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ return euint8.wrap(Impl.min(euint8.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(uint8 a, euint8 b) internal returns (euint8) {
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint8.wrap(Impl.min(euint8.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint8 a, uint8 b) internal returns (euint8) {
+ if (!isInitialized(a)) {
+ a = asEuint8(0);
+ }
+ return euint8.wrap(Impl.max(euint8.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(uint8 a, euint8 b) internal returns (euint8) {
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint8.wrap(Impl.max(euint8.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint16 a, euint4 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint16 a, euint4 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint16 a, euint4 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
}
// Evaluate and(a, b) and return the result.
function and(euint16 a, euint4 b) internal returns (euint16) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint16 a, euint4 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint16 a, euint4 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint16 a, euint4 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint16 a, euint4 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint16 a, euint4 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint16 a, euint4 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint16 a, euint4 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint16 a, euint4 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint16 a, euint4 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint16 a, euint4 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint16 a, euint8 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint16 a, euint8 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint16 a, euint8 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint16 a, euint8 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint16 a, euint8 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint16 a, euint8 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint16 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint16 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint16 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint16 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint16 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint16 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint16 a, euint8 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint16 a, euint8 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint16 a, euint16 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(b), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint16 a, euint16 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(b), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint16 a, euint16 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(b), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint16 a, euint16 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(b), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint16 a, euint16 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(b), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint16 a, euint16 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(b), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint16 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(b), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint16 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(b), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint16 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(b), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint16 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(b), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint16 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(b), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint16 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(b), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint16 a, euint16 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(b), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint16 a, euint16 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(b), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint16 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.add(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint16 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.sub(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint16 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.mul(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint16 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.and(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint16 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.or(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint16 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.xor(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint16 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.eq(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint16 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.ne(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint16 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.ge(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint16 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.gt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint16 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.le(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint16 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.lt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint16 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.min(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint16 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.max(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint16 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint16 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint16 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint16 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint16 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint16 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint16 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint16 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint16 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint16 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint16 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint16 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint16 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint16 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint16 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint16 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint16 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint16 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint16 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint16 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint16 a, euint128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint16 a, euint128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint16 a, euint128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint16 a, euint128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint16 a, euint128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint16 a, euint128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint16 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint16 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint16 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint16 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint16 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint16 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint16 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint16 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint16 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint16 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint16 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint16 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint16 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint16 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint16 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint16 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint16 a, uint16 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ return euint16.wrap(Impl.add(euint16.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(uint16 a, euint16 b) internal returns (euint16) {
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint16.wrap(Impl.add(euint16.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint16 a, uint16 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ return euint16.wrap(Impl.sub(euint16.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(uint16 a, euint16 b) internal returns (euint16) {
+ euint16 aEnc = asEuint16(a);
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint16.wrap(Impl.sub(euint16.unwrap(aEnc), euint16.unwrap(b), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint16 a, uint16 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ return euint16.wrap(Impl.mul(euint16.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(uint16 a, euint16 b) internal returns (euint16) {
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint16.wrap(Impl.mul(euint16.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate div(a, b) and return the result.
+ function div(euint16 a, uint16 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ return euint16.wrap(Impl.div(euint16.unwrap(a), uint256(b)));
+ }
+
+ // Evaluate rem(a, b) and return the result.
+ function rem(euint16 a, uint16 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ return euint16.wrap(Impl.rem(euint16.unwrap(a), uint256(b)));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint16 a, uint16 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ return euint16.wrap(Impl.and(euint16.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(uint16 a, euint16 b) internal returns (euint16) {
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint16.wrap(Impl.and(euint16.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint16 a, uint16 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ return euint16.wrap(Impl.or(euint16.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(uint16 a, euint16 b) internal returns (euint16) {
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint16.wrap(Impl.or(euint16.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint16 a, uint16 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ return euint16.wrap(Impl.xor(euint16.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(uint16 a, euint16 b) internal returns (euint16) {
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint16.wrap(Impl.xor(euint16.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint16 a, uint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ return ebool.wrap(Impl.eq(euint16.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(uint16 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.eq(euint16.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint16 a, uint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ return ebool.wrap(Impl.ne(euint16.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(uint16 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.ne(euint16.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint16 a, uint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ return ebool.wrap(Impl.ge(euint16.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(uint16 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.le(euint16.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint16 a, uint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ return ebool.wrap(Impl.gt(euint16.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(uint16 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.lt(euint16.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint16 a, uint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ return ebool.wrap(Impl.le(euint16.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(uint16 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.ge(euint16.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint16 a, uint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ return ebool.wrap(Impl.lt(euint16.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(uint16 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.gt(euint16.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint16 a, uint16 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ return euint16.wrap(Impl.min(euint16.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(uint16 a, euint16 b) internal returns (euint16) {
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint16.wrap(Impl.min(euint16.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint16 a, uint16 b) internal returns (euint16) {
+ if (!isInitialized(a)) {
+ a = asEuint16(0);
+ }
+ return euint16.wrap(Impl.max(euint16.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(uint16 a, euint16 b) internal returns (euint16) {
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint16.wrap(Impl.max(euint16.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint32 a, euint4 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint32 a, euint4 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint32 a, euint4 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint32 a, euint4 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint32 a, euint4 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint32 a, euint4 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint32 a, euint4 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint32 a, euint4 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint32 a, euint4 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint32 a, euint4 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint32 a, euint4 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint32 a, euint4 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint32 a, euint4 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint32 a, euint4 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint32 a, euint8 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint32 a, euint8 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint32 a, euint8 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint32 a, euint8 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint32 a, euint8 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint32 a, euint8 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint32 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint32 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint32 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint32 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint32 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint32 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint32 a, euint8 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint32 a, euint8 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint32 a, euint16 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint32 a, euint16 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint32 a, euint16 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint32 a, euint16 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint32 a, euint16 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint32 a, euint16 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint32 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint32 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint32 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint32 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint32 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint32 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint32 a, euint16 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint32 a, euint16 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint32 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(b), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint32 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(b), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint32 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(b), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint32 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(b), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint32 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(b), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint32 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(b), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint32 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(b), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint32 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(b), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint32 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(b), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint32 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(b), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint32 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(b), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint32 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(b), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint32 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(b), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint32 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(b), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint32 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint32 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint32 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint32 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint32 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint32 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint32 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint32 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint32 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint32 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint32 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint32 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint32 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint32 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint32 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint32 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint32 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint32 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint32 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint32 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint32 a, euint128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint32 a, euint128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint32 a, euint128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint32 a, euint128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint32 a, euint128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint32 a, euint128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint32 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint32 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint32 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint32 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint32 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint32 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint32 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint32 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint32 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint32 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint32 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint32 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint32 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint32 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint32 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint32 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint32 a, uint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ return euint32.wrap(Impl.add(euint32.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(uint32 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.add(euint32.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint32 a, uint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ return euint32.wrap(Impl.sub(euint32.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(uint32 a, euint32 b) internal returns (euint32) {
+ euint32 aEnc = asEuint32(a);
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.sub(euint32.unwrap(aEnc), euint32.unwrap(b), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint32 a, uint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ return euint32.wrap(Impl.mul(euint32.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(uint32 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.mul(euint32.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate div(a, b) and return the result.
+ function div(euint32 a, uint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ return euint32.wrap(Impl.div(euint32.unwrap(a), uint256(b)));
+ }
+
+ // Evaluate rem(a, b) and return the result.
+ function rem(euint32 a, uint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ return euint32.wrap(Impl.rem(euint32.unwrap(a), uint256(b)));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint32 a, uint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ return euint32.wrap(Impl.and(euint32.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(uint32 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.and(euint32.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint32 a, uint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ return euint32.wrap(Impl.or(euint32.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(uint32 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.or(euint32.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint32 a, uint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ return euint32.wrap(Impl.xor(euint32.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(uint32 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.xor(euint32.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint32 a, uint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ return ebool.wrap(Impl.eq(euint32.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(uint32 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.eq(euint32.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint32 a, uint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ return ebool.wrap(Impl.ne(euint32.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(uint32 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.ne(euint32.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint32 a, uint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ return ebool.wrap(Impl.ge(euint32.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(uint32 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.le(euint32.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint32 a, uint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ return ebool.wrap(Impl.gt(euint32.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(uint32 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.lt(euint32.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint32 a, uint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ return ebool.wrap(Impl.le(euint32.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(uint32 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.ge(euint32.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint32 a, uint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ return ebool.wrap(Impl.lt(euint32.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(uint32 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.gt(euint32.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint32 a, uint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ return euint32.wrap(Impl.min(euint32.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(uint32 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.min(euint32.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint32 a, uint32 b) internal returns (euint32) {
+ if (!isInitialized(a)) {
+ a = asEuint32(0);
+ }
+ return euint32.wrap(Impl.max(euint32.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(uint32 a, euint32 b) internal returns (euint32) {
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint32.wrap(Impl.max(euint32.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint64 a, euint4 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint64 a, euint4 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint64 a, euint4 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint64 a, euint4 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint64 a, euint4 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint64 a, euint4 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint64 a, euint4 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint64 a, euint4 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint64 a, euint4 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint64 a, euint4 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint64 a, euint4 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint64 a, euint4 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint64 a, euint4 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint64 a, euint4 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint4(0);
+ }
+ return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint64 a, euint8 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint64 a, euint8 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint64 a, euint8 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint64 a, euint8 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint64 a, euint8 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint64 a, euint8 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint64 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint64 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint64 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint64 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint64 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint64 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint64 a, euint8 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint64 a, euint8 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint64 a, euint16 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint64 a, euint16 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint64 a, euint16 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint64 a, euint16 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint64 a, euint16 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint64 a, euint16 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint64 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint64 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint64 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint64 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint64 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint64 a, euint16 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint64 a, euint16 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint64 a, euint16 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint16(0);
+ }
+ return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint64 a, euint32 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint64 a, euint32 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint64 a, euint32 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint64 a, euint32 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint64 a, euint32 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint64 a, euint32 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint64 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint64 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint64 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint64 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint64 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint64 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint64 a, euint32 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint64 a, euint32 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint64 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(b), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint64 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(b), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint64 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(b), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint64 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(b), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint64 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(b), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint64 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(b), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint64 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(b), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint64 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(b), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint64 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(b), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint64 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(b), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint64 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(b), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint64 a, euint64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(b), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint64 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(b), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint64 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(b), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint64 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint64 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint64 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
+ }
+ return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint64 a, euint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint128(0);
}
- return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(asEuint16(b))));
+ return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate or(a, b) and return the result.
- function or(euint16 a, euint4 b) internal returns (euint16) {
+ function or(euint64 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(asEuint16(b))));
+ return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate xor(a, b) and return the result.
- function xor(euint16 a, euint4 b) internal returns (euint16) {
+ function xor(euint64 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(asEuint16(b))));
+ return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint16 a, euint4 b) internal returns (ebool) {
+ function eq(euint64 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint16 a, euint4 b) internal returns (ebool) {
+ function ne(euint64 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint16 a, euint4 b) internal returns (ebool) {
+ function ge(euint64 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint16 a, euint4 b) internal returns (ebool) {
+ function gt(euint64 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint16 a, euint4 b) internal returns (ebool) {
+ function le(euint64 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint16 a, euint4 b) internal returns (ebool) {
+ function lt(euint64 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint16 a, euint4 b) internal returns (euint16) {
+ function min(euint64 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint16 a, euint4 b) internal returns (euint16) {
+ function max(euint64 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint128(0);
}
- return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint16 a, euint8 b) internal returns (euint16) {
+ function add(euint64 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint256(0);
}
- return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint16 a, euint8 b) internal returns (euint16) {
+ function sub(euint64 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint256(0);
}
- return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint16 a, euint8 b) internal returns (euint16) {
+ function mul(euint64 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint256(0);
}
- return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate and(a, b) and return the result.
- function and(euint16 a, euint8 b) internal returns (euint16) {
+ function and(euint64 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint256(0);
}
- return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(asEuint16(b))));
+ return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate or(a, b) and return the result.
- function or(euint16 a, euint8 b) internal returns (euint16) {
+ function or(euint64 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint64 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(euint64 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(euint64 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(euint64 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(euint64 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(euint64 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(euint64 a, euint256 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(euint64 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(euint64 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(euint64 a, uint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ return euint64.wrap(Impl.add(euint64.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(uint64 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.add(euint64.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(euint64 a, uint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ return euint64.wrap(Impl.sub(euint64.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(uint64 a, euint64 b) internal returns (euint64) {
+ euint64 aEnc = asEuint64(a);
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.sub(euint64.unwrap(aEnc), euint64.unwrap(b), false));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(euint64 a, uint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ return euint64.wrap(Impl.mul(euint64.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(uint64 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
+ }
+ return euint64.wrap(Impl.mul(euint64.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate div(a, b) and return the result.
+ function div(euint64 a, uint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ return euint64.wrap(Impl.div(euint64.unwrap(a), uint256(b)));
+ }
+
+ // Evaluate rem(a, b) and return the result.
+ function rem(euint64 a, uint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ return euint64.wrap(Impl.rem(euint64.unwrap(a), uint256(b)));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint64 a, uint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ return euint64.wrap(Impl.and(euint64.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(uint64 a, euint64 b) internal returns (euint64) {
+ if (!isInitialized(b)) {
+ b = asEuint64(0);
}
+ return euint64.wrap(Impl.and(euint64.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint64 a, uint64 b) internal returns (euint64) {
+ if (!isInitialized(a)) {
+ a = asEuint64(0);
+ }
+ return euint64.wrap(Impl.or(euint64.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(uint64 a, euint64 b) internal returns (euint64) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint64(0);
}
- return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(asEuint16(b))));
+ return euint64.wrap(Impl.or(euint64.unwrap(b), uint256(a), true));
}
// Evaluate xor(a, b) and return the result.
- function xor(euint16 a, euint8 b) internal returns (euint16) {
+ function xor(euint64 a, uint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
+ return euint64.wrap(Impl.xor(euint64.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(uint64 a, euint64 b) internal returns (euint64) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint64(0);
}
- return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(asEuint16(b))));
+ return euint64.wrap(Impl.xor(euint64.unwrap(b), uint256(a), true));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint16 a, euint8 b) internal returns (ebool) {
+ function eq(euint64 a, uint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
+ return ebool.wrap(Impl.eq(euint64.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(uint64 a, euint64 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint64(0);
}
- return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return ebool.wrap(Impl.eq(euint64.unwrap(b), uint256(a), true));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint16 a, euint8 b) internal returns (ebool) {
+ function ne(euint64 a, uint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
+ return ebool.wrap(Impl.ne(euint64.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(uint64 a, euint64 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint64(0);
}
- return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return ebool.wrap(Impl.ne(euint64.unwrap(b), uint256(a), true));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint16 a, euint8 b) internal returns (ebool) {
+ function ge(euint64 a, uint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
+ return ebool.wrap(Impl.ge(euint64.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(uint64 a, euint64 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint64(0);
}
- return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return ebool.wrap(Impl.le(euint64.unwrap(b), uint256(a), true));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint16 a, euint8 b) internal returns (ebool) {
+ function gt(euint64 a, uint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
+ return ebool.wrap(Impl.gt(euint64.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(uint64 a, euint64 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint64(0);
}
- return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return ebool.wrap(Impl.lt(euint64.unwrap(b), uint256(a), true));
}
// Evaluate le(a, b) and return the result.
- function le(euint16 a, euint8 b) internal returns (ebool) {
+ function le(euint64 a, uint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
+ return ebool.wrap(Impl.le(euint64.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(uint64 a, euint64 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint64(0);
}
- return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return ebool.wrap(Impl.ge(euint64.unwrap(b), uint256(a), true));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint16 a, euint8 b) internal returns (ebool) {
+ function lt(euint64 a, uint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
+ return ebool.wrap(Impl.lt(euint64.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(uint64 a, euint64 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint64(0);
}
- return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return ebool.wrap(Impl.gt(euint64.unwrap(b), uint256(a), true));
}
// Evaluate min(a, b) and return the result.
- function min(euint16 a, euint8 b) internal returns (euint16) {
+ function min(euint64 a, uint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
+ return euint64.wrap(Impl.min(euint64.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(uint64 a, euint64 b) internal returns (euint64) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint64(0);
}
- return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return euint64.wrap(Impl.min(euint64.unwrap(b), uint256(a), true));
}
// Evaluate max(a, b) and return the result.
- function max(euint16 a, euint8 b) internal returns (euint16) {
+ function max(euint64 a, uint64 b) internal returns (euint64) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint64(0);
}
+ return euint64.wrap(Impl.max(euint64.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(uint64 a, euint64 b) internal returns (euint64) {
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint64(0);
}
- return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false));
+ return euint64.wrap(Impl.max(euint64.unwrap(b), uint256(a), true));
}
// Evaluate add(a, b) and return the result.
- function add(euint16 a, euint16 b) internal returns (euint16) {
+ function add(euint128 a, euint4 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(b), false));
+ return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint16 a, euint16 b) internal returns (euint16) {
+ function sub(euint128 a, euint4 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(b), false));
+ return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint16 a, euint16 b) internal returns (euint16) {
+ function mul(euint128 a, euint4 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(b), false));
+ return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate and(a, b) and return the result.
- function and(euint16 a, euint16 b) internal returns (euint16) {
+ function and(euint128 a, euint4 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(b)));
+ return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate or(a, b) and return the result.
- function or(euint16 a, euint16 b) internal returns (euint16) {
+ function or(euint128 a, euint4 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(b)));
+ return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate xor(a, b) and return the result.
- function xor(euint16 a, euint16 b) internal returns (euint16) {
+ function xor(euint128 a, euint4 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(b)));
+ return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint16 a, euint16 b) internal returns (ebool) {
+ function eq(euint128 a, euint4 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(b), false));
+ return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint16 a, euint16 b) internal returns (ebool) {
+ function ne(euint128 a, euint4 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(b), false));
+ return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint16 a, euint16 b) internal returns (ebool) {
+ function ge(euint128 a, euint4 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(b), false));
+ return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint16 a, euint16 b) internal returns (ebool) {
+ function gt(euint128 a, euint4 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(b), false));
+ return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint16 a, euint16 b) internal returns (ebool) {
+ function le(euint128 a, euint4 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(b), false));
+ return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint16 a, euint16 b) internal returns (ebool) {
+ function lt(euint128 a, euint4 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(b), false));
+ return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint16 a, euint16 b) internal returns (euint16) {
+ function min(euint128 a, euint4 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(b), false));
+ return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint16 a, euint16 b) internal returns (euint16) {
+ function max(euint128 a, euint4 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint4(0);
}
- return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(b), false));
+ return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint16 a, euint32 b) internal returns (euint32) {
+ function add(euint128 a, euint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.add(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint16 a, euint32 b) internal returns (euint32) {
+ function sub(euint128 a, euint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.sub(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint16 a, euint32 b) internal returns (euint32) {
+ function mul(euint128 a, euint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.mul(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate and(a, b) and return the result.
- function and(euint16 a, euint32 b) internal returns (euint32) {
+ function and(euint128 a, euint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.and(euint32.unwrap(asEuint32(a)), euint32.unwrap(b)));
+ return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate or(a, b) and return the result.
- function or(euint16 a, euint32 b) internal returns (euint32) {
+ function or(euint128 a, euint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.or(euint32.unwrap(asEuint32(a)), euint32.unwrap(b)));
+ return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate xor(a, b) and return the result.
- function xor(euint16 a, euint32 b) internal returns (euint32) {
+ function xor(euint128 a, euint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.xor(euint32.unwrap(asEuint32(a)), euint32.unwrap(b)));
+ return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint16 a, euint32 b) internal returns (ebool) {
+ function eq(euint128 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return ebool.wrap(Impl.eq(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint16 a, euint32 b) internal returns (ebool) {
+ function ne(euint128 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return ebool.wrap(Impl.ne(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint16 a, euint32 b) internal returns (ebool) {
+ function ge(euint128 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return ebool.wrap(Impl.ge(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint16 a, euint32 b) internal returns (ebool) {
+ function gt(euint128 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return ebool.wrap(Impl.gt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint16 a, euint32 b) internal returns (ebool) {
+ function le(euint128 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return ebool.wrap(Impl.le(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint16 a, euint32 b) internal returns (ebool) {
+ function lt(euint128 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return ebool.wrap(Impl.lt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint16 a, euint32 b) internal returns (euint32) {
+ function min(euint128 a, euint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.min(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint16 a, euint32 b) internal returns (euint32) {
+ function max(euint128 a, euint8 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.max(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false));
+ return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint16 a, euint64 b) internal returns (euint64) {
+ function add(euint128 a, euint16 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint16 a, euint64 b) internal returns (euint64) {
+ function sub(euint128 a, euint16 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint16 a, euint64 b) internal returns (euint64) {
+ function mul(euint128 a, euint16 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate and(a, b) and return the result.
- function and(euint16 a, euint64 b) internal returns (euint64) {
+ function and(euint128 a, euint16 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b)));
+ return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate or(a, b) and return the result.
- function or(euint16 a, euint64 b) internal returns (euint64) {
+ function or(euint128 a, euint16 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b)));
+ return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate xor(a, b) and return the result.
- function xor(euint16 a, euint64 b) internal returns (euint64) {
+ function xor(euint128 a, euint16 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b)));
+ return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint16 a, euint64 b) internal returns (ebool) {
+ function eq(euint128 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint16 a, euint64 b) internal returns (ebool) {
+ function ne(euint128 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint16 a, euint64 b) internal returns (ebool) {
+ function ge(euint128 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint16 a, euint64 b) internal returns (ebool) {
+ function gt(euint128 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint16 a, euint64 b) internal returns (ebool) {
+ function le(euint128 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint16 a, euint64 b) internal returns (ebool) {
+ function lt(euint128 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint16 a, euint64 b) internal returns (euint64) {
+ function min(euint128 a, euint16 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint16 a, euint64 b) internal returns (euint64) {
+ function max(euint128 a, euint16 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint16 a, uint16 b) internal returns (euint16) {
+ function add(euint128 a, euint32 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
- return euint16.wrap(Impl.add(euint16.unwrap(a), uint256(b), true));
- }
-
- // Evaluate add(a, b) and return the result.
- function add(uint16 a, euint16 b) internal returns (euint16) {
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint32(0);
}
- return euint16.wrap(Impl.add(euint16.unwrap(b), uint256(a), true));
+ return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint16 a, uint16 b) internal returns (euint16) {
+ function sub(euint128 a, euint32 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
- return euint16.wrap(Impl.sub(euint16.unwrap(a), uint256(b), true));
- }
-
- // Evaluate sub(a, b) and return the result.
- function sub(uint16 a, euint16 b) internal returns (euint16) {
- euint16 aEnc = asEuint16(a);
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint32(0);
}
- return euint16.wrap(Impl.sub(euint16.unwrap(aEnc), euint16.unwrap(b), false));
+ return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint16 a, uint16 b) internal returns (euint16) {
+ function mul(euint128 a, euint32 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
- return euint16.wrap(Impl.mul(euint16.unwrap(a), uint256(b), true));
- }
-
- // Evaluate mul(a, b) and return the result.
- function mul(uint16 a, euint16 b) internal returns (euint16) {
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint32(0);
}
- return euint16.wrap(Impl.mul(euint16.unwrap(b), uint256(a), true));
+ return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
- // Evaluate div(a, b) and return the result.
- function div(euint16 a, uint16 b) internal returns (euint16) {
+ // Evaluate and(a, b) and return the result.
+ function and(euint128 a, euint32 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
- return euint16.wrap(Impl.div(euint16.unwrap(a), uint256(b)));
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
- // Evaluate rem(a, b) and return the result.
- function rem(euint16 a, uint16 b) internal returns (euint16) {
+ // Evaluate or(a, b) and return the result.
+ function or(euint128 a, euint32 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
- return euint16.wrap(Impl.rem(euint16.unwrap(a), uint256(b)));
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
- // Evaluate eq(a, b) and return the result.
- function eq(euint16 a, uint16 b) internal returns (ebool) {
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint128 a, euint32 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
- return ebool.wrap(Impl.eq(euint16.unwrap(a), uint256(b), true));
+ if (!isInitialized(b)) {
+ b = asEuint32(0);
+ }
+ return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(uint16 a, euint16 b) internal returns (ebool) {
+ function eq(euint128 a, euint32 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint128(0);
+ }
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint32(0);
}
- return ebool.wrap(Impl.eq(euint16.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint16 a, uint16 b) internal returns (ebool) {
+ function ne(euint128 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
- return ebool.wrap(Impl.ne(euint16.unwrap(a), uint256(b), true));
- }
-
- // Evaluate ne(a, b) and return the result.
- function ne(uint16 a, euint16 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint32(0);
}
- return ebool.wrap(Impl.ne(euint16.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint16 a, uint16 b) internal returns (ebool) {
+ function ge(euint128 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
- return ebool.wrap(Impl.ge(euint16.unwrap(a), uint256(b), true));
- }
-
- // Evaluate ge(a, b) and return the result.
- function ge(uint16 a, euint16 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint32(0);
}
- return ebool.wrap(Impl.le(euint16.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint16 a, uint16 b) internal returns (ebool) {
+ function gt(euint128 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
- return ebool.wrap(Impl.gt(euint16.unwrap(a), uint256(b), true));
- }
-
- // Evaluate gt(a, b) and return the result.
- function gt(uint16 a, euint16 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint32(0);
}
- return ebool.wrap(Impl.lt(euint16.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint16 a, uint16 b) internal returns (ebool) {
+ function le(euint128 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
- return ebool.wrap(Impl.le(euint16.unwrap(a), uint256(b), true));
- }
-
- // Evaluate le(a, b) and return the result.
- function le(uint16 a, euint16 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint32(0);
}
- return ebool.wrap(Impl.ge(euint16.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint16 a, uint16 b) internal returns (ebool) {
+ function lt(euint128 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
- return ebool.wrap(Impl.lt(euint16.unwrap(a), uint256(b), true));
- }
-
- // Evaluate lt(a, b) and return the result.
- function lt(uint16 a, euint16 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint32(0);
}
- return ebool.wrap(Impl.gt(euint16.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint16 a, uint16 b) internal returns (euint16) {
+ function min(euint128 a, euint32 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
- return euint16.wrap(Impl.min(euint16.unwrap(a), uint256(b), true));
- }
-
- // Evaluate min(a, b) and return the result.
- function min(uint16 a, euint16 b) internal returns (euint16) {
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint32(0);
}
- return euint16.wrap(Impl.min(euint16.unwrap(b), uint256(a), true));
+ return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint16 a, uint16 b) internal returns (euint16) {
+ function max(euint128 a, euint32 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint16(0);
+ a = asEuint128(0);
}
- return euint16.wrap(Impl.max(euint16.unwrap(a), uint256(b), true));
- }
-
- // Evaluate max(a, b) and return the result.
- function max(uint16 a, euint16 b) internal returns (euint16) {
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint32(0);
}
- return euint16.wrap(Impl.max(euint16.unwrap(b), uint256(a), true));
+ return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint32 a, euint4 b) internal returns (euint32) {
+ function add(euint128 a, euint64 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint64(0);
}
- return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint32 a, euint4 b) internal returns (euint32) {
+ function sub(euint128 a, euint64 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint64(0);
}
- return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint32 a, euint4 b) internal returns (euint32) {
+ function mul(euint128 a, euint64 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint64(0);
}
- return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate and(a, b) and return the result.
- function and(euint32 a, euint4 b) internal returns (euint32) {
+ function and(euint128 a, euint64 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint64(0);
}
- return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b))));
+ return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate or(a, b) and return the result.
- function or(euint32 a, euint4 b) internal returns (euint32) {
+ function or(euint128 a, euint64 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint64(0);
}
- return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b))));
+ return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate xor(a, b) and return the result.
- function xor(euint32 a, euint4 b) internal returns (euint32) {
+ function xor(euint128 a, euint64 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint64(0);
}
- return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b))));
+ return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint32 a, euint4 b) internal returns (ebool) {
+ function eq(euint128 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint64(0);
}
- return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint32 a, euint4 b) internal returns (ebool) {
+ function ne(euint128 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint64(0);
}
- return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint32 a, euint4 b) internal returns (ebool) {
+ function ge(euint128 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint64(0);
}
- return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint32 a, euint4 b) internal returns (ebool) {
+ function gt(euint128 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint64(0);
}
- return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint32 a, euint4 b) internal returns (ebool) {
+ function le(euint128 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint64(0);
}
- return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint32 a, euint4 b) internal returns (ebool) {
+ function lt(euint128 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint64(0);
}
- return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint32 a, euint4 b) internal returns (euint32) {
+ function min(euint128 a, euint64 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint64(0);
}
- return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint32 a, euint4 b) internal returns (euint32) {
+ function max(euint128 a, euint64 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint64(0);
}
- return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint32 a, euint8 b) internal returns (euint32) {
+ function add(euint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint128(0);
}
- return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(b), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint32 a, euint8 b) internal returns (euint32) {
+ function sub(euint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint128(0);
}
- return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(b), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint32 a, euint8 b) internal returns (euint32) {
+ function mul(euint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint128(0);
}
- return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(b), false));
}
// Evaluate and(a, b) and return the result.
- function and(euint32 a, euint8 b) internal returns (euint32) {
+ function and(euint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint128(0);
}
- return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b))));
+ return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(b), false));
}
// Evaluate or(a, b) and return the result.
- function or(euint32 a, euint8 b) internal returns (euint32) {
+ function or(euint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint128(0);
}
- return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b))));
+ return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(b), false));
}
// Evaluate xor(a, b) and return the result.
- function xor(euint32 a, euint8 b) internal returns (euint32) {
+ function xor(euint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint128(0);
}
- return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b))));
+ return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(b), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint32 a, euint8 b) internal returns (ebool) {
+ function eq(euint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(b), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint32 a, euint8 b) internal returns (ebool) {
+ function ne(euint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(b), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint32 a, euint8 b) internal returns (ebool) {
+ function ge(euint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(b), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint32 a, euint8 b) internal returns (ebool) {
+ function gt(euint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(b), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint32 a, euint8 b) internal returns (ebool) {
+ function le(euint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(b), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint32 a, euint8 b) internal returns (ebool) {
+ function lt(euint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(b), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint32 a, euint8 b) internal returns (euint32) {
+ function min(euint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint128(0);
}
- return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(b), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint32 a, euint8 b) internal returns (euint32) {
+ function max(euint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint128(0);
}
- return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(b), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint32 a, euint16 b) internal returns (euint32) {
+ function add(euint128 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint256(0);
}
- return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint32 a, euint16 b) internal returns (euint32) {
+ function sub(euint128 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint256(0);
}
- return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint32 a, euint16 b) internal returns (euint32) {
+ function mul(euint128 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint256(0);
}
- return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate and(a, b) and return the result.
- function and(euint32 a, euint16 b) internal returns (euint32) {
+ function and(euint128 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint256(0);
}
- return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b))));
+ return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate or(a, b) and return the result.
- function or(euint32 a, euint16 b) internal returns (euint32) {
+ function or(euint128 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint256(0);
}
- return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b))));
+ return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate xor(a, b) and return the result.
- function xor(euint32 a, euint16 b) internal returns (euint32) {
+ function xor(euint128 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint256(0);
}
- return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b))));
+ return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint32 a, euint16 b) internal returns (ebool) {
+ function eq(euint128 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint32 a, euint16 b) internal returns (ebool) {
+ function ne(euint128 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint32 a, euint16 b) internal returns (ebool) {
+ function ge(euint128 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint32 a, euint16 b) internal returns (ebool) {
+ function gt(euint128 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint32 a, euint16 b) internal returns (ebool) {
+ function le(euint128 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint32 a, euint16 b) internal returns (ebool) {
+ function lt(euint128 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint32 a, euint16 b) internal returns (euint32) {
+ function min(euint128 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint256(0);
}
- return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint32 a, euint16 b) internal returns (euint32) {
+ function max(euint128 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint256(0);
}
- return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false));
+ return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint32 a, euint32 b) internal returns (euint32) {
+ function add(euint128 a, uint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
+ return euint128.wrap(Impl.add(euint128.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate add(a, b) and return the result.
+ function add(uint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(b), false));
+ return euint128.wrap(Impl.add(euint128.unwrap(b), uint256(a), true));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint32 a, euint32 b) internal returns (euint32) {
+ function sub(euint128 a, uint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
+ return euint128.wrap(Impl.sub(euint128.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate sub(a, b) and return the result.
+ function sub(uint128 a, euint128 b) internal returns (euint128) {
+ euint128 aEnc = asEuint128(a);
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(b), false));
+ return euint128.wrap(Impl.sub(euint128.unwrap(aEnc), euint128.unwrap(b), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint32 a, euint32 b) internal returns (euint32) {
+ function mul(euint128 a, uint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
+ return euint128.wrap(Impl.mul(euint128.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate mul(a, b) and return the result.
+ function mul(uint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(b), false));
+ return euint128.wrap(Impl.mul(euint128.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate div(a, b) and return the result.
+ function div(euint128 a, uint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint128(0);
+ }
+ return euint128.wrap(Impl.div(euint128.unwrap(a), uint256(b)));
+ }
+
+ // Evaluate rem(a, b) and return the result.
+ function rem(euint128 a, uint128 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint128(0);
+ }
+ return euint128.wrap(Impl.rem(euint128.unwrap(a), uint256(b)));
}
// Evaluate and(a, b) and return the result.
- function and(euint32 a, euint32 b) internal returns (euint32) {
+ function and(euint128 a, uint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
+ return euint128.wrap(Impl.and(euint128.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(uint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(b)));
+ return euint128.wrap(Impl.and(euint128.unwrap(b), uint256(a), true));
}
// Evaluate or(a, b) and return the result.
- function or(euint32 a, euint32 b) internal returns (euint32) {
+ function or(euint128 a, uint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
+ return euint128.wrap(Impl.or(euint128.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(uint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(b)));
+ return euint128.wrap(Impl.or(euint128.unwrap(b), uint256(a), true));
}
// Evaluate xor(a, b) and return the result.
- function xor(euint32 a, euint32 b) internal returns (euint32) {
+ function xor(euint128 a, uint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
+ return euint128.wrap(Impl.xor(euint128.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(uint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(b)));
+ return euint128.wrap(Impl.xor(euint128.unwrap(b), uint256(a), true));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint32 a, euint32 b) internal returns (ebool) {
+ function eq(euint128 a, uint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
+ return ebool.wrap(Impl.eq(euint128.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(uint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(b), false));
+ return ebool.wrap(Impl.eq(euint128.unwrap(b), uint256(a), true));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint32 a, euint32 b) internal returns (ebool) {
+ function ne(euint128 a, uint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
+ return ebool.wrap(Impl.ne(euint128.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(uint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(b), false));
+ return ebool.wrap(Impl.ne(euint128.unwrap(b), uint256(a), true));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint32 a, euint32 b) internal returns (ebool) {
+ function ge(euint128 a, uint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
+ return ebool.wrap(Impl.ge(euint128.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate ge(a, b) and return the result.
+ function ge(uint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(b), false));
+ return ebool.wrap(Impl.le(euint128.unwrap(b), uint256(a), true));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint32 a, euint32 b) internal returns (ebool) {
+ function gt(euint128 a, uint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
+ return ebool.wrap(Impl.gt(euint128.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate gt(a, b) and return the result.
+ function gt(uint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(b), false));
+ return ebool.wrap(Impl.lt(euint128.unwrap(b), uint256(a), true));
}
// Evaluate le(a, b) and return the result.
- function le(euint32 a, euint32 b) internal returns (ebool) {
+ function le(euint128 a, uint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
+ return ebool.wrap(Impl.le(euint128.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate le(a, b) and return the result.
+ function le(uint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(b), false));
+ return ebool.wrap(Impl.ge(euint128.unwrap(b), uint256(a), true));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint32 a, euint32 b) internal returns (ebool) {
+ function lt(euint128 a, uint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
+ return ebool.wrap(Impl.lt(euint128.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate lt(a, b) and return the result.
+ function lt(uint128 a, euint128 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(b), false));
+ return ebool.wrap(Impl.gt(euint128.unwrap(b), uint256(a), true));
}
// Evaluate min(a, b) and return the result.
- function min(euint32 a, euint32 b) internal returns (euint32) {
+ function min(euint128 a, uint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
+ return euint128.wrap(Impl.min(euint128.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate min(a, b) and return the result.
+ function min(uint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(b), false));
+ return euint128.wrap(Impl.min(euint128.unwrap(b), uint256(a), true));
}
// Evaluate max(a, b) and return the result.
- function max(euint32 a, euint32 b) internal returns (euint32) {
+ function max(euint128 a, uint128 b) internal returns (euint128) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint128(0);
}
+ return euint128.wrap(Impl.max(euint128.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate max(a, b) and return the result.
+ function max(uint128 a, euint128 b) internal returns (euint128) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(b), false));
+ return euint128.wrap(Impl.max(euint128.unwrap(b), uint256(a), true));
}
// Evaluate add(a, b) and return the result.
- function add(euint32 a, euint64 b) internal returns (euint64) {
+ function add(euint256 a, euint4 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint4(0);
}
- return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint32 a, euint64 b) internal returns (euint64) {
+ function sub(euint256 a, euint4 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint4(0);
}
- return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint32 a, euint64 b) internal returns (euint64) {
+ function mul(euint256 a, euint4 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint4(0);
}
- return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate and(a, b) and return the result.
- function and(euint32 a, euint64 b) internal returns (euint64) {
+ function and(euint256 a, euint4 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint4(0);
}
- return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b)));
+ return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate or(a, b) and return the result.
- function or(euint32 a, euint64 b) internal returns (euint64) {
+ function or(euint256 a, euint4 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint4(0);
}
- return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b)));
+ return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate xor(a, b) and return the result.
- function xor(euint32 a, euint64 b) internal returns (euint64) {
+ function xor(euint256 a, euint4 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint4(0);
}
- return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b)));
+ return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint32 a, euint64 b) internal returns (ebool) {
+ function eq(euint256 a, euint4 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint32 a, euint64 b) internal returns (ebool) {
+ function ne(euint256 a, euint4 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint32 a, euint64 b) internal returns (ebool) {
+ function ge(euint256 a, euint4 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint32 a, euint64 b) internal returns (ebool) {
+ function gt(euint256 a, euint4 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint32 a, euint64 b) internal returns (ebool) {
+ function le(euint256 a, euint4 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint32 a, euint64 b) internal returns (ebool) {
+ function lt(euint256 a, euint4 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint4(0);
}
- return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint32 a, euint64 b) internal returns (euint64) {
+ function min(euint256 a, euint4 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint4(0);
}
- return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint32 a, euint64 b) internal returns (euint64) {
+ function max(euint256 a, euint4 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint4(0);
}
- return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false));
+ return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint32 a, uint32 b) internal returns (euint32) {
+ function add(euint256 a, euint8 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
- return euint32.wrap(Impl.add(euint32.unwrap(a), uint256(b), true));
- }
-
- // Evaluate add(a, b) and return the result.
- function add(uint32 a, euint32 b) internal returns (euint32) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.add(euint32.unwrap(b), uint256(a), true));
+ return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint32 a, uint32 b) internal returns (euint32) {
+ function sub(euint256 a, euint8 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
- return euint32.wrap(Impl.sub(euint32.unwrap(a), uint256(b), true));
- }
-
- // Evaluate sub(a, b) and return the result.
- function sub(uint32 a, euint32 b) internal returns (euint32) {
- euint32 aEnc = asEuint32(a);
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.sub(euint32.unwrap(aEnc), euint32.unwrap(b), false));
+ return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint32 a, uint32 b) internal returns (euint32) {
+ function mul(euint256 a, euint8 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
- return euint32.wrap(Impl.mul(euint32.unwrap(a), uint256(b), true));
- }
-
- // Evaluate mul(a, b) and return the result.
- function mul(uint32 a, euint32 b) internal returns (euint32) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.mul(euint32.unwrap(b), uint256(a), true));
+ return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
- // Evaluate div(a, b) and return the result.
- function div(euint32 a, uint32 b) internal returns (euint32) {
+ // Evaluate and(a, b) and return the result.
+ function and(euint256 a, euint8 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
- return euint32.wrap(Impl.div(euint32.unwrap(a), uint256(b)));
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
- // Evaluate rem(a, b) and return the result.
- function rem(euint32 a, uint32 b) internal returns (euint32) {
+ // Evaluate or(a, b) and return the result.
+ function or(euint256 a, euint8 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
- return euint32.wrap(Impl.rem(euint32.unwrap(a), uint256(b)));
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
- // Evaluate eq(a, b) and return the result.
- function eq(euint32 a, uint32 b) internal returns (ebool) {
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint256 a, euint8 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
- return ebool.wrap(Impl.eq(euint32.unwrap(a), uint256(b), true));
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(uint32 a, euint32 b) internal returns (ebool) {
+ function eq(euint256 a, euint8 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEuint256(0);
+ }
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return ebool.wrap(Impl.eq(euint32.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint32 a, uint32 b) internal returns (ebool) {
+ function ne(euint256 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
- return ebool.wrap(Impl.ne(euint32.unwrap(a), uint256(b), true));
- }
-
- // Evaluate ne(a, b) and return the result.
- function ne(uint32 a, euint32 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return ebool.wrap(Impl.ne(euint32.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint32 a, uint32 b) internal returns (ebool) {
+ function ge(euint256 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
- return ebool.wrap(Impl.ge(euint32.unwrap(a), uint256(b), true));
- }
-
- // Evaluate ge(a, b) and return the result.
- function ge(uint32 a, euint32 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return ebool.wrap(Impl.le(euint32.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint32 a, uint32 b) internal returns (ebool) {
+ function gt(euint256 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
- return ebool.wrap(Impl.gt(euint32.unwrap(a), uint256(b), true));
- }
-
- // Evaluate gt(a, b) and return the result.
- function gt(uint32 a, euint32 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return ebool.wrap(Impl.lt(euint32.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint32 a, uint32 b) internal returns (ebool) {
+ function le(euint256 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
- return ebool.wrap(Impl.le(euint32.unwrap(a), uint256(b), true));
- }
-
- // Evaluate le(a, b) and return the result.
- function le(uint32 a, euint32 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return ebool.wrap(Impl.ge(euint32.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint32 a, uint32 b) internal returns (ebool) {
+ function lt(euint256 a, euint8 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
- return ebool.wrap(Impl.lt(euint32.unwrap(a), uint256(b), true));
- }
-
- // Evaluate lt(a, b) and return the result.
- function lt(uint32 a, euint32 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return ebool.wrap(Impl.gt(euint32.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint32 a, uint32 b) internal returns (euint32) {
+ function min(euint256 a, euint8 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
- return euint32.wrap(Impl.min(euint32.unwrap(a), uint256(b), true));
- }
-
- // Evaluate min(a, b) and return the result.
- function min(uint32 a, euint32 b) internal returns (euint32) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.min(euint32.unwrap(b), uint256(a), true));
+ return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint32 a, uint32 b) internal returns (euint32) {
+ function max(euint256 a, euint8 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint32(0);
+ a = asEuint256(0);
}
- return euint32.wrap(Impl.max(euint32.unwrap(a), uint256(b), true));
- }
-
- // Evaluate max(a, b) and return the result.
- function max(uint32 a, euint32 b) internal returns (euint32) {
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint8(0);
}
- return euint32.wrap(Impl.max(euint32.unwrap(b), uint256(a), true));
+ return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint64 a, euint4 b) internal returns (euint64) {
+ function add(euint256 a, euint16 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint64 a, euint4 b) internal returns (euint64) {
+ function sub(euint256 a, euint16 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint64 a, euint4 b) internal returns (euint64) {
+ function mul(euint256 a, euint16 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate and(a, b) and return the result.
- function and(euint64 a, euint4 b) internal returns (euint64) {
+ function and(euint256 a, euint16 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b))));
+ return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate or(a, b) and return the result.
- function or(euint64 a, euint4 b) internal returns (euint64) {
+ function or(euint256 a, euint16 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b))));
+ return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate xor(a, b) and return the result.
- function xor(euint64 a, euint4 b) internal returns (euint64) {
+ function xor(euint256 a, euint16 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b))));
+ return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint64 a, euint4 b) internal returns (ebool) {
+ function eq(euint256 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint16(0);
}
- return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint64 a, euint4 b) internal returns (ebool) {
+ function ne(euint256 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint16(0);
}
- return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint64 a, euint4 b) internal returns (ebool) {
+ function ge(euint256 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint16(0);
}
- return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint64 a, euint4 b) internal returns (ebool) {
+ function gt(euint256 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint16(0);
}
- return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint64 a, euint4 b) internal returns (ebool) {
+ function le(euint256 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint16(0);
}
- return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint64 a, euint4 b) internal returns (ebool) {
+ function lt(euint256 a, euint16 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint16(0);
}
- return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint64 a, euint4 b) internal returns (euint64) {
+ function min(euint256 a, euint16 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint64 a, euint4 b) internal returns (euint64) {
+ function max(euint256 a, euint16 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint4(0);
+ b = asEuint16(0);
}
- return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint64 a, euint8 b) internal returns (euint64) {
+ function add(euint256 a, euint32 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint64 a, euint8 b) internal returns (euint64) {
+ function sub(euint256 a, euint32 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint64 a, euint8 b) internal returns (euint64) {
+ function mul(euint256 a, euint32 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate and(a, b) and return the result.
- function and(euint64 a, euint8 b) internal returns (euint64) {
+ function and(euint256 a, euint32 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b))));
+ return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate or(a, b) and return the result.
- function or(euint64 a, euint8 b) internal returns (euint64) {
+ function or(euint256 a, euint32 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b))));
+ return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate xor(a, b) and return the result.
- function xor(euint64 a, euint8 b) internal returns (euint64) {
+ function xor(euint256 a, euint32 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b))));
+ return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint64 a, euint8 b) internal returns (ebool) {
+ function eq(euint256 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint64 a, euint8 b) internal returns (ebool) {
+ function ne(euint256 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint64 a, euint8 b) internal returns (ebool) {
+ function ge(euint256 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint64 a, euint8 b) internal returns (ebool) {
+ function gt(euint256 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint64 a, euint8 b) internal returns (ebool) {
+ function le(euint256 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint64 a, euint8 b) internal returns (ebool) {
+ function lt(euint256 a, euint32 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint64 a, euint8 b) internal returns (euint64) {
+ function min(euint256 a, euint32 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint64 a, euint8 b) internal returns (euint64) {
+ function max(euint256 a, euint32 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint8(0);
+ b = asEuint32(0);
}
- return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint64 a, euint16 b) internal returns (euint64) {
+ function add(euint256 a, euint64 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint64(0);
}
- return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint64 a, euint16 b) internal returns (euint64) {
+ function sub(euint256 a, euint64 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint64(0);
}
- return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint64 a, euint16 b) internal returns (euint64) {
+ function mul(euint256 a, euint64 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint64(0);
}
- return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate and(a, b) and return the result.
- function and(euint64 a, euint16 b) internal returns (euint64) {
+ function and(euint256 a, euint64 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint64(0);
}
- return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b))));
+ return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate or(a, b) and return the result.
- function or(euint64 a, euint16 b) internal returns (euint64) {
+ function or(euint256 a, euint64 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint64(0);
}
- return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b))));
+ return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate xor(a, b) and return the result.
- function xor(euint64 a, euint16 b) internal returns (euint64) {
+ function xor(euint256 a, euint64 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint64(0);
}
- return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b))));
+ return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint64 a, euint16 b) internal returns (ebool) {
+ function eq(euint256 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint64(0);
}
- return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint64 a, euint16 b) internal returns (ebool) {
+ function ne(euint256 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint64(0);
}
- return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint64 a, euint16 b) internal returns (ebool) {
+ function ge(euint256 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint64(0);
}
- return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint64 a, euint16 b) internal returns (ebool) {
+ function gt(euint256 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint64(0);
}
- return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint64 a, euint16 b) internal returns (ebool) {
+ function le(euint256 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint64(0);
}
- return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint64 a, euint16 b) internal returns (ebool) {
+ function lt(euint256 a, euint64 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint64(0);
}
- return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint64 a, euint16 b) internal returns (euint64) {
+ function min(euint256 a, euint64 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint64(0);
}
- return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint64 a, euint16 b) internal returns (euint64) {
+ function max(euint256 a, euint64 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint16(0);
+ b = asEuint64(0);
}
- return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint64 a, euint32 b) internal returns (euint64) {
+ function add(euint256 a, euint128 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint64 a, euint32 b) internal returns (euint64) {
+ function sub(euint256 a, euint128 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint64 a, euint32 b) internal returns (euint64) {
+ function mul(euint256 a, euint128 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate and(a, b) and return the result.
- function and(euint64 a, euint32 b) internal returns (euint64) {
+ function and(euint256 a, euint128 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b))));
+ return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate or(a, b) and return the result.
- function or(euint64 a, euint32 b) internal returns (euint64) {
+ function or(euint256 a, euint128 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b))));
+ return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate xor(a, b) and return the result.
- function xor(euint64 a, euint32 b) internal returns (euint64) {
+ function xor(euint256 a, euint128 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b))));
+ return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint64 a, euint32 b) internal returns (ebool) {
+ function eq(euint256 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint64 a, euint32 b) internal returns (ebool) {
+ function ne(euint256 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint64 a, euint32 b) internal returns (ebool) {
+ function ge(euint256 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint64 a, euint32 b) internal returns (ebool) {
+ function gt(euint256 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint64 a, euint32 b) internal returns (ebool) {
+ function le(euint256 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint64 a, euint32 b) internal returns (ebool) {
+ function lt(euint256 a, euint128 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint64 a, euint32 b) internal returns (euint64) {
+ function min(euint256 a, euint128 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint64 a, euint32 b) internal returns (euint64) {
+ function max(euint256 a, euint128 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint32(0);
+ b = asEuint128(0);
}
- return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false));
+ return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint64 a, euint64 b) internal returns (euint64) {
+ function add(euint256 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(b), false));
+ return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(b), false));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint64 a, euint64 b) internal returns (euint64) {
+ function sub(euint256 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(b), false));
+ return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(b), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint64 a, euint64 b) internal returns (euint64) {
+ function mul(euint256 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(b), false));
+ return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(b), false));
}
// Evaluate and(a, b) and return the result.
- function and(euint64 a, euint64 b) internal returns (euint64) {
+ function and(euint256 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(b)));
+ return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(b), false));
}
// Evaluate or(a, b) and return the result.
- function or(euint64 a, euint64 b) internal returns (euint64) {
+ function or(euint256 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(b)));
+ return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(b), false));
}
// Evaluate xor(a, b) and return the result.
- function xor(euint64 a, euint64 b) internal returns (euint64) {
+ function xor(euint256 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(b)));
+ return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(b), false));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint64 a, euint64 b) internal returns (ebool) {
+ function eq(euint256 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(b), false));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint64 a, euint64 b) internal returns (ebool) {
+ function ne(euint256 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(b), false));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint64 a, euint64 b) internal returns (ebool) {
+ function ge(euint256 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(b), false));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint64 a, euint64 b) internal returns (ebool) {
+ function gt(euint256 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(b), false));
}
// Evaluate le(a, b) and return the result.
- function le(euint64 a, euint64 b) internal returns (ebool) {
+ function le(euint256 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(b), false));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint64 a, euint64 b) internal returns (ebool) {
+ function lt(euint256 a, euint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(b), false));
+ return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(b), false));
}
// Evaluate min(a, b) and return the result.
- function min(euint64 a, euint64 b) internal returns (euint64) {
+ function min(euint256 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(b), false));
+ return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(b), false));
}
// Evaluate max(a, b) and return the result.
- function max(euint64 a, euint64 b) internal returns (euint64) {
+ function max(euint256 a, euint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(b), false));
+ return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(b), false));
}
// Evaluate add(a, b) and return the result.
- function add(euint64 a, uint64 b) internal returns (euint64) {
+ function add(euint256 a, uint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
- return euint64.wrap(Impl.add(euint64.unwrap(a), uint256(b), true));
+ return euint256.wrap(Impl.add(euint256.unwrap(a), uint256(b), true));
}
// Evaluate add(a, b) and return the result.
- function add(uint64 a, euint64 b) internal returns (euint64) {
+ function add(uint256 a, euint256 b) internal returns (euint256) {
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return euint64.wrap(Impl.add(euint64.unwrap(b), uint256(a), true));
+ return euint256.wrap(Impl.add(euint256.unwrap(b), uint256(a), true));
}
// Evaluate sub(a, b) and return the result.
- function sub(euint64 a, uint64 b) internal returns (euint64) {
+ function sub(euint256 a, uint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
- return euint64.wrap(Impl.sub(euint64.unwrap(a), uint256(b), true));
+ return euint256.wrap(Impl.sub(euint256.unwrap(a), uint256(b), true));
}
// Evaluate sub(a, b) and return the result.
- function sub(uint64 a, euint64 b) internal returns (euint64) {
- euint64 aEnc = asEuint64(a);
+ function sub(uint256 a, euint256 b) internal returns (euint256) {
+ euint256 aEnc = asEuint256(a);
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return euint64.wrap(Impl.sub(euint64.unwrap(aEnc), euint64.unwrap(b), false));
+ return euint256.wrap(Impl.sub(euint256.unwrap(aEnc), euint256.unwrap(b), false));
}
// Evaluate mul(a, b) and return the result.
- function mul(euint64 a, uint64 b) internal returns (euint64) {
+ function mul(euint256 a, uint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
- return euint64.wrap(Impl.mul(euint64.unwrap(a), uint256(b), true));
+ return euint256.wrap(Impl.mul(euint256.unwrap(a), uint256(b), true));
}
// Evaluate mul(a, b) and return the result.
- function mul(uint64 a, euint64 b) internal returns (euint64) {
+ function mul(uint256 a, euint256 b) internal returns (euint256) {
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return euint64.wrap(Impl.mul(euint64.unwrap(b), uint256(a), true));
+ return euint256.wrap(Impl.mul(euint256.unwrap(b), uint256(a), true));
}
// Evaluate div(a, b) and return the result.
- function div(euint64 a, uint64 b) internal returns (euint64) {
+ function div(euint256 a, uint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint256(0);
+ }
+ return euint256.wrap(Impl.div(euint256.unwrap(a), uint256(b)));
+ }
+
+ // Evaluate rem(a, b) and return the result.
+ function rem(euint256 a, uint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint256(0);
+ }
+ return euint256.wrap(Impl.rem(euint256.unwrap(a), uint256(b)));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(euint256 a, uint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint256(0);
+ }
+ return euint256.wrap(Impl.and(euint256.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(uint256 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.and(euint256.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(euint256 a, uint256 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint256(0);
+ }
+ return euint256.wrap(Impl.or(euint256.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(uint256 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
+ }
+ return euint256.wrap(Impl.or(euint256.unwrap(b), uint256(a), true));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(euint256 a, uint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
- return euint64.wrap(Impl.div(euint64.unwrap(a), uint256(b)));
+ return euint256.wrap(Impl.xor(euint256.unwrap(a), uint256(b), true));
}
- // Evaluate rem(a, b) and return the result.
- function rem(euint64 a, uint64 b) internal returns (euint64) {
- if (!isInitialized(a)) {
- a = asEuint64(0);
+ // Evaluate xor(a, b) and return the result.
+ function xor(uint256 a, euint256 b) internal returns (euint256) {
+ if (!isInitialized(b)) {
+ b = asEuint256(0);
}
- return euint64.wrap(Impl.rem(euint64.unwrap(a), uint256(b)));
+ return euint256.wrap(Impl.xor(euint256.unwrap(b), uint256(a), true));
}
// Evaluate eq(a, b) and return the result.
- function eq(euint64 a, uint64 b) internal returns (ebool) {
+ function eq(euint256 a, uint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
- return ebool.wrap(Impl.eq(euint64.unwrap(a), uint256(b), true));
+ return ebool.wrap(Impl.eq(euint256.unwrap(a), uint256(b), true));
}
// Evaluate eq(a, b) and return the result.
- function eq(uint64 a, euint64 b) internal returns (ebool) {
+ function eq(uint256 a, euint256 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.eq(euint64.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.eq(euint256.unwrap(b), uint256(a), true));
}
// Evaluate ne(a, b) and return the result.
- function ne(euint64 a, uint64 b) internal returns (ebool) {
+ function ne(euint256 a, uint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
- return ebool.wrap(Impl.ne(euint64.unwrap(a), uint256(b), true));
+ return ebool.wrap(Impl.ne(euint256.unwrap(a), uint256(b), true));
}
// Evaluate ne(a, b) and return the result.
- function ne(uint64 a, euint64 b) internal returns (ebool) {
+ function ne(uint256 a, euint256 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.ne(euint64.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.ne(euint256.unwrap(b), uint256(a), true));
}
// Evaluate ge(a, b) and return the result.
- function ge(euint64 a, uint64 b) internal returns (ebool) {
+ function ge(euint256 a, uint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
- return ebool.wrap(Impl.ge(euint64.unwrap(a), uint256(b), true));
+ return ebool.wrap(Impl.ge(euint256.unwrap(a), uint256(b), true));
}
// Evaluate ge(a, b) and return the result.
- function ge(uint64 a, euint64 b) internal returns (ebool) {
+ function ge(uint256 a, euint256 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.le(euint64.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.le(euint256.unwrap(b), uint256(a), true));
}
// Evaluate gt(a, b) and return the result.
- function gt(euint64 a, uint64 b) internal returns (ebool) {
+ function gt(euint256 a, uint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
- return ebool.wrap(Impl.gt(euint64.unwrap(a), uint256(b), true));
+ return ebool.wrap(Impl.gt(euint256.unwrap(a), uint256(b), true));
}
// Evaluate gt(a, b) and return the result.
- function gt(uint64 a, euint64 b) internal returns (ebool) {
+ function gt(uint256 a, euint256 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.lt(euint64.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.lt(euint256.unwrap(b), uint256(a), true));
}
// Evaluate le(a, b) and return the result.
- function le(euint64 a, uint64 b) internal returns (ebool) {
+ function le(euint256 a, uint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
- return ebool.wrap(Impl.le(euint64.unwrap(a), uint256(b), true));
+ return ebool.wrap(Impl.le(euint256.unwrap(a), uint256(b), true));
}
// Evaluate le(a, b) and return the result.
- function le(uint64 a, euint64 b) internal returns (ebool) {
+ function le(uint256 a, euint256 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.ge(euint64.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.ge(euint256.unwrap(b), uint256(a), true));
}
// Evaluate lt(a, b) and return the result.
- function lt(euint64 a, uint64 b) internal returns (ebool) {
+ function lt(euint256 a, uint256 b) internal returns (ebool) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
- return ebool.wrap(Impl.lt(euint64.unwrap(a), uint256(b), true));
+ return ebool.wrap(Impl.lt(euint256.unwrap(a), uint256(b), true));
}
// Evaluate lt(a, b) and return the result.
- function lt(uint64 a, euint64 b) internal returns (ebool) {
+ function lt(uint256 a, euint256 b) internal returns (ebool) {
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return ebool.wrap(Impl.gt(euint64.unwrap(b), uint256(a), true));
+ return ebool.wrap(Impl.gt(euint256.unwrap(b), uint256(a), true));
}
// Evaluate min(a, b) and return the result.
- function min(euint64 a, uint64 b) internal returns (euint64) {
+ function min(euint256 a, uint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
- return euint64.wrap(Impl.min(euint64.unwrap(a), uint256(b), true));
+ return euint256.wrap(Impl.min(euint256.unwrap(a), uint256(b), true));
}
// Evaluate min(a, b) and return the result.
- function min(uint64 a, euint64 b) internal returns (euint64) {
+ function min(uint256 a, euint256 b) internal returns (euint256) {
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return euint64.wrap(Impl.min(euint64.unwrap(b), uint256(a), true));
+ return euint256.wrap(Impl.min(euint256.unwrap(b), uint256(a), true));
}
// Evaluate max(a, b) and return the result.
- function max(euint64 a, uint64 b) internal returns (euint64) {
+ function max(euint256 a, uint256 b) internal returns (euint256) {
if (!isInitialized(a)) {
- a = asEuint64(0);
+ a = asEuint256(0);
}
- return euint64.wrap(Impl.max(euint64.unwrap(a), uint256(b), true));
+ return euint256.wrap(Impl.max(euint256.unwrap(a), uint256(b), true));
}
// Evaluate max(a, b) and return the result.
- function max(uint64 a, euint64 b) internal returns (euint64) {
+ function max(uint256 a, euint256 b) internal returns (euint256) {
if (!isInitialized(b)) {
- b = asEuint64(0);
+ b = asEuint256(0);
}
- return euint64.wrap(Impl.max(euint64.unwrap(b), uint256(a), true));
+ return euint256.wrap(Impl.max(euint256.unwrap(b), uint256(a), true));
}
// Evaluate shl(a, b) and return the result.
@@ -5217,6 +9649,158 @@ library TFHE {
return euint64.wrap(Impl.rotr(euint64.unwrap(a), uint256(b), true));
}
+ // Evaluate shl(a, b) and return the result.
+ function shl(euint128 a, euint8 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint128(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint128.wrap(Impl.shl(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
+ }
+
+ // Evaluate shl(a, b) and return the result.
+ function shl(euint128 a, uint8 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint128(0);
+ }
+ return euint128.wrap(Impl.shl(euint128.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate shr(a, b) and return the result.
+ function shr(euint128 a, euint8 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint128(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint128.wrap(Impl.shr(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
+ }
+
+ // Evaluate shr(a, b) and return the result.
+ function shr(euint128 a, uint8 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint128(0);
+ }
+ return euint128.wrap(Impl.shr(euint128.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate rotl(a, b) and return the result.
+ function rotl(euint128 a, euint8 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint128(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint128.wrap(Impl.rotl(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
+ }
+
+ // Evaluate rotl(a, b) and return the result.
+ function rotl(euint128 a, uint8 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint128(0);
+ }
+ return euint128.wrap(Impl.rotl(euint128.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate rotr(a, b) and return the result.
+ function rotr(euint128 a, euint8 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint128(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint128.wrap(Impl.rotr(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false));
+ }
+
+ // Evaluate rotr(a, b) and return the result.
+ function rotr(euint128 a, uint8 b) internal returns (euint128) {
+ if (!isInitialized(a)) {
+ a = asEuint128(0);
+ }
+ return euint128.wrap(Impl.rotr(euint128.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate shl(a, b) and return the result.
+ function shl(euint256 a, euint8 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint256(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint256.wrap(Impl.shl(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
+ }
+
+ // Evaluate shl(a, b) and return the result.
+ function shl(euint256 a, uint8 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint256(0);
+ }
+ return euint256.wrap(Impl.shl(euint256.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate shr(a, b) and return the result.
+ function shr(euint256 a, euint8 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint256(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint256.wrap(Impl.shr(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
+ }
+
+ // Evaluate shr(a, b) and return the result.
+ function shr(euint256 a, uint8 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint256(0);
+ }
+ return euint256.wrap(Impl.shr(euint256.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate rotl(a, b) and return the result.
+ function rotl(euint256 a, euint8 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint256(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint256.wrap(Impl.rotl(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
+ }
+
+ // Evaluate rotl(a, b) and return the result.
+ function rotl(euint256 a, uint8 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint256(0);
+ }
+ return euint256.wrap(Impl.rotl(euint256.unwrap(a), uint256(b), true));
+ }
+
+ // Evaluate rotr(a, b) and return the result.
+ function rotr(euint256 a, euint8 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint256(0);
+ }
+ if (!isInitialized(b)) {
+ b = asEuint8(0);
+ }
+ return euint256.wrap(Impl.rotr(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false));
+ }
+
+ // Evaluate rotr(a, b) and return the result.
+ function rotr(euint256 a, uint8 b) internal returns (euint256) {
+ if (!isInitialized(a)) {
+ a = asEuint256(0);
+ }
+ return euint256.wrap(Impl.rotr(euint256.unwrap(a), uint256(b), true));
+ }
+
// If 'control''s value is 'true', the result has the same value as 'a'.
// If 'control''s value is 'false', the result has the same value as 'b'.
function select(ebool control, euint4 a, euint4 b) internal returns (euint4) {
@@ -5242,6 +9826,16 @@ library TFHE {
function select(ebool control, euint64 a, euint64 b) internal returns (euint64) {
return euint64.wrap(Impl.select(ebool.unwrap(control), euint64.unwrap(a), euint64.unwrap(b)));
}
+ // If 'control''s value is 'true', the result has the same value as 'a'.
+ // If 'control''s value is 'false', the result has the same value as 'b'.
+ function select(ebool control, euint128 a, euint128 b) internal returns (euint128) {
+ return euint128.wrap(Impl.select(ebool.unwrap(control), euint128.unwrap(a), euint128.unwrap(b)));
+ }
+ // If 'control''s value is 'true', the result has the same value as 'a'.
+ // If 'control''s value is 'false', the result has the same value as 'b'.
+ function select(ebool control, euint256 a, euint256 b) internal returns (euint256) {
+ return euint256.wrap(Impl.select(ebool.unwrap(control), euint256.unwrap(a), euint256.unwrap(b)));
+ }
// Cast an encrypted integer from euint8 to euint4.
function asEuint4(euint8 value) internal returns (euint4) {
return euint4.wrap(Impl.cast(euint8.unwrap(value), Common.euint4_t));
@@ -5262,6 +9856,16 @@ library TFHE {
return euint4.wrap(Impl.cast(euint64.unwrap(value), Common.euint4_t));
}
+ // Cast an encrypted integer from euint128 to euint4.
+ function asEuint4(euint128 value) internal returns (euint4) {
+ return euint4.wrap(Impl.cast(euint128.unwrap(value), Common.euint4_t));
+ }
+
+ // Cast an encrypted integer from euint256 to euint4.
+ function asEuint4(euint256 value) internal returns (euint4) {
+ return euint4.wrap(Impl.cast(euint256.unwrap(value), Common.euint4_t));
+ }
+
// Cast an encrypted integer from euint4 to ebool.
function asEbool(euint4 value) internal returns (ebool) {
return ne(value, 0);
@@ -5292,6 +9896,16 @@ library TFHE {
return euint8.wrap(Impl.cast(euint64.unwrap(value), Common.euint8_t));
}
+ // Cast an encrypted integer from euint128 to euint8.
+ function asEuint8(euint128 value) internal returns (euint8) {
+ return euint8.wrap(Impl.cast(euint128.unwrap(value), Common.euint8_t));
+ }
+
+ // Cast an encrypted integer from euint256 to euint8.
+ function asEuint8(euint256 value) internal returns (euint8) {
+ return euint8.wrap(Impl.cast(euint256.unwrap(value), Common.euint8_t));
+ }
+
// Cast an encrypted integer from euint8 to ebool.
function asEbool(euint8 value) internal returns (ebool) {
return ne(value, 0);
@@ -5323,17 +9937,47 @@ library TFHE {
// Evaluate and(a, b) and return the result.
function and(ebool a, ebool b) internal returns (ebool) {
- return ebool.wrap(Impl.and(ebool.unwrap(a), ebool.unwrap(b)));
+ return ebool.wrap(Impl.and(ebool.unwrap(a), ebool.unwrap(b), false));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(ebool a, bool b) internal returns (ebool) {
+ return ebool.wrap(Impl.and(ebool.unwrap(a), b ? 1 : 0, true));
+ }
+
+ // Evaluate and(a, b) and return the result.
+ function and(bool a, ebool b) internal returns (ebool) {
+ return ebool.wrap(Impl.and(ebool.unwrap(b), a ? 1 : 0, true));
}
// Evaluate or(a, b) and return the result.
function or(ebool a, ebool b) internal returns (ebool) {
- return ebool.wrap(Impl.or(ebool.unwrap(a), ebool.unwrap(b)));
+ return ebool.wrap(Impl.or(ebool.unwrap(a), ebool.unwrap(b), false));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(ebool a, bool b) internal returns (ebool) {
+ return ebool.wrap(Impl.or(ebool.unwrap(a), b ? 1 : 0, true));
+ }
+
+ // Evaluate or(a, b) and return the result.
+ function or(bool a, ebool b) internal returns (ebool) {
+ return ebool.wrap(Impl.or(ebool.unwrap(b), a ? 1 : 0, true));
}
// Evaluate xor(a, b) and return the result.
function xor(ebool a, ebool b) internal returns (ebool) {
- return ebool.wrap(Impl.xor(ebool.unwrap(a), ebool.unwrap(b)));
+ return ebool.wrap(Impl.xor(ebool.unwrap(a), ebool.unwrap(b), false));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(ebool a, bool b) internal returns (ebool) {
+ return ebool.wrap(Impl.xor(ebool.unwrap(a), b ? 1 : 0, true));
+ }
+
+ // Evaluate xor(a, b) and return the result.
+ function xor(bool a, ebool b) internal returns (ebool) {
+ return ebool.wrap(Impl.xor(ebool.unwrap(b), a ? 1 : 0, true));
}
function not(ebool a) internal returns (ebool) {
@@ -5360,6 +10004,16 @@ library TFHE {
return euint16.wrap(Impl.cast(euint64.unwrap(value), Common.euint16_t));
}
+ // Cast an encrypted integer from euint128 to euint16.
+ function asEuint16(euint128 value) internal returns (euint16) {
+ return euint16.wrap(Impl.cast(euint128.unwrap(value), Common.euint16_t));
+ }
+
+ // Cast an encrypted integer from euint256 to euint16.
+ function asEuint16(euint256 value) internal returns (euint16) {
+ return euint16.wrap(Impl.cast(euint256.unwrap(value), Common.euint16_t));
+ }
+
// Cast an encrypted integer from euint16 to ebool.
function asEbool(euint16 value) internal returns (ebool) {
return ne(value, 0);
@@ -5390,6 +10044,16 @@ library TFHE {
return euint32.wrap(Impl.cast(euint64.unwrap(value), Common.euint32_t));
}
+ // Cast an encrypted integer from euint128 to euint32.
+ function asEuint32(euint128 value) internal returns (euint32) {
+ return euint32.wrap(Impl.cast(euint128.unwrap(value), Common.euint32_t));
+ }
+
+ // Cast an encrypted integer from euint256 to euint32.
+ function asEuint32(euint256 value) internal returns (euint32) {
+ return euint32.wrap(Impl.cast(euint256.unwrap(value), Common.euint32_t));
+ }
+
// Cast an encrypted integer from euint32 to ebool.
function asEbool(euint32 value) internal returns (ebool) {
return ne(value, 0);
@@ -5400,34 +10064,124 @@ library TFHE {
return euint32.wrap(Impl.cast(ebool.unwrap(b), Common.euint32_t));
}
- // Cast an encrypted integer from euint4 to euint64.
- function asEuint64(euint4 value) internal returns (euint64) {
- return euint64.wrap(Impl.cast(euint4.unwrap(value), Common.euint64_t));
+ // Cast an encrypted integer from euint4 to euint64.
+ function asEuint64(euint4 value) internal returns (euint64) {
+ return euint64.wrap(Impl.cast(euint4.unwrap(value), Common.euint64_t));
+ }
+
+ // Cast an encrypted integer from euint8 to euint64.
+ function asEuint64(euint8 value) internal returns (euint64) {
+ return euint64.wrap(Impl.cast(euint8.unwrap(value), Common.euint64_t));
+ }
+
+ // Cast an encrypted integer from euint16 to euint64.
+ function asEuint64(euint16 value) internal returns (euint64) {
+ return euint64.wrap(Impl.cast(euint16.unwrap(value), Common.euint64_t));
+ }
+
+ // Cast an encrypted integer from euint32 to euint64.
+ function asEuint64(euint32 value) internal returns (euint64) {
+ return euint64.wrap(Impl.cast(euint32.unwrap(value), Common.euint64_t));
+ }
+
+ // Cast an encrypted integer from euint128 to euint64.
+ function asEuint64(euint128 value) internal returns (euint64) {
+ return euint64.wrap(Impl.cast(euint128.unwrap(value), Common.euint64_t));
+ }
+
+ // Cast an encrypted integer from euint256 to euint64.
+ function asEuint64(euint256 value) internal returns (euint64) {
+ return euint64.wrap(Impl.cast(euint256.unwrap(value), Common.euint64_t));
+ }
+
+ // Cast an encrypted integer from euint64 to ebool.
+ function asEbool(euint64 value) internal returns (ebool) {
+ return ne(value, 0);
+ }
+
+ // Converts an 'ebool' to an 'euint64'.
+ function asEuint64(ebool b) internal returns (euint64) {
+ return euint64.wrap(Impl.cast(ebool.unwrap(b), Common.euint64_t));
+ }
+
+ // Cast an encrypted integer from euint4 to euint128.
+ function asEuint128(euint4 value) internal returns (euint128) {
+ return euint128.wrap(Impl.cast(euint4.unwrap(value), Common.euint128_t));
+ }
+
+ // Cast an encrypted integer from euint8 to euint128.
+ function asEuint128(euint8 value) internal returns (euint128) {
+ return euint128.wrap(Impl.cast(euint8.unwrap(value), Common.euint128_t));
+ }
+
+ // Cast an encrypted integer from euint16 to euint128.
+ function asEuint128(euint16 value) internal returns (euint128) {
+ return euint128.wrap(Impl.cast(euint16.unwrap(value), Common.euint128_t));
+ }
+
+ // Cast an encrypted integer from euint32 to euint128.
+ function asEuint128(euint32 value) internal returns (euint128) {
+ return euint128.wrap(Impl.cast(euint32.unwrap(value), Common.euint128_t));
+ }
+
+ // Cast an encrypted integer from euint64 to euint128.
+ function asEuint128(euint64 value) internal returns (euint128) {
+ return euint128.wrap(Impl.cast(euint64.unwrap(value), Common.euint128_t));
+ }
+
+ // Cast an encrypted integer from euint256 to euint128.
+ function asEuint128(euint256 value) internal returns (euint128) {
+ return euint128.wrap(Impl.cast(euint256.unwrap(value), Common.euint128_t));
+ }
+
+ // Cast an encrypted integer from euint128 to ebool.
+ function asEbool(euint128 value) internal returns (ebool) {
+ return ne(value, 0);
+ }
+
+ // Converts an 'ebool' to an 'euint128'.
+ function asEuint128(ebool b) internal returns (euint128) {
+ return euint128.wrap(Impl.cast(ebool.unwrap(b), Common.euint128_t));
+ }
+
+ // Cast an encrypted integer from euint4 to euint256.
+ function asEuint256(euint4 value) internal returns (euint256) {
+ return euint256.wrap(Impl.cast(euint4.unwrap(value), Common.euint256_t));
+ }
+
+ // Cast an encrypted integer from euint8 to euint256.
+ function asEuint256(euint8 value) internal returns (euint256) {
+ return euint256.wrap(Impl.cast(euint8.unwrap(value), Common.euint256_t));
+ }
+
+ // Cast an encrypted integer from euint16 to euint256.
+ function asEuint256(euint16 value) internal returns (euint256) {
+ return euint256.wrap(Impl.cast(euint16.unwrap(value), Common.euint256_t));
}
- // Cast an encrypted integer from euint8 to euint64.
- function asEuint64(euint8 value) internal returns (euint64) {
- return euint64.wrap(Impl.cast(euint8.unwrap(value), Common.euint64_t));
+ // Cast an encrypted integer from euint32 to euint256.
+ function asEuint256(euint32 value) internal returns (euint256) {
+ return euint256.wrap(Impl.cast(euint32.unwrap(value), Common.euint256_t));
}
- // Cast an encrypted integer from euint16 to euint64.
- function asEuint64(euint16 value) internal returns (euint64) {
- return euint64.wrap(Impl.cast(euint16.unwrap(value), Common.euint64_t));
+ // Cast an encrypted integer from euint64 to euint256.
+ function asEuint256(euint64 value) internal returns (euint256) {
+ return euint256.wrap(Impl.cast(euint64.unwrap(value), Common.euint256_t));
}
- // Cast an encrypted integer from euint32 to euint64.
- function asEuint64(euint32 value) internal returns (euint64) {
- return euint64.wrap(Impl.cast(euint32.unwrap(value), Common.euint64_t));
+ // Cast an encrypted integer from euint128 to euint256.
+ function asEuint256(euint128 value) internal returns (euint256) {
+ return euint256.wrap(Impl.cast(euint128.unwrap(value), Common.euint256_t));
}
- // Cast an encrypted integer from euint64 to ebool.
- function asEbool(euint64 value) internal returns (ebool) {
+ // Cast an encrypted integer from euint256 to ebool.
+ function asEbool(euint256 value) internal returns (ebool) {
return ne(value, 0);
}
- // Converts an 'ebool' to an 'euint64'.
- function asEuint64(ebool b) internal returns (euint64) {
- return euint64.wrap(Impl.cast(ebool.unwrap(b), Common.euint64_t));
+ // Converts an 'ebool' to an 'euint256'.
+ function asEuint256(ebool b) internal returns (euint256) {
+ return euint256.wrap(Impl.cast(ebool.unwrap(b), Common.euint256_t));
}
function neg(euint4 value) internal returns (euint4) {
@@ -5470,6 +10224,22 @@ library TFHE {
return euint64.wrap(Impl.not(euint64.unwrap(value)));
}
+ function neg(euint128 value) internal returns (euint128) {
+ return euint128.wrap(Impl.neg(euint128.unwrap(value)));
+ }
+
+ function not(euint128 value) internal returns (euint128) {
+ return euint128.wrap(Impl.not(euint128.unwrap(value)));
+ }
+
+ function neg(euint256 value) internal returns (euint256) {
+ return euint256.wrap(Impl.neg(euint256.unwrap(value)));
+ }
+
+ function not(euint256 value) internal returns (euint256) {
+ return euint256.wrap(Impl.not(euint256.unwrap(value)));
+ }
+
// Convert an inputHandle with corresponding inputProof to an encrypted euint4 integer.
function asEuint4(einput inputHandle, bytes memory inputProof) internal returns (euint4) {
return euint4.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint4_t));
@@ -5520,83 +10290,283 @@ library TFHE {
return euint64.wrap(Impl.trivialEncrypt(value, Common.euint64_t));
}
+ // Convert an inputHandle with corresponding inputProof to an encrypted euint128 integer.
+ function asEuint128(einput inputHandle, bytes memory inputProof) internal returns (euint128) {
+ return euint128.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint128_t));
+ }
+
+ // Convert a plaintext value to an encrypted euint128 integer.
+ function asEuint128(uint256 value) internal returns (euint128) {
+ return euint128.wrap(Impl.trivialEncrypt(value, Common.euint128_t));
+ }
+
+ // Convert an inputHandle with corresponding inputProof to an encrypted euint256 integer.
+ function asEuint256(einput inputHandle, bytes memory inputProof) internal returns (euint256) {
+ return euint256.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint256_t));
+ }
+
+ // Convert a plaintext value to an encrypted euint256 integer.
+ function asEuint256(uint256 value) internal returns (euint256) {
+ return euint256.wrap(Impl.trivialEncrypt(value, Common.euint256_t));
+ }
+
+ // Generates a random encrypted boolean.
+ function randEbool() internal returns (ebool) {
+ return ebool.wrap(Impl.rand(Common.ebool_t));
+ }
+
+ // Generates a random encrypted 4-bit unsigned integer.
+ function randEuint4() internal returns (euint4) {
+ return euint4.wrap(Impl.rand(Common.euint4_t));
+ }
+
+ // Generates a random encrypted 4-bit unsigned integer in the [0, upperBound) range.
+ // The upperBound must be a power of 2.
+ function randEuint4(uint8 upperBound) internal returns (euint4) {
+ return euint4.wrap(Impl.randBounded(upperBound, Common.euint4_t));
+ }
+
// Generates a random encrypted 8-bit unsigned integer.
- // Important: The random integer is generated in the plain! An FHE-based version is coming soon.
function randEuint8() internal returns (euint8) {
return euint8.wrap(Impl.rand(Common.euint8_t));
}
// Generates a random encrypted 8-bit unsigned integer in the [0, upperBound) range.
// The upperBound must be a power of 2.
- // Important: The random integer is generated in the plain! An FHE-based version is coming soon.
function randEuint8(uint8 upperBound) internal returns (euint8) {
return euint8.wrap(Impl.randBounded(upperBound, Common.euint8_t));
}
// Generates a random encrypted 16-bit unsigned integer.
- // Important: The random integer is generated in the plain! An FHE-based version is coming soon.
function randEuint16() internal returns (euint16) {
return euint16.wrap(Impl.rand(Common.euint16_t));
}
// Generates a random encrypted 16-bit unsigned integer in the [0, upperBound) range.
// The upperBound must be a power of 2.
- // Important: The random integer is generated in the plain! An FHE-based version is coming soon.
function randEuint16(uint16 upperBound) internal returns (euint16) {
return euint16.wrap(Impl.randBounded(upperBound, Common.euint16_t));
}
// Generates a random encrypted 32-bit unsigned integer.
- // Important: The random integer is generated in the plain! An FHE-based version is coming soon.
function randEuint32() internal returns (euint32) {
return euint32.wrap(Impl.rand(Common.euint32_t));
}
// Generates a random encrypted 32-bit unsigned integer in the [0, upperBound) range.
// The upperBound must be a power of 2.
- // Important: The random integer is generated in the plain! An FHE-based version is coming soon.
function randEuint32(uint32 upperBound) internal returns (euint32) {
return euint32.wrap(Impl.randBounded(upperBound, Common.euint32_t));
}
// Generates a random encrypted 64-bit unsigned integer.
- // Important: The random integer is generated in the plain! An FHE-based version is coming soon.
function randEuint64() internal returns (euint64) {
return euint64.wrap(Impl.rand(Common.euint64_t));
}
// Generates a random encrypted 64-bit unsigned integer in the [0, upperBound) range.
// The upperBound must be a power of 2.
- // Important: The random integer is generated in the plain! An FHE-based version is coming soon.
function randEuint64(uint64 upperBound) internal returns (euint64) {
return euint64.wrap(Impl.randBounded(upperBound, Common.euint64_t));
}
+ // Generates a random encrypted 128-bit unsigned integer.
+ function randEuint128() internal returns (euint128) {
+ return euint128.wrap(Impl.rand(Common.euint128_t));
+ }
+
+ // Generates a random encrypted 128-bit unsigned integer in the [0, upperBound) range.
+ // The upperBound must be a power of 2.
+ function randEuint128(uint128 upperBound) internal returns (euint128) {
+ return euint128.wrap(Impl.randBounded(upperBound, Common.euint128_t));
+ }
+
+ // Generates a random encrypted 256-bit unsigned integer.
+ function randEuint256() internal returns (euint256) {
+ return euint256.wrap(Impl.rand(Common.euint256_t));
+ }
+
+ // Generates a random encrypted 256-bit unsigned integer in the [0, upperBound) range.
+ // The upperBound must be a power of 2.
+ function randEuint256(uint256 upperBound) internal returns (euint256) {
+ return euint256.wrap(Impl.randBounded(upperBound, Common.euint256_t));
+ }
+
+ // Generates a random encrypted 512-bit unsigned integer.
+ function randEbytes64() internal returns (ebytes64) {
+ return ebytes64.wrap(Impl.rand(Common.ebytes64_t));
+ }
+
+ // Generates a random encrypted 1024-bit unsigned integer.
+ function randEbytes128() internal returns (ebytes128) {
+ return ebytes128.wrap(Impl.rand(Common.ebytes128_t));
+ }
+
+ // Generates a random encrypted 2048-bit unsigned integer.
+ function randEbytes256() internal returns (ebytes256) {
+ return ebytes256.wrap(Impl.rand(Common.ebytes256_t));
+ }
+
// Convert an inputHandle with corresponding inputProof to an encrypted eaddress.
function asEaddress(einput inputHandle, bytes memory inputProof) internal returns (eaddress) {
return eaddress.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint160_t));
}
- // Convert a plaintext value to an encrypted asEaddress.
+ // Convert a plaintext value to an encrypted address.
function asEaddress(address value) internal returns (eaddress) {
return eaddress.wrap(Impl.trivialEncrypt(uint160(value), Common.euint160_t));
}
+ // Convert the given inputHandle and inputProof to an encrypted ebytes64 value.
+ function asEbytes64(einput inputHandle, bytes memory inputProof) internal returns (ebytes64) {
+ return ebytes64.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebytes64_t));
+ }
+
+ // Left-pad a bytes array with zeros such that it becomes of length 64.
+ function padToBytes64(bytes memory input) internal pure returns (bytes memory) {
+ require(input.length <= 64, "Input exceeds 64 bytes");
+ bytes memory result = new bytes(64);
+ uint256 paddingLength = 64 - input.length;
+ for (uint256 i = 0; i < paddingLength; i++) {
+ result[i] = 0;
+ }
+ for (uint256 i = 0; i < input.length; i++) {
+ result[paddingLength + i] = input[i];
+ }
+ return result;
+ }
+
+ // Convert a plaintext value - must be a bytes array of size 64 - to an encrypted Bytes64.
+ function asEbytes64(bytes memory value) internal returns (ebytes64) {
+ return ebytes64.wrap(Impl.trivialEncrypt(value, Common.ebytes64_t));
+ }
+
+ // Convert the given inputHandle and inputProof to an encrypted ebytes128 value.
+ function asEbytes128(einput inputHandle, bytes memory inputProof) internal returns (ebytes128) {
+ return ebytes128.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebytes128_t));
+ }
+
+ // Left-pad a bytes array with zeros such that it becomes of length 128.
+ function padToBytes128(bytes memory input) internal pure returns (bytes memory) {
+ require(input.length <= 128, "Input exceeds 128 bytes");
+ bytes memory result = new bytes(128);
+ uint256 paddingLength = 128 - input.length;
+ for (uint256 i = 0; i < paddingLength; i++) {
+ result[i] = 0;
+ }
+ for (uint256 i = 0; i < input.length; i++) {
+ result[paddingLength + i] = input[i];
+ }
+ return result;
+ }
+
+ // Convert a plaintext value - must be a bytes array of size 128 - to an encrypted Bytes128.
+ function asEbytes128(bytes memory value) internal returns (ebytes128) {
+ return ebytes128.wrap(Impl.trivialEncrypt(value, Common.ebytes128_t));
+ }
+
// Convert the given inputHandle and inputProof to an encrypted ebytes256 value.
function asEbytes256(einput inputHandle, bytes memory inputProof) internal returns (ebytes256) {
return ebytes256.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebytes256_t));
}
+ // Left-pad a bytes array with zeros such that it becomes of length 256.
+ function padToBytes256(bytes memory input) internal pure returns (bytes memory) {
+ require(input.length <= 256, "Input exceeds 256 bytes");
+ bytes memory result = new bytes(256);
+ uint256 paddingLength = 256 - input.length;
+ for (uint256 i = 0; i < paddingLength; i++) {
+ result[i] = 0;
+ }
+ for (uint256 i = 0; i < input.length; i++) {
+ result[paddingLength + i] = input[i];
+ }
+ return result;
+ }
+
+ // Convert a plaintext value - must be a bytes array of size 256 - to an encrypted Bytes256.
+ function asEbytes256(bytes memory value) internal returns (ebytes256) {
+ return ebytes256.wrap(Impl.trivialEncrypt(value, Common.ebytes256_t));
+ }
+
// Return true if the enrypted address is initialized and false otherwise.
function isInitialized(eaddress v) internal pure returns (bool) {
return eaddress.unwrap(v) != 0;
}
+ // Return true if the enrypted value is initialized and false otherwise.
+ function isInitialized(ebytes64 v) internal pure returns (bool) {
+ return ebytes64.unwrap(v) != 0;
+ }
+
+ // Return true if the enrypted value is initialized and false otherwise.
+ function isInitialized(ebytes128 v) internal pure returns (bool) {
+ return ebytes128.unwrap(v) != 0;
+ }
+
// Return true if the enrypted value is initialized and false otherwise.
function isInitialized(ebytes256 v) internal pure returns (bool) {
return ebytes256.unwrap(v) != 0;
}
+ // Evaluate eq(a, b) and return the result.
+ function eq(ebool a, ebool b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbool(false);
+ }
+ if (!isInitialized(b)) {
+ b = asEbool(false);
+ }
+ return ebool.wrap(Impl.eq(ebool.unwrap(a), ebool.unwrap(b), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(ebool a, ebool b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbool(false);
+ }
+ if (!isInitialized(b)) {
+ b = asEbool(false);
+ }
+ return ebool.wrap(Impl.ne(ebool.unwrap(a), ebool.unwrap(b), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(ebool a, bool b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbool(false);
+ }
+ uint256 bProc = b ? 1 : 0;
+ return ebool.wrap(Impl.eq(ebool.unwrap(a), bProc, true));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(bool b, ebool a) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbool(false);
+ }
+ uint256 bProc = b ? 1 : 0;
+ return ebool.wrap(Impl.eq(ebool.unwrap(a), bProc, true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(ebool a, bool b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbool(false);
+ }
+ uint256 bProc = b ? 1 : 0;
+ return ebool.wrap(Impl.ne(ebool.unwrap(a), bProc, true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(bool b, ebool a) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbool(false);
+ }
+ uint256 bProc = b ? 1 : 0;
+ return ebool.wrap(Impl.ne(ebool.unwrap(a), bProc, true));
+ }
+
// Evaluate eq(a, b) and return the result.
function eq(eaddress a, eaddress b) internal returns (ebool) {
if (!isInitialized(a)) {
@@ -5655,26 +10625,198 @@ library TFHE {
return ebool.wrap(Impl.ne(eaddress.unwrap(a), bProc, true));
}
+ // If 'control''s value is 'true', the result has the same value as 'a'.
+ // If 'control''s value is 'false', the result has the same value as 'b'.
+ function select(ebool control, ebool a, ebool b) internal returns (ebool) {
+ return ebool.wrap(Impl.select(ebool.unwrap(control), ebool.unwrap(a), ebool.unwrap(b)));
+ }
+
// If 'control''s value is 'true', the result has the same value as 'a'.
// If 'control''s value is 'false', the result has the same value as 'b'.
function select(ebool control, eaddress a, eaddress b) internal returns (eaddress) {
return eaddress.wrap(Impl.select(ebool.unwrap(control), eaddress.unwrap(a), eaddress.unwrap(b)));
}
+ // If 'control''s value is 'true', the result has the same value as 'a'.
+ // If 'control''s value is 'false', the result has the same value as 'b'.
+ function select(ebool control, ebytes64 a, ebytes64 b) internal returns (ebytes64) {
+ return ebytes64.wrap(Impl.select(ebool.unwrap(control), ebytes64.unwrap(a), ebytes64.unwrap(b)));
+ }
+
+ // If 'control''s value is 'true', the result has the same value as 'a'.
+ // If 'control''s value is 'false', the result has the same value as 'b'.
+ function select(ebool control, ebytes128 a, ebytes128 b) internal returns (ebytes128) {
+ return ebytes128.wrap(Impl.select(ebool.unwrap(control), ebytes128.unwrap(a), ebytes128.unwrap(b)));
+ }
+
+ // If 'control''s value is 'true', the result has the same value as 'a'.
+ // If 'control''s value is 'false', the result has the same value as 'b'.
+ function select(ebool control, ebytes256 a, ebytes256 b) internal returns (ebytes256) {
+ return ebytes256.wrap(Impl.select(ebool.unwrap(control), ebytes256.unwrap(a), ebytes256.unwrap(b)));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(ebytes64 a, ebytes64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbytes64(padToBytes64(hex""));
+ }
+ if (!isInitialized(b)) {
+ b = asEbytes64(padToBytes64(hex""));
+ }
+ return ebool.wrap(Impl.eq(ebytes64.unwrap(a), ebytes64.unwrap(b), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(ebytes64 a, bytes memory b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbytes64(padToBytes64(hex""));
+ }
+ return ebool.wrap(Impl.eq(ebytes64.unwrap(a), b, true));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(bytes memory a, ebytes64 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEbytes64(padToBytes64(hex""));
+ }
+ return ebool.wrap(Impl.eq(ebytes64.unwrap(b), a, true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(ebytes64 a, ebytes64 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbytes64(padToBytes64(hex""));
+ }
+ if (!isInitialized(b)) {
+ b = asEbytes64(padToBytes64(hex""));
+ }
+ return ebool.wrap(Impl.ne(ebytes64.unwrap(a), ebytes64.unwrap(b), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(ebytes64 a, bytes memory b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbytes64(padToBytes64(hex""));
+ }
+ return ebool.wrap(Impl.ne(ebytes64.unwrap(a), b, true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(bytes memory a, ebytes64 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEbytes64(padToBytes64(hex""));
+ }
+ return ebool.wrap(Impl.ne(ebytes64.unwrap(b), a, true));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(ebytes128 a, ebytes128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbytes128(padToBytes128(hex""));
+ }
+ if (!isInitialized(b)) {
+ b = asEbytes128(padToBytes128(hex""));
+ }
+ return ebool.wrap(Impl.eq(ebytes128.unwrap(a), ebytes128.unwrap(b), false));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(ebytes128 a, bytes memory b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbytes128(padToBytes128(hex""));
+ }
+ return ebool.wrap(Impl.eq(ebytes128.unwrap(a), b, true));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(bytes memory a, ebytes128 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEbytes128(padToBytes128(hex""));
+ }
+ return ebool.wrap(Impl.eq(ebytes128.unwrap(b), a, true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(ebytes128 a, ebytes128 b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbytes128(padToBytes128(hex""));
+ }
+ if (!isInitialized(b)) {
+ b = asEbytes128(padToBytes128(hex""));
+ }
+ return ebool.wrap(Impl.ne(ebytes128.unwrap(a), ebytes128.unwrap(b), false));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(ebytes128 a, bytes memory b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbytes128(padToBytes128(hex""));
+ }
+ return ebool.wrap(Impl.ne(ebytes128.unwrap(a), b, true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(bytes memory a, ebytes128 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEbytes128(padToBytes128(hex""));
+ }
+ return ebool.wrap(Impl.ne(ebytes128.unwrap(b), a, true));
+ }
+
// Evaluate eq(a, b) and return the result.
function eq(ebytes256 a, ebytes256 b) internal returns (ebool) {
- require(isInitialized(a), "a is uninitialized");
- require(isInitialized(b), "b is uninitialized");
+ if (!isInitialized(a)) {
+ a = asEbytes256(padToBytes256(hex""));
+ }
+ if (!isInitialized(b)) {
+ b = asEbytes256(padToBytes256(hex""));
+ }
return ebool.wrap(Impl.eq(ebytes256.unwrap(a), ebytes256.unwrap(b), false));
}
+ // Evaluate eq(a, b) and return the result.
+ function eq(ebytes256 a, bytes memory b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbytes256(padToBytes256(hex""));
+ }
+ return ebool.wrap(Impl.eq(ebytes256.unwrap(a), b, true));
+ }
+
+ // Evaluate eq(a, b) and return the result.
+ function eq(bytes memory a, ebytes256 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEbytes256(padToBytes256(hex""));
+ }
+ return ebool.wrap(Impl.eq(ebytes256.unwrap(b), a, true));
+ }
+
// Evaluate ne(a, b) and return the result.
function ne(ebytes256 a, ebytes256 b) internal returns (ebool) {
- require(isInitialized(a), "a is uninitialized");
- require(isInitialized(b), "b is uninitialized");
+ if (!isInitialized(a)) {
+ a = asEbytes256(padToBytes256(hex""));
+ }
+ if (!isInitialized(b)) {
+ b = asEbytes256(padToBytes256(hex""));
+ }
return ebool.wrap(Impl.ne(ebytes256.unwrap(a), ebytes256.unwrap(b), false));
}
+ // Evaluate ne(a, b) and return the result.
+ function ne(ebytes256 a, bytes memory b) internal returns (ebool) {
+ if (!isInitialized(a)) {
+ a = asEbytes256(padToBytes256(hex""));
+ }
+ return ebool.wrap(Impl.ne(ebytes256.unwrap(a), b, true));
+ }
+
+ // Evaluate ne(a, b) and return the result.
+ function ne(bytes memory a, ebytes256 b) internal returns (ebool) {
+ if (!isInitialized(b)) {
+ b = asEbytes256(padToBytes256(hex""));
+ }
+ return ebool.wrap(Impl.ne(ebytes256.unwrap(b), a, true));
+ }
+
// cleans the transient storage of ACL containing all the allowedTransient accounts
// to be used for integration with Account Abstraction or when bundling UserOps calling the FHEVMCoprocessor
function cleanTransientStorage() internal {
@@ -5699,6 +10841,12 @@ library TFHE {
function isAllowed(euint64 value, address account) internal view returns (bool) {
return Impl.isAllowed(euint64.unwrap(value), account);
}
+ function isAllowed(euint128 value, address account) internal view returns (bool) {
+ return Impl.isAllowed(euint128.unwrap(value), account);
+ }
+ function isAllowed(euint256 value, address account) internal view returns (bool) {
+ return Impl.isAllowed(euint256.unwrap(value), account);
+ }
function isAllowed(eaddress value, address account) internal view returns (bool) {
return Impl.isAllowed(eaddress.unwrap(value), account);
}
@@ -5731,6 +10879,14 @@ library TFHE {
return Impl.isAllowed(euint64.unwrap(value), msg.sender);
}
+ function isSenderAllowed(euint128 value) internal view returns (bool) {
+ return Impl.isAllowed(euint128.unwrap(value), msg.sender);
+ }
+
+ function isSenderAllowed(euint256 value) internal view returns (bool) {
+ return Impl.isAllowed(euint256.unwrap(value), msg.sender);
+ }
+
function isSenderAllowed(eaddress value) internal view returns (bool) {
return Impl.isAllowed(eaddress.unwrap(value), msg.sender);
}
@@ -5787,6 +10943,22 @@ library TFHE {
Impl.allow(euint64.unwrap(value), address(this));
}
+ function allow(euint128 value, address account) internal {
+ Impl.allow(euint128.unwrap(value), account);
+ }
+
+ function allowThis(euint128 value) internal {
+ Impl.allow(euint128.unwrap(value), address(this));
+ }
+
+ function allow(euint256 value, address account) internal {
+ Impl.allow(euint256.unwrap(value), account);
+ }
+
+ function allowThis(euint256 value) internal {
+ Impl.allow(euint256.unwrap(value), address(this));
+ }
+
function allow(eaddress value, address account) internal {
Impl.allow(eaddress.unwrap(value), account);
}
@@ -5795,6 +10967,22 @@ library TFHE {
Impl.allow(eaddress.unwrap(value), address(this));
}
+ function allow(ebytes64 value, address account) internal {
+ Impl.allow(ebytes64.unwrap(value), account);
+ }
+
+ function allowThis(ebytes64 value) internal {
+ Impl.allow(ebytes64.unwrap(value), address(this));
+ }
+
+ function allow(ebytes128 value, address account) internal {
+ Impl.allow(ebytes128.unwrap(value), account);
+ }
+
+ function allowThis(ebytes128 value) internal {
+ Impl.allow(ebytes128.unwrap(value), address(this));
+ }
+
function allow(ebytes256 value, address account) internal {
Impl.allow(ebytes256.unwrap(value), account);
}
@@ -5827,6 +11015,14 @@ library TFHE {
Impl.allowTransient(euint64.unwrap(value), account);
}
+ function allowTransient(euint128 value, address account) internal {
+ Impl.allowTransient(euint128.unwrap(value), account);
+ }
+
+ function allowTransient(euint256 value, address account) internal {
+ Impl.allowTransient(euint256.unwrap(value), account);
+ }
+
function allowTransient(eaddress value, address account) internal {
Impl.allowTransient(eaddress.unwrap(value), account);
}
diff --git a/lib/TFHEExecutor.sol b/lib/TFHEExecutor.sol
index 732d4457..5ff0fe92 100644
--- a/lib/TFHEExecutor.sol
+++ b/lib/TFHEExecutor.sol
@@ -184,7 +184,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function fheAdd(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
- uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
@@ -193,7 +193,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function fheSub(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
- uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
@@ -202,7 +202,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function fheMul(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
- uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
@@ -212,7 +212,8 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
function fheDiv(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
require(scalarByte & 0x01 == 0x01, "Only fheDiv by a scalar is supported");
- uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ require(rhs != 0, "Could not divide by 0");
+ uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
@@ -222,7 +223,8 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
function fheRem(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
require(scalarByte & 0x01 == 0x01, "Only fheRem by a scalar is supported");
- uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ require(rhs != 0, "Could not divide by 0");
+ uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
@@ -231,8 +233,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function fheBitAnd(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
- require(scalarByte & 0x01 == 0x00, "Only fheBitAnd by a ciphertext is supported");
- uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
@@ -241,8 +242,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function fheBitOr(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
- require(scalarByte & 0x01 == 0x00, "Only fheBitOr by a ciphertext is supported");
- uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
@@ -251,8 +251,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function fheBitXor(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
- require(scalarByte & 0x01 == 0x00, "Only fheBitXor by a ciphertext is supported");
- uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
@@ -261,7 +260,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function fheShl(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
- uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
@@ -270,7 +269,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function fheShr(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
- uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
@@ -279,7 +278,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function fheRotl(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
- uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
@@ -288,7 +287,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function fheRotr(uint256 lhs, uint256 rhs, bytes1 scalarByte) external returns (uint256 result) {
- uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
@@ -297,25 +296,97 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function fheEq(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
- uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 7) + (1 << 11);
+ uint256 supportedTypes = (1 << 0) +
+ (1 << 1) +
+ (1 << 2) +
+ (1 << 3) +
+ (1 << 4) +
+ (1 << 5) +
+ (1 << 6) +
+ (1 << 7) +
+ (1 << 8) +
+ (1 << 9) +
+ (1 << 10) +
+ (1 << 11);
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
+ if (scalar == 0x01) {
+ require(lhsType <= 8, "Scalar fheEq for ebytesXXX types must use the overloaded fheEq");
+ }
fhePayment.payForFheEq(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheEq, lhs, rhs, scalar, 0);
}
+ function fheEq(uint256 lhs, bytes memory rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
+ uint256 supportedTypes = (1 << 9) + (1 << 10) + (1 << 11);
+ requireType(lhs, supportedTypes);
+ uint8 lhsType = typeOf(lhs);
+ bytes1 scalar = scalarByte & 0x01;
+ require(scalar == 0x01, "Overloaded fheEq is only for scalar ebytesXXX second operand");
+ fhePayment.payForFheEq(msg.sender, lhsType, scalar);
+ require(acl.isAllowed(lhs, msg.sender), "Sender doesn't own lhs on op");
+ uint256 lenBytesPT = rhs.length;
+ if (lhsType == 9) {
+ require(lenBytesPT == 64, "Bytes array length of Bytes64 should be 64");
+ } else if (lhsType == 10) {
+ require(lenBytesPT == 128, "Bytes array length of Bytes128 should be 128");
+ } else {
+ // @note: i.e lhsType == 11 thanks to the first pre-condition
+ require(lenBytesPT == 256, "Bytes array length of Bytes256 should be 256");
+ }
+ result = uint256(keccak256(abi.encodePacked(Operators.fheEq, lhs, rhs, scalar, acl, block.chainid)));
+ result = appendType(result, 0);
+ acl.allowTransient(result, msg.sender);
+ }
+
function fheNe(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
- uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 7) + (1 << 11);
+ uint256 supportedTypes = (1 << 0) +
+ (1 << 1) +
+ (1 << 2) +
+ (1 << 3) +
+ (1 << 4) +
+ (1 << 5) +
+ (1 << 6) +
+ (1 << 7) +
+ (1 << 8) +
+ (1 << 9) +
+ (1 << 10) +
+ (1 << 11);
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
+ if (scalar == 0x01) {
+ require(lhsType <= 8, "Scalar fheNe for ebytesXXX types must use the overloaded fheNe");
+ }
fhePayment.payForFheNe(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheNe, lhs, rhs, scalar, 0);
}
+ function fheNe(uint256 lhs, bytes memory rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
+ uint256 supportedTypes = (1 << 9) + (1 << 10) + (1 << 11);
+ requireType(lhs, supportedTypes);
+ uint8 lhsType = typeOf(lhs);
+ bytes1 scalar = scalarByte & 0x01;
+ require(scalar == 0x01, "Overloaded fheNe is only for scalar ebytesXXX second operand");
+ fhePayment.payForFheNe(msg.sender, lhsType, scalar);
+ require(acl.isAllowed(lhs, msg.sender), "Sender doesn't own lhs on op");
+ uint256 lenBytesPT = rhs.length;
+ if (lhsType == 9) {
+ require(lenBytesPT == 64, "Bytes array length of Bytes64 should be 64");
+ } else if (lhsType == 10) {
+ require(lenBytesPT == 128, "Bytes array length of Bytes128 should be 128");
+ } else {
+ // @note: i.e lhsType == 11 thanks to the first pre-condition
+ require(lenBytesPT == 256, "Bytes array length of Bytes256 should be 256");
+ }
+ result = uint256(keccak256(abi.encodePacked(Operators.fheNe, lhs, rhs, scalar, acl, block.chainid)));
+ result = appendType(result, 0);
+ acl.allowTransient(result, msg.sender);
+ }
+
function fheGe(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
- uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
@@ -324,7 +395,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function fheGt(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
- uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
@@ -333,7 +404,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function fheLe(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
- uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
@@ -342,7 +413,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function fheLt(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
- uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
@@ -351,7 +422,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function fheMin(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
- uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
@@ -360,7 +431,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function fheMax(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
- uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
@@ -369,7 +440,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function fheNeg(uint256 ct) external virtual returns (uint256 result) {
- uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(ct, supportedTypes);
uint8 typeCt = typeOf(ct);
fhePayment.payForFheNeg(msg.sender, typeCt);
@@ -377,7 +448,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function fheNot(uint256 ct) external virtual returns (uint256 result) {
- uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(ct, supportedTypes);
uint8 typeCt = typeOf(ct);
fhePayment.payForFheNot(msg.sender, typeCt);
@@ -403,9 +474,16 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
function cast(uint256 ct, bytes1 toType) external virtual returns (uint256 result) {
require(acl.isAllowed(ct, msg.sender), "Sender doesn't own ct on cast");
- uint256 supportedTypesInput = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypesInput = (1 << 0) +
+ (1 << 1) +
+ (1 << 2) +
+ (1 << 3) +
+ (1 << 4) +
+ (1 << 5) +
+ (1 << 6) +
+ (1 << 8);
requireType(ct, supportedTypesInput);
- uint256 supportedTypesOutput = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5); // @note: unsupported casting to ebool (use fheNe instead)
+ uint256 supportedTypesOutput = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); // @note: unsupported casting to ebool (use fheNe instead)
require((1 << uint8(toType)) & supportedTypesOutput > 0, "Unsupported output type");
uint8 typeCt = typeOf(ct);
require(bytes1(typeCt) != toType, "Cannot cast to same type");
@@ -416,17 +494,56 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function trivialEncrypt(uint256 pt, bytes1 toType) external virtual returns (uint256 result) {
- uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 7);
+ uint256 supportedTypes = (1 << 0) +
+ (1 << 1) +
+ (1 << 2) +
+ (1 << 3) +
+ (1 << 4) +
+ (1 << 5) +
+ (1 << 6) +
+ (1 << 7) +
+ (1 << 8);
+ uint8 toT = uint8(toType);
+ require((1 << toT) & supportedTypes > 0, "Unsupported type");
+ fhePayment.payForTrivialEncrypt(msg.sender, toT);
+ result = uint256(keccak256(abi.encodePacked(Operators.trivialEncrypt, pt, toType, acl, block.chainid)));
+ result = appendType(result, toT);
+ acl.allowTransient(result, msg.sender);
+ }
+
+ function trivialEncrypt(bytes memory pt, bytes1 toType) external virtual returns (uint256 result) {
+ // @note: overloaded function for ebytesXX types
+ uint256 supportedTypes = (1 << 9) + (1 << 10) + (1 << 11);
uint8 toT = uint8(toType);
require((1 << toT) & supportedTypes > 0, "Unsupported type");
fhePayment.payForTrivialEncrypt(msg.sender, toT);
+ uint256 lenBytesPT = pt.length;
+ if (toT == 9) {
+ require(lenBytesPT == 64, "Bytes array length of Bytes64 should be 64");
+ } else if (toT == 10) {
+ require(lenBytesPT == 128, "Bytes array length of Bytes128 should be 128");
+ } else {
+ // @note: i.e toT == 11 thanks to the pre-condition above
+ require(lenBytesPT == 256, "Bytes array length of Bytes256 should be 256");
+ }
result = uint256(keccak256(abi.encodePacked(Operators.trivialEncrypt, pt, toType, acl, block.chainid)));
result = appendType(result, toT);
acl.allowTransient(result, msg.sender);
}
function fheIfThenElse(uint256 control, uint256 ifTrue, uint256 ifFalse) external virtual returns (uint256 result) {
- uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 7);
+ uint256 supportedTypes = (1 << 0) +
+ (1 << 1) +
+ (1 << 2) +
+ (1 << 3) +
+ (1 << 4) +
+ (1 << 5) +
+ (1 << 6) +
+ (1 << 7) +
+ (1 << 8) +
+ (1 << 9) +
+ (1 << 10) +
+ (1 << 11);
requireType(ifTrue, supportedTypes);
uint8 typeCt = typeOf(ifTrue);
fhePayment.payForIfThenElse(msg.sender, typeCt);
@@ -435,7 +552,17 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
function fheRand(bytes1 randType) external virtual returns (uint256 result) {
TFHEExecutorStorage storage $ = _getTFHEExecutorStorage();
- uint256 supportedTypes = (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypes = (1 << 0) +
+ (1 << 1) +
+ (1 << 2) +
+ (1 << 3) +
+ (1 << 4) +
+ (1 << 5) +
+ (1 << 6) +
+ (1 << 8) +
+ (1 << 9) +
+ (1 << 10) +
+ (1 << 11);
uint8 randT = uint8(randType);
require((1 << randT) & supportedTypes > 0, "Unsupported erandom type");
fhePayment.payForFheRand(msg.sender, randT);
@@ -450,7 +577,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
function fheRandBounded(uint256 upperBound, bytes1 randType) external virtual returns (uint256 result) {
TFHEExecutorStorage storage $ = _getTFHEExecutorStorage();
- uint256 supportedTypes = (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);
+ uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
uint8 randT = uint8(randType);
require((1 << randT) & supportedTypes > 0, "Unsupported erandom type");
require(isPowerOfTwo(upperBound), "UpperBound must be a power of 2");
diff --git a/test/asyncDecrypt.ts b/test/asyncDecrypt.ts
index a024bf23..e9a16374 100644
--- a/test/asyncDecrypt.ts
+++ b/test/asyncDecrypt.ts
@@ -21,6 +21,9 @@ const CiphertextType = {
5: 'uint64',
6: 'uint128',
7: 'address',
+ 8: 'uint256',
+ 9: 'bytes',
+ 10: 'bytes',
11: 'bytes',
};
@@ -44,7 +47,7 @@ let gateway: GatewayContract;
let firstBlockListening: number;
let lastBlockSnapshotForDecrypt: number;
-export const asyncDecrypt = async (): Promise => {
+export const initGateway = async (): Promise => {
firstBlockListening = await ethers.provider.getBlockNumber();
if (networkName === 'hardhat' && hre.__SOLIDITY_COVERAGE_RUNNING !== true) {
// evm_snapshot is not supported in coverage mode
@@ -130,24 +133,29 @@ const fulfillAllPastRequestsIds = async (mocked: boolean) => {
if (!allTrue(isAllowedForDec)) {
throw new Error('Some handle is not authorized for decryption');
}
-
const types = typesList.map((num) => CiphertextType[num]);
const values = await Promise.all(handles.map(async (handle) => BigInt(await getClearText(handle))));
const valuesFormatted = values.map((value, index) =>
types[index] === 'address' ? '0x' + value.toString(16).padStart(40, '0') : value,
);
const valuesFormatted2 = valuesFormatted.map((value, index) =>
- types[index] === 'bytes' ? '0x' + value.toString(16).padStart(512, '0') : value,
+ typesList[index] === 9 ? '0x' + value.toString(16).padStart(128, '0') : value,
+ );
+ const valuesFormatted3 = valuesFormatted2.map((value, index) =>
+ typesList[index] === 10 ? '0x' + value.toString(16).padStart(256, '0') : value,
+ );
+ const valuesFormatted4 = valuesFormatted3.map((value, index) =>
+ typesList[index] === 11 ? '0x' + value.toString(16).padStart(512, '0') : value,
);
const abiCoder = new ethers.AbiCoder();
let encodedData;
let calldata;
if (!passSignaturesToCaller) {
- encodedData = abiCoder.encode(['uint256', ...types], [31, ...valuesFormatted2]); // 31 is just a dummy uint256 requestID to get correct abi encoding for the remaining arguments (i.e everything except the requestID)
+ encodedData = abiCoder.encode(['uint256', ...types], [31, ...valuesFormatted4]); // 31 is just a dummy uint256 requestID to get correct abi encoding for the remaining arguments (i.e everything except the requestID)
calldata = '0x' + encodedData.slice(66); // we just pop the dummy requestID to get the correct value to pass for `decryptedCts`
} else {
- encodedData = abiCoder.encode(['uint256', ...types, 'bytes[]'], [31, ...valuesFormatted2, []]); // adding also a dummy empty array of bytes for correct abi-encoding when used with signatures
+ encodedData = abiCoder.encode(['uint256', ...types, 'bytes[]'], [31, ...valuesFormatted4, []]); // adding also a dummy empty array of bytes for correct abi-encoding when used with signatures
calldata = '0x' + encodedData.slice(66).slice(0, -64); // we also pop the last 32 bytes (empty bytes[])
}
diff --git a/test/coprocessorUtils.ts b/test/coprocessorUtils.ts
index c3c62a2a..42222fea 100644
--- a/test/coprocessorUtils.ts
+++ b/test/coprocessorUtils.ts
@@ -223,6 +223,19 @@ async function insertHandle(
insertSQL(handle, clearText);
break;
+ case 'trivialEncrypt(bytes,bytes1)':
+ resultType = Number(decodedData[1]);
+ clearText = decodedData[0];
+ handle = ethers.keccak256(
+ ethers.solidityPacked(
+ ['uint8', 'bytes', 'bytes1', 'address', 'uint256'],
+ [Operators.trivialEncrypt, decodedData[0], decodedData[1], aclAddress, chainId],
+ ),
+ );
+ handle = appendType(handle, resultType);
+ insertSQL(handle, clearText);
+ break;
+
case 'fheAdd(uint256,uint256,bytes1)':
handle = ethers.keccak256(
ethers.solidityPacked(
@@ -507,6 +520,24 @@ async function insertHandle(
insertSQL(handle, clearText);
break;
+ case 'fheEq(uint256,bytes,bytes1)':
+ handle = ethers.keccak256(
+ ethers.solidityPacked(
+ ['uint8', 'uint256', 'bytes', 'bytes1', 'address', 'uint256'],
+ [Operators.fheEq, decodedData[0], decodedData[1], decodedData[2], aclAddress, chainId],
+ ),
+ );
+ handle = appendType(handle, 0);
+ clearLHS = await getClearText(decodedData[0]);
+ if (decodedData[2] === '0x01') {
+ clearText = BigInt(clearLHS) === BigInt(decodedData[1]) ? 1n : 0n;
+ } else {
+ clearRHS = await getClearText(decodedData[1]);
+ clearText = BigInt(clearLHS) === BigInt(clearRHS) ? 1n : 0n;
+ }
+ insertSQL(handle, clearText);
+ break;
+
case 'fheNe(uint256,uint256,bytes1)':
handle = ethers.keccak256(
ethers.solidityPacked(
@@ -525,6 +556,24 @@ async function insertHandle(
insertSQL(handle, clearText);
break;
+ case 'fheNe(uint256,bytes,bytes1)':
+ handle = ethers.keccak256(
+ ethers.solidityPacked(
+ ['uint8', 'uint256', 'bytes', 'bytes1', 'address', 'uint256'],
+ [Operators.fheNe, decodedData[0], decodedData[1], decodedData[2], aclAddress, chainId],
+ ),
+ );
+ handle = appendType(handle, 0);
+ clearLHS = await getClearText(decodedData[0]);
+ if (decodedData[2] === '0x01') {
+ clearText = BigInt(clearLHS) !== BigInt(decodedData[1]) ? 1n : 0n;
+ } else {
+ clearRHS = await getClearText(decodedData[1]);
+ clearText = BigInt(clearLHS) !== BigInt(clearRHS) ? 1n : 0n;
+ }
+ insertSQL(handle, clearText);
+ break;
+
case 'fheGe(uint256,uint256,bytes1)':
handle = ethers.keccak256(
ethers.solidityPacked(
diff --git a/test/gatewayDecrypt/testAsyncDecrypt.ts b/test/gatewayDecrypt/testAsyncDecrypt.ts
index a490bd83..803e957c 100644
--- a/test/gatewayDecrypt/testAsyncDecrypt.ts
+++ b/test/gatewayDecrypt/testAsyncDecrypt.ts
@@ -1,10 +1,10 @@
import { expect } from 'chai';
import { ethers, network } from 'hardhat';
-import { asyncDecrypt, awaitAllDecryptionResults } from '../asyncDecrypt';
+import { awaitAllDecryptionResults, initGateway } from '../asyncDecrypt';
import { createInstances } from '../instance';
import { getSigners, initSigners } from '../signers';
-import { bigIntToBytes256, waitNBlocks } from '../utils';
+import { bigIntToBytes64, bigIntToBytes128, bigIntToBytes256, waitNBlocks } from '../utils';
describe('TestAsyncDecrypt', function () {
before(async function () {
@@ -23,7 +23,7 @@ describe('TestAsyncDecrypt', function () {
await tx.wait(); // this first request is here just to silence the current gateway bug at the moment
await waitNBlocks(1);
- await asyncDecrypt();
+ await initGateway();
});
beforeEach(async function () {
@@ -233,6 +233,48 @@ describe('TestAsyncDecrypt', function () {
expect(y).to.equal(18446744073709551600n);
});
+ it('test async decrypt uint128', async function () {
+ const tx2 = await this.contract.connect(this.signers.carol).requestUint128({ gasLimit: 5_000_000 });
+ await tx2.wait();
+ await awaitAllDecryptionResults();
+ const y = await this.contract.yUint128();
+ expect(y).to.equal(1267650600228229401496703205443n);
+ });
+
+ it('test async decrypt uint128 non-trivial', async function () {
+ const inputAlice = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
+ inputAlice.add128(184467440737095500429401496n);
+ const encryptedAmount = await inputAlice.encrypt();
+ const tx = await this.contract.requestUint128NonTrivial(encryptedAmount.handles[0], encryptedAmount.inputProof, {
+ gasLimit: 5_000_000,
+ });
+ await tx.wait();
+ await awaitAllDecryptionResults();
+ const y = await this.contract.yUint128();
+ expect(y).to.equal(184467440737095500429401496n);
+ });
+
+ it('test async decrypt uint256', async function () {
+ const tx2 = await this.contract.connect(this.signers.carol).requestUint256({ gasLimit: 5_000_000 });
+ await tx2.wait();
+ await awaitAllDecryptionResults();
+ const y = await this.contract.yUint256();
+ expect(y).to.equal(27606985387162255149739023449108101809804435888681546220650096895197251n);
+ });
+
+ it('test async decrypt uint256 non-trivial', async function () {
+ const inputAlice = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
+ inputAlice.add256(6985387162255149739023449108101809804435888681546n);
+ const encryptedAmount = await inputAlice.encrypt();
+ const tx = await this.contract.requestUint256NonTrivial(encryptedAmount.handles[0], encryptedAmount.inputProof, {
+ gasLimit: 5_000_000,
+ });
+ await tx.wait();
+ await awaitAllDecryptionResults();
+ const y = await this.contract.yUint256();
+ expect(y).to.equal(6985387162255149739023449108101809804435888681546n);
+ });
+
it.skip('test async decrypt FAKE uint64', async function () {
if (network.name !== 'hardhat') {
// only in fhevm mode
@@ -322,6 +364,78 @@ describe('TestAsyncDecrypt', function () {
expect(y).to.equal(18446744073709550042n);
});
+ it('test async decrypt ebytes64 trivial', async function () {
+ const tx = await this.contract.requestEbytes64Trivial('0x78685689');
+ await tx.wait();
+ await awaitAllDecryptionResults();
+ const y = await this.contract.yBytes64();
+ expect(y).to.equal(ethers.toBeHex(BigInt('0x78685689'), 64));
+ });
+
+ it('test async decrypt ebytes64 non-trivial', async function () {
+ const inputAlice = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
+ inputAlice.addBytes64(
+ bigIntToBytes64(98870780878070870878787887072921111299111111000000292928818818818818221112111n),
+ );
+ const encryptedAmount = await inputAlice.encrypt();
+ const tx = await this.contract.requestEbytes64NonTrivial(encryptedAmount.handles[0], encryptedAmount.inputProof, {
+ gasLimit: 5_000_000,
+ });
+ await tx.wait();
+ await awaitAllDecryptionResults();
+ const y = await this.contract.yBytes64();
+ expect(y).to.equal(
+ ethers.toBeHex(98870780878070870878787887072921111299111111000000292928818818818818221112111n, 64),
+ );
+ });
+
+ it('test async decrypt ebytes128 trivial', async function () {
+ const tx = await this.contract.requestEbytes128Trivial(
+ '0x8701d11594415047dfac2d9cb87e6631df5a735a2f364fba1511fa7b812dfad2972b809b80ff25ec19591a598081af357cba384cf5aa8e085678ff70bc55faee',
+ );
+ await tx.wait();
+ await awaitAllDecryptionResults();
+ const y = await this.contract.yBytes128();
+ expect(y).to.equal(
+ ethers.toBeHex(
+ BigInt(
+ '0x8701d11594415047dfac2d9cb87e6631df5a735a2f364fba1511fa7b812dfad2972b809b80ff25ec19591a598081af357cba384cf5aa8e085678ff70bc55faee',
+ ),
+ 128,
+ ),
+ );
+ });
+
+ it('test async decrypt ebytes128 non-trivial', async function () {
+ const inputAlice = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
+ inputAlice.addBytes128(
+ bigIntToBytes128(
+ 9887078087807087087878788707292111129911111100000029292881881881881822111211198870780878070870878787887072921111299111111000000292928818818818818221112111n,
+ ),
+ );
+ const encryptedAmount = await inputAlice.encrypt();
+ const tx = await this.contract.requestEbytes128NonTrivial(encryptedAmount.handles[0], encryptedAmount.inputProof, {
+ gasLimit: 5_000_000,
+ });
+ await tx.wait();
+ await awaitAllDecryptionResults();
+ const y = await this.contract.yBytes128();
+ expect(y).to.equal(
+ ethers.toBeHex(
+ 9887078087807087087878788707292111129911111100000029292881881881881822111211198870780878070870878787887072921111299111111000000292928818818818818221112111n,
+ 128,
+ ),
+ );
+ });
+
+ it('test async decrypt ebytes256 trivial', async function () {
+ const tx = await this.contract.requestEbytes256Trivial('0x78685689');
+ await tx.wait();
+ await awaitAllDecryptionResults();
+ const y = await this.contract.yBytes256();
+ expect(y).to.equal(ethers.toBeHex(BigInt('0x78685689'), 256));
+ });
+
it('test async decrypt ebytes256 non-trivial', async function () {
const inputAlice = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
inputAlice.addBytes256(bigIntToBytes256(18446744073709550022n));
@@ -378,6 +492,8 @@ describe('TestAsyncDecrypt', function () {
await awaitAllDecryptionResults();
const y = await this.contract.yBytes256();
expect(y).to.equal(ethers.toBeHex(18446744073709550032n, 256));
+ const y2 = await this.contract.yBytes64();
+ expect(y2).to.equal(ethers.toBeHex(BigInt('0xaaff42'), 64));
const yb = await this.contract.yBool();
expect(yb).to.equal(true);
const yAdd = await this.contract.yAddress();
diff --git a/test/instance.ts b/test/instance.ts
index ee307d9d..453bf64c 100644
--- a/test/instance.ts
+++ b/test/instance.ts
@@ -190,6 +190,42 @@ export const decrypt64 = async (handle: bigint): Promise => {
}
};
+/**
+ * @debug
+ * This function is intended for debugging purposes only.
+ * It cannot be used in production code, since it requires the FHE private key for decryption.
+ * In production, decryption is only possible via an asyncronous on-chain call to the Gateway.
+ *
+ * @param {bigint} a handle to decrypt
+ * @returns {bigint}
+ */
+export const decrypt128 = async (handle: bigint): Promise => {
+ if (network.name === 'hardhat') {
+ await awaitCoprocessor();
+ return BigInt(await getClearText(handle));
+ } else {
+ return getDecryptor().decrypt128(await getCiphertext(handle, ethers));
+ }
+};
+
+/**
+ * @debug
+ * This function is intended for debugging purposes only.
+ * It cannot be used in production code, since it requires the FHE private key for decryption.
+ * In production, decryption is only possible via an asyncronous on-chain call to the Gateway.
+ *
+ * @param {bigint} a handle to decrypt
+ * @returns {bigint}
+ */
+export const decrypt256 = async (handle: bigint): Promise => {
+ if (network.name === 'hardhat') {
+ await awaitCoprocessor();
+ return BigInt(await getClearText(handle));
+ } else {
+ return getDecryptor().decrypt256(await getCiphertext(handle, ethers));
+ }
+};
+
/**
* @debug
* This function is intended for debugging purposes only.
@@ -209,3 +245,57 @@ export const decryptAddress = async (handle: bigint): Promise => {
return getDecryptor().decryptAddress(await getCiphertext(handle, ethers));
}
};
+
+/**
+ * @debug
+ * This function is intended for debugging purposes only.
+ * It cannot be used in production code, since it requires the FHE private key for decryption.
+ * In production, decryption is only possible via an asyncronous on-chain call to the Gateway.
+ *
+ * @param {bigint} a handle to decrypt
+ * @returns {bigint}
+ */
+export const decryptEbytes64 = async (handle: bigint): Promise => {
+ if (network.name === 'hardhat') {
+ await awaitCoprocessor();
+ return BigInt(await getClearText(handle));
+ } else {
+ return getDecryptor().decryptEbytes64(await getCiphertext(handle, ethers));
+ }
+};
+
+/**
+ * @debug
+ * This function is intended for debugging purposes only.
+ * It cannot be used in production code, since it requires the FHE private key for decryption.
+ * In production, decryption is only possible via an asyncronous on-chain call to the Gateway.
+ *
+ * @param {bigint} a handle to decrypt
+ * @returns {bigint}
+ */
+export const decryptEbytes128 = async (handle: bigint): Promise => {
+ if (network.name === 'hardhat') {
+ await awaitCoprocessor();
+ return BigInt(await getClearText(handle));
+ } else {
+ return getDecryptor().decryptEbytes128(await getCiphertext(handle, ethers));
+ }
+};
+
+/**
+ * @debug
+ * This function is intended for debugging purposes only.
+ * It cannot be used in production code, since it requires the FHE private key for decryption.
+ * In production, decryption is only possible via an asyncronous on-chain call to the Gateway.
+ *
+ * @param {bigint} a handle to decrypt
+ * @returns {bigint}
+ */
+export const decryptEbytes256 = async (handle: bigint): Promise => {
+ if (network.name === 'hardhat') {
+ await awaitCoprocessor();
+ return BigInt(await getClearText(handle));
+ } else {
+ return getDecryptor().decryptEbytes256(await getCiphertext(handle, ethers));
+ }
+};
diff --git a/test/kmsVerifier/kmsVerifier.ts b/test/kmsVerifier/kmsVerifier.ts
index b4bba0be..11e3c533 100644
--- a/test/kmsVerifier/kmsVerifier.ts
+++ b/test/kmsVerifier/kmsVerifier.ts
@@ -3,7 +3,7 @@ import dotenv from 'dotenv';
import fs from 'fs';
import { ethers } from 'hardhat';
-import { asyncDecrypt, awaitAllDecryptionResults } from '../asyncDecrypt';
+import { awaitAllDecryptionResults, initGateway } from '../asyncDecrypt';
import { createInstances } from '../instance';
import { getSigners, initSigners } from '../signers';
import { bigIntToBytes256 } from '../utils';
@@ -14,7 +14,7 @@ describe('KMSVerifier', function () {
this.signers = await getSigners();
this.instances = await createInstances(this.signers);
this.kmsFactory = await ethers.getContractFactory('KMSVerifier');
- await asyncDecrypt();
+ await initGateway();
});
it('original owner adds one signer, then adds two more signers, then removes one signer', async function () {
diff --git a/test/rand/Rand.ts b/test/rand/Rand.ts
index b2ea35ce..e45886f6 100644
--- a/test/rand/Rand.ts
+++ b/test/rand/Rand.ts
@@ -1,7 +1,20 @@
import { expect } from 'chai';
import { ethers, network } from 'hardhat';
-import { createInstances, decrypt8, decrypt16, decrypt32, decrypt64 } from '../instance';
+import {
+ createInstances,
+ decrypt4,
+ decrypt8,
+ decrypt16,
+ decrypt32,
+ decrypt64,
+ decrypt128,
+ decrypt256,
+ decryptBool,
+ decryptEbytes64,
+ decryptEbytes128,
+ decryptEbytes256,
+} from '../instance';
import { getSigners, initSigners } from '../signers';
import { deployRandFixture } from './Rand.fixture';
@@ -18,6 +31,50 @@ describe('Rand', function () {
this.instances = await createInstances(this.signers);
});
+ it('ebool generate and decrypt', async function () {
+ const values: boolean[] = [];
+ for (let i = 0; i < 15; i++) {
+ const txn = await this.rand.generateBool();
+ await txn.wait();
+ const valueHandle = await this.rand.valueb();
+ const value = await decryptBool(valueHandle);
+ values.push(value);
+ }
+ // Expect at least two different generated values.
+ const unique = new Set(values);
+ expect(unique.size).to.be.greaterThanOrEqual(2);
+ });
+
+ it('4 bits generate and decrypt', async function () {
+ const values: number[] = [];
+ for (let i = 0; i < 5; i++) {
+ const txn = await this.rand.generate4();
+ await txn.wait();
+ const valueHandle = await this.rand.value4();
+ const value = await decrypt4(valueHandle);
+ expect(value).to.be.lessThanOrEqual(0xf);
+ values.push(value);
+ }
+ // Expect at least two different generated values.
+ const unique = new Set(values);
+ expect(unique.size).to.be.greaterThanOrEqual(2);
+ });
+
+ it('4 bits generate with upper bound and decrypt', async function () {
+ const values: number[] = [];
+ for (let i = 0; i < 7; i++) {
+ const txn = await this.rand.generate4UpperBound(8);
+ await txn.wait();
+ const valueHandle = await this.rand.value4();
+ const value = await decrypt4(valueHandle);
+ expect(value).to.be.lessThanOrEqual(7);
+ values.push(value);
+ }
+ // Expect at least two different generated values.
+ const unique = new Set(values);
+ expect(unique.size).to.be.greaterThanOrEqual(2);
+ });
+
it('8 bits generate and decrypt', async function () {
const values: number[] = [];
for (let i = 0; i < 5; i++) {
@@ -132,10 +189,11 @@ describe('Rand', function () {
if (value > BigInt('0xffffffff')) {
has64bit = true;
}
+ // Make sure we actually generate 64 bit integers.
+ expect(has64bit).to.be.true;
values.push(value);
}
- // Make sure we actually generate 64 bit integers.
- expect(has64bit).to.be.true;
+
// Expect at least two different generated values.
const unique = new Set(values);
expect(unique.size).to.be.greaterThanOrEqual(2);
@@ -156,6 +214,138 @@ describe('Rand', function () {
expect(unique.size).to.be.greaterThanOrEqual(2);
});
+ it('128 bits generate and decrypt', async function () {
+ const values: bigint[] = [];
+ let has128bit: boolean = false;
+ for (let i = 0; i < 5; i++) {
+ const txn = await this.rand.generate128();
+ await txn.wait();
+ const valueHandle = await this.rand.value128();
+ const value = await decrypt128(valueHandle);
+ expect(value).to.be.lessThanOrEqual(BigInt('0xffffffffffffffffffffffffffffffff'));
+ if (value > BigInt('0xffffffffffffffff')) {
+ has128bit = true;
+ }
+ values.push(value);
+ // Make sure we actually generate 128 bit integers.
+ expect(has128bit).to.be.true;
+ }
+ // Expect at least 4 different generated values.
+ const unique = new Set(values);
+ expect(unique.size).to.be.greaterThanOrEqual(4);
+ });
+
+ it('128 bits generate with upper bound and decrypt', async function () {
+ const values: bigint[] = [];
+ for (let i = 0; i < 5; i++) {
+ const txn = await this.rand.generate128UpperBound(2n ** 100n);
+ await txn.wait();
+ const valueHandle = await this.rand.value128();
+ const value = await decrypt128(valueHandle);
+ expect(value).to.be.lessThanOrEqual(2n ** 100n);
+ values.push(value);
+ }
+ // Expect at least 4 different generated values.
+ const unique = new Set(values);
+ expect(unique.size).to.be.greaterThanOrEqual(4);
+ });
+
+ it('256 bits generate and decrypt', async function () {
+ const values: bigint[] = [];
+ let has256bit: boolean = false;
+ for (let i = 0; i < 5; i++) {
+ const txn = await this.rand.generate256();
+ await txn.wait();
+ const valueHandle = await this.rand.value256();
+ const value = await decrypt256(valueHandle);
+ expect(value).to.be.lessThanOrEqual(BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'));
+ if (value > BigInt('0xffffffffffffffffffffffffffffffff')) {
+ has256bit = true;
+ }
+ values.push(value);
+ // Make sure we actually generate 256 bit integers.
+ expect(has256bit).to.be.true;
+ }
+ // Expect at least 5 different generated values.
+ const unique = new Set(values);
+ expect(unique.size).to.be.greaterThanOrEqual(5);
+ });
+
+ it('256 bits generate with upper bound and decrypt', async function () {
+ const values: bigint[] = [];
+ for (let i = 0; i < 5; i++) {
+ const txn = await this.rand.generate256UpperBound(2n ** 200n);
+ await txn.wait();
+ const valueHandle = await this.rand.value256();
+ const value = await decrypt256(valueHandle);
+ expect(value).to.be.lessThanOrEqual(2n ** 200n);
+ values.push(value);
+ }
+ // Expect at least 5 different generated values.
+ const unique = new Set(values);
+ expect(unique.size).to.be.greaterThanOrEqual(5);
+ });
+
+ it('512 bits generate and decrypt', async function () {
+ const values: bigint[] = [];
+ let has512bit: boolean = false;
+ for (let i = 0; i < 5; i++) {
+ const txn = await this.rand.generate512();
+ await txn.wait();
+ const valueHandle = await this.rand.value512();
+ const value = await decryptEbytes64(valueHandle);
+ expect(value).to.be.lessThan(2n ** 512n);
+ if (value > 2n ** 256n) {
+ has512bit = true;
+ }
+ values.push(value);
+ expect(has512bit).to.be.true;
+ }
+ // Expect at least 5 different generated values.
+ const unique = new Set(values);
+ expect(unique.size).to.be.greaterThanOrEqual(5);
+ });
+
+ it('1024 bits generate and decrypt', async function () {
+ const values: bigint[] = [];
+ let has1024bit: boolean = false;
+ for (let i = 0; i < 5; i++) {
+ const txn = await this.rand.generate1024();
+ await txn.wait();
+ const valueHandle = await this.rand.value1024();
+ const value = await decryptEbytes128(valueHandle);
+ expect(value).to.be.lessThan(2n ** 1024n);
+ if (value > 2n ** 512n) {
+ has1024bit = true;
+ }
+ values.push(value);
+ expect(has1024bit).to.be.true;
+ }
+ // Expect at least 5 different generated values.
+ const unique = new Set(values);
+ expect(unique.size).to.be.greaterThanOrEqual(5);
+ });
+
+ it('2048 bits generate and decrypt', async function () {
+ const values: bigint[] = [];
+ let has2048bit: boolean = false;
+ for (let i = 0; i < 5; i++) {
+ const txn = await this.rand.generate2048();
+ await txn.wait();
+ const valueHandle = await this.rand.value2048();
+ const value = await decryptEbytes256(valueHandle);
+ expect(value).to.be.lessThan(2n ** 2048n);
+ if (value > 2n ** 1024n) {
+ has2048bit = true;
+ }
+ values.push(value);
+ expect(has2048bit).to.be.true;
+ }
+ // Expect at least 5 different generated values.
+ const unique = new Set(values);
+ expect(unique.size).to.be.greaterThanOrEqual(5);
+ });
+
it('8 and 16 bits generate and decrypt with hardhat snapshots [skip-on-coverage]', async function () {
if (network.name === 'hardhat') {
// snapshots are only possible in hardhat node, i.e in mocked mode
diff --git a/test/reencryption/reencryption.ts b/test/reencryption/reencryption.ts
index 476d7fcb..a604f8f7 100644
--- a/test/reencryption/reencryption.ts
+++ b/test/reencryption/reencryption.ts
@@ -15,16 +15,6 @@ describe('Reencryption', function () {
this.contract = await contractFactory.connect(this.signers.alice).deploy();
this.contractAddress = await this.contract.getAddress();
this.instances = await createInstances(this.signers);
-
- const inputAlice = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
- inputAlice.addBytes256(
- bigIntToBytes256(184467440737095500228978978978978970980978908978978907890778907089780970897890n),
- );
- const encryptedAmount = await inputAlice.encrypt();
- const tx = await this.contract.setEBytes256(encryptedAmount.handles[0], encryptedAmount.inputProof, {
- gasLimit: 5_000_000,
- });
- await tx.wait();
});
it('test reencrypt ebool', async function () {
@@ -147,6 +137,26 @@ describe('Reencryption', function () {
expect(decryptedValue).to.equal(18446744073709551600n);
});
+ it('test reencrypt euint128', async function () {
+ const handle = await this.contract.xUint128();
+ const { publicKey, privateKey } = this.instances.alice.generateKeypair();
+ const eip712 = this.instances.alice.createEIP712(publicKey, this.contractAddress);
+ const signature = await this.signers.alice.signTypedData(
+ eip712.domain,
+ { Reencrypt: eip712.types.Reencrypt },
+ eip712.message,
+ );
+ const decryptedValue = await this.instances.alice.reencrypt(
+ handle,
+ privateKey,
+ publicKey,
+ signature.replace('0x', ''),
+ this.contractAddress,
+ this.signers.alice.address,
+ );
+ expect(decryptedValue).to.equal(145275933516363203950142179850024740765n);
+ });
+
it('test reencrypt eaddress', async function () {
const handle = await this.contract.xAddress();
const { publicKey, privateKey } = this.instances.alice.generateKeypair();
@@ -167,6 +177,74 @@ describe('Reencryption', function () {
expect(decryptedValue).to.equal(BigInt('0x8ba1f109551bD432803012645Ac136ddd64DBA72'));
});
+ it('test reencrypt euint256', async function () {
+ const handle = await this.contract.xUint256();
+ const { publicKey, privateKey } = this.instances.alice.generateKeypair();
+ const eip712 = this.instances.alice.createEIP712(publicKey, this.contractAddress);
+ const signature = await this.signers.alice.signTypedData(
+ eip712.domain,
+ { Reencrypt: eip712.types.Reencrypt },
+ eip712.message,
+ );
+ const decryptedValue = await this.instances.alice.reencrypt(
+ handle,
+ privateKey,
+ publicKey,
+ signature.replace('0x', ''),
+ this.contractAddress,
+ this.signers.alice.address,
+ );
+ expect(decryptedValue).to.equal(74285495974541385002137713624115238327312291047062397922780925695323480915729n);
+ });
+
+ it('test reencrypt ebytes64', async function () {
+ const handle = await this.contract.yBytes64();
+ const { publicKey, privateKey } = this.instances.alice.generateKeypair();
+ const eip712 = this.instances.alice.createEIP712(publicKey, this.contractAddress);
+ const signature = await this.signers.alice.signTypedData(
+ eip712.domain,
+ { Reencrypt: eip712.types.Reencrypt },
+ eip712.message,
+ );
+ const decryptedValue = await this.instances.alice.reencrypt(
+ handle,
+ privateKey,
+ publicKey,
+ signature.replace('0x', ''),
+ this.contractAddress,
+ this.signers.alice.address,
+ );
+ expect(decryptedValue).to.equal(
+ BigInt(
+ '0x19d179e0cc7e816dc944582ed4f5652f5951900098fc2e0a15a7ea4dc8cfa4e3b6c54beea5ee95e56b728762f659347ce1d4aa1b05fcc5',
+ ),
+ );
+ });
+
+ it('test reencrypt ebytes128', async function () {
+ const handle = await this.contract.yBytes128();
+ const { publicKey, privateKey } = this.instances.alice.generateKeypair();
+ const eip712 = this.instances.alice.createEIP712(publicKey, this.contractAddress);
+ const signature = await this.signers.alice.signTypedData(
+ eip712.domain,
+ { Reencrypt: eip712.types.Reencrypt },
+ eip712.message,
+ );
+ const decryptedValue = await this.instances.alice.reencrypt(
+ handle,
+ privateKey,
+ publicKey,
+ signature.replace('0x', ''),
+ this.contractAddress,
+ this.signers.alice.address,
+ );
+ expect(decryptedValue).to.equal(
+ BigInt(
+ '0x13e7819123de6e2870c7e83bb764508e22d7c3ab8a5aee6bdfb26355ef0d3f1977d651b83bf5f78634fa360aa14debdc3daa6a587b5c2fb1710ab4d6677e62a8577f2d9fecc190ad8b11c9f0a5ec3138b27da1f055437af8c90a9495dad230',
+ ),
+ );
+ });
+
it('test reencrypt ebytes256', async function () {
const handle = await this.contract.yBytes256();
const { publicKey, privateKey } = this.instances.alice.generateKeypair();
@@ -184,6 +262,10 @@ describe('Reencryption', function () {
this.contractAddress,
this.signers.alice.address,
);
- expect(decryptedValue).to.equal(184467440737095500228978978978978970980978908978978907890778907089780970897890n);
+ expect(decryptedValue).to.equal(
+ BigInt(
+ '0xd179e0cc7e816dc944582ed4f5652f5951900098fc2e0a15a7ea4dc8cfa4e3b6c54beea5ee95e56b728762f659347ce1d4aa1b05fcc513e7819123de6e2870c7e83bb764508e22d7c3ab8a5aee6bdfb26355ef0d3f1977d651b83bf5f78634fa360aa14debdc3daa6a587b5c2fb1710ab4d6677e62a8577f2d9fecc190ad8b11c9f0a5ec3138b27da1f055437af8c90a9495dad230',
+ ),
+ );
});
});
diff --git a/test/tfheOperations/manual.ts b/test/tfheOperations/manual.ts
index ae0fe362..d4a56b8e 100644
--- a/test/tfheOperations/manual.ts
+++ b/test/tfheOperations/manual.ts
@@ -9,8 +9,13 @@ import {
decrypt16,
decrypt32,
decrypt64,
+ decrypt128,
+ decrypt256,
decryptAddress,
decryptBool,
+ decryptEbytes64,
+ decryptEbytes128,
+ decryptEbytes256,
} from '../instance';
import { getSigners, initSigners } from '../signers';
import { bigIntToBytes256 } from '../utils';
@@ -72,6 +77,68 @@ describe('TFHE manual operations', function () {
expect(res).to.equal(3);
});
+ it('Select ebool', async function () {
+ const tx = await this.contract.test_select_ebool(true, false, true);
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+ const tx2 = await this.contract.test_select_ebool(false, false, true);
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(true);
+ });
+
+ it('Select ebytes64', async function () {
+ const tx = await this.contract.test_select_ebytes64(
+ true,
+ '0x6798aa6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb',
+ '0x11',
+ );
+ await tx.wait();
+ const res = await decryptEbytes64(await this.contract.resB64());
+ expect(res).to.equal(
+ ethers.toBeHex(BigInt('0x6798aa6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb'), 64),
+ );
+ const tx2 = await this.contract.test_select_ebytes64(false, '0x42', '0xaaaaaaaa');
+ await tx2.wait();
+ const res2 = await decryptEbytes64(await this.contract.resB64());
+ expect(res2).to.equal(ethers.toBeHex(BigInt('0xaaaaaaaa'), 64));
+ });
+
+ it('Select ebytes128', async function () {
+ const tx = await this.contract.test_select_ebytes128(
+ true,
+ '0x6798aa6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb',
+ '0x11',
+ );
+ await tx.wait();
+ const res = await decryptEbytes128(await this.contract.resB128());
+ expect(res).to.equal(
+ ethers.toBeHex(BigInt('0x6798aa6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb'), 128),
+ );
+ const tx2 = await this.contract.test_select_ebytes128(false, '0x42', '0xaaaaaaaa');
+ await tx2.wait();
+ const res2 = await decryptEbytes128(await this.contract.resB128());
+ expect(res2).to.equal(ethers.toBeHex(BigInt('0xaaaaaaaa'), 128));
+ });
+
+ it('Select ebytes256', async function () {
+ const tx = await this.contract.test_select_ebytes256(
+ true,
+ '0x6798aa6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb',
+ '0x11',
+ );
+ await tx.wait();
+ const res = await decryptEbytes256(await this.contract.resB256());
+ expect(res).to.equal(
+ ethers.toBeHex(BigInt('0x6798aa6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb'), 256),
+ );
+ const tx2 = await this.contract.test_select_ebytes256(false, '0x428899', '0xaaaaaabb');
+ await tx2.wait();
+ const res2 = await decryptEbytes256(await this.contract.resB256());
+ expect(res2).to.equal(ethers.toBeHex(BigInt('0xaaaaaabb'), 256));
+ });
+
it('Select works for eaddress returning if false', async function () {
const input = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
input.addBool(false);
@@ -106,6 +173,120 @@ describe('TFHE manual operations', function () {
expect(res).to.equal('0x8ba1f109551bd432803012645ac136ddd64dba72');
});
+ it('ebool eq ebool', async function () {
+ const tx = await this.contract.eqEbool(true, true);
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(true);
+ const tx2 = await this.contract.eqEbool(false, false);
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(true);
+ const tx3 = await this.contract.eqEbool(false, true);
+ await tx3.wait();
+ const res3 = await decryptBool(await this.contract.resb());
+ expect(res3).to.equal(false);
+ const tx4 = await this.contract.eqEbool(true, false);
+ await tx4.wait();
+ const res4 = await decryptBool(await this.contract.resb());
+ expect(res4).to.equal(false);
+ });
+
+ it('ebool eq ebool - ScalarL', async function () {
+ const tx = await this.contract.eqEboolScalarL(true, true);
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(true);
+ const tx2 = await this.contract.eqEboolScalarL(false, true);
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(false);
+ const tx3 = await this.contract.eqEboolScalarL(false, false);
+ await tx3.wait();
+ const res3 = await decryptBool(await this.contract.resb());
+ expect(res3).to.equal(true);
+ const tx4 = await this.contract.eqEboolScalarL(true, false);
+ await tx4.wait();
+ const res4 = await decryptBool(await this.contract.resb());
+ expect(res4).to.equal(false);
+ });
+
+ it('ebool eq ebool - ScalarR', async function () {
+ const tx = await this.contract.eqEboolScalarL(false, false);
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(true);
+ const tx2 = await this.contract.eqEboolScalarL(false, true);
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(false);
+ const tx3 = await this.contract.eqEboolScalarL(true, true);
+ await tx3.wait();
+ const res3 = await decryptBool(await this.contract.resb());
+ expect(res3).to.equal(true);
+ const tx4 = await this.contract.eqEboolScalarL(true, false);
+ await tx4.wait();
+ const res4 = await decryptBool(await this.contract.resb());
+ expect(res4).to.equal(false);
+ });
+
+ it('ebool ne ebool', async function () {
+ const tx = await this.contract.neEbool(true, true);
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+ const tx2 = await this.contract.neEbool(false, false);
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(false);
+ const tx3 = await this.contract.neEbool(false, true);
+ await tx3.wait();
+ const res3 = await decryptBool(await this.contract.resb());
+ expect(res3).to.equal(true);
+ const tx4 = await this.contract.neEbool(true, false);
+ await tx4.wait();
+ const res4 = await decryptBool(await this.contract.resb());
+ expect(res4).to.equal(true);
+ });
+
+ it('ebool ne ebool - ScalarL', async function () {
+ const tx = await this.contract.neEboolScalarL(true, true);
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+ const tx2 = await this.contract.neEboolScalarL(false, true);
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(true);
+ const tx3 = await this.contract.neEboolScalarL(false, false);
+ await tx3.wait();
+ const res3 = await decryptBool(await this.contract.resb());
+ expect(res3).to.equal(false);
+ const tx4 = await this.contract.neEboolScalarL(true, false);
+ await tx4.wait();
+ const res4 = await decryptBool(await this.contract.resb());
+ expect(res4).to.equal(true);
+ });
+
+ it('ebool ne ebool - ScalarR', async function () {
+ const tx = await this.contract.neEboolScalarL(false, false);
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+ const tx2 = await this.contract.neEboolScalarL(false, true);
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(true);
+ const tx3 = await this.contract.neEboolScalarL(true, true);
+ await tx3.wait();
+ const res3 = await decryptBool(await this.contract.resb());
+ expect(res3).to.equal(false);
+ const tx4 = await this.contract.neEboolScalarL(true, false);
+ await tx4.wait();
+ const res4 = await decryptBool(await this.contract.resb());
+ expect(res4).to.equal(true);
+ });
+
it('eaddress eq eaddress,eaddress true', async function () {
const input = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
input.addAddress('0x8ba1f109551bd432803012645ac136ddd64dba72');
@@ -324,6 +505,48 @@ describe('TFHE manual operations', function () {
expect(res).to.equal(0);
});
+ it('ebool to euint128 casting works with true', async function () {
+ const tx = await this.contract.test_ebool_to_euint128_cast(true);
+ await tx.wait();
+ const res = await decrypt128(await this.contract.res128());
+ expect(res).to.equal(1);
+ });
+
+ it('ebool to euint128 casting works with false', async function () {
+ const tx = await this.contract.test_ebool_to_euint128_cast(false);
+ await tx.wait();
+ const res = await decrypt128(await this.contract.res128());
+ expect(res).to.equal(0);
+ });
+
+ it('ebool to euint256 casting works with true', async function () {
+ const tx = await this.contract.test_ebool_to_euint256_cast(true);
+ await tx.wait();
+ const res = await decrypt256(await this.contract.res256());
+ expect(res).to.equal(1);
+ });
+
+ it('ebool to euint256 casting works with false', async function () {
+ const tx = await this.contract.test_ebool_to_euint256_cast(false);
+ await tx.wait();
+ const res = await decrypt256(await this.contract.res256());
+ expect(res).to.equal(0);
+ });
+
+ it('euint4 to euint256 casting works', async function () {
+ const tx = await this.contract.test_euint4_to_euint256_cast(12);
+ await tx.wait();
+ const res = await decrypt256(await this.contract.res256());
+ expect(res).to.equal(12);
+ });
+
+ it('euint128 to euint8 casting works', async function () {
+ const tx = await this.contract.test_euint128_to_euint8_cast(7668756464674969496544n);
+ await tx.wait();
+ const res = await decrypt8(await this.contract.res8());
+ expect(res).to.equal(224n);
+ });
+
it('ebool not for false is true', async function () {
const tx = await this.contract.test_ebool_not(false);
await tx.wait();
@@ -404,6 +627,138 @@ describe('TFHE manual operations', function () {
expect(res4).to.equal(false);
});
+ it('ebool xor scalarL', async function () {
+ const tx = await this.contract.test_ebool_xor_scalarL(false, false);
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+
+ const tx2 = await this.contract.test_ebool_xor_scalarL(false, true);
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(true);
+
+ const tx3 = await this.contract.test_ebool_xor_scalarL(true, false);
+ await tx3.wait();
+ const res3 = await decryptBool(await this.contract.resb());
+ expect(res3).to.equal(true);
+
+ const tx4 = await this.contract.test_ebool_xor_scalarL(true, true);
+ await tx4.wait();
+ const res4 = await decryptBool(await this.contract.resb());
+ expect(res4).to.equal(false);
+ });
+
+ it('ebool xor scalarR', async function () {
+ const tx = await this.contract.test_ebool_xor_scalarR(false, false);
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+
+ const tx2 = await this.contract.test_ebool_xor_scalarR(false, true);
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(true);
+
+ const tx3 = await this.contract.test_ebool_xor_scalarR(true, false);
+ await tx3.wait();
+ const res3 = await decryptBool(await this.contract.resb());
+ expect(res3).to.equal(true);
+
+ const tx4 = await this.contract.test_ebool_xor_scalarR(true, true);
+ await tx4.wait();
+ const res4 = await decryptBool(await this.contract.resb());
+ expect(res4).to.equal(false);
+ });
+
+ it('ebool or scalarL', async function () {
+ const tx = await this.contract.test_ebool_or_scalarL(false, false);
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+
+ const tx2 = await this.contract.test_ebool_or_scalarL(false, true);
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(true);
+
+ const tx3 = await this.contract.test_ebool_or_scalarL(true, false);
+ await tx3.wait();
+ const res3 = await decryptBool(await this.contract.resb());
+ expect(res3).to.equal(true);
+
+ const tx4 = await this.contract.test_ebool_or_scalarL(true, true);
+ await tx4.wait();
+ const res4 = await decryptBool(await this.contract.resb());
+ expect(res4).to.equal(true);
+ });
+
+ it('ebool or scalarR', async function () {
+ const tx = await this.contract.test_ebool_or_scalarR(false, false);
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+
+ const tx2 = await this.contract.test_ebool_or_scalarR(false, true);
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(true);
+
+ const tx3 = await this.contract.test_ebool_or_scalarR(true, false);
+ await tx3.wait();
+ const res3 = await decryptBool(await this.contract.resb());
+ expect(res3).to.equal(true);
+
+ const tx4 = await this.contract.test_ebool_or_scalarR(true, true);
+ await tx4.wait();
+ const res4 = await decryptBool(await this.contract.resb());
+ expect(res4).to.equal(true);
+ });
+
+ it('ebool and scalarL', async function () {
+ const tx = await this.contract.test_ebool_and_scalarL(false, false);
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+
+ const tx2 = await this.contract.test_ebool_and_scalarL(false, true);
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(false);
+
+ const tx3 = await this.contract.test_ebool_and_scalarL(true, false);
+ await tx3.wait();
+ const res3 = await decryptBool(await this.contract.resb());
+ expect(res3).to.equal(false);
+
+ const tx4 = await this.contract.test_ebool_and_scalarL(true, true);
+ await tx4.wait();
+ const res4 = await decryptBool(await this.contract.resb());
+ expect(res4).to.equal(true);
+ });
+
+ it('ebool and scalarR', async function () {
+ const tx = await this.contract.test_ebool_and_scalarR(false, false);
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+
+ const tx2 = await this.contract.test_ebool_and_scalarR(false, true);
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(false);
+
+ const tx3 = await this.contract.test_ebool_and_scalarR(true, false);
+ await tx3.wait();
+ const res3 = await decryptBool(await this.contract.resb());
+ expect(res3).to.equal(false);
+
+ const tx4 = await this.contract.test_ebool_and_scalarR(true, true);
+ await tx4.wait();
+ const res4 = await decryptBool(await this.contract.resb());
+ expect(res4).to.equal(true);
+ });
+
it('eq ebytes256,ebytes256 true', async function () {
const inputAliceA = this.instances.alice.createEncryptedInput(this.contractAddress, this.signers.alice.address);
inputAliceA.addBytes256(bigIntToBytes256(18446744073709550022n));
@@ -491,4 +846,291 @@ describe('TFHE manual operations', function () {
const decRes = await decryptBool(res);
expect(decRes).to.equal(false);
});
+
+ it('ebytes64 eq ebytes64', async function () {
+ const tx = await this.contract.eqEbytes64(
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb',
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb',
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(true);
+ const tx2 = await this.contract.eqEbytes64('0x1100', '0x0011');
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(false);
+ });
+
+ it('ebytes64 eq ebytes64 - scalarL', async function () {
+ const tx = await this.contract.eqEbytes64ScalarL(
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb',
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa',
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+ const tx2 = await this.contract.eqEbytes64ScalarL('0x1100', '0x1100');
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(true);
+ });
+
+ it('ebytes64 eq ebytes64 - scalarR', async function () {
+ const tx = await this.contract.eqEbytes64ScalarR(
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb',
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa',
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+ const tx2 = await this.contract.eqEbytes64ScalarR('0x1100', '0x1100');
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(true);
+ });
+
+ it('ebytes64 ne ebytes64', async function () {
+ const tx = await this.contract.neEbytes64(
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb',
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb',
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+ const tx2 = await this.contract.neEbytes64('0x1100', '0x0011');
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(true);
+ });
+
+ it('ebytes64 ne ebytes64 - scalarL', async function () {
+ const tx = await this.contract.neEbytes64ScalarL(
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb',
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa',
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(true);
+ const tx2 = await this.contract.neEbytes64ScalarL('0x1100', '0x1100');
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(false);
+ });
+
+ it('ebytes64 ne ebytes64 - scalarR', async function () {
+ const tx = await this.contract.neEbytes64ScalarR(
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb',
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa',
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(true);
+ const tx2 = await this.contract.neEbytes64ScalarR('0x1100', '0x1100');
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(false);
+ });
+
+ it('ebytes128 eq ebytes128', async function () {
+ const tx = await this.contract.eqEbytes128(
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb73',
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb73',
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(true);
+ const tx2 = await this.contract.eqEbytes128(
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb73',
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb71',
+ );
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(false);
+ });
+
+ it('ebytes128 eq ebytes128 - scalarL', async function () {
+ const tx = await this.contract.eqEbytes128ScalarL(
+ '0x6d4b2086ba8e3d2104fbf4a8dfe9679d6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb',
+ '0x6d4b2086ba8e3d2104fbf4a8dfe9679d6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa',
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+ const tx2 = await this.contract.eqEbytes128ScalarL('0x1100', '0x1100');
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(true);
+ });
+
+ it('ebytes128 eq ebytes128 - scalarR', async function () {
+ const tx = await this.contract.eqEbytes128ScalarR(
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb',
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa',
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+ const tx2 = await this.contract.eqEbytes128ScalarR('0x1100', '0x1100');
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(true);
+ });
+
+ it('ebytes128 ne ebytes128', async function () {
+ const tx = await this.contract.neEbytes128(
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb73',
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb73',
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+ const tx2 = await this.contract.neEbytes128(
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb73',
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb71',
+ );
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(true);
+ });
+
+ it('ebytes128 ne ebytes128 - scalarL', async function () {
+ const tx = await this.contract.neEbytes128ScalarL(
+ '0x6d4b2086ba8e3d2104fbf4a8dfe9679d6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb',
+ '0x6d4b2086ba8e3d2104fbf4a8dfe9679d6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa',
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(true);
+ const tx2 = await this.contract.neEbytes128ScalarL('0x1100', '0x1100');
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(false);
+ });
+
+ it('ebytes128 ne ebytes128 - scalarR', async function () {
+ const tx = await this.contract.neEbytes128ScalarR(
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb',
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa',
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(true);
+ const tx2 = await this.contract.neEbytes128ScalarR('0x1100', '0x1100');
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(false);
+ });
+
+ it('ebytes256 eq ebytes256 - scalarL', async function () {
+ const tx = await this.contract.eqEbytes256ScalarL(
+ '0x6d4b2086ba8e3d2104fbf4a8dfe9679d6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb',
+ '0x6d4b2086ba8e3d2104fbf4a8dfe9679d6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa',
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+ const tx2 = await this.contract.eqEbytes256ScalarL('0x1100', '0x1100');
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(true);
+ });
+
+ it('ebytes256 eq ebytes256 - scalarR', async function () {
+ const tx = await this.contract.eqEbytes256ScalarR(
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbaa',
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaaaa',
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+ const tx2 = await this.contract.eqEbytes256ScalarR('0x1100', '0x1100');
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(true);
+ });
+
+ it('ebytes256 ne ebytes256 - scalarL', async function () {
+ const tx = await this.contract.neEbytes256ScalarL(
+ '0x6d4b2086ba8e3d2104fbf4a8dfe9679d6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb',
+ '0x6d4b2086ba8e3d2104fbf4a8dfe9679d6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa',
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(true);
+ const tx2 = await this.contract.neEbytes256ScalarL('0x1100', '0x1100');
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(false);
+ });
+
+ it('ebytes256 ne ebytes256 - scalarR', async function () {
+ const tx = await this.contract.neEbytes256ScalarR(
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbaa',
+ '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaaaa',
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(true);
+ const tx2 = await this.contract.neEbytes256ScalarR('0x1100', '0x1100');
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(false);
+ });
+
+ it('ebool ne ebool', async function () {
+ const tx = await this.contract.neEbool(true, true);
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+ const tx2 = await this.contract.neEbool(false, false);
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(false);
+ const tx3 = await this.contract.neEbool(false, true);
+ await tx3.wait();
+ const res3 = await decryptBool(await this.contract.resb());
+ expect(res3).to.equal(true);
+ const tx4 = await this.contract.neEbool(true, false);
+ await tx4.wait();
+ const res4 = await decryptBool(await this.contract.resb());
+ expect(res4).to.equal(true);
+ });
+
+ it('ebool ne ebool - ScalarL', async function () {
+ const tx = await this.contract.neEboolScalarL(true, true);
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+ const tx2 = await this.contract.neEboolScalarL(false, true);
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(true);
+ const tx3 = await this.contract.neEboolScalarL(false, false);
+ await tx3.wait();
+ const res3 = await decryptBool(await this.contract.resb());
+ expect(res3).to.equal(false);
+ const tx4 = await this.contract.neEboolScalarL(true, false);
+ await tx4.wait();
+ const res4 = await decryptBool(await this.contract.resb());
+ expect(res4).to.equal(true);
+ });
+
+ it('ebool ne ebool - ScalarR', async function () {
+ const tx = await this.contract.neEboolScalarL(false, false);
+ await tx.wait();
+ const res = await decryptBool(await this.contract.resb());
+ expect(res).to.equal(false);
+ const tx2 = await this.contract.neEboolScalarL(false, true);
+ await tx2.wait();
+ const res2 = await decryptBool(await this.contract.resb());
+ expect(res2).to.equal(true);
+ const tx3 = await this.contract.neEboolScalarL(true, true);
+ await tx3.wait();
+ const res3 = await decryptBool(await this.contract.resb());
+ expect(res3).to.equal(false);
+ const tx4 = await this.contract.neEboolScalarL(true, false);
+ await tx4.wait();
+ const res4 = await decryptBool(await this.contract.resb());
+ expect(res4).to.equal(true);
+ });
});
diff --git a/test/tfheOperations/tfheOperations1.ts b/test/tfheOperations/tfheOperations1.ts
index ecd18ae7..82012291 100644
--- a/test/tfheOperations/tfheOperations1.ts
+++ b/test/tfheOperations/tfheOperations1.ts
@@ -7,7 +7,22 @@ import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'
import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance';
+import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
+import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
+import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
+import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
+import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
+import {
+ createInstances,
+ decrypt4,
+ decrypt8,
+ decrypt16,
+ decrypt32,
+ decrypt64,
+ decrypt128,
+ decrypt256,
+ decryptBool,
+} from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
@@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise {
return contract;
}
+async function deployTfheTestFixture7(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite7');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture8(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite8');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture9(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite9');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture10(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite10');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture11(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite11');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
describe('TFHE operations 1', function () {
before(async function () {
await initSigners(1);
@@ -105,14 +175,34 @@ describe('TFHE operations 1', function () {
this.contract6Address = await contract6.getAddress();
this.contract6 = contract6;
+ const contract7 = await deployTfheTestFixture7();
+ this.contract7Address = await contract7.getAddress();
+ this.contract7 = contract7;
+
+ const contract8 = await deployTfheTestFixture8();
+ this.contract8Address = await contract8.getAddress();
+ this.contract8 = contract8;
+
+ const contract9 = await deployTfheTestFixture9();
+ this.contract9Address = await contract9.getAddress();
+ this.contract9 = contract9;
+
+ const contract10 = await deployTfheTestFixture10();
+ this.contract10Address = await contract10.getAddress();
+ this.contract10 = contract10;
+
+ const contract11 = await deployTfheTestFixture11();
+ this.contract11Address = await contract11.getAddress();
+ this.contract11 = contract11;
+
const instances = await createInstances(this.signers);
this.instances = instances;
});
- it('test operator "add" overload (euint4, euint4) => euint4 test 1 (3, 2)', async function () {
+ it('test operator "add" overload (euint4, euint4) => euint4 test 1 (2, 7)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(3n);
input.add4(2n);
+ input.add4(7n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.add_euint4_euint4(
encryptedAmount.handles[0],
@@ -121,7 +211,7 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(5n);
+ expect(res).to.equal(9n);
});
it('test operator "add" overload (euint4, euint4) => euint4 test 2 (4, 8)', async function () {
@@ -199,10 +289,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(4n);
});
- it('test operator "mul" overload (euint4, euint4) => euint4 test 1 (3, 3)', async function () {
+ it('test operator "mul" overload (euint4, euint4) => euint4 test 1 (1, 7)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(3n);
- input.add4(3n);
+ input.add4(1n);
+ input.add4(7n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.mul_euint4_euint4(
encryptedAmount.handles[0],
@@ -211,7 +301,7 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(9n);
+ expect(res).to.equal(7n);
});
it('test operator "mul" overload (euint4, euint4) => euint4 test 2 (3, 5)', async function () {
@@ -259,10 +349,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(15n);
});
- it('test operator "and" overload (euint4, euint4) => euint4 test 1 (8, 8)', async function () {
+ it('test operator "and" overload (euint4, euint4) => euint4 test 1 (14, 7)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add4(8n);
+ input.add4(14n);
+ input.add4(7n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.and_euint4_euint4(
encryptedAmount.handles[0],
@@ -271,7 +361,7 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(8n);
+ expect(res).to.equal(6n);
});
it('test operator "and" overload (euint4, euint4) => euint4 test 2 (4, 8)', async function () {
@@ -319,10 +409,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(0n);
});
- it('test operator "or" overload (euint4, euint4) => euint4 test 1 (7, 10)', async function () {
+ it('test operator "or" overload (euint4, euint4) => euint4 test 1 (10, 6)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(7n);
input.add4(10n);
+ input.add4(6n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.or_euint4_euint4(
encryptedAmount.handles[0],
@@ -331,7 +421,7 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(15n);
+ expect(res).to.equal(14n);
});
it('test operator "or" overload (euint4, euint4) => euint4 test 2 (4, 8)', async function () {
@@ -379,10 +469,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(12n);
});
- it('test operator "xor" overload (euint4, euint4) => euint4 test 1 (13, 14)', async function () {
+ it('test operator "xor" overload (euint4, euint4) => euint4 test 1 (9, 4)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
- input.add4(14n);
+ input.add4(9n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.xor_euint4_euint4(
encryptedAmount.handles[0],
@@ -391,13 +481,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(3n);
+ expect(res).to.equal(13n);
});
- it('test operator "xor" overload (euint4, euint4) => euint4 test 2 (9, 13)', async function () {
+ it('test operator "xor" overload (euint4, euint4) => euint4 test 2 (4, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(9n);
- input.add4(13n);
+ input.add4(4n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.xor_euint4_euint4(
encryptedAmount.handles[0],
@@ -406,13 +496,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(4n);
+ expect(res).to.equal(12n);
});
- it('test operator "xor" overload (euint4, euint4) => euint4 test 3 (13, 13)', async function () {
+ it('test operator "xor" overload (euint4, euint4) => euint4 test 3 (8, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
- input.add4(13n);
+ input.add4(8n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.xor_euint4_euint4(
encryptedAmount.handles[0],
@@ -424,10 +514,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(0n);
});
- it('test operator "xor" overload (euint4, euint4) => euint4 test 4 (13, 9)', async function () {
+ it('test operator "xor" overload (euint4, euint4) => euint4 test 4 (8, 4)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
- input.add4(9n);
+ input.add4(8n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.xor_euint4_euint4(
encryptedAmount.handles[0],
@@ -436,13 +526,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(4n);
+ expect(res).to.equal(12n);
});
- it('test operator "eq" overload (euint4, euint4) => ebool test 1 (6, 11)', async function () {
+ it('test operator "eq" overload (euint4, euint4) => ebool test 1 (2, 2)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(6n);
- input.add4(11n);
+ input.add4(2n);
+ input.add4(2n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.eq_euint4_euint4(
encryptedAmount.handles[0],
@@ -451,7 +541,7 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ expect(res).to.equal(true);
});
it('test operator "eq" overload (euint4, euint4) => ebool test 2 (4, 8)', async function () {
@@ -499,10 +589,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint4, euint4) => ebool test 1 (11, 4)', async function () {
+ it('test operator "ne" overload (euint4, euint4) => ebool test 1 (1, 9)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(11n);
- input.add4(4n);
+ input.add4(1n);
+ input.add4(9n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.ne_euint4_euint4(
encryptedAmount.handles[0],
@@ -559,10 +649,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint4, euint4) => ebool test 1 (9, 9)', async function () {
+ it('test operator "ge" overload (euint4, euint4) => ebool test 1 (6, 11)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(9n);
- input.add4(9n);
+ input.add4(6n);
+ input.add4(11n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.ge_euint4_euint4(
encryptedAmount.handles[0],
@@ -571,13 +661,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint4, euint4) => ebool test 2 (5, 9)', async function () {
+ it('test operator "ge" overload (euint4, euint4) => ebool test 2 (4, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(5n);
- input.add4(9n);
+ input.add4(4n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.ge_euint4_euint4(
encryptedAmount.handles[0],
@@ -589,10 +679,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint4, euint4) => ebool test 3 (9, 9)', async function () {
+ it('test operator "ge" overload (euint4, euint4) => ebool test 3 (8, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(9n);
- input.add4(9n);
+ input.add4(8n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.ge_euint4_euint4(
encryptedAmount.handles[0],
@@ -604,10 +694,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint4, euint4) => ebool test 4 (9, 5)', async function () {
+ it('test operator "ge" overload (euint4, euint4) => ebool test 4 (8, 4)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(9n);
- input.add4(5n);
+ input.add4(8n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.ge_euint4_euint4(
encryptedAmount.handles[0],
@@ -619,9 +709,9 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint4, euint4) => ebool test 1 (4, 14)', async function () {
+ it('test operator "gt" overload (euint4, euint4) => ebool test 1 (12, 14)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
+ input.add4(12n);
input.add4(14n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.gt_euint4_euint4(
@@ -634,10 +724,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint4, euint4) => ebool test 2 (4, 8)', async function () {
+ it('test operator "gt" overload (euint4, euint4) => ebool test 2 (8, 12)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
input.add4(8n);
+ input.add4(12n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.gt_euint4_euint4(
encryptedAmount.handles[0],
@@ -649,10 +739,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint4, euint4) => ebool test 3 (8, 8)', async function () {
+ it('test operator "gt" overload (euint4, euint4) => ebool test 3 (12, 12)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add4(8n);
+ input.add4(12n);
+ input.add4(12n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.gt_euint4_euint4(
encryptedAmount.handles[0],
@@ -664,10 +754,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint4, euint4) => ebool test 4 (8, 4)', async function () {
+ it('test operator "gt" overload (euint4, euint4) => ebool test 4 (12, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(12n);
input.add4(8n);
- input.add4(4n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.gt_euint4_euint4(
encryptedAmount.handles[0],
@@ -679,10 +769,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint4, euint4) => ebool test 1 (10, 9)', async function () {
+ it('test operator "le" overload (euint4, euint4) => ebool test 1 (6, 6)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add4(9n);
+ input.add4(6n);
+ input.add4(6n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.le_euint4_euint4(
encryptedAmount.handles[0],
@@ -691,13 +781,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ expect(res).to.equal(true);
});
- it('test operator "le" overload (euint4, euint4) => ebool test 2 (5, 9)', async function () {
+ it('test operator "le" overload (euint4, euint4) => ebool test 2 (4, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(5n);
- input.add4(9n);
+ input.add4(4n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.le_euint4_euint4(
encryptedAmount.handles[0],
@@ -709,10 +799,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint4, euint4) => ebool test 3 (9, 9)', async function () {
+ it('test operator "le" overload (euint4, euint4) => ebool test 3 (8, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(9n);
- input.add4(9n);
+ input.add4(8n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.le_euint4_euint4(
encryptedAmount.handles[0],
@@ -724,10 +814,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint4, euint4) => ebool test 4 (9, 5)', async function () {
+ it('test operator "le" overload (euint4, euint4) => ebool test 4 (8, 4)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(9n);
- input.add4(5n);
+ input.add4(8n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.le_euint4_euint4(
encryptedAmount.handles[0],
@@ -739,10 +829,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint4, euint4) => ebool test 1 (4, 10)', async function () {
+ it('test operator "lt" overload (euint4, euint4) => ebool test 1 (2, 6)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add4(10n);
+ input.add4(2n);
+ input.add4(6n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.lt_euint4_euint4(
encryptedAmount.handles[0],
@@ -799,10 +889,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "min" overload (euint4, euint4) => euint4 test 1 (7, 10)', async function () {
+ it('test operator "min" overload (euint4, euint4) => euint4 test 1 (14, 13)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(7n);
- input.add4(10n);
+ input.add4(14n);
+ input.add4(13n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.min_euint4_euint4(
encryptedAmount.handles[0],
@@ -811,13 +901,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(7n);
+ expect(res).to.equal(13n);
});
- it('test operator "min" overload (euint4, euint4) => euint4 test 2 (4, 8)', async function () {
+ it('test operator "min" overload (euint4, euint4) => euint4 test 2 (9, 13)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add4(8n);
+ input.add4(9n);
+ input.add4(13n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.min_euint4_euint4(
encryptedAmount.handles[0],
@@ -826,13 +916,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(4n);
+ expect(res).to.equal(9n);
});
- it('test operator "min" overload (euint4, euint4) => euint4 test 3 (8, 8)', async function () {
+ it('test operator "min" overload (euint4, euint4) => euint4 test 3 (13, 13)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add4(8n);
+ input.add4(13n);
+ input.add4(13n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.min_euint4_euint4(
encryptedAmount.handles[0],
@@ -841,13 +931,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(8n);
+ expect(res).to.equal(13n);
});
- it('test operator "min" overload (euint4, euint4) => euint4 test 4 (8, 4)', async function () {
+ it('test operator "min" overload (euint4, euint4) => euint4 test 4 (13, 9)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add4(4n);
+ input.add4(13n);
+ input.add4(9n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.min_euint4_euint4(
encryptedAmount.handles[0],
@@ -856,13 +946,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(4n);
+ expect(res).to.equal(9n);
});
- it('test operator "max" overload (euint4, euint4) => euint4 test 1 (3, 1)', async function () {
+ it('test operator "max" overload (euint4, euint4) => euint4 test 1 (9, 13)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(3n);
- input.add4(1n);
+ input.add4(9n);
+ input.add4(13n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.max_euint4_euint4(
encryptedAmount.handles[0],
@@ -871,13 +961,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(3n);
+ expect(res).to.equal(13n);
});
- it('test operator "max" overload (euint4, euint4) => euint4 test 2 (4, 8)', async function () {
+ it('test operator "max" overload (euint4, euint4) => euint4 test 2 (5, 9)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add4(8n);
+ input.add4(5n);
+ input.add4(9n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.max_euint4_euint4(
encryptedAmount.handles[0],
@@ -886,13 +976,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(8n);
+ expect(res).to.equal(9n);
});
- it('test operator "max" overload (euint4, euint4) => euint4 test 3 (8, 8)', async function () {
+ it('test operator "max" overload (euint4, euint4) => euint4 test 3 (9, 9)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add4(8n);
+ input.add4(9n);
+ input.add4(9n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.max_euint4_euint4(
encryptedAmount.handles[0],
@@ -901,13 +991,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(8n);
+ expect(res).to.equal(9n);
});
- it('test operator "max" overload (euint4, euint4) => euint4 test 4 (8, 4)', async function () {
+ it('test operator "max" overload (euint4, euint4) => euint4 test 4 (9, 5)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add4(4n);
+ input.add4(9n);
+ input.add4(5n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.max_euint4_euint4(
encryptedAmount.handles[0],
@@ -916,13 +1006,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(8n);
+ expect(res).to.equal(9n);
});
- it('test operator "add" overload (euint4, euint8) => euint8 test 1 (1, 9)', async function () {
+ it('test operator "add" overload (euint4, euint8) => euint8 test 1 (2, 10)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(1n);
- input.add8(9n);
+ input.add4(2n);
+ input.add8(10n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.add_euint4_euint8(
encryptedAmount.handles[0],
@@ -931,13 +1021,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(10n);
+ expect(res).to.equal(12n);
});
- it('test operator "add" overload (euint4, euint8) => euint8 test 2 (4, 8)', async function () {
+ it('test operator "add" overload (euint4, euint8) => euint8 test 2 (5, 9)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add8(8n);
+ input.add4(5n);
+ input.add8(9n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.add_euint4_euint8(
encryptedAmount.handles[0],
@@ -946,7 +1036,7 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(12n);
+ expect(res).to.equal(14n);
});
it('test operator "add" overload (euint4, euint8) => euint8 test 3 (5, 5)', async function () {
@@ -964,10 +1054,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(10n);
});
- it('test operator "add" overload (euint4, euint8) => euint8 test 4 (8, 4)', async function () {
+ it('test operator "add" overload (euint4, euint8) => euint8 test 4 (9, 5)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add8(4n);
+ input.add4(9n);
+ input.add8(5n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.add_euint4_euint8(
encryptedAmount.handles[0],
@@ -976,13 +1066,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(12n);
+ expect(res).to.equal(14n);
});
- it('test operator "sub" overload (euint4, euint8) => euint8 test 1 (10, 10)', async function () {
+ it('test operator "sub" overload (euint4, euint8) => euint8 test 1 (8, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add8(10n);
+ input.add4(8n);
+ input.add8(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.sub_euint4_euint8(
encryptedAmount.handles[0],
@@ -994,10 +1084,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(0n);
});
- it('test operator "sub" overload (euint4, euint8) => euint8 test 2 (10, 6)', async function () {
+ it('test operator "sub" overload (euint4, euint8) => euint8 test 2 (8, 4)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add8(6n);
+ input.add4(8n);
+ input.add8(4n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.sub_euint4_euint8(
encryptedAmount.handles[0],
@@ -1024,10 +1114,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(10n);
});
- it('test operator "mul" overload (euint4, euint8) => euint8 test 2 (3, 3)', async function () {
+ it('test operator "mul" overload (euint4, euint8) => euint8 test 2 (3, 5)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
input.add4(3n);
- input.add8(3n);
+ input.add8(5n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.mul_euint4_euint8(
encryptedAmount.handles[0],
@@ -1036,7 +1126,7 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(9n);
+ expect(res).to.equal(15n);
});
it('test operator "mul" overload (euint4, euint8) => euint8 test 3 (3, 3)', async function () {
@@ -1054,9 +1144,9 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(9n);
});
- it('test operator "mul" overload (euint4, euint8) => euint8 test 4 (3, 3)', async function () {
+ it('test operator "mul" overload (euint4, euint8) => euint8 test 4 (5, 3)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(3n);
+ input.add4(5n);
input.add8(3n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.mul_euint4_euint8(
@@ -1066,13 +1156,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(9n);
+ expect(res).to.equal(15n);
});
- it('test operator "and" overload (euint4, euint8) => euint8 test 1 (10, 6)', async function () {
+ it('test operator "and" overload (euint4, euint8) => euint8 test 1 (10, 116)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
input.add4(10n);
- input.add8(6n);
+ input.add8(116n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.and_euint4_euint8(
encryptedAmount.handles[0],
@@ -1081,13 +1171,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(2n);
+ expect(res).to.equal(0n);
});
- it('test operator "and" overload (euint4, euint8) => euint8 test 2 (4, 8)', async function () {
+ it('test operator "and" overload (euint4, euint8) => euint8 test 2 (6, 10)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add8(8n);
+ input.add4(6n);
+ input.add8(10n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.and_euint4_euint8(
encryptedAmount.handles[0],
@@ -1096,13 +1186,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(0n);
+ expect(res).to.equal(2n);
});
- it('test operator "and" overload (euint4, euint8) => euint8 test 3 (8, 8)', async function () {
+ it('test operator "and" overload (euint4, euint8) => euint8 test 3 (10, 10)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add8(8n);
+ input.add4(10n);
+ input.add8(10n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.and_euint4_euint8(
encryptedAmount.handles[0],
@@ -1111,13 +1201,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(8n);
+ expect(res).to.equal(10n);
});
- it('test operator "and" overload (euint4, euint8) => euint8 test 4 (8, 4)', async function () {
+ it('test operator "and" overload (euint4, euint8) => euint8 test 4 (10, 6)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add8(4n);
+ input.add4(10n);
+ input.add8(6n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.and_euint4_euint8(
encryptedAmount.handles[0],
@@ -1126,13 +1216,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(0n);
+ expect(res).to.equal(2n);
});
- it('test operator "or" overload (euint4, euint8) => euint8 test 1 (12, 18)', async function () {
+ it('test operator "or" overload (euint4, euint8) => euint8 test 1 (8, 185)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(12n);
- input.add8(18n);
+ input.add4(8n);
+ input.add8(185n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.or_euint4_euint8(
encryptedAmount.handles[0],
@@ -1141,13 +1231,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(30n);
+ expect(res).to.equal(185n);
});
- it('test operator "or" overload (euint4, euint8) => euint8 test 2 (8, 12)', async function () {
+ it('test operator "or" overload (euint4, euint8) => euint8 test 2 (4, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add8(12n);
+ input.add4(4n);
+ input.add8(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.or_euint4_euint8(
encryptedAmount.handles[0],
@@ -1159,10 +1249,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(12n);
});
- it('test operator "or" overload (euint4, euint8) => euint8 test 3 (12, 12)', async function () {
+ it('test operator "or" overload (euint4, euint8) => euint8 test 3 (8, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(12n);
- input.add8(12n);
+ input.add4(8n);
+ input.add8(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.or_euint4_euint8(
encryptedAmount.handles[0],
@@ -1171,13 +1261,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(12n);
+ expect(res).to.equal(8n);
});
- it('test operator "or" overload (euint4, euint8) => euint8 test 4 (12, 8)', async function () {
+ it('test operator "or" overload (euint4, euint8) => euint8 test 4 (8, 4)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(12n);
- input.add8(8n);
+ input.add4(8n);
+ input.add8(4n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.or_euint4_euint8(
encryptedAmount.handles[0],
@@ -1189,10 +1279,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(12n);
});
- it('test operator "xor" overload (euint4, euint8) => euint8 test 1 (5, 19)', async function () {
+ it('test operator "xor" overload (euint4, euint8) => euint8 test 1 (10, 103)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(5n);
- input.add8(19n);
+ input.add4(10n);
+ input.add8(103n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.xor_euint4_euint8(
encryptedAmount.handles[0],
@@ -1201,13 +1291,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(22n);
+ expect(res).to.equal(109n);
});
- it('test operator "xor" overload (euint4, euint8) => euint8 test 2 (4, 8)', async function () {
+ it('test operator "xor" overload (euint4, euint8) => euint8 test 2 (6, 10)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add8(8n);
+ input.add4(6n);
+ input.add8(10n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.xor_euint4_euint8(
encryptedAmount.handles[0],
@@ -1219,10 +1309,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(12n);
});
- it('test operator "xor" overload (euint4, euint8) => euint8 test 3 (8, 8)', async function () {
+ it('test operator "xor" overload (euint4, euint8) => euint8 test 3 (10, 10)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add8(8n);
+ input.add4(10n);
+ input.add8(10n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.xor_euint4_euint8(
encryptedAmount.handles[0],
@@ -1234,10 +1324,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(0n);
});
- it('test operator "xor" overload (euint4, euint8) => euint8 test 4 (8, 4)', async function () {
+ it('test operator "xor" overload (euint4, euint8) => euint8 test 4 (10, 6)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add8(4n);
+ input.add4(10n);
+ input.add8(6n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.xor_euint4_euint8(
encryptedAmount.handles[0],
@@ -1249,10 +1339,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(12n);
});
- it('test operator "eq" overload (euint4, euint8) => ebool test 1 (4, 5)', async function () {
+ it('test operator "eq" overload (euint4, euint8) => ebool test 1 (14, 3)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add8(5n);
+ input.add4(14n);
+ input.add8(3n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.eq_euint4_euint8(
encryptedAmount.handles[0],
@@ -1309,10 +1399,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint4, euint8) => ebool test 1 (4, 62)', async function () {
+ it('test operator "ne" overload (euint4, euint8) => ebool test 1 (8, 128)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add8(62n);
+ input.add4(8n);
+ input.add8(128n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.ne_euint4_euint8(
encryptedAmount.handles[0],
@@ -1369,10 +1459,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint4, euint8) => ebool test 1 (13, 91)', async function () {
+ it('test operator "ge" overload (euint4, euint8) => ebool test 1 (3, 79)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
- input.add8(91n);
+ input.add4(3n);
+ input.add8(79n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.ge_euint4_euint8(
encryptedAmount.handles[0],
@@ -1384,10 +1474,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint4, euint8) => ebool test 2 (9, 13)', async function () {
+ it('test operator "ge" overload (euint4, euint8) => ebool test 2 (4, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(9n);
- input.add8(13n);
+ input.add4(4n);
+ input.add8(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.ge_euint4_euint8(
encryptedAmount.handles[0],
@@ -1399,10 +1489,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint4, euint8) => ebool test 3 (13, 13)', async function () {
+ it('test operator "ge" overload (euint4, euint8) => ebool test 3 (8, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
- input.add8(13n);
+ input.add4(8n);
+ input.add8(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.ge_euint4_euint8(
encryptedAmount.handles[0],
@@ -1414,10 +1504,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint4, euint8) => ebool test 4 (13, 9)', async function () {
+ it('test operator "ge" overload (euint4, euint8) => ebool test 4 (8, 4)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
- input.add8(9n);
+ input.add4(8n);
+ input.add8(4n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.ge_euint4_euint8(
encryptedAmount.handles[0],
@@ -1429,10 +1519,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint4, euint8) => ebool test 1 (14, 199)', async function () {
+ it('test operator "gt" overload (euint4, euint8) => ebool test 1 (1, 59)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(14n);
- input.add8(199n);
+ input.add4(1n);
+ input.add8(59n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.gt_euint4_euint8(
encryptedAmount.handles[0],
@@ -1444,10 +1534,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint4, euint8) => ebool test 2 (10, 14)', async function () {
+ it('test operator "gt" overload (euint4, euint8) => ebool test 2 (4, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add8(14n);
+ input.add4(4n);
+ input.add8(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.gt_euint4_euint8(
encryptedAmount.handles[0],
@@ -1459,10 +1549,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint4, euint8) => ebool test 3 (14, 14)', async function () {
+ it('test operator "gt" overload (euint4, euint8) => ebool test 3 (8, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(14n);
- input.add8(14n);
+ input.add4(8n);
+ input.add8(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.gt_euint4_euint8(
encryptedAmount.handles[0],
@@ -1474,10 +1564,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint4, euint8) => ebool test 4 (14, 10)', async function () {
+ it('test operator "gt" overload (euint4, euint8) => ebool test 4 (8, 4)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(14n);
- input.add8(10n);
+ input.add4(8n);
+ input.add8(4n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.gt_euint4_euint8(
encryptedAmount.handles[0],
@@ -1489,10 +1579,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint4, euint8) => ebool test 1 (13, 94)', async function () {
+ it('test operator "le" overload (euint4, euint8) => ebool test 1 (1, 98)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
- input.add8(94n);
+ input.add4(1n);
+ input.add8(98n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.le_euint4_euint8(
encryptedAmount.handles[0],
@@ -1504,10 +1594,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint4, euint8) => ebool test 2 (9, 13)', async function () {
+ it('test operator "le" overload (euint4, euint8) => ebool test 2 (4, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(9n);
- input.add8(13n);
+ input.add4(4n);
+ input.add8(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.le_euint4_euint8(
encryptedAmount.handles[0],
@@ -1519,10 +1609,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint4, euint8) => ebool test 3 (13, 13)', async function () {
+ it('test operator "le" overload (euint4, euint8) => ebool test 3 (8, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
- input.add8(13n);
+ input.add4(8n);
+ input.add8(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.le_euint4_euint8(
encryptedAmount.handles[0],
@@ -1534,10 +1624,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint4, euint8) => ebool test 4 (13, 9)', async function () {
+ it('test operator "le" overload (euint4, euint8) => ebool test 4 (8, 4)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
- input.add8(9n);
+ input.add4(8n);
+ input.add8(4n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.le_euint4_euint8(
encryptedAmount.handles[0],
@@ -1549,10 +1639,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint4, euint8) => ebool test 1 (13, 128)', async function () {
+ it('test operator "lt" overload (euint4, euint8) => ebool test 1 (12, 31)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
- input.add8(128n);
+ input.add4(12n);
+ input.add8(31n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.lt_euint4_euint8(
encryptedAmount.handles[0],
@@ -1564,10 +1654,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint4, euint8) => ebool test 2 (9, 13)', async function () {
+ it('test operator "lt" overload (euint4, euint8) => ebool test 2 (8, 12)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(9n);
- input.add8(13n);
+ input.add4(8n);
+ input.add8(12n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.lt_euint4_euint8(
encryptedAmount.handles[0],
@@ -1579,10 +1669,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint4, euint8) => ebool test 3 (13, 13)', async function () {
+ it('test operator "lt" overload (euint4, euint8) => ebool test 3 (12, 12)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
- input.add8(13n);
+ input.add4(12n);
+ input.add8(12n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.lt_euint4_euint8(
encryptedAmount.handles[0],
@@ -1594,10 +1684,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint4, euint8) => ebool test 4 (13, 9)', async function () {
+ it('test operator "lt" overload (euint4, euint8) => ebool test 4 (12, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
- input.add8(9n);
+ input.add4(12n);
+ input.add8(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.lt_euint4_euint8(
encryptedAmount.handles[0],
@@ -1609,10 +1699,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "min" overload (euint4, euint8) => euint8 test 1 (8, 124)', async function () {
+ it('test operator "min" overload (euint4, euint8) => euint8 test 1 (5, 254)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add8(124n);
+ input.add4(5n);
+ input.add8(254n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.min_euint4_euint8(
encryptedAmount.handles[0],
@@ -1621,7 +1711,7 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(8n);
+ expect(res).to.equal(5n);
});
it('test operator "min" overload (euint4, euint8) => euint8 test 2 (4, 8)', async function () {
@@ -1669,10 +1759,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(4n);
});
- it('test operator "max" overload (euint4, euint8) => euint8 test 1 (1, 157)', async function () {
+ it('test operator "max" overload (euint4, euint8) => euint8 test 1 (14, 226)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(1n);
- input.add8(157n);
+ input.add4(14n);
+ input.add8(226n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.max_euint4_euint8(
encryptedAmount.handles[0],
@@ -1681,13 +1771,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(157n);
+ expect(res).to.equal(226n);
});
- it('test operator "max" overload (euint4, euint8) => euint8 test 2 (4, 8)', async function () {
+ it('test operator "max" overload (euint4, euint8) => euint8 test 2 (10, 14)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add8(8n);
+ input.add4(10n);
+ input.add8(14n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.max_euint4_euint8(
encryptedAmount.handles[0],
@@ -1696,13 +1786,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(8n);
+ expect(res).to.equal(14n);
});
- it('test operator "max" overload (euint4, euint8) => euint8 test 3 (8, 8)', async function () {
+ it('test operator "max" overload (euint4, euint8) => euint8 test 3 (14, 14)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add8(8n);
+ input.add4(14n);
+ input.add8(14n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.max_euint4_euint8(
encryptedAmount.handles[0],
@@ -1711,13 +1801,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(8n);
+ expect(res).to.equal(14n);
});
- it('test operator "max" overload (euint4, euint8) => euint8 test 4 (8, 4)', async function () {
+ it('test operator "max" overload (euint4, euint8) => euint8 test 4 (14, 10)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add8(4n);
+ input.add4(14n);
+ input.add8(10n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.max_euint4_euint8(
encryptedAmount.handles[0],
@@ -1726,13 +1816,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(8n);
+ expect(res).to.equal(14n);
});
- it('test operator "add" overload (euint4, euint16) => euint16 test 1 (2, 13)', async function () {
+ it('test operator "add" overload (euint4, euint16) => euint16 test 1 (2, 9)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
input.add4(2n);
- input.add16(13n);
+ input.add16(9n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.add_euint4_euint16(
encryptedAmount.handles[0],
@@ -1741,12 +1831,12 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(15n);
+ expect(res).to.equal(11n);
});
- it('test operator "add" overload (euint4, euint16) => euint16 test 2 (4, 8)', async function () {
+ it('test operator "add" overload (euint4, euint16) => euint16 test 2 (6, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
+ input.add4(6n);
input.add16(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.add_euint4_euint16(
@@ -1756,7 +1846,7 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(12n);
+ expect(res).to.equal(14n);
});
it('test operator "add" overload (euint4, euint16) => euint16 test 3 (5, 5)', async function () {
@@ -1774,10 +1864,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(10n);
});
- it('test operator "add" overload (euint4, euint16) => euint16 test 4 (8, 4)', async function () {
+ it('test operator "add" overload (euint4, euint16) => euint16 test 4 (8, 6)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
input.add4(8n);
- input.add16(4n);
+ input.add16(6n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.add_euint4_euint16(
encryptedAmount.handles[0],
@@ -1786,13 +1876,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(12n);
+ expect(res).to.equal(14n);
});
- it('test operator "sub" overload (euint4, euint16) => euint16 test 1 (11, 11)', async function () {
+ it('test operator "sub" overload (euint4, euint16) => euint16 test 1 (13, 13)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(11n);
- input.add16(11n);
+ input.add4(13n);
+ input.add16(13n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.sub_euint4_euint16(
encryptedAmount.handles[0],
@@ -1804,10 +1894,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(0n);
});
- it('test operator "sub" overload (euint4, euint16) => euint16 test 2 (11, 7)', async function () {
+ it('test operator "sub" overload (euint4, euint16) => euint16 test 2 (13, 9)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(11n);
- input.add16(7n);
+ input.add4(13n);
+ input.add16(9n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.sub_euint4_euint16(
encryptedAmount.handles[0],
@@ -1819,10 +1909,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(4n);
});
- it('test operator "mul" overload (euint4, euint16) => euint16 test 1 (2, 5)', async function () {
+ it('test operator "mul" overload (euint4, euint16) => euint16 test 1 (2, 6)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
input.add4(2n);
- input.add16(5n);
+ input.add16(6n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.mul_euint4_euint16(
encryptedAmount.handles[0],
@@ -1831,7 +1921,7 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(10n);
+ expect(res).to.equal(12n);
});
it('test operator "mul" overload (euint4, euint16) => euint16 test 2 (3, 5)', async function () {
@@ -1879,10 +1969,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(15n);
});
- it('test operator "and" overload (euint4, euint16) => euint16 test 1 (10, 28165)', async function () {
+ it('test operator "and" overload (euint4, euint16) => euint16 test 1 (3, 65312)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add16(28165n);
+ input.add4(3n);
+ input.add16(65312n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.and_euint4_euint16(
encryptedAmount.handles[0],
@@ -1894,10 +1984,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(0n);
});
- it('test operator "and" overload (euint4, euint16) => euint16 test 2 (6, 10)', async function () {
+ it('test operator "and" overload (euint4, euint16) => euint16 test 2 (4, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(6n);
- input.add16(10n);
+ input.add4(4n);
+ input.add16(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.and_euint4_euint16(
encryptedAmount.handles[0],
@@ -1906,13 +1996,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(2n);
+ expect(res).to.equal(0n);
});
- it('test operator "and" overload (euint4, euint16) => euint16 test 3 (10, 10)', async function () {
+ it('test operator "and" overload (euint4, euint16) => euint16 test 3 (8, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add16(10n);
+ input.add4(8n);
+ input.add16(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.and_euint4_euint16(
encryptedAmount.handles[0],
@@ -1921,13 +2011,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(10n);
+ expect(res).to.equal(8n);
});
- it('test operator "and" overload (euint4, euint16) => euint16 test 4 (10, 6)', async function () {
+ it('test operator "and" overload (euint4, euint16) => euint16 test 4 (8, 4)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add16(6n);
+ input.add4(8n);
+ input.add16(4n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.and_euint4_euint16(
encryptedAmount.handles[0],
@@ -1936,13 +2026,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(2n);
+ expect(res).to.equal(0n);
});
- it('test operator "or" overload (euint4, euint16) => euint16 test 1 (12, 197)', async function () {
+ it('test operator "or" overload (euint4, euint16) => euint16 test 1 (9, 28733)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(12n);
- input.add16(197n);
+ input.add4(9n);
+ input.add16(28733n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.or_euint4_euint16(
encryptedAmount.handles[0],
@@ -1951,13 +2041,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(205n);
+ expect(res).to.equal(28733n);
});
- it('test operator "or" overload (euint4, euint16) => euint16 test 2 (8, 12)', async function () {
+ it('test operator "or" overload (euint4, euint16) => euint16 test 2 (5, 9)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add16(12n);
+ input.add4(5n);
+ input.add16(9n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.or_euint4_euint16(
encryptedAmount.handles[0],
@@ -1966,13 +2056,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(12n);
+ expect(res).to.equal(13n);
});
- it('test operator "or" overload (euint4, euint16) => euint16 test 3 (12, 12)', async function () {
+ it('test operator "or" overload (euint4, euint16) => euint16 test 3 (9, 9)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(12n);
- input.add16(12n);
+ input.add4(9n);
+ input.add16(9n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.or_euint4_euint16(
encryptedAmount.handles[0],
@@ -1981,13 +2071,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(12n);
+ expect(res).to.equal(9n);
});
- it('test operator "or" overload (euint4, euint16) => euint16 test 4 (12, 8)', async function () {
+ it('test operator "or" overload (euint4, euint16) => euint16 test 4 (9, 5)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(12n);
- input.add16(8n);
+ input.add4(9n);
+ input.add16(5n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.or_euint4_euint16(
encryptedAmount.handles[0],
@@ -1996,13 +2086,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(12n);
+ expect(res).to.equal(13n);
});
- it('test operator "xor" overload (euint4, euint16) => euint16 test 1 (10, 13907)', async function () {
+ it('test operator "xor" overload (euint4, euint16) => euint16 test 1 (14, 11463)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add16(13907n);
+ input.add4(14n);
+ input.add16(11463n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.xor_euint4_euint16(
encryptedAmount.handles[0],
@@ -2011,13 +2101,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(13913n);
+ expect(res).to.equal(11465n);
});
- it('test operator "xor" overload (euint4, euint16) => euint16 test 2 (6, 10)', async function () {
+ it('test operator "xor" overload (euint4, euint16) => euint16 test 2 (10, 14)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(6n);
- input.add16(10n);
+ input.add4(10n);
+ input.add16(14n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.xor_euint4_euint16(
encryptedAmount.handles[0],
@@ -2026,13 +2116,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(12n);
+ expect(res).to.equal(4n);
});
- it('test operator "xor" overload (euint4, euint16) => euint16 test 3 (10, 10)', async function () {
+ it('test operator "xor" overload (euint4, euint16) => euint16 test 3 (14, 14)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add16(10n);
+ input.add4(14n);
+ input.add16(14n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.xor_euint4_euint16(
encryptedAmount.handles[0],
@@ -2044,10 +2134,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(0n);
});
- it('test operator "xor" overload (euint4, euint16) => euint16 test 4 (10, 6)', async function () {
+ it('test operator "xor" overload (euint4, euint16) => euint16 test 4 (14, 10)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add16(6n);
+ input.add4(14n);
+ input.add16(10n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.xor_euint4_euint16(
encryptedAmount.handles[0],
@@ -2056,13 +2146,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(12n);
+ expect(res).to.equal(4n);
});
- it('test operator "eq" overload (euint4, euint16) => ebool test 1 (10, 41899)', async function () {
+ it('test operator "eq" overload (euint4, euint16) => ebool test 1 (11, 40901)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add16(41899n);
+ input.add4(11n);
+ input.add16(40901n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.eq_euint4_euint16(
encryptedAmount.handles[0],
@@ -2074,10 +2164,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint4, euint16) => ebool test 2 (6, 10)', async function () {
+ it('test operator "eq" overload (euint4, euint16) => ebool test 2 (7, 11)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(6n);
- input.add16(10n);
+ input.add4(7n);
+ input.add16(11n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.eq_euint4_euint16(
encryptedAmount.handles[0],
@@ -2089,10 +2179,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint4, euint16) => ebool test 3 (10, 10)', async function () {
+ it('test operator "eq" overload (euint4, euint16) => ebool test 3 (11, 11)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add16(10n);
+ input.add4(11n);
+ input.add16(11n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.eq_euint4_euint16(
encryptedAmount.handles[0],
@@ -2104,10 +2194,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint4, euint16) => ebool test 4 (10, 6)', async function () {
+ it('test operator "eq" overload (euint4, euint16) => ebool test 4 (11, 7)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add16(6n);
+ input.add4(11n);
+ input.add16(7n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.eq_euint4_euint16(
encryptedAmount.handles[0],
@@ -2119,10 +2209,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint4, euint16) => ebool test 1 (3, 41708)', async function () {
+ it('test operator "ne" overload (euint4, euint16) => ebool test 1 (14, 35568)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(3n);
- input.add16(41708n);
+ input.add4(14n);
+ input.add16(35568n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.ne_euint4_euint16(
encryptedAmount.handles[0],
@@ -2134,10 +2224,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint4, euint16) => ebool test 2 (4, 8)', async function () {
+ it('test operator "ne" overload (euint4, euint16) => ebool test 2 (10, 14)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add16(8n);
+ input.add4(10n);
+ input.add16(14n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.ne_euint4_euint16(
encryptedAmount.handles[0],
@@ -2149,10 +2239,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint4, euint16) => ebool test 3 (8, 8)', async function () {
+ it('test operator "ne" overload (euint4, euint16) => ebool test 3 (14, 14)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add16(8n);
+ input.add4(14n);
+ input.add16(14n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.ne_euint4_euint16(
encryptedAmount.handles[0],
@@ -2164,10 +2254,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint4, euint16) => ebool test 4 (8, 4)', async function () {
+ it('test operator "ne" overload (euint4, euint16) => ebool test 4 (14, 10)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add16(4n);
+ input.add4(14n);
+ input.add16(10n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.ne_euint4_euint16(
encryptedAmount.handles[0],
@@ -2179,10 +2269,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint4, euint16) => ebool test 1 (5, 34397)', async function () {
+ it('test operator "ge" overload (euint4, euint16) => ebool test 1 (1, 53247)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(5n);
- input.add16(34397n);
+ input.add4(1n);
+ input.add16(53247n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.ge_euint4_euint16(
encryptedAmount.handles[0],
@@ -2239,10 +2329,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint4, euint16) => ebool test 1 (10, 34348)', async function () {
+ it('test operator "gt" overload (euint4, euint16) => ebool test 1 (13, 43765)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add16(34348n);
+ input.add4(13n);
+ input.add16(43765n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.gt_euint4_euint16(
encryptedAmount.handles[0],
@@ -2254,10 +2344,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint4, euint16) => ebool test 2 (6, 10)', async function () {
+ it('test operator "gt" overload (euint4, euint16) => ebool test 2 (9, 13)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(6n);
- input.add16(10n);
+ input.add4(9n);
+ input.add16(13n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.gt_euint4_euint16(
encryptedAmount.handles[0],
@@ -2269,10 +2359,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint4, euint16) => ebool test 3 (10, 10)', async function () {
+ it('test operator "gt" overload (euint4, euint16) => ebool test 3 (13, 13)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add16(10n);
+ input.add4(13n);
+ input.add16(13n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.gt_euint4_euint16(
encryptedAmount.handles[0],
@@ -2284,10 +2374,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint4, euint16) => ebool test 4 (10, 6)', async function () {
+ it('test operator "gt" overload (euint4, euint16) => ebool test 4 (13, 9)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add16(6n);
+ input.add4(13n);
+ input.add16(9n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.gt_euint4_euint16(
encryptedAmount.handles[0],
@@ -2299,10 +2389,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint4, euint16) => ebool test 1 (3, 38645)', async function () {
+ it('test operator "le" overload (euint4, euint16) => ebool test 1 (14, 62468)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(3n);
- input.add16(38645n);
+ input.add4(14n);
+ input.add16(62468n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.le_euint4_euint16(
encryptedAmount.handles[0],
@@ -2314,10 +2404,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint4, euint16) => ebool test 2 (4, 8)', async function () {
+ it('test operator "le" overload (euint4, euint16) => ebool test 2 (10, 14)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add16(8n);
+ input.add4(10n);
+ input.add16(14n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.le_euint4_euint16(
encryptedAmount.handles[0],
@@ -2329,10 +2419,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint4, euint16) => ebool test 3 (8, 8)', async function () {
+ it('test operator "le" overload (euint4, euint16) => ebool test 3 (14, 14)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add16(8n);
+ input.add4(14n);
+ input.add16(14n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.le_euint4_euint16(
encryptedAmount.handles[0],
@@ -2344,10 +2434,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint4, euint16) => ebool test 4 (8, 4)', async function () {
+ it('test operator "le" overload (euint4, euint16) => ebool test 4 (14, 10)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add16(4n);
+ input.add4(14n);
+ input.add16(10n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.le_euint4_euint16(
encryptedAmount.handles[0],
@@ -2359,10 +2449,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint4, euint16) => ebool test 1 (10, 15096)', async function () {
+ it('test operator "lt" overload (euint4, euint16) => ebool test 1 (10, 24653)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
input.add4(10n);
- input.add16(15096n);
+ input.add16(24653n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.lt_euint4_euint16(
encryptedAmount.handles[0],
@@ -2419,10 +2509,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(false);
});
- it('test operator "min" overload (euint4, euint16) => euint16 test 1 (12, 47994)', async function () {
+ it('test operator "min" overload (euint4, euint16) => euint16 test 1 (1, 50108)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(12n);
- input.add16(47994n);
+ input.add4(1n);
+ input.add16(50108n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.min_euint4_euint16(
encryptedAmount.handles[0],
@@ -2431,13 +2521,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(12n);
+ expect(res).to.equal(1n);
});
- it('test operator "min" overload (euint4, euint16) => euint16 test 2 (8, 12)', async function () {
+ it('test operator "min" overload (euint4, euint16) => euint16 test 2 (4, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add16(12n);
+ input.add4(4n);
+ input.add16(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.min_euint4_euint16(
encryptedAmount.handles[0],
@@ -2446,13 +2536,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(8n);
+ expect(res).to.equal(4n);
});
- it('test operator "min" overload (euint4, euint16) => euint16 test 3 (12, 12)', async function () {
+ it('test operator "min" overload (euint4, euint16) => euint16 test 3 (8, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(12n);
- input.add16(12n);
+ input.add4(8n);
+ input.add16(8n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.min_euint4_euint16(
encryptedAmount.handles[0],
@@ -2461,13 +2551,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(12n);
+ expect(res).to.equal(8n);
});
- it('test operator "min" overload (euint4, euint16) => euint16 test 4 (12, 8)', async function () {
+ it('test operator "min" overload (euint4, euint16) => euint16 test 4 (8, 4)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(12n);
- input.add16(8n);
+ input.add4(8n);
+ input.add16(4n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.min_euint4_euint16(
encryptedAmount.handles[0],
@@ -2476,13 +2566,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(8n);
+ expect(res).to.equal(4n);
});
- it('test operator "max" overload (euint4, euint16) => euint16 test 1 (6, 62382)', async function () {
+ it('test operator "max" overload (euint4, euint16) => euint16 test 1 (14, 33411)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(6n);
- input.add16(62382n);
+ input.add4(14n);
+ input.add16(33411n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.max_euint4_euint16(
encryptedAmount.handles[0],
@@ -2491,13 +2581,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(62382n);
+ expect(res).to.equal(33411n);
});
- it('test operator "max" overload (euint4, euint16) => euint16 test 2 (4, 8)', async function () {
+ it('test operator "max" overload (euint4, euint16) => euint16 test 2 (10, 14)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add16(8n);
+ input.add4(10n);
+ input.add16(14n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.max_euint4_euint16(
encryptedAmount.handles[0],
@@ -2506,13 +2596,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(8n);
+ expect(res).to.equal(14n);
});
- it('test operator "max" overload (euint4, euint16) => euint16 test 3 (8, 8)', async function () {
+ it('test operator "max" overload (euint4, euint16) => euint16 test 3 (14, 14)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add16(8n);
+ input.add4(14n);
+ input.add16(14n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.max_euint4_euint16(
encryptedAmount.handles[0],
@@ -2521,13 +2611,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(8n);
+ expect(res).to.equal(14n);
});
- it('test operator "max" overload (euint4, euint16) => euint16 test 4 (8, 4)', async function () {
+ it('test operator "max" overload (euint4, euint16) => euint16 test 4 (14, 10)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add16(4n);
+ input.add4(14n);
+ input.add16(10n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.max_euint4_euint16(
encryptedAmount.handles[0],
@@ -2536,13 +2626,13 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt16(await this.contract1.res16());
- expect(res).to.equal(8n);
+ expect(res).to.equal(14n);
});
- it('test operator "add" overload (euint4, euint32) => euint32 test 1 (2, 8)', async function () {
+ it('test operator "add" overload (euint4, euint32) => euint32 test 1 (2, 9)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
input.add4(2n);
- input.add32(8n);
+ input.add32(9n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.add_euint4_euint32(
encryptedAmount.handles[0],
@@ -2551,13 +2641,28 @@ describe('TFHE operations 1', function () {
);
await tx.wait();
const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(10n);
+ expect(res).to.equal(11n);
});
- it('test operator "add" overload (euint4, euint32) => euint32 test 2 (4, 8)', async function () {
+ it('test operator "add" overload (euint4, euint32) => euint32 test 2 (4, 6)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
input.add4(4n);
- input.add32(8n);
+ input.add32(6n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.add_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "add" overload (euint4, euint32) => euint32 test 3 (6, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(6n);
+ input.add32(6n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.add_euint4_euint32(
encryptedAmount.handles[0],
@@ -2569,10 +2674,10 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(12n);
});
- it('test operator "add" overload (euint4, euint32) => euint32 test 3 (5, 5)', async function () {
+ it('test operator "add" overload (euint4, euint32) => euint32 test 4 (6, 4)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(5n);
- input.add32(5n);
+ input.add4(6n);
+ input.add32(4n);
const encryptedAmount = await input.encrypt();
const tx = await this.contract1.add_euint4_euint32(
encryptedAmount.handles[0],
@@ -2584,12 +2689,267 @@ describe('TFHE operations 1', function () {
expect(res).to.equal(10n);
});
- it('test operator "add" overload (euint4, euint32) => euint32 test 4 (8, 4)', async function () {
+ it('test operator "sub" overload (euint4, euint32) => euint32 test 1 (13, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(13n);
+ input.add32(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.sub_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint4, euint32) => euint32 test 2 (13, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(13n);
+ input.add32(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.sub_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint4, euint32) => euint32 test 1 (2, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(2n);
+ input.add32(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.mul_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "mul" overload (euint4, euint32) => euint32 test 2 (3, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(3n);
+ input.add32(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.mul_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "mul" overload (euint4, euint32) => euint32 test 3 (3, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(3n);
+ input.add32(3n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.mul_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(9n);
+ });
+
+ it('test operator "mul" overload (euint4, euint32) => euint32 test 4 (4, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add32(3n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.mul_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "and" overload (euint4, euint32) => euint32 test 1 (6, 3666388192)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(6n);
+ input.add32(3666388192n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.and_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "and" overload (euint4, euint32) => euint32 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add32(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.and_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "and" overload (euint4, euint32) => euint32 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add32(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.and_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "and" overload (euint4, euint32) => euint32 test 4 (8, 4)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
input.add4(8n);
input.add32(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.add_euint4_euint32(
+ const tx = await this.contract1.and_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "or" overload (euint4, euint32) => euint32 test 1 (13, 371092847)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(13n);
+ input.add32(371092847n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.or_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(371092847n);
+ });
+
+ it('test operator "or" overload (euint4, euint32) => euint32 test 2 (9, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(9n);
+ input.add32(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.or_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(13n);
+ });
+
+ it('test operator "or" overload (euint4, euint32) => euint32 test 3 (13, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(13n);
+ input.add32(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.or_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(13n);
+ });
+
+ it('test operator "or" overload (euint4, euint32) => euint32 test 4 (13, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(13n);
+ input.add32(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.or_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(13n);
+ });
+
+ it('test operator "xor" overload (euint4, euint32) => euint32 test 1 (1, 1939413163)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(1n);
+ input.add32(1939413163n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.xor_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(1939413162n);
+ });
+
+ it('test operator "xor" overload (euint4, euint32) => euint32 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add32(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.xor_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "xor" overload (euint4, euint32) => euint32 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add32(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.xor_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint4, euint32) => euint32 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add32(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.xor_euint4_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
@@ -2598,4 +2958,1864 @@ describe('TFHE operations 1', function () {
const res = await decrypt32(await this.contract1.res32());
expect(res).to.equal(12n);
});
+
+ it('test operator "eq" overload (euint4, euint32) => ebool test 1 (9, 1089894566)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(9n);
+ input.add32(1089894566n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.eq_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint4, euint32) => ebool test 2 (5, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(5n);
+ input.add32(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.eq_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint4, euint32) => ebool test 3 (9, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(9n);
+ input.add32(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.eq_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint4, euint32) => ebool test 4 (9, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(9n);
+ input.add32(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.eq_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint4, euint32) => ebool test 1 (5, 2818677977)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(5n);
+ input.add32(2818677977n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ne_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint4, euint32) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add32(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ne_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint4, euint32) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add32(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ne_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint4, euint32) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add32(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ne_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint4, euint32) => ebool test 1 (1, 2262617776)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(1n);
+ input.add32(2262617776n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ge_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint4, euint32) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add32(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ge_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint4, euint32) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add32(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ge_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint4, euint32) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add32(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ge_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint4, euint32) => ebool test 1 (8, 1791761269)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add32(1791761269n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.gt_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint4, euint32) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add32(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.gt_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint4, euint32) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add32(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.gt_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint4, euint32) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add32(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.gt_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint4, euint32) => ebool test 1 (4, 1782114748)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add32(1782114748n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.le_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint4, euint32) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add32(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.le_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint4, euint32) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add32(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.le_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint4, euint32) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add32(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.le_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint4, euint32) => ebool test 1 (1, 3154883490)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(1n);
+ input.add32(3154883490n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.lt_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint4, euint32) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add32(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.lt_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint4, euint32) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add32(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.lt_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint4, euint32) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add32(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.lt_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint4, euint32) => euint32 test 1 (9, 2831156674)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(9n);
+ input.add32(2831156674n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.min_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(9n);
+ });
+
+ it('test operator "min" overload (euint4, euint32) => euint32 test 2 (5, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(5n);
+ input.add32(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.min_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(5n);
+ });
+
+ it('test operator "min" overload (euint4, euint32) => euint32 test 3 (9, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(9n);
+ input.add32(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.min_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(9n);
+ });
+
+ it('test operator "min" overload (euint4, euint32) => euint32 test 4 (9, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(9n);
+ input.add32(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.min_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(5n);
+ });
+
+ it('test operator "max" overload (euint4, euint32) => euint32 test 1 (12, 623453237)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(12n);
+ input.add32(623453237n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.max_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(623453237n);
+ });
+
+ it('test operator "max" overload (euint4, euint32) => euint32 test 2 (8, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add32(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.max_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "max" overload (euint4, euint32) => euint32 test 3 (12, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(12n);
+ input.add32(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.max_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "max" overload (euint4, euint32) => euint32 test 4 (12, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(12n);
+ input.add32(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.max_euint4_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract1.res32());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "add" overload (euint4, euint64) => euint64 test 1 (1, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(1n);
+ input.add64(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.add_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "add" overload (euint4, euint64) => euint64 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add64(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.add_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "add" overload (euint4, euint64) => euint64 test 3 (5, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(5n);
+ input.add64(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.add_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "add" overload (euint4, euint64) => euint64 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add64(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.add_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "sub" overload (euint4, euint64) => euint64 test 1 (12, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(12n);
+ input.add64(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.sub_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint4, euint64) => euint64 test 2 (12, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(12n);
+ input.add64(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.sub_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint4, euint64) => euint64 test 1 (2, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(2n);
+ input.add64(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.mul_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "mul" overload (euint4, euint64) => euint64 test 2 (3, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(3n);
+ input.add64(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.mul_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(15n);
+ });
+
+ it('test operator "mul" overload (euint4, euint64) => euint64 test 3 (3, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(3n);
+ input.add64(3n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.mul_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(9n);
+ });
+
+ it('test operator "mul" overload (euint4, euint64) => euint64 test 4 (5, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(5n);
+ input.add64(3n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.mul_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(15n);
+ });
+
+ it('test operator "and" overload (euint4, euint64) => euint64 test 1 (6, 18438764365497303935)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(6n);
+ input.add64(18438764365497303935n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.and_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(6n);
+ });
+
+ it('test operator "and" overload (euint4, euint64) => euint64 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add64(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.and_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "and" overload (euint4, euint64) => euint64 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add64(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.and_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "and" overload (euint4, euint64) => euint64 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add64(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.and_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "or" overload (euint4, euint64) => euint64 test 1 (14, 18440698678220010551)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(14n);
+ input.add64(18440698678220010551n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.or_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(18440698678220010559n);
+ });
+
+ it('test operator "or" overload (euint4, euint64) => euint64 test 2 (10, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(10n);
+ input.add64(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.or_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(14n);
+ });
+
+ it('test operator "or" overload (euint4, euint64) => euint64 test 3 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(14n);
+ input.add64(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.or_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(14n);
+ });
+
+ it('test operator "or" overload (euint4, euint64) => euint64 test 4 (14, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(14n);
+ input.add64(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.or_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(14n);
+ });
+
+ it('test operator "xor" overload (euint4, euint64) => euint64 test 1 (2, 18438078325844207475)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(2n);
+ input.add64(18438078325844207475n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.xor_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(18438078325844207473n);
+ });
+
+ it('test operator "xor" overload (euint4, euint64) => euint64 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add64(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.xor_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "xor" overload (euint4, euint64) => euint64 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add64(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.xor_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint4, euint64) => euint64 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add64(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.xor_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "eq" overload (euint4, euint64) => ebool test 1 (3, 18443050121569259433)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(3n);
+ input.add64(18443050121569259433n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.eq_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint4, euint64) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add64(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.eq_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint4, euint64) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add64(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.eq_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint4, euint64) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add64(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.eq_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint4, euint64) => ebool test 1 (7, 18446555094221865045)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(7n);
+ input.add64(18446555094221865045n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ne_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint4, euint64) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add64(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ne_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint4, euint64) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add64(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ne_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint4, euint64) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add64(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ne_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint4, euint64) => ebool test 1 (12, 18446558548033148537)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(12n);
+ input.add64(18446558548033148537n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ge_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint4, euint64) => ebool test 2 (8, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add64(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ge_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint4, euint64) => ebool test 3 (12, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(12n);
+ input.add64(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ge_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint4, euint64) => ebool test 4 (12, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(12n);
+ input.add64(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ge_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint4, euint64) => ebool test 1 (11, 18445624350177245281)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(11n);
+ input.add64(18445624350177245281n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.gt_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint4, euint64) => ebool test 2 (7, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(7n);
+ input.add64(11n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.gt_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint4, euint64) => ebool test 3 (11, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(11n);
+ input.add64(11n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.gt_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint4, euint64) => ebool test 4 (11, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(11n);
+ input.add64(7n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.gt_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint4, euint64) => ebool test 1 (14, 18446414069240547725)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(14n);
+ input.add64(18446414069240547725n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.le_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint4, euint64) => ebool test 2 (10, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(10n);
+ input.add64(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.le_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint4, euint64) => ebool test 3 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(14n);
+ input.add64(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.le_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint4, euint64) => ebool test 4 (14, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(14n);
+ input.add64(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.le_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint4, euint64) => ebool test 1 (13, 18441885120383916401)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(13n);
+ input.add64(18441885120383916401n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.lt_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint4, euint64) => ebool test 2 (9, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(9n);
+ input.add64(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.lt_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint4, euint64) => ebool test 3 (13, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(13n);
+ input.add64(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.lt_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint4, euint64) => ebool test 4 (13, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(13n);
+ input.add64(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.lt_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint4, euint64) => euint64 test 1 (12, 18440035039683442233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(12n);
+ input.add64(18440035039683442233n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.min_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "min" overload (euint4, euint64) => euint64 test 2 (8, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add64(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.min_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "min" overload (euint4, euint64) => euint64 test 3 (12, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(12n);
+ input.add64(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.min_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "min" overload (euint4, euint64) => euint64 test 4 (12, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(12n);
+ input.add64(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.min_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "max" overload (euint4, euint64) => euint64 test 1 (9, 18439762941056895609)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(9n);
+ input.add64(18439762941056895609n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.max_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(18439762941056895609n);
+ });
+
+ it('test operator "max" overload (euint4, euint64) => euint64 test 2 (5, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(5n);
+ input.add64(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.max_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(9n);
+ });
+
+ it('test operator "max" overload (euint4, euint64) => euint64 test 3 (9, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(9n);
+ input.add64(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.max_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(9n);
+ });
+
+ it('test operator "max" overload (euint4, euint64) => euint64 test 4 (9, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(9n);
+ input.add64(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.max_euint4_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract1.res64());
+ expect(res).to.equal(9n);
+ });
+
+ it('test operator "add" overload (euint4, euint128) => euint128 test 1 (2, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(2n);
+ input.add128(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.add_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(11n);
+ });
+
+ it('test operator "add" overload (euint4, euint128) => euint128 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add128(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.add_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "add" overload (euint4, euint128) => euint128 test 3 (5, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(5n);
+ input.add128(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.add_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "add" overload (euint4, euint128) => euint128 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add128(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.add_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "sub" overload (euint4, euint128) => euint128 test 1 (13, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(13n);
+ input.add128(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.sub_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint4, euint128) => euint128 test 2 (13, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(13n);
+ input.add128(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.sub_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint4, euint128) => euint128 test 1 (2, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(2n);
+ input.add128(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.mul_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "mul" overload (euint4, euint128) => euint128 test 2 (3, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(3n);
+ input.add128(3n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.mul_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(9n);
+ });
+
+ it('test operator "mul" overload (euint4, euint128) => euint128 test 3 (3, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(3n);
+ input.add128(3n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.mul_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(9n);
+ });
+
+ it('test operator "mul" overload (euint4, euint128) => euint128 test 4 (3, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(3n);
+ input.add128(3n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.mul_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(9n);
+ });
+
+ it('test operator "and" overload (euint4, euint128) => euint128 test 1 (8, 340282366920938463463367802109078157213)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add128(340282366920938463463367802109078157213n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.and_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "and" overload (euint4, euint128) => euint128 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add128(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.and_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "and" overload (euint4, euint128) => euint128 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add128(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.and_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "and" overload (euint4, euint128) => euint128 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add128(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.and_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "or" overload (euint4, euint128) => euint128 test 1 (4, 340282366920938463463366343089484611447)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add128(340282366920938463463366343089484611447n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.or_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(340282366920938463463366343089484611447n);
+ });
+
+ it('test operator "or" overload (euint4, euint128) => euint128 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add128(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.or_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "or" overload (euint4, euint128) => euint128 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add128(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.or_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "or" overload (euint4, euint128) => euint128 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add128(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.or_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "xor" overload (euint4, euint128) => euint128 test 1 (13, 340282366920938463463366123999290070707)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(13n);
+ input.add128(340282366920938463463366123999290070707n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.xor_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(340282366920938463463366123999290070718n);
+ });
+
+ it('test operator "xor" overload (euint4, euint128) => euint128 test 2 (9, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(9n);
+ input.add128(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.xor_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "xor" overload (euint4, euint128) => euint128 test 3 (13, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(13n);
+ input.add128(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.xor_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint4, euint128) => euint128 test 4 (13, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(13n);
+ input.add128(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.xor_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "eq" overload (euint4, euint128) => ebool test 1 (10, 340282366920938463463370073243865312497)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(10n);
+ input.add128(340282366920938463463370073243865312497n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.eq_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint4, euint128) => ebool test 2 (6, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(6n);
+ input.add128(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.eq_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint4, euint128) => ebool test 3 (10, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(10n);
+ input.add128(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.eq_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint4, euint128) => ebool test 4 (10, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(10n);
+ input.add128(6n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.eq_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint4, euint128) => ebool test 1 (13, 340282366920938463463368725666766226609)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(13n);
+ input.add128(340282366920938463463368725666766226609n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ne_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint4, euint128) => ebool test 2 (9, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(9n);
+ input.add128(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ne_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint4, euint128) => ebool test 3 (13, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(13n);
+ input.add128(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ne_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint4, euint128) => ebool test 4 (13, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(13n);
+ input.add128(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ne_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint4, euint128) => ebool test 1 (3, 340282366920938463463374467311851431135)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(3n);
+ input.add128(340282366920938463463374467311851431135n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ge_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint4, euint128) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add128(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ge_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint4, euint128) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add128(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ge_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint4, euint128) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add128(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.ge_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint4, euint128) => ebool test 1 (14, 340282366920938463463369565306924367885)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(14n);
+ input.add128(340282366920938463463369565306924367885n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.gt_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint4, euint128) => ebool test 2 (10, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(10n);
+ input.add128(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.gt_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint4, euint128) => ebool test 3 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(14n);
+ input.add128(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.gt_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint4, euint128) => ebool test 4 (14, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ input.add4(14n);
+ input.add128(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract1.gt_euint4_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
+ });
});
diff --git a/test/tfheOperations/tfheOperations10.ts b/test/tfheOperations/tfheOperations10.ts
index 963f198c..fa223d0d 100644
--- a/test/tfheOperations/tfheOperations10.ts
+++ b/test/tfheOperations/tfheOperations10.ts
@@ -7,7 +7,22 @@ import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'
import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance';
+import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
+import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
+import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
+import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
+import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
+import {
+ createInstances,
+ decrypt4,
+ decrypt8,
+ decrypt16,
+ decrypt32,
+ decrypt64,
+ decrypt128,
+ decrypt256,
+ decryptBool,
+} from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
@@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise {
return contract;
}
+async function deployTfheTestFixture7(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite7');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture8(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite8');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture9(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite9');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture10(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite10');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture11(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite11');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
describe('TFHE operations 10', function () {
before(async function () {
await initSigners(1);
@@ -105,2497 +175,4647 @@ describe('TFHE operations 10', function () {
this.contract6Address = await contract6.getAddress();
this.contract6 = contract6;
+ const contract7 = await deployTfheTestFixture7();
+ this.contract7Address = await contract7.getAddress();
+ this.contract7 = contract7;
+
+ const contract8 = await deployTfheTestFixture8();
+ this.contract8Address = await contract8.getAddress();
+ this.contract8 = contract8;
+
+ const contract9 = await deployTfheTestFixture9();
+ this.contract9Address = await contract9.getAddress();
+ this.contract9 = contract9;
+
+ const contract10 = await deployTfheTestFixture10();
+ this.contract10Address = await contract10.getAddress();
+ this.contract10 = contract10;
+
+ const contract11 = await deployTfheTestFixture11();
+ this.contract11Address = await contract11.getAddress();
+ this.contract11 = contract11;
+
const instances = await createInstances(this.signers);
this.instances = instances;
});
- it('test operator "lt" overload (euint64, euint4) => ebool test 1 (18443056909764585511, 1)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(18443056909764585511n);
- input.add4(1n);
+ it('test operator "le" overload (euint128, euint128) => ebool test 1 (340282366920938463463373992528465349581, 340282366920938463463372840104721436799)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463373992528465349581n);
+ input.add128(340282366920938463463372840104721436799n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint64_euint4(
+ const tx = await this.contract9.le_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract9.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint64, euint4) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(4n);
- input.add4(8n);
+ it('test operator "le" overload (euint128, euint128) => ebool test 2 (340282366920938463463372840104721436795, 340282366920938463463372840104721436799)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463372840104721436795n);
+ input.add128(340282366920938463463372840104721436799n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint64_euint4(
+ const tx = await this.contract9.le_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract9.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint64, euint4) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(8n);
- input.add4(8n);
+ it('test operator "le" overload (euint128, euint128) => ebool test 3 (340282366920938463463372840104721436799, 340282366920938463463372840104721436799)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463372840104721436799n);
+ input.add128(340282366920938463463372840104721436799n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.le_euint128_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint128, euint128) => ebool test 4 (340282366920938463463372840104721436799, 340282366920938463463372840104721436795)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463372840104721436799n);
+ input.add128(340282366920938463463372840104721436795n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint64_euint4(
+ const tx = await this.contract9.le_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract9.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint64, euint4) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(8n);
- input.add4(4n);
+ it('test operator "lt" overload (euint128, euint128) => ebool test 1 (340282366920938463463368309276517872429, 340282366920938463463372024309642476529)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463368309276517872429n);
+ input.add128(340282366920938463463372024309642476529n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.lt_euint128_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint128, euint128) => ebool test 2 (340282366920938463463368309276517872425, 340282366920938463463368309276517872429)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463368309276517872425n);
+ input.add128(340282366920938463463368309276517872429n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.lt_euint128_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint128, euint128) => ebool test 3 (340282366920938463463368309276517872429, 340282366920938463463368309276517872429)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463368309276517872429n);
+ input.add128(340282366920938463463368309276517872429n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint64_euint4(
+ const tx = await this.contract9.lt_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract9.resb());
expect(res).to.equal(false);
});
- it('test operator "min" overload (euint64, euint4) => euint64 test 1 (18446705827641256747, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(18446705827641256747n);
- input.add4(10n);
+ it('test operator "lt" overload (euint128, euint128) => ebool test 4 (340282366920938463463368309276517872429, 340282366920938463463368309276517872425)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463368309276517872429n);
+ input.add128(340282366920938463463368309276517872425n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint64_euint4(
+ const tx = await this.contract9.lt_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(10n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "min" overload (euint64, euint4) => euint64 test 2 (6, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(6n);
- input.add4(10n);
+ it('test operator "min" overload (euint128, euint128) => euint128 test 1 (340282366920938463463369507025632955721, 340282366920938463463371759125181075731)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463369507025632955721n);
+ input.add128(340282366920938463463371759125181075731n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint64_euint4(
+ const tx = await this.contract9.min_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(6n);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463369507025632955721n);
});
- it('test operator "min" overload (euint64, euint4) => euint64 test 3 (10, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(10n);
- input.add4(10n);
+ it('test operator "min" overload (euint128, euint128) => euint128 test 2 (340282366920938463463369507025632955717, 340282366920938463463369507025632955721)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463369507025632955717n);
+ input.add128(340282366920938463463369507025632955721n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint64_euint4(
+ const tx = await this.contract9.min_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(10n);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463369507025632955717n);
});
- it('test operator "min" overload (euint64, euint4) => euint64 test 4 (10, 6)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(10n);
- input.add4(6n);
+ it('test operator "min" overload (euint128, euint128) => euint128 test 3 (340282366920938463463369507025632955721, 340282366920938463463369507025632955721)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463369507025632955721n);
+ input.add128(340282366920938463463369507025632955721n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint64_euint4(
+ const tx = await this.contract9.min_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(6n);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463369507025632955721n);
});
- it('test operator "max" overload (euint64, euint4) => euint64 test 1 (18445668950732298129, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(18445668950732298129n);
- input.add4(5n);
+ it('test operator "min" overload (euint128, euint128) => euint128 test 4 (340282366920938463463369507025632955721, 340282366920938463463369507025632955717)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463369507025632955721n);
+ input.add128(340282366920938463463369507025632955717n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint64_euint4(
+ const tx = await this.contract9.min_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(18445668950732298129n);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463369507025632955717n);
});
- it('test operator "max" overload (euint64, euint4) => euint64 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(4n);
- input.add4(8n);
+ it('test operator "max" overload (euint128, euint128) => euint128 test 1 (340282366920938463463374311959896511759, 340282366920938463463367499312160836031)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463374311959896511759n);
+ input.add128(340282366920938463463367499312160836031n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint64_euint4(
+ const tx = await this.contract9.max_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(8n);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463374311959896511759n);
});
- it('test operator "max" overload (euint64, euint4) => euint64 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(8n);
- input.add4(8n);
+ it('test operator "max" overload (euint128, euint128) => euint128 test 2 (340282366920938463463367499312160836027, 340282366920938463463367499312160836031)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367499312160836027n);
+ input.add128(340282366920938463463367499312160836031n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint64_euint4(
+ const tx = await this.contract9.max_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(8n);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463367499312160836031n);
});
- it('test operator "max" overload (euint64, euint4) => euint64 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(8n);
- input.add4(4n);
+ it('test operator "max" overload (euint128, euint128) => euint128 test 3 (340282366920938463463367499312160836031, 340282366920938463463367499312160836031)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367499312160836031n);
+ input.add128(340282366920938463463367499312160836031n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint64_euint4(
+ const tx = await this.contract9.max_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(8n);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463367499312160836031n);
});
- it('test operator "add" overload (euint64, euint8) => euint64 test 1 (129, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(129n);
- input.add8(2n);
+ it('test operator "max" overload (euint128, euint128) => euint128 test 4 (340282366920938463463367499312160836031, 340282366920938463463367499312160836027)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367499312160836031n);
+ input.add128(340282366920938463463367499312160836027n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint64_euint8(
+ const tx = await this.contract9.max_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(131n);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463367499312160836031n);
});
- it('test operator "add" overload (euint64, euint8) => euint64 test 2 (89, 91)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(89n);
- input.add8(91n);
+ it('test operator "add" overload (euint128, euint256) => euint256 test 1 (2, 170141183460469231731687303715884105729)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(2n);
+ input.add256(170141183460469231731687303715884105729n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint64_euint8(
+ const tx = await this.contract9.add_euint128_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(180n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(170141183460469231731687303715884105731n);
});
- it('test operator "add" overload (euint64, euint8) => euint64 test 3 (91, 91)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(91n);
- input.add8(91n);
+ it('test operator "add" overload (euint128, euint256) => euint256 test 2 (170141183460469231731686007573348351546, 170141183460469231731686007573348351548)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(170141183460469231731686007573348351546n);
+ input.add256(170141183460469231731686007573348351548n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint64_euint8(
+ const tx = await this.contract9.add_euint128_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(182n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(340282366920938463463372015146696703094n);
});
- it('test operator "add" overload (euint64, euint8) => euint64 test 4 (91, 89)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(91n);
- input.add8(89n);
+ it('test operator "add" overload (euint128, euint256) => euint256 test 3 (170141183460469231731686007573348351548, 170141183460469231731686007573348351548)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(170141183460469231731686007573348351548n);
+ input.add256(170141183460469231731686007573348351548n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint64_euint8(
+ const tx = await this.contract9.add_euint128_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(180n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(340282366920938463463372015146696703096n);
});
- it('test operator "sub" overload (euint64, euint8) => euint64 test 1 (25, 25)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(25n);
- input.add8(25n);
+ it('test operator "add" overload (euint128, euint256) => euint256 test 4 (170141183460469231731686007573348351548, 170141183460469231731686007573348351546)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(170141183460469231731686007573348351548n);
+ input.add256(170141183460469231731686007573348351546n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.add_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(340282366920938463463372015146696703094n);
+ });
+
+ it('test operator "sub" overload (euint128, euint256) => euint256 test 1 (340282366920938463463369549263218693865, 340282366920938463463369549263218693865)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463369549263218693865n);
+ input.add256(340282366920938463463369549263218693865n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.sub_euint64_euint8(
+ const tx = await this.contract9.sub_euint128_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
+ const res = await decrypt256(await this.contract9.res256());
expect(res).to.equal(0n);
});
- it('test operator "sub" overload (euint64, euint8) => euint64 test 2 (25, 21)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(25n);
- input.add8(21n);
+ it('test operator "sub" overload (euint128, euint256) => euint256 test 2 (340282366920938463463369549263218693865, 340282366920938463463369549263218693861)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463369549263218693865n);
+ input.add256(340282366920938463463369549263218693861n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.sub_euint64_euint8(
+ const tx = await this.contract9.sub_euint128_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
+ const res = await decrypt256(await this.contract9.res256());
expect(res).to.equal(4n);
});
- it('test operator "mul" overload (euint64, euint8) => euint64 test 1 (65, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(65n);
- input.add8(2n);
+ it('test operator "mul" overload (euint128, euint256) => euint256 test 1 (2, 85070591730234615865843651857942052865)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(2n);
+ input.add256(85070591730234615865843651857942052865n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint64_euint8(
+ const tx = await this.contract9.mul_euint128_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(130n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(170141183460469231731687303715884105730n);
+ });
+
+ it('test operator "mul" overload (euint128, euint256) => euint256 test 2 (9223372036854775809, 9223372036854775809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(9223372036854775809n);
+ input.add256(9223372036854775809n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.mul_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(85070591730234615884290395931651604481n);
+ });
+
+ it('test operator "mul" overload (euint128, euint256) => euint256 test 3 (9223372036854775809, 9223372036854775809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(9223372036854775809n);
+ input.add256(9223372036854775809n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.mul_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(85070591730234615884290395931651604481n);
+ });
+
+ it('test operator "mul" overload (euint128, euint256) => euint256 test 4 (9223372036854775809, 9223372036854775809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(9223372036854775809n);
+ input.add256(9223372036854775809n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.mul_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(85070591730234615884290395931651604481n);
+ });
+
+ it('test operator "and" overload (euint128, euint256) => euint256 test 1 (340282366920938463463366718158519885511, 115792089237316195423570985008687907853269984665640564039457581748247155679323)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463366718158519885511n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581748247155679323n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.and_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(340282366920938463463366717989234606147n);
+ });
+
+ it('test operator "and" overload (euint128, euint256) => euint256 test 2 (340282366920938463463366718158519885507, 340282366920938463463366718158519885511)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463366718158519885507n);
+ input.add256(340282366920938463463366718158519885511n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.and_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(340282366920938463463366718158519885507n);
+ });
+
+ it('test operator "and" overload (euint128, euint256) => euint256 test 3 (340282366920938463463366718158519885511, 340282366920938463463366718158519885511)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463366718158519885511n);
+ input.add256(340282366920938463463366718158519885511n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.and_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(340282366920938463463366718158519885511n);
+ });
+
+ it('test operator "and" overload (euint128, euint256) => euint256 test 4 (340282366920938463463366718158519885511, 340282366920938463463366718158519885507)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463366718158519885511n);
+ input.add256(340282366920938463463366718158519885507n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.and_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(340282366920938463463366718158519885507n);
+ });
+
+ it('test operator "or" overload (euint128, euint256) => euint256 test 1 (340282366920938463463366429103695675815, 115792089237316195423570985008687907853269984665640564039457583383018428109749)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463366429103695675815n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457583383018428109749n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.or_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457583999099276579767n);
+ });
+
+ it('test operator "or" overload (euint128, euint256) => euint256 test 2 (340282366920938463463366429103695675811, 340282366920938463463366429103695675815)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463366429103695675811n);
+ input.add256(340282366920938463463366429103695675815n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.or_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(340282366920938463463366429103695675815n);
+ });
+
+ it('test operator "or" overload (euint128, euint256) => euint256 test 3 (340282366920938463463366429103695675815, 340282366920938463463366429103695675815)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463366429103695675815n);
+ input.add256(340282366920938463463366429103695675815n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.or_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(340282366920938463463366429103695675815n);
});
- it('test operator "mul" overload (euint64, euint8) => euint64 test 2 (9, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(9n);
- input.add8(10n);
+ it('test operator "or" overload (euint128, euint256) => euint256 test 4 (340282366920938463463366429103695675815, 340282366920938463463366429103695675811)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463366429103695675815n);
+ input.add256(340282366920938463463366429103695675811n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint64_euint8(
+ const tx = await this.contract9.or_euint128_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(90n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(340282366920938463463366429103695675815n);
});
- it('test operator "mul" overload (euint64, euint8) => euint64 test 3 (10, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(10n);
- input.add8(10n);
+ it('test operator "xor" overload (euint128, euint256) => euint256 test 1 (340282366920938463463370357504982561043, 115792089237316195423570985008687907853269984665640564039457576209743222065387)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463370357504982561043n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457576209743222065387n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint64_euint8(
+ const tx = await this.contract9.xor_euint128_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(100n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(115792089237316195423570985008687907852929702298719625575994215220393361046008n);
});
- it('test operator "mul" overload (euint64, euint8) => euint64 test 4 (10, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(10n);
- input.add8(9n);
+ it('test operator "xor" overload (euint128, euint256) => euint256 test 2 (340282366920938463463370357504982561039, 340282366920938463463370357504982561043)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463370357504982561039n);
+ input.add256(340282366920938463463370357504982561043n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint64_euint8(
+ const tx = await this.contract9.xor_euint128_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(90n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(28n);
});
- it('test operator "and" overload (euint64, euint8) => euint64 test 1 (18441413446268134663, 40)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(18441413446268134663n);
- input.add8(40n);
+ it('test operator "xor" overload (euint128, euint256) => euint256 test 3 (340282366920938463463370357504982561043, 340282366920938463463370357504982561043)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463370357504982561043n);
+ input.add256(340282366920938463463370357504982561043n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.and_euint64_euint8(
+ const tx = await this.contract9.xor_euint128_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
+ const res = await decrypt256(await this.contract9.res256());
expect(res).to.equal(0n);
});
- it('test operator "and" overload (euint64, euint8) => euint64 test 2 (36, 40)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(36n);
- input.add8(40n);
+ it('test operator "xor" overload (euint128, euint256) => euint256 test 4 (340282366920938463463370357504982561043, 340282366920938463463370357504982561039)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463370357504982561043n);
+ input.add256(340282366920938463463370357504982561039n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.xor_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(28n);
+ });
+
+ it('test operator "eq" overload (euint128, euint256) => ebool test 1 (340282366920938463463367588896596491863, 115792089237316195423570985008687907853269984665640564039457578982740222216241)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367588896596491863n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457578982740222216241n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.eq_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint128, euint256) => ebool test 2 (340282366920938463463367588896596491859, 340282366920938463463367588896596491863)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367588896596491859n);
+ input.add256(340282366920938463463367588896596491863n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.eq_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint128, euint256) => ebool test 3 (340282366920938463463367588896596491863, 340282366920938463463367588896596491863)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367588896596491863n);
+ input.add256(340282366920938463463367588896596491863n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.eq_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint128, euint256) => ebool test 4 (340282366920938463463367588896596491863, 340282366920938463463367588896596491859)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367588896596491863n);
+ input.add256(340282366920938463463367588896596491859n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.eq_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint128, euint256) => ebool test 1 (340282366920938463463374144988236257799, 115792089237316195423570985008687907853269984665640564039457582794848891263301)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463374144988236257799n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582794848891263301n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ne_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint128, euint256) => ebool test 2 (340282366920938463463374144988236257795, 340282366920938463463374144988236257799)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463374144988236257795n);
+ input.add256(340282366920938463463374144988236257799n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ne_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint128, euint256) => ebool test 3 (340282366920938463463374144988236257799, 340282366920938463463374144988236257799)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463374144988236257799n);
+ input.add256(340282366920938463463374144988236257799n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ne_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint128, euint256) => ebool test 4 (340282366920938463463374144988236257799, 340282366920938463463374144988236257795)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463374144988236257799n);
+ input.add256(340282366920938463463374144988236257795n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ne_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint128, euint256) => ebool test 1 (340282366920938463463372552646665539131, 115792089237316195423570985008687907853269984665640564039457578321851153049841)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463372552646665539131n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457578321851153049841n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ge_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint128, euint256) => ebool test 2 (340282366920938463463372552646665539127, 340282366920938463463372552646665539131)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463372552646665539127n);
+ input.add256(340282366920938463463372552646665539131n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ge_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint128, euint256) => ebool test 3 (340282366920938463463372552646665539131, 340282366920938463463372552646665539131)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463372552646665539131n);
+ input.add256(340282366920938463463372552646665539131n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ge_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint128, euint256) => ebool test 4 (340282366920938463463372552646665539131, 340282366920938463463372552646665539127)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463372552646665539131n);
+ input.add256(340282366920938463463372552646665539127n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ge_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint128, euint256) => ebool test 1 (340282366920938463463370843114455636527, 115792089237316195423570985008687907853269984665640564039457583283635470770217)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463370843114455636527n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457583283635470770217n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.gt_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint128, euint256) => ebool test 2 (340282366920938463463370843114455636523, 340282366920938463463370843114455636527)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463370843114455636523n);
+ input.add256(340282366920938463463370843114455636527n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.gt_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint128, euint256) => ebool test 3 (340282366920938463463370843114455636527, 340282366920938463463370843114455636527)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463370843114455636527n);
+ input.add256(340282366920938463463370843114455636527n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.gt_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint128, euint256) => ebool test 4 (340282366920938463463370843114455636527, 340282366920938463463370843114455636523)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463370843114455636527n);
+ input.add256(340282366920938463463370843114455636523n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.gt_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint128, euint256) => ebool test 1 (340282366920938463463370154534182411951, 115792089237316195423570985008687907853269984665640564039457582642838670062225)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463370154534182411951n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582642838670062225n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.le_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint128, euint256) => ebool test 2 (340282366920938463463370154534182411947, 340282366920938463463370154534182411951)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463370154534182411947n);
+ input.add256(340282366920938463463370154534182411951n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.le_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint128, euint256) => ebool test 3 (340282366920938463463370154534182411951, 340282366920938463463370154534182411951)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463370154534182411951n);
+ input.add256(340282366920938463463370154534182411951n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.le_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint128, euint256) => ebool test 4 (340282366920938463463370154534182411951, 340282366920938463463370154534182411947)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463370154534182411951n);
+ input.add256(340282366920938463463370154534182411947n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.le_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint128, euint256) => ebool test 1 (340282366920938463463373024758287549459, 115792089237316195423570985008687907853269984665640564039457580686028388504291)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463373024758287549459n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580686028388504291n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.lt_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint128, euint256) => ebool test 2 (340282366920938463463373024758287549455, 340282366920938463463373024758287549459)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463373024758287549455n);
+ input.add256(340282366920938463463373024758287549459n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.lt_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint128, euint256) => ebool test 3 (340282366920938463463373024758287549459, 340282366920938463463373024758287549459)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463373024758287549459n);
+ input.add256(340282366920938463463373024758287549459n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.lt_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint128, euint256) => ebool test 4 (340282366920938463463373024758287549459, 340282366920938463463373024758287549455)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463373024758287549459n);
+ input.add256(340282366920938463463373024758287549455n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.lt_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint128, euint256) => euint256 test 1 (340282366920938463463370734691749234713, 115792089237316195423570985008687907853269984665640564039457579316332311519059)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463370734691749234713n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579316332311519059n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.min_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(340282366920938463463370734691749234713n);
+ });
+
+ it('test operator "min" overload (euint128, euint256) => euint256 test 2 (340282366920938463463370734691749234709, 340282366920938463463370734691749234713)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463370734691749234709n);
+ input.add256(340282366920938463463370734691749234713n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.min_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(340282366920938463463370734691749234709n);
+ });
+
+ it('test operator "min" overload (euint128, euint256) => euint256 test 3 (340282366920938463463370734691749234713, 340282366920938463463370734691749234713)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463370734691749234713n);
+ input.add256(340282366920938463463370734691749234713n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.min_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(340282366920938463463370734691749234713n);
+ });
+
+ it('test operator "min" overload (euint128, euint256) => euint256 test 4 (340282366920938463463370734691749234713, 340282366920938463463370734691749234709)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463370734691749234713n);
+ input.add256(340282366920938463463370734691749234709n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.min_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(340282366920938463463370734691749234709n);
+ });
+
+ it('test operator "max" overload (euint128, euint256) => euint256 test 1 (340282366920938463463373789765297113341, 115792089237316195423570985008687907853269984665640564039457579894549860743867)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463373789765297113341n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579894549860743867n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.max_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579894549860743867n);
+ });
+
+ it('test operator "max" overload (euint128, euint256) => euint256 test 2 (340282366920938463463373789765297113337, 340282366920938463463373789765297113341)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463373789765297113337n);
+ input.add256(340282366920938463463373789765297113341n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.max_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(340282366920938463463373789765297113341n);
+ });
+
+ it('test operator "max" overload (euint128, euint256) => euint256 test 3 (340282366920938463463373789765297113341, 340282366920938463463373789765297113341)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463373789765297113341n);
+ input.add256(340282366920938463463373789765297113341n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.max_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(340282366920938463463373789765297113341n);
+ });
+
+ it('test operator "max" overload (euint128, euint256) => euint256 test 4 (340282366920938463463373789765297113341, 340282366920938463463373789765297113337)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463373789765297113341n);
+ input.add256(340282366920938463463373789765297113337n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.max_euint128_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(340282366920938463463373789765297113341n);
+ });
+
+ it('test operator "add" overload (euint128, uint128) => euint128 test 1 (170141183460469231731685489259224150459, 170141183460469231731685023392215721043)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(170141183460469231731685489259224150459n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.add_euint128_uint128(
+ encryptedAmount.handles[0],
+ 170141183460469231731685023392215721043n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463370512651439871502n);
+ });
+
+ it('test operator "add" overload (euint128, uint128) => euint128 test 2 (170141183460469231731685489259224150457, 170141183460469231731685489259224150459)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(170141183460469231731685489259224150457n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.add_euint128_uint128(
+ encryptedAmount.handles[0],
+ 170141183460469231731685489259224150459n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463370978518448300916n);
+ });
+
+ it('test operator "add" overload (euint128, uint128) => euint128 test 3 (170141183460469231731685489259224150459, 170141183460469231731685489259224150459)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(170141183460469231731685489259224150459n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.add_euint128_uint128(
+ encryptedAmount.handles[0],
+ 170141183460469231731685489259224150459n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463370978518448300918n);
+ });
+
+ it('test operator "add" overload (euint128, uint128) => euint128 test 4 (170141183460469231731685489259224150459, 170141183460469231731685489259224150457)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(170141183460469231731685489259224150459n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.add_euint128_uint128(
+ encryptedAmount.handles[0],
+ 170141183460469231731685489259224150457n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463370978518448300916n);
+ });
+
+ it('test operator "add" overload (uint128, euint128) => euint128 test 1 (170141183460469231731685837916615726593, 170141183460469231731685023392215721043)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(170141183460469231731685023392215721043n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.add_uint128_euint128(
+ 170141183460469231731685837916615726593n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463370861308831447636n);
+ });
+
+ it('test operator "add" overload (uint128, euint128) => euint128 test 2 (170141183460469231731685489259224150457, 170141183460469231731685489259224150459)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(170141183460469231731685489259224150459n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.add_uint128_euint128(
+ 170141183460469231731685489259224150457n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463370978518448300916n);
+ });
+
+ it('test operator "add" overload (uint128, euint128) => euint128 test 3 (170141183460469231731685489259224150459, 170141183460469231731685489259224150459)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(170141183460469231731685489259224150459n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.add_uint128_euint128(
+ 170141183460469231731685489259224150459n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463370978518448300918n);
+ });
+
+ it('test operator "add" overload (uint128, euint128) => euint128 test 4 (170141183460469231731685489259224150459, 170141183460469231731685489259224150457)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(170141183460469231731685489259224150457n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.add_uint128_euint128(
+ 170141183460469231731685489259224150459n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463370978518448300916n);
+ });
+
+ it('test operator "sub" overload (euint128, uint128) => euint128 test 1 (340282366920938463463366688248127833841, 340282366920938463463366688248127833841)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463366688248127833841n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.sub_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463366688248127833841n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint128, uint128) => euint128 test 2 (340282366920938463463366688248127833841, 340282366920938463463366688248127833837)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463366688248127833841n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.sub_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463366688248127833837n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "sub" overload (uint128, euint128) => euint128 test 1 (340282366920938463463366688248127833841, 340282366920938463463366688248127833841)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463366688248127833841n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.sub_uint128_euint128(
+ 340282366920938463463366688248127833841n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (uint128, euint128) => euint128 test 2 (340282366920938463463366688248127833841, 340282366920938463463366688248127833837)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463366688248127833837n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.sub_uint128_euint128(
+ 340282366920938463463366688248127833841n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint128, uint128) => euint128 test 1 (9223372036854775809, 9223372036854775809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(9223372036854775809n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.mul_euint128_uint128(
+ encryptedAmount.handles[0],
+ 9223372036854775809n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(85070591730234615884290395931651604481n);
+ });
+
+ it('test operator "mul" overload (euint128, uint128) => euint128 test 2 (9223372036854775809, 9223372036854775809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(9223372036854775809n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.mul_euint128_uint128(
+ encryptedAmount.handles[0],
+ 9223372036854775809n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(85070591730234615884290395931651604481n);
+ });
+
+ it('test operator "mul" overload (euint128, uint128) => euint128 test 3 (9223372036854775809, 9223372036854775809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(9223372036854775809n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.mul_euint128_uint128(
+ encryptedAmount.handles[0],
+ 9223372036854775809n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(85070591730234615884290395931651604481n);
+ });
+
+ it('test operator "mul" overload (euint128, uint128) => euint128 test 4 (9223372036854775809, 9223372036854775809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(9223372036854775809n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.mul_euint128_uint128(
+ encryptedAmount.handles[0],
+ 9223372036854775809n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(85070591730234615884290395931651604481n);
+ });
+
+ it('test operator "mul" overload (uint128, euint128) => euint128 test 1 (9223372036854775809, 9223372036854775809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(9223372036854775809n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.mul_uint128_euint128(
+ 9223372036854775809n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(85070591730234615884290395931651604481n);
+ });
+
+ it('test operator "mul" overload (uint128, euint128) => euint128 test 2 (9223372036854775809, 9223372036854775809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(9223372036854775809n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.mul_uint128_euint128(
+ 9223372036854775809n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(85070591730234615884290395931651604481n);
+ });
+
+ it('test operator "mul" overload (uint128, euint128) => euint128 test 3 (9223372036854775809, 9223372036854775809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(9223372036854775809n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.mul_uint128_euint128(
+ 9223372036854775809n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(85070591730234615884290395931651604481n);
+ });
+
+ it('test operator "mul" overload (uint128, euint128) => euint128 test 4 (9223372036854775809, 9223372036854775809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(9223372036854775809n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.mul_uint128_euint128(
+ 9223372036854775809n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(85070591730234615884290395931651604481n);
+ });
+
+ it('test operator "div" overload (euint128, uint128) => euint128 test 1 (340282366920938463463372619792959880891, 340282366920938463463368477899733272407)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463372619792959880891n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.div_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463368477899733272407n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(1n);
+ });
+
+ it('test operator "div" overload (euint128, uint128) => euint128 test 2 (340282366920938463463372619792959880887, 340282366920938463463372619792959880891)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463372619792959880887n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.div_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463372619792959880891n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "div" overload (euint128, uint128) => euint128 test 3 (340282366920938463463372619792959880891, 340282366920938463463372619792959880891)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463372619792959880891n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.div_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463372619792959880891n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(1n);
+ });
+
+ it('test operator "div" overload (euint128, uint128) => euint128 test 4 (340282366920938463463372619792959880891, 340282366920938463463372619792959880887)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463372619792959880891n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.div_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463372619792959880887n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(1n);
+ });
+
+ it('test operator "rem" overload (euint128, uint128) => euint128 test 1 (340282366920938463463367984231624733459, 340282366920938463463368025855706253793)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367984231624733459n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.rem_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463368025855706253793n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463367984231624733459n);
+ });
+
+ it('test operator "rem" overload (euint128, uint128) => euint128 test 2 (340282366920938463463367984231624733455, 340282366920938463463367984231624733459)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367984231624733455n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.rem_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463367984231624733459n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463367984231624733455n);
+ });
+
+ it('test operator "rem" overload (euint128, uint128) => euint128 test 3 (340282366920938463463367984231624733459, 340282366920938463463367984231624733459)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367984231624733459n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.rem_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463367984231624733459n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "rem" overload (euint128, uint128) => euint128 test 4 (340282366920938463463367984231624733459, 340282366920938463463367984231624733455)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367984231624733459n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.rem_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463367984231624733455n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "and" overload (euint128, uint128) => euint128 test 1 (340282366920938463463365754576278416105, 340282366920938463463366410191459861233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463365754576278416105n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.and_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463366410191459861233n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463365741001161851617n);
+ });
+
+ it('test operator "and" overload (euint128, uint128) => euint128 test 2 (340282366920938463463365754576278416101, 340282366920938463463365754576278416105)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463365754576278416101n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.and_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463365754576278416105n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463365754576278416097n);
+ });
+
+ it('test operator "and" overload (euint128, uint128) => euint128 test 3 (340282366920938463463365754576278416105, 340282366920938463463365754576278416105)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463365754576278416105n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.and_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463365754576278416105n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463365754576278416105n);
+ });
+
+ it('test operator "and" overload (euint128, uint128) => euint128 test 4 (340282366920938463463365754576278416105, 340282366920938463463365754576278416101)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463365754576278416105n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.and_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463365754576278416101n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463365754576278416097n);
+ });
+
+ it('test operator "and" overload (uint128, euint128) => euint128 test 1 (340282366920938463463371836375477224759, 340282366920938463463366410191459861233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463366410191459861233n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.and_uint128_euint128(
+ 340282366920938463463371836375477224759n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463366199075542663217n);
+ });
+
+ it('test operator "and" overload (uint128, euint128) => euint128 test 2 (340282366920938463463365754576278416101, 340282366920938463463365754576278416105)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463365754576278416105n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.and_uint128_euint128(
+ 340282366920938463463365754576278416101n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463365754576278416097n);
+ });
+
+ it('test operator "and" overload (uint128, euint128) => euint128 test 3 (340282366920938463463365754576278416105, 340282366920938463463365754576278416105)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463365754576278416105n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.and_uint128_euint128(
+ 340282366920938463463365754576278416105n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463365754576278416105n);
+ });
+
+ it('test operator "and" overload (uint128, euint128) => euint128 test 4 (340282366920938463463365754576278416105, 340282366920938463463365754576278416101)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463365754576278416101n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.and_uint128_euint128(
+ 340282366920938463463365754576278416105n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463365754576278416097n);
+ });
+
+ it('test operator "or" overload (euint128, uint128) => euint128 test 1 (340282366920938463463367655063545859643, 340282366920938463463373853783183776929)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367655063545859643n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.or_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463373853783183776929n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463374430271410986683n);
+ });
+
+ it('test operator "or" overload (euint128, uint128) => euint128 test 2 (340282366920938463463367655063545859639, 340282366920938463463367655063545859643)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367655063545859639n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.or_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463367655063545859643n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463367655063545859647n);
+ });
+
+ it('test operator "or" overload (euint128, uint128) => euint128 test 3 (340282366920938463463367655063545859643, 340282366920938463463367655063545859643)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367655063545859643n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.or_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463367655063545859643n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463367655063545859643n);
+ });
+
+ it('test operator "or" overload (euint128, uint128) => euint128 test 4 (340282366920938463463367655063545859643, 340282366920938463463367655063545859639)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367655063545859643n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.or_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463367655063545859639n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463367655063545859647n);
+ });
+
+ it('test operator "or" overload (uint128, euint128) => euint128 test 1 (340282366920938463463370547981929977503, 340282366920938463463373853783183776929)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463373853783183776929n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.or_uint128_euint128(
+ 340282366920938463463370547981929977503n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463373996101960916671n);
+ });
+
+ it('test operator "or" overload (uint128, euint128) => euint128 test 2 (340282366920938463463367655063545859639, 340282366920938463463367655063545859643)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463367655063545859643n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.or_uint128_euint128(
+ 340282366920938463463367655063545859639n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463367655063545859647n);
+ });
+
+ it('test operator "or" overload (uint128, euint128) => euint128 test 3 (340282366920938463463367655063545859643, 340282366920938463463367655063545859643)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463367655063545859643n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.or_uint128_euint128(
+ 340282366920938463463367655063545859643n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463367655063545859643n);
+ });
+
+ it('test operator "or" overload (uint128, euint128) => euint128 test 4 (340282366920938463463367655063545859643, 340282366920938463463367655063545859639)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463367655063545859639n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.or_uint128_euint128(
+ 340282366920938463463367655063545859643n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463367655063545859647n);
+ });
+
+ it('test operator "xor" overload (euint128, uint128) => euint128 test 1 (340282366920938463463372080691181989981, 340282366920938463463368386031692563719)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463372080691181989981n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.xor_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463368386031692563719n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(8690927368893786n);
+ });
+
+ it('test operator "xor" overload (euint128, uint128) => euint128 test 2 (340282366920938463463368941059346865325, 340282366920938463463368941059346865329)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463368941059346865325n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.xor_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463368941059346865329n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(28n);
+ });
+
+ it('test operator "xor" overload (euint128, uint128) => euint128 test 3 (340282366920938463463368941059346865329, 340282366920938463463368941059346865329)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463368941059346865329n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.xor_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463368941059346865329n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint128, uint128) => euint128 test 4 (340282366920938463463368941059346865329, 340282366920938463463368941059346865325)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463368941059346865329n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.xor_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463368941059346865325n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(28n);
+ });
+
+ it('test operator "xor" overload (uint128, euint128) => euint128 test 1 (340282366920938463463374269120313762865, 340282366920938463463368386031692563719)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463368386031692563719n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.xor_uint128_euint128(
+ 340282366920938463463374269120313762865n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(6519991538245942n);
+ });
+
+ it('test operator "xor" overload (uint128, euint128) => euint128 test 2 (340282366920938463463368941059346865325, 340282366920938463463368941059346865329)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463368941059346865329n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.xor_uint128_euint128(
+ 340282366920938463463368941059346865325n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(28n);
+ });
+
+ it('test operator "xor" overload (uint128, euint128) => euint128 test 3 (340282366920938463463368941059346865329, 340282366920938463463368941059346865329)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463368941059346865329n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.xor_uint128_euint128(
+ 340282366920938463463368941059346865329n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (uint128, euint128) => euint128 test 4 (340282366920938463463368941059346865329, 340282366920938463463368941059346865325)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463368941059346865325n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.xor_uint128_euint128(
+ 340282366920938463463368941059346865329n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(28n);
+ });
+
+ it('test operator "eq" overload (euint128, uint128) => ebool test 1 (340282366920938463463371368021216956093, 340282366920938463463373345909663104587)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463371368021216956093n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.eq_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463373345909663104587n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint128, uint128) => ebool test 2 (340282366920938463463370243874611927701, 340282366920938463463370243874611927705)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463370243874611927701n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.eq_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463370243874611927705n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint128, uint128) => ebool test 3 (340282366920938463463370243874611927705, 340282366920938463463370243874611927705)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463370243874611927705n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.eq_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463370243874611927705n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint128, uint128) => ebool test 4 (340282366920938463463370243874611927705, 340282366920938463463370243874611927701)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463370243874611927705n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.eq_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463370243874611927701n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (uint128, euint128) => ebool test 1 (340282366920938463463369712474902223435, 340282366920938463463373345909663104587)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463373345909663104587n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.eq_uint128_euint128(
+ 340282366920938463463369712474902223435n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (uint128, euint128) => ebool test 2 (340282366920938463463370243874611927701, 340282366920938463463370243874611927705)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463370243874611927705n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.eq_uint128_euint128(
+ 340282366920938463463370243874611927701n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (uint128, euint128) => ebool test 3 (340282366920938463463370243874611927705, 340282366920938463463370243874611927705)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463370243874611927705n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.eq_uint128_euint128(
+ 340282366920938463463370243874611927705n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (uint128, euint128) => ebool test 4 (340282366920938463463370243874611927705, 340282366920938463463370243874611927701)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463370243874611927701n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.eq_uint128_euint128(
+ 340282366920938463463370243874611927705n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint128, uint128) => ebool test 1 (340282366920938463463366690564024700303, 340282366920938463463373212539976330723)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463366690564024700303n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ne_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463373212539976330723n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint128, uint128) => ebool test 2 (340282366920938463463366105643215363061, 340282366920938463463366105643215363065)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463366105643215363061n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ne_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463366105643215363065n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint128, uint128) => ebool test 3 (340282366920938463463366105643215363065, 340282366920938463463366105643215363065)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463366105643215363065n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ne_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463366105643215363065n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint128, uint128) => ebool test 4 (340282366920938463463366105643215363065, 340282366920938463463366105643215363061)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463366105643215363065n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ne_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463366105643215363061n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (uint128, euint128) => ebool test 1 (340282366920938463463372802578174510491, 340282366920938463463373212539976330723)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463373212539976330723n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ne_uint128_euint128(
+ 340282366920938463463372802578174510491n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (uint128, euint128) => ebool test 2 (340282366920938463463366105643215363061, 340282366920938463463366105643215363065)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463366105643215363065n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ne_uint128_euint128(
+ 340282366920938463463366105643215363061n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (uint128, euint128) => ebool test 3 (340282366920938463463366105643215363065, 340282366920938463463366105643215363065)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463366105643215363065n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ne_uint128_euint128(
+ 340282366920938463463366105643215363065n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (uint128, euint128) => ebool test 4 (340282366920938463463366105643215363065, 340282366920938463463366105643215363061)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463366105643215363061n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ne_uint128_euint128(
+ 340282366920938463463366105643215363065n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint128, uint128) => ebool test 1 (340282366920938463463369991167430665173, 340282366920938463463370096368753149585)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463369991167430665173n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ge_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463370096368753149585n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint128, uint128) => ebool test 2 (340282366920938463463367243418798341495, 340282366920938463463367243418798341499)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367243418798341495n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ge_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463367243418798341499n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint128, uint128) => ebool test 3 (340282366920938463463367243418798341499, 340282366920938463463367243418798341499)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367243418798341499n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ge_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463367243418798341499n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint128, uint128) => ebool test 4 (340282366920938463463367243418798341499, 340282366920938463463367243418798341495)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367243418798341499n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ge_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463367243418798341495n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (uint128, euint128) => ebool test 1 (340282366920938463463370285053807900009, 340282366920938463463370096368753149585)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463370096368753149585n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ge_uint128_euint128(
+ 340282366920938463463370285053807900009n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (uint128, euint128) => ebool test 2 (340282366920938463463367243418798341495, 340282366920938463463367243418798341499)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463367243418798341499n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ge_uint128_euint128(
+ 340282366920938463463367243418798341495n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (uint128, euint128) => ebool test 3 (340282366920938463463367243418798341499, 340282366920938463463367243418798341499)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463367243418798341499n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ge_uint128_euint128(
+ 340282366920938463463367243418798341499n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (uint128, euint128) => ebool test 4 (340282366920938463463367243418798341499, 340282366920938463463367243418798341495)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463367243418798341495n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ge_uint128_euint128(
+ 340282366920938463463367243418798341499n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint128, uint128) => ebool test 1 (340282366920938463463367714696589499231, 340282366920938463463369886774124197135)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367714696589499231n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.gt_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463369886774124197135n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint128, uint128) => ebool test 2 (340282366920938463463367714696589499227, 340282366920938463463367714696589499231)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367714696589499227n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.gt_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463367714696589499231n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint128, uint128) => ebool test 3 (340282366920938463463367714696589499231, 340282366920938463463367714696589499231)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367714696589499231n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.gt_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463367714696589499231n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint128, uint128) => ebool test 4 (340282366920938463463367714696589499231, 340282366920938463463367714696589499227)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367714696589499231n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.gt_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463367714696589499227n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (uint128, euint128) => ebool test 1 (340282366920938463463371365285946007453, 340282366920938463463369886774124197135)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463369886774124197135n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.gt_uint128_euint128(
+ 340282366920938463463371365285946007453n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (uint128, euint128) => ebool test 2 (340282366920938463463367714696589499227, 340282366920938463463367714696589499231)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463367714696589499231n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.gt_uint128_euint128(
+ 340282366920938463463367714696589499227n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (uint128, euint128) => ebool test 3 (340282366920938463463367714696589499231, 340282366920938463463367714696589499231)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463367714696589499231n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.gt_uint128_euint128(
+ 340282366920938463463367714696589499231n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (uint128, euint128) => ebool test 4 (340282366920938463463367714696589499231, 340282366920938463463367714696589499227)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463367714696589499227n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.gt_uint128_euint128(
+ 340282366920938463463367714696589499231n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint128, uint128) => ebool test 1 (340282366920938463463373992528465349581, 340282366920938463463373835012809081201)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463373992528465349581n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.le_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463373835012809081201n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "le" overload (euint128, uint128) => ebool test 2 (340282366920938463463372840104721436795, 340282366920938463463372840104721436799)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463372840104721436795n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.le_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463372840104721436799n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint128, uint128) => ebool test 3 (340282366920938463463372840104721436799, 340282366920938463463372840104721436799)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463372840104721436799n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.le_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463372840104721436799n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint128, uint128) => ebool test 4 (340282366920938463463372840104721436799, 340282366920938463463372840104721436795)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463372840104721436799n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.le_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463372840104721436795n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "le" overload (uint128, euint128) => ebool test 1 (340282366920938463463374153561991926979, 340282366920938463463373835012809081201)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463373835012809081201n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.le_uint128_euint128(
+ 340282366920938463463374153561991926979n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "le" overload (uint128, euint128) => ebool test 2 (340282366920938463463372840104721436795, 340282366920938463463372840104721436799)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463372840104721436799n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.le_uint128_euint128(
+ 340282366920938463463372840104721436795n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (uint128, euint128) => ebool test 3 (340282366920938463463372840104721436799, 340282366920938463463372840104721436799)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463372840104721436799n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.le_uint128_euint128(
+ 340282366920938463463372840104721436799n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (uint128, euint128) => ebool test 4 (340282366920938463463372840104721436799, 340282366920938463463372840104721436795)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463372840104721436795n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.le_uint128_euint128(
+ 340282366920938463463372840104721436799n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint128, uint128) => ebool test 1 (340282366920938463463368309276517872429, 340282366920938463463366305725915183957)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463368309276517872429n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.lt_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463366305725915183957n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint128, uint128) => ebool test 2 (340282366920938463463368309276517872425, 340282366920938463463368309276517872429)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463368309276517872425n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.lt_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463368309276517872429n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint128, uint128) => ebool test 3 (340282366920938463463368309276517872429, 340282366920938463463368309276517872429)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463368309276517872429n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.lt_euint128_uint128(
+ encryptedAmount.handles[0],
+ 340282366920938463463368309276517872429n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint128, uint128) => ebool test 4 (340282366920938463463368309276517872429, 340282366920938463463368309276517872425)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463368309276517872429n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.and_euint64_euint8(
+ const tx = await this.contract9.lt_euint128_uint128(
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
+ 340282366920938463463368309276517872425n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(32n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "and" overload (euint64, euint8) => euint64 test 3 (40, 40)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(40n);
- input.add8(40n);
+ it('test operator "lt" overload (uint128, euint128) => ebool test 1 (340282366920938463463371881592186712743, 340282366920938463463366305725915183957)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463366305725915183957n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.and_euint64_euint8(
+ const tx = await this.contract9.lt_uint128_euint128(
+ 340282366920938463463371881592186712743n,
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(40n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "and" overload (euint64, euint8) => euint64 test 4 (40, 36)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(40n);
- input.add8(36n);
+ it('test operator "lt" overload (uint128, euint128) => ebool test 2 (340282366920938463463368309276517872425, 340282366920938463463368309276517872429)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463368309276517872429n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.and_euint64_euint8(
+ const tx = await this.contract9.lt_uint128_euint128(
+ 340282366920938463463368309276517872425n,
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(32n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "or" overload (euint64, euint8) => euint64 test 1 (18442062213086556497, 168)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(18442062213086556497n);
- input.add8(168n);
+ it('test operator "lt" overload (uint128, euint128) => ebool test 3 (340282366920938463463368309276517872429, 340282366920938463463368309276517872429)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463368309276517872429n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint64_euint8(
+ const tx = await this.contract9.lt_uint128_euint128(
+ 340282366920938463463368309276517872429n,
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(18442062213086556665n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "or" overload (euint64, euint8) => euint64 test 2 (164, 168)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(164n);
- input.add8(168n);
+ it('test operator "lt" overload (uint128, euint128) => ebool test 4 (340282366920938463463368309276517872429, 340282366920938463463368309276517872425)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463368309276517872425n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint64_euint8(
+ const tx = await this.contract9.lt_uint128_euint128(
+ 340282366920938463463368309276517872429n,
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(172n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "or" overload (euint64, euint8) => euint64 test 3 (168, 168)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(168n);
- input.add8(168n);
+ it('test operator "min" overload (euint128, uint128) => euint128 test 1 (340282366920938463463369507025632955721, 340282366920938463463369479362880511843)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463369507025632955721n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint64_euint8(
+ const tx = await this.contract9.min_euint128_uint128(
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
+ 340282366920938463463369479362880511843n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(168n);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463369479362880511843n);
});
- it('test operator "or" overload (euint64, euint8) => euint64 test 4 (168, 164)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(168n);
- input.add8(164n);
+ it('test operator "min" overload (euint128, uint128) => euint128 test 2 (340282366920938463463369507025632955717, 340282366920938463463369507025632955721)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463369507025632955717n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint64_euint8(
+ const tx = await this.contract9.min_euint128_uint128(
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
+ 340282366920938463463369507025632955721n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(172n);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463369507025632955717n);
});
- it('test operator "xor" overload (euint64, euint8) => euint64 test 1 (18443626965217997733, 213)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(18443626965217997733n);
- input.add8(213n);
+ it('test operator "min" overload (euint128, uint128) => euint128 test 3 (340282366920938463463369507025632955721, 340282366920938463463369507025632955721)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463369507025632955721n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint64_euint8(
+ const tx = await this.contract9.min_euint128_uint128(
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
+ 340282366920938463463369507025632955721n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(18443626965217997680n);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463369507025632955721n);
});
- it('test operator "xor" overload (euint64, euint8) => euint64 test 2 (209, 213)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(209n);
- input.add8(213n);
+ it('test operator "min" overload (euint128, uint128) => euint128 test 4 (340282366920938463463369507025632955721, 340282366920938463463369507025632955717)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463369507025632955721n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint64_euint8(
+ const tx = await this.contract9.min_euint128_uint128(
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
+ 340282366920938463463369507025632955717n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(4n);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463369507025632955717n);
});
- it('test operator "xor" overload (euint64, euint8) => euint64 test 3 (213, 213)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(213n);
- input.add8(213n);
+ it('test operator "min" overload (uint128, euint128) => euint128 test 1 (340282366920938463463367460119738968177, 340282366920938463463369479362880511843)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463369479362880511843n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint64_euint8(
+ const tx = await this.contract9.min_uint128_euint128(
+ 340282366920938463463367460119738968177n,
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(0n);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463367460119738968177n);
});
- it('test operator "xor" overload (euint64, euint8) => euint64 test 4 (213, 209)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(213n);
- input.add8(209n);
+ it('test operator "min" overload (uint128, euint128) => euint128 test 2 (340282366920938463463369507025632955717, 340282366920938463463369507025632955721)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463369507025632955721n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint64_euint8(
+ const tx = await this.contract9.min_uint128_euint128(
+ 340282366920938463463369507025632955717n,
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(4n);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463369507025632955717n);
});
- it('test operator "eq" overload (euint64, euint8) => ebool test 1 (18446185668440461367, 98)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(18446185668440461367n);
- input.add8(98n);
+ it('test operator "min" overload (uint128, euint128) => euint128 test 3 (340282366920938463463369507025632955721, 340282366920938463463369507025632955721)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463369507025632955721n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint64_euint8(
+ const tx = await this.contract9.min_uint128_euint128(
+ 340282366920938463463369507025632955721n,
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463369507025632955721n);
});
- it('test operator "eq" overload (euint64, euint8) => ebool test 2 (94, 98)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(94n);
- input.add8(98n);
+ it('test operator "min" overload (uint128, euint128) => euint128 test 4 (340282366920938463463369507025632955721, 340282366920938463463369507025632955717)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463369507025632955717n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint64_euint8(
+ const tx = await this.contract9.min_uint128_euint128(
+ 340282366920938463463369507025632955721n,
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463369507025632955717n);
});
- it('test operator "eq" overload (euint64, euint8) => ebool test 3 (98, 98)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(98n);
- input.add8(98n);
+ it('test operator "max" overload (euint128, uint128) => euint128 test 1 (340282366920938463463374311959896511759, 340282366920938463463371397781663603615)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463374311959896511759n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint64_euint8(
+ const tx = await this.contract9.max_euint128_uint128(
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
+ 340282366920938463463371397781663603615n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463374311959896511759n);
});
- it('test operator "eq" overload (euint64, euint8) => ebool test 4 (98, 94)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(98n);
- input.add8(94n);
+ it('test operator "max" overload (euint128, uint128) => euint128 test 2 (340282366920938463463367499312160836027, 340282366920938463463367499312160836031)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367499312160836027n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint64_euint8(
+ const tx = await this.contract9.max_euint128_uint128(
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
+ 340282366920938463463367499312160836031n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463367499312160836031n);
});
- it('test operator "ne" overload (euint64, euint8) => ebool test 1 (18445474251392791649, 41)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(18445474251392791649n);
- input.add8(41n);
+ it('test operator "max" overload (euint128, uint128) => euint128 test 3 (340282366920938463463367499312160836031, 340282366920938463463367499312160836031)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367499312160836031n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint64_euint8(
+ const tx = await this.contract9.max_euint128_uint128(
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
+ 340282366920938463463367499312160836031n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463367499312160836031n);
});
- it('test operator "ne" overload (euint64, euint8) => ebool test 2 (37, 41)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(37n);
- input.add8(41n);
+ it('test operator "max" overload (euint128, uint128) => euint128 test 4 (340282366920938463463367499312160836031, 340282366920938463463367499312160836027)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add128(340282366920938463463367499312160836031n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint64_euint8(
+ const tx = await this.contract9.max_euint128_uint128(
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
+ 340282366920938463463367499312160836027n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463367499312160836031n);
});
- it('test operator "ne" overload (euint64, euint8) => ebool test 3 (41, 41)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(41n);
- input.add8(41n);
+ it('test operator "max" overload (uint128, euint128) => euint128 test 1 (340282366920938463463370589299931927619, 340282366920938463463371397781663603615)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463371397781663603615n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint64_euint8(
+ const tx = await this.contract9.max_uint128_euint128(
+ 340282366920938463463370589299931927619n,
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463371397781663603615n);
});
- it('test operator "ne" overload (euint64, euint8) => ebool test 4 (41, 37)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(41n);
- input.add8(37n);
+ it('test operator "max" overload (uint128, euint128) => euint128 test 2 (340282366920938463463367499312160836027, 340282366920938463463367499312160836031)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463367499312160836031n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint64_euint8(
+ const tx = await this.contract9.max_uint128_euint128(
+ 340282366920938463463367499312160836027n,
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463367499312160836031n);
});
- it('test operator "ge" overload (euint64, euint8) => ebool test 1 (18444294270645254277, 229)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(18444294270645254277n);
- input.add8(229n);
+ it('test operator "max" overload (uint128, euint128) => euint128 test 3 (340282366920938463463367499312160836031, 340282366920938463463367499312160836031)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463367499312160836031n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint64_euint8(
+ const tx = await this.contract9.max_uint128_euint128(
+ 340282366920938463463367499312160836031n,
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463367499312160836031n);
});
- it('test operator "ge" overload (euint64, euint8) => ebool test 2 (225, 229)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(225n);
- input.add8(229n);
+ it('test operator "max" overload (uint128, euint128) => euint128 test 4 (340282366920938463463367499312160836031, 340282366920938463463367499312160836027)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+
+ input.add128(340282366920938463463367499312160836027n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint64_euint8(
+ const tx = await this.contract9.max_uint128_euint128(
+ 340282366920938463463367499312160836031n,
encryptedAmount.handles[0],
- encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract9.res128());
+ expect(res).to.equal(340282366920938463463367499312160836031n);
});
- it('test operator "ge" overload (euint64, euint8) => ebool test 3 (229, 229)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(229n);
- input.add8(229n);
+ it('test operator "add" overload (euint256, euint4) => euint256 test 1 (9, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(9n);
+ input.add4(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint64_euint8(
+ const tx = await this.contract9.add_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(11n);
});
- it('test operator "ge" overload (euint64, euint8) => ebool test 4 (229, 225)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(229n);
- input.add8(225n);
+ it('test operator "add" overload (euint256, euint4) => euint256 test 2 (6, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(6n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint64_euint8(
+ const tx = await this.contract9.add_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(14n);
});
- it('test operator "gt" overload (euint64, euint8) => ebool test 1 (18446048537684194985, 113)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(18446048537684194985n);
- input.add8(113n);
+ it('test operator "add" overload (euint256, euint4) => euint256 test 3 (5, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(5n);
+ input.add4(5n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint64_euint8(
+ const tx = await this.contract9.add_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(10n);
});
- it('test operator "gt" overload (euint64, euint8) => ebool test 2 (109, 113)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(109n);
- input.add8(113n);
+ it('test operator "add" overload (euint256, euint4) => euint256 test 4 (8, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(8n);
+ input.add4(6n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint64_euint8(
+ const tx = await this.contract9.add_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(14n);
});
- it('test operator "gt" overload (euint64, euint8) => ebool test 3 (113, 113)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(113n);
- input.add8(113n);
+ it('test operator "sub" overload (euint256, euint4) => euint256 test 1 (11, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(11n);
+ input.add4(11n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint64_euint8(
+ const tx = await this.contract9.sub_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(0n);
});
- it('test operator "gt" overload (euint64, euint8) => ebool test 4 (113, 109)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(113n);
- input.add8(109n);
+ it('test operator "sub" overload (euint256, euint4) => euint256 test 2 (11, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(11n);
+ input.add4(7n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint64_euint8(
+ const tx = await this.contract9.sub_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(4n);
});
- it('test operator "le" overload (euint64, euint8) => ebool test 1 (18443934013808426023, 129)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18443934013808426023n);
- input.add8(129n);
+ it('test operator "mul" overload (euint256, euint4) => euint256 test 1 (5, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(5n);
+ input.add4(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_euint64_euint8(
+ const tx = await this.contract9.mul_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(10n);
});
- it('test operator "le" overload (euint64, euint8) => ebool test 2 (125, 129)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(125n);
- input.add8(129n);
+ it('test operator "mul" overload (euint256, euint4) => euint256 test 2 (3, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(3n);
+ input.add4(5n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_euint64_euint8(
+ const tx = await this.contract9.mul_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(15n);
});
- it('test operator "le" overload (euint64, euint8) => ebool test 3 (129, 129)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(129n);
- input.add8(129n);
+ it('test operator "mul" overload (euint256, euint4) => euint256 test 3 (3, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(3n);
+ input.add4(3n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_euint64_euint8(
+ const tx = await this.contract9.mul_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(9n);
});
- it('test operator "le" overload (euint64, euint8) => ebool test 4 (129, 125)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(129n);
- input.add8(125n);
+ it('test operator "mul" overload (euint256, euint4) => euint256 test 4 (5, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(5n);
+ input.add4(3n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_euint64_euint8(
+ const tx = await this.contract9.mul_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(15n);
});
- it('test operator "lt" overload (euint64, euint8) => ebool test 1 (18444118039600142421, 79)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18444118039600142421n);
- input.add8(79n);
+ it('test operator "and" overload (euint256, euint4) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579364828919798977, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579364828919798977n);
+ input.add4(5n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_euint64_euint8(
+ const tx = await this.contract9.and_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(1n);
});
- it('test operator "lt" overload (euint64, euint8) => ebool test 2 (75, 79)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(75n);
- input.add8(79n);
+ it('test operator "and" overload (euint256, euint4) => euint256 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(4n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_euint64_euint8(
+ const tx = await this.contract9.and_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(0n);
});
- it('test operator "lt" overload (euint64, euint8) => ebool test 3 (79, 79)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(79n);
- input.add8(79n);
+ it('test operator "and" overload (euint256, euint4) => euint256 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(8n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_euint64_euint8(
+ const tx = await this.contract9.and_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(8n);
});
- it('test operator "lt" overload (euint64, euint8) => ebool test 4 (79, 75)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(79n);
- input.add8(75n);
+ it('test operator "and" overload (euint256, euint4) => euint256 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(8n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_euint64_euint8(
+ const tx = await this.contract9.and_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(0n);
});
- it('test operator "min" overload (euint64, euint8) => euint64 test 1 (18440761228336909285, 170)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18440761228336909285n);
- input.add8(170n);
+ it('test operator "or" overload (euint256, euint4) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579810763114124559, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579810763114124559n);
+ input.add4(14n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_euint64_euint8(
+ const tx = await this.contract9.or_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(170n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579810763114124559n);
});
- it('test operator "min" overload (euint64, euint8) => euint64 test 2 (166, 170)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(166n);
- input.add8(170n);
+ it('test operator "or" overload (euint256, euint4) => euint256 test 2 (10, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(10n);
+ input.add4(14n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_euint64_euint8(
+ const tx = await this.contract9.or_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(166n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(14n);
});
- it('test operator "min" overload (euint64, euint8) => euint64 test 3 (170, 170)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(170n);
- input.add8(170n);
+ it('test operator "or" overload (euint256, euint4) => euint256 test 3 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(14n);
+ input.add4(14n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_euint64_euint8(
+ const tx = await this.contract9.or_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(170n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(14n);
});
- it('test operator "min" overload (euint64, euint8) => euint64 test 4 (170, 166)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(170n);
- input.add8(166n);
+ it('test operator "or" overload (euint256, euint4) => euint256 test 4 (14, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(14n);
+ input.add4(10n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_euint64_euint8(
+ const tx = await this.contract9.or_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(166n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(14n);
});
- it('test operator "max" overload (euint64, euint8) => euint64 test 1 (18446007384031513667, 44)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18446007384031513667n);
- input.add8(44n);
+ it('test operator "xor" overload (euint256, euint4) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582453903191902895, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582453903191902895n);
+ input.add4(12n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_euint64_euint8(
+ const tx = await this.contract9.xor_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18446007384031513667n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457582453903191902883n);
});
- it('test operator "max" overload (euint64, euint8) => euint64 test 2 (40, 44)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(40n);
- input.add8(44n);
+ it('test operator "xor" overload (euint256, euint4) => euint256 test 2 (8, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(8n);
+ input.add4(12n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_euint64_euint8(
+ const tx = await this.contract9.xor_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(44n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(4n);
});
- it('test operator "max" overload (euint64, euint8) => euint64 test 3 (44, 44)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(44n);
- input.add8(44n);
+ it('test operator "xor" overload (euint256, euint4) => euint256 test 3 (12, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(12n);
+ input.add4(12n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_euint64_euint8(
+ const tx = await this.contract9.xor_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(44n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(0n);
});
- it('test operator "max" overload (euint64, euint8) => euint64 test 4 (44, 40)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(44n);
- input.add8(40n);
+ it('test operator "xor" overload (euint256, euint4) => euint256 test 4 (12, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(12n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_euint64_euint8(
+ const tx = await this.contract9.xor_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(44n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(4n);
});
- it('test operator "add" overload (euint64, euint16) => euint64 test 1 (65527, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(65527n);
- input.add16(2n);
+ it('test operator "eq" overload (euint256, euint4) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457581942293222963611, 1)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581942293222963611n);
+ input.add4(1n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.add_euint64_euint16(
+ const tx = await this.contract9.eq_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(65529n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "add" overload (euint64, euint16) => euint64 test 2 (22102, 22104)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(22102n);
- input.add16(22104n);
+ it('test operator "eq" overload (euint256, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(4n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.add_euint64_euint16(
+ const tx = await this.contract9.eq_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(44206n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "add" overload (euint64, euint16) => euint64 test 3 (22104, 22104)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(22104n);
- input.add16(22104n);
+ it('test operator "eq" overload (euint256, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(8n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.add_euint64_euint16(
+ const tx = await this.contract9.eq_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(44208n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "add" overload (euint64, euint16) => euint64 test 4 (22104, 22102)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(22104n);
- input.add16(22102n);
+ it('test operator "eq" overload (euint256, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(8n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.add_euint64_euint16(
+ const tx = await this.contract9.eq_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(44206n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "sub" overload (euint64, euint16) => euint64 test 1 (45502, 45502)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(45502n);
- input.add16(45502n);
+ it('test operator "ne" overload (euint256, euint4) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457577394215847356385, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577394215847356385n);
+ input.add4(12n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.sub_euint64_euint16(
+ const tx = await this.contract9.ne_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(0n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "sub" overload (euint64, euint16) => euint64 test 2 (45502, 45498)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(45502n);
- input.add16(45498n);
+ it('test operator "ne" overload (euint256, euint4) => ebool test 2 (8, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(8n);
+ input.add4(12n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.sub_euint64_euint16(
+ const tx = await this.contract9.ne_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(4n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "mul" overload (euint64, euint16) => euint64 test 1 (32761, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(32761n);
- input.add16(2n);
+ it('test operator "ne" overload (euint256, euint4) => ebool test 3 (12, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(12n);
+ input.add4(12n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.mul_euint64_euint16(
+ const tx = await this.contract9.ne_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(65522n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "mul" overload (euint64, euint16) => euint64 test 2 (252, 252)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(252n);
- input.add16(252n);
+ it('test operator "ne" overload (euint256, euint4) => ebool test 4 (12, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(12n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.mul_euint64_euint16(
+ const tx = await this.contract9.ne_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(63504n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "mul" overload (euint64, euint16) => euint64 test 3 (252, 252)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(252n);
- input.add16(252n);
+ it('test operator "ge" overload (euint256, euint4) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457575496173341010993, 1)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575496173341010993n);
+ input.add4(1n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.mul_euint64_euint16(
+ const tx = await this.contract9.ge_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(63504n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "mul" overload (euint64, euint16) => euint64 test 4 (252, 252)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(252n);
- input.add16(252n);
+ it('test operator "ge" overload (euint256, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(4n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.mul_euint64_euint16(
+ const tx = await this.contract9.ge_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(63504n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "and" overload (euint64, euint16) => euint64 test 1 (18446210605213941359, 52123)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18446210605213941359n);
- input.add16(52123n);
+ it('test operator "ge" overload (euint256, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(8n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.and_euint64_euint16(
+ const tx = await this.contract9.ge_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(51723n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "and" overload (euint64, euint16) => euint64 test 2 (52119, 52123)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(52119n);
- input.add16(52123n);
+ it('test operator "ge" overload (euint256, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(8n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.and_euint64_euint16(
+ const tx = await this.contract9.ge_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(52115n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "and" overload (euint64, euint16) => euint64 test 3 (52123, 52123)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(52123n);
- input.add16(52123n);
+ it('test operator "gt" overload (euint256, euint4) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457576018520605547063, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457576018520605547063n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.and_euint64_euint16(
+ const tx = await this.contract9.gt_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(52123n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "and" overload (euint64, euint16) => euint64 test 4 (52123, 52119)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(52123n);
- input.add16(52119n);
+ it('test operator "gt" overload (euint256, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(4n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.and_euint64_euint16(
+ const tx = await this.contract9.gt_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(52115n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "or" overload (euint64, euint16) => euint64 test 1 (18437769114436402597, 8954)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18437769114436402597n);
- input.add16(8954n);
+ it('test operator "gt" overload (euint256, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(8n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.or_euint64_euint16(
+ const tx = await this.contract9.gt_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18437769114436403199n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "or" overload (euint64, euint16) => euint64 test 2 (8950, 8954)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(8950n);
- input.add16(8954n);
+ it('test operator "gt" overload (euint256, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(8n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.or_euint64_euint16(
+ const tx = await this.contract9.gt_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(8958n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "or" overload (euint64, euint16) => euint64 test 3 (8954, 8954)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(8954n);
- input.add16(8954n);
+ it('test operator "le" overload (euint256, euint4) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457578089704885195999, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457578089704885195999n);
+ input.add4(11n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.or_euint64_euint16(
+ const tx = await this.contract9.le_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(8954n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "or" overload (euint64, euint16) => euint64 test 4 (8954, 8950)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(8954n);
- input.add16(8950n);
+ it('test operator "le" overload (euint256, euint4) => ebool test 2 (7, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(7n);
+ input.add4(11n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.or_euint64_euint16(
+ const tx = await this.contract9.le_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(8958n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "xor" overload (euint64, euint16) => euint64 test 1 (18442272025927693303, 37790)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442272025927693303n);
- input.add16(37790n);
+ it('test operator "le" overload (euint256, euint4) => ebool test 3 (11, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(11n);
+ input.add4(11n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.xor_euint64_euint16(
+ const tx = await this.contract9.le_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18442272025927721065n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "xor" overload (euint64, euint16) => euint64 test 2 (37786, 37790)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(37786n);
- input.add16(37790n);
+ it('test operator "le" overload (euint256, euint4) => ebool test 4 (11, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(11n);
+ input.add4(7n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.xor_euint64_euint16(
+ const tx = await this.contract9.le_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(4n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "xor" overload (euint64, euint16) => euint64 test 3 (37790, 37790)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(37790n);
- input.add16(37790n);
+ it('test operator "lt" overload (euint256, euint4) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457580046200927487349, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580046200927487349n);
+ input.add4(9n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.xor_euint64_euint16(
+ const tx = await this.contract9.lt_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(0n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "xor" overload (euint64, euint16) => euint64 test 4 (37790, 37786)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(37790n);
- input.add16(37786n);
+ it('test operator "lt" overload (euint256, euint4) => ebool test 2 (5, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(5n);
+ input.add4(9n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.xor_euint64_euint16(
+ const tx = await this.contract9.lt_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(4n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint64, euint16) => ebool test 1 (18439660654359160363, 41883)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18439660654359160363n);
- input.add16(41883n);
+ it('test operator "lt" overload (euint256, euint4) => ebool test 3 (9, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(9n);
+ input.add4(9n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.eq_euint64_euint16(
+ const tx = await this.contract9.lt_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract9.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint64, euint16) => ebool test 2 (41879, 41883)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(41879n);
- input.add16(41883n);
+ it('test operator "lt" overload (euint256, euint4) => ebool test 4 (9, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(9n);
+ input.add4(5n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.eq_euint64_euint16(
+ const tx = await this.contract9.lt_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract9.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint64, euint16) => ebool test 3 (41883, 41883)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(41883n);
- input.add16(41883n);
+ it('test operator "min" overload (euint256, euint4) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582664799758938101, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582664799758938101n);
+ input.add4(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.eq_euint64_euint16(
+ const tx = await this.contract9.min_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(2n);
});
- it('test operator "eq" overload (euint64, euint16) => ebool test 4 (41883, 41879)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(41883n);
- input.add16(41879n);
+ it('test operator "min" overload (euint256, euint4) => euint256 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(4n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.eq_euint64_euint16(
+ const tx = await this.contract9.min_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(4n);
});
- it('test operator "ne" overload (euint64, euint16) => ebool test 1 (18440863971063577997, 29590)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18440863971063577997n);
- input.add16(29590n);
+ it('test operator "min" overload (euint256, euint4) => euint256 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(8n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ne_euint64_euint16(
+ const tx = await this.contract9.min_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(8n);
});
- it('test operator "ne" overload (euint64, euint16) => ebool test 2 (29586, 29590)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(29586n);
- input.add16(29590n);
+ it('test operator "min" overload (euint256, euint4) => euint256 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(8n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ne_euint64_euint16(
+ const tx = await this.contract9.min_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(4n);
});
- it('test operator "ne" overload (euint64, euint16) => ebool test 3 (29590, 29590)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(29590n);
- input.add16(29590n);
+ it('test operator "max" overload (euint256, euint4) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457577303760309863037, 1)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577303760309863037n);
+ input.add4(1n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ne_euint64_euint16(
+ const tx = await this.contract9.max_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577303760309863037n);
});
- it('test operator "ne" overload (euint64, euint16) => ebool test 4 (29590, 29586)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(29590n);
- input.add16(29586n);
+ it('test operator "max" overload (euint256, euint4) => euint256 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(4n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ne_euint64_euint16(
+ const tx = await this.contract9.max_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(8n);
});
- it('test operator "ge" overload (euint64, euint16) => ebool test 1 (18437766862316060605, 31992)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18437766862316060605n);
- input.add16(31992n);
+ it('test operator "max" overload (euint256, euint4) => euint256 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(8n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ge_euint64_euint16(
+ const tx = await this.contract9.max_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(8n);
});
- it('test operator "ge" overload (euint64, euint16) => ebool test 2 (31988, 31992)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(31988n);
- input.add16(31992n);
+ it('test operator "max" overload (euint256, euint4) => euint256 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(8n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ge_euint64_euint16(
+ const tx = await this.contract9.max_euint256_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(8n);
});
- it('test operator "ge" overload (euint64, euint16) => ebool test 3 (31992, 31992)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(31992n);
- input.add16(31992n);
+ it('test operator "add" overload (euint256, euint8) => euint256 test 1 (129, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(129n);
+ input.add8(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ge_euint64_euint16(
+ const tx = await this.contract9.add_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(131n);
});
- it('test operator "ge" overload (euint64, euint16) => ebool test 4 (31992, 31988)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(31992n);
- input.add16(31988n);
+ it('test operator "add" overload (euint256, euint8) => euint256 test 2 (101, 103)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(101n);
+ input.add8(103n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ge_euint64_euint16(
+ const tx = await this.contract9.add_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(204n);
});
- it('test operator "gt" overload (euint64, euint16) => ebool test 1 (18446546126614473389, 55175)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18446546126614473389n);
- input.add16(55175n);
+ it('test operator "add" overload (euint256, euint8) => euint256 test 3 (103, 103)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(103n);
+ input.add8(103n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.gt_euint64_euint16(
+ const tx = await this.contract9.add_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(206n);
});
- it('test operator "gt" overload (euint64, euint16) => ebool test 2 (55171, 55175)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(55171n);
- input.add16(55175n);
+ it('test operator "add" overload (euint256, euint8) => euint256 test 4 (103, 101)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(103n);
+ input.add8(101n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.gt_euint64_euint16(
+ const tx = await this.contract9.add_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(204n);
});
- it('test operator "gt" overload (euint64, euint16) => ebool test 3 (55175, 55175)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(55175n);
- input.add16(55175n);
+ it('test operator "sub" overload (euint256, euint8) => euint256 test 1 (234, 234)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(234n);
+ input.add8(234n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.gt_euint64_euint16(
+ const tx = await this.contract9.sub_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(0n);
});
- it('test operator "gt" overload (euint64, euint16) => ebool test 4 (55175, 55171)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(55175n);
- input.add16(55171n);
+ it('test operator "sub" overload (euint256, euint8) => euint256 test 2 (234, 230)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(234n);
+ input.add8(230n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.gt_euint64_euint16(
+ const tx = await this.contract9.sub_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(4n);
});
- it('test operator "le" overload (euint64, euint16) => ebool test 1 (18445404390633548443, 34855)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18445404390633548443n);
- input.add16(34855n);
+ it('test operator "mul" overload (euint256, euint8) => euint256 test 1 (65, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(65n);
+ input.add8(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_euint64_euint16(
+ const tx = await this.contract9.mul_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(130n);
});
- it('test operator "le" overload (euint64, euint16) => ebool test 2 (34851, 34855)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(34851n);
- input.add16(34855n);
+ it('test operator "mul" overload (euint256, euint8) => euint256 test 2 (13, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(13n);
+ input.add8(14n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_euint64_euint16(
+ const tx = await this.contract9.mul_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(182n);
});
- it('test operator "le" overload (euint64, euint16) => ebool test 3 (34855, 34855)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(34855n);
- input.add16(34855n);
+ it('test operator "mul" overload (euint256, euint8) => euint256 test 3 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(14n);
+ input.add8(14n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_euint64_euint16(
+ const tx = await this.contract9.mul_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(196n);
});
- it('test operator "le" overload (euint64, euint16) => ebool test 4 (34855, 34851)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(34855n);
- input.add16(34851n);
+ it('test operator "mul" overload (euint256, euint8) => euint256 test 4 (14, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(14n);
+ input.add8(13n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_euint64_euint16(
+ const tx = await this.contract9.mul_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(182n);
});
- it('test operator "lt" overload (euint64, euint16) => ebool test 1 (18438335232029320935, 10564)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438335232029320935n);
- input.add16(10564n);
+ it('test operator "and" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457580200311934752389, 160)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580200311934752389n);
+ input.add8(160n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_euint64_euint16(
+ const tx = await this.contract9.and_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(128n);
});
- it('test operator "lt" overload (euint64, euint16) => ebool test 2 (10560, 10564)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(10560n);
- input.add16(10564n);
+ it('test operator "and" overload (euint256, euint8) => euint256 test 2 (156, 160)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(156n);
+ input.add8(160n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_euint64_euint16(
+ const tx = await this.contract9.and_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(128n);
});
- it('test operator "lt" overload (euint64, euint16) => ebool test 3 (10564, 10564)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(10564n);
- input.add16(10564n);
+ it('test operator "and" overload (euint256, euint8) => euint256 test 3 (160, 160)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(160n);
+ input.add8(160n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_euint64_euint16(
+ const tx = await this.contract9.and_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(160n);
});
- it('test operator "lt" overload (euint64, euint16) => ebool test 4 (10564, 10560)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(10564n);
- input.add16(10560n);
+ it('test operator "and" overload (euint256, euint8) => euint256 test 4 (160, 156)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(160n);
+ input.add8(156n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_euint64_euint16(
+ const tx = await this.contract9.and_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(128n);
});
- it('test operator "min" overload (euint64, euint16) => euint64 test 1 (18438622448280376415, 51692)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438622448280376415n);
- input.add16(51692n);
+ it('test operator "or" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579600697842114421, 25)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579600697842114421n);
+ input.add8(25n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_euint64_euint16(
+ const tx = await this.contract9.or_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(51692n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579600697842114429n);
});
- it('test operator "min" overload (euint64, euint16) => euint64 test 2 (51688, 51692)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(51688n);
- input.add16(51692n);
+ it('test operator "or" overload (euint256, euint8) => euint256 test 2 (21, 25)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(21n);
+ input.add8(25n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_euint64_euint16(
+ const tx = await this.contract9.or_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(51688n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(29n);
});
- it('test operator "min" overload (euint64, euint16) => euint64 test 3 (51692, 51692)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(51692n);
- input.add16(51692n);
+ it('test operator "or" overload (euint256, euint8) => euint256 test 3 (25, 25)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(25n);
+ input.add8(25n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_euint64_euint16(
+ const tx = await this.contract9.or_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(51692n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(25n);
});
- it('test operator "min" overload (euint64, euint16) => euint64 test 4 (51692, 51688)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(51692n);
- input.add16(51688n);
+ it('test operator "or" overload (euint256, euint8) => euint256 test 4 (25, 21)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(25n);
+ input.add8(21n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_euint64_euint16(
+ const tx = await this.contract9.or_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(51688n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(29n);
});
- it('test operator "max" overload (euint64, euint16) => euint64 test 1 (18444284510736997839, 51628)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18444284510736997839n);
- input.add16(51628n);
+ it('test operator "xor" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457576224347045805665, 175)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457576224347045805665n);
+ input.add8(175n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_euint64_euint16(
+ const tx = await this.contract9.xor_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18444284510736997839n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576224347045805774n);
});
- it('test operator "max" overload (euint64, euint16) => euint64 test 2 (51624, 51628)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(51624n);
- input.add16(51628n);
+ it('test operator "xor" overload (euint256, euint8) => euint256 test 2 (171, 175)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(171n);
+ input.add8(175n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_euint64_euint16(
+ const tx = await this.contract9.xor_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(51628n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(4n);
});
- it('test operator "max" overload (euint64, euint16) => euint64 test 3 (51628, 51628)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(51628n);
- input.add16(51628n);
+ it('test operator "xor" overload (euint256, euint8) => euint256 test 3 (175, 175)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(175n);
+ input.add8(175n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_euint64_euint16(
+ const tx = await this.contract9.xor_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(51628n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(0n);
});
- it('test operator "max" overload (euint64, euint16) => euint64 test 4 (51628, 51624)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(51628n);
- input.add16(51624n);
+ it('test operator "xor" overload (euint256, euint8) => euint256 test 4 (175, 171)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(175n);
+ input.add8(171n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_euint64_euint16(
+ const tx = await this.contract9.xor_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(51628n);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(4n);
});
- it('test operator "add" overload (euint64, euint32) => euint64 test 1 (4293751578, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(4293751578n);
- input.add32(2n);
+ it('test operator "eq" overload (euint256, euint8) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457581724603808654415, 213)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581724603808654415n);
+ input.add8(213n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.add_euint64_euint32(
+ const tx = await this.contract9.eq_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(4293751580n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "add" overload (euint64, euint32) => euint64 test 2 (1806019599, 1806019601)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(1806019599n);
- input.add32(1806019601n);
+ it('test operator "eq" overload (euint256, euint8) => ebool test 2 (209, 213)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(209n);
+ input.add8(213n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.add_euint64_euint32(
+ const tx = await this.contract9.eq_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(3612039200n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "add" overload (euint64, euint32) => euint64 test 3 (1806019601, 1806019601)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(1806019601n);
- input.add32(1806019601n);
+ it('test operator "eq" overload (euint256, euint8) => ebool test 3 (213, 213)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(213n);
+ input.add8(213n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.add_euint64_euint32(
+ const tx = await this.contract9.eq_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(3612039202n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "add" overload (euint64, euint32) => euint64 test 4 (1806019601, 1806019599)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(1806019601n);
- input.add32(1806019599n);
+ it('test operator "eq" overload (euint256, euint8) => ebool test 4 (213, 209)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(213n);
+ input.add8(209n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.add_euint64_euint32(
+ const tx = await this.contract9.eq_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(3612039200n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "sub" overload (euint64, euint32) => euint64 test 1 (3425308729, 3425308729)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(3425308729n);
- input.add32(3425308729n);
+ it('test operator "ne" overload (euint256, euint8) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457577306800788645475, 79)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577306800788645475n);
+ input.add8(79n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.sub_euint64_euint32(
+ const tx = await this.contract9.ne_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(0n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "sub" overload (euint64, euint32) => euint64 test 2 (3425308729, 3425308725)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(3425308729n);
- input.add32(3425308725n);
+ it('test operator "ne" overload (euint256, euint8) => ebool test 2 (75, 79)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(75n);
+ input.add8(79n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.sub_euint64_euint32(
+ const tx = await this.contract9.ne_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(4n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "mul" overload (euint64, euint32) => euint64 test 1 (2147367784, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(2147367784n);
- input.add32(2n);
+ it('test operator "ne" overload (euint256, euint8) => ebool test 3 (79, 79)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(79n);
+ input.add8(79n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.mul_euint64_euint32(
+ const tx = await this.contract9.ne_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(4294735568n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "mul" overload (euint64, euint32) => euint64 test 2 (50787, 50787)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(50787n);
- input.add32(50787n);
+ it('test operator "ne" overload (euint256, euint8) => ebool test 4 (79, 75)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(79n);
+ input.add8(75n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.mul_euint64_euint32(
+ const tx = await this.contract9.ne_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(2579319369n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "mul" overload (euint64, euint32) => euint64 test 3 (50787, 50787)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(50787n);
- input.add32(50787n);
+ it('test operator "ge" overload (euint256, euint8) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457583777768346925767, 250)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457583777768346925767n);
+ input.add8(250n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.mul_euint64_euint32(
+ const tx = await this.contract9.ge_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(2579319369n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "mul" overload (euint64, euint32) => euint64 test 4 (50787, 50787)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(50787n);
- input.add32(50787n);
+ it('test operator "ge" overload (euint256, euint8) => ebool test 2 (246, 250)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(246n);
+ input.add8(250n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.mul_euint64_euint32(
+ const tx = await this.contract9.ge_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(2579319369n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "and" overload (euint64, euint32) => euint64 test 1 (18442857416785747441, 1547691532)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442857416785747441n);
- input.add32(1547691532n);
+ it('test operator "ge" overload (euint256, euint8) => ebool test 3 (250, 250)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(250n);
+ input.add8(250n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.and_euint64_euint32(
+ const tx = await this.contract9.ge_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(137446400n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "and" overload (euint64, euint32) => euint64 test 2 (1547691528, 1547691532)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(1547691528n);
- input.add32(1547691532n);
+ it('test operator "ge" overload (euint256, euint8) => ebool test 4 (250, 246)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(250n);
+ input.add8(246n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.and_euint64_euint32(
+ const tx = await this.contract9.ge_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(1547691528n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "and" overload (euint64, euint32) => euint64 test 3 (1547691532, 1547691532)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(1547691532n);
- input.add32(1547691532n);
+ it('test operator "gt" overload (euint256, euint8) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457583855482126679265, 93)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457583855482126679265n);
+ input.add8(93n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.and_euint64_euint32(
+ const tx = await this.contract9.gt_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(1547691532n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "and" overload (euint64, euint32) => euint64 test 4 (1547691532, 1547691528)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(1547691532n);
- input.add32(1547691528n);
+ it('test operator "gt" overload (euint256, euint8) => ebool test 2 (89, 93)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(89n);
+ input.add8(93n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.and_euint64_euint32(
+ const tx = await this.contract9.gt_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(1547691528n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "or" overload (euint64, euint32) => euint64 test 1 (18438806940040470143, 729835566)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438806940040470143n);
- input.add32(729835566n);
+ it('test operator "gt" overload (euint256, euint8) => ebool test 3 (93, 93)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(93n);
+ input.add8(93n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.or_euint64_euint32(
+ const tx = await this.contract9.gt_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18438806940585754239n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "or" overload (euint64, euint32) => euint64 test 2 (729835562, 729835566)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(729835562n);
- input.add32(729835566n);
+ it('test operator "gt" overload (euint256, euint8) => ebool test 4 (93, 89)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(93n);
+ input.add8(89n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.or_euint64_euint32(
+ const tx = await this.contract9.gt_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(729835566n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "or" overload (euint64, euint32) => euint64 test 3 (729835566, 729835566)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(729835566n);
- input.add32(729835566n);
+ it('test operator "le" overload (euint256, euint8) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457580743279895693245, 161)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580743279895693245n);
+ input.add8(161n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.or_euint64_euint32(
+ const tx = await this.contract9.le_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(729835566n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "or" overload (euint64, euint32) => euint64 test 4 (729835566, 729835562)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(729835566n);
- input.add32(729835562n);
+ it('test operator "le" overload (euint256, euint8) => ebool test 2 (157, 161)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(157n);
+ input.add8(161n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.or_euint64_euint32(
+ const tx = await this.contract9.le_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(729835566n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "xor" overload (euint64, euint32) => euint64 test 1 (18444516407156523745, 3421158537)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18444516407156523745n);
- input.add32(3421158537n);
+ it('test operator "le" overload (euint256, euint8) => ebool test 3 (161, 161)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(161n);
+ input.add8(161n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.xor_euint64_euint32(
+ const tx = await this.contract9.le_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18444516404054425192n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "xor" overload (euint64, euint32) => euint64 test 2 (3421158533, 3421158537)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(3421158533n);
- input.add32(3421158537n);
+ it('test operator "le" overload (euint256, euint8) => ebool test 4 (161, 157)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(161n);
+ input.add8(157n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.xor_euint64_euint32(
+ const tx = await this.contract9.le_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(12n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "xor" overload (euint64, euint32) => euint64 test 3 (3421158537, 3421158537)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(3421158537n);
- input.add32(3421158537n);
+ it('test operator "lt" overload (euint256, euint8) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457575356850463874977, 220)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575356850463874977n);
+ input.add8(220n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.xor_euint64_euint32(
+ const tx = await this.contract9.lt_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(0n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
});
- it('test operator "xor" overload (euint64, euint32) => euint64 test 4 (3421158537, 3421158533)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(3421158537n);
- input.add32(3421158533n);
+ it('test operator "lt" overload (euint256, euint8) => ebool test 2 (216, 220)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(216n);
+ input.add8(220n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.xor_euint64_euint32(
+ const tx = await this.contract9.lt_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(12n);
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint64, euint32) => ebool test 1 (18445744067307966387, 926561519)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18445744067307966387n);
- input.add32(926561519n);
+ it('test operator "lt" overload (euint256, euint8) => ebool test 3 (220, 220)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(220n);
+ input.add8(220n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.eq_euint64_euint32(
+ const tx = await this.contract9.lt_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract9.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint64, euint32) => ebool test 2 (926561515, 926561519)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(926561515n);
- input.add32(926561519n);
+ it('test operator "lt" overload (euint256, euint8) => ebool test 4 (220, 216)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(220n);
+ input.add8(216n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.eq_euint64_euint32(
+ const tx = await this.contract9.lt_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract9.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint64, euint32) => ebool test 3 (926561519, 926561519)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(926561519n);
- input.add32(926561519n);
+ it('test operator "min" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457577026640283682165, 103)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577026640283682165n);
+ input.add8(103n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.eq_euint64_euint32(
+ const tx = await this.contract9.min_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(103n);
});
- it('test operator "eq" overload (euint64, euint32) => ebool test 4 (926561519, 926561515)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(926561519n);
- input.add32(926561515n);
+ it('test operator "min" overload (euint256, euint8) => euint256 test 2 (99, 103)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(99n);
+ input.add8(103n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.eq_euint64_euint32(
+ const tx = await this.contract9.min_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(99n);
});
- it('test operator "ne" overload (euint64, euint32) => ebool test 1 (18446476368209552349, 3024704127)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18446476368209552349n);
- input.add32(3024704127n);
+ it('test operator "min" overload (euint256, euint8) => euint256 test 3 (103, 103)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(103n);
+ input.add8(103n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ne_euint64_euint32(
+ const tx = await this.contract9.min_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(103n);
});
- it('test operator "ne" overload (euint64, euint32) => ebool test 2 (3024704123, 3024704127)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(3024704123n);
- input.add32(3024704127n);
+ it('test operator "min" overload (euint256, euint8) => euint256 test 4 (103, 99)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(103n);
+ input.add8(99n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ne_euint64_euint32(
+ const tx = await this.contract9.min_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(99n);
});
- it('test operator "ne" overload (euint64, euint32) => ebool test 3 (3024704127, 3024704127)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(3024704127n);
- input.add32(3024704127n);
+ it('test operator "max" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457581923844171729579, 237)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581923844171729579n);
+ input.add8(237n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ne_euint64_euint32(
+ const tx = await this.contract9.max_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457581923844171729579n);
});
- it('test operator "ne" overload (euint64, euint32) => ebool test 4 (3024704127, 3024704123)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(3024704127n);
- input.add32(3024704123n);
+ it('test operator "max" overload (euint256, euint8) => euint256 test 2 (233, 237)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(233n);
+ input.add8(237n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ne_euint64_euint32(
+ const tx = await this.contract9.max_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(237n);
});
- it('test operator "ge" overload (euint64, euint32) => ebool test 1 (18440264286866387829, 85256317)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18440264286866387829n);
- input.add32(85256317n);
+ it('test operator "max" overload (euint256, euint8) => euint256 test 3 (237, 237)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(237n);
+ input.add8(237n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ge_euint64_euint32(
+ const tx = await this.contract9.max_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(237n);
});
- it('test operator "ge" overload (euint64, euint32) => ebool test 2 (85256313, 85256317)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(85256313n);
- input.add32(85256317n);
+ it('test operator "max" overload (euint256, euint8) => euint256 test 4 (237, 233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(237n);
+ input.add8(233n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ge_euint64_euint32(
+ const tx = await this.contract9.max_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(237n);
});
- it('test operator "ge" overload (euint64, euint32) => ebool test 3 (85256317, 85256317)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(85256317n);
- input.add32(85256317n);
+ it('test operator "add" overload (euint256, euint16) => euint256 test 1 (32769, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(32769n);
+ input.add16(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ge_euint64_euint32(
+ const tx = await this.contract9.add_euint256_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(32771n);
});
- it('test operator "ge" overload (euint64, euint32) => ebool test 4 (85256317, 85256313)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(85256317n);
- input.add32(85256313n);
+ it('test operator "add" overload (euint256, euint16) => euint256 test 2 (18590, 18592)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(18590n);
+ input.add16(18592n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ge_euint64_euint32(
+ const tx = await this.contract9.add_euint256_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(37182n);
});
- it('test operator "gt" overload (euint64, euint32) => ebool test 1 (18443613995542007651, 1679838761)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18443613995542007651n);
- input.add32(1679838761n);
+ it('test operator "add" overload (euint256, euint16) => euint256 test 3 (18592, 18592)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(18592n);
+ input.add16(18592n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.gt_euint64_euint32(
+ const tx = await this.contract9.add_euint256_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(37184n);
});
- it('test operator "gt" overload (euint64, euint32) => ebool test 2 (1679838757, 1679838761)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(1679838757n);
- input.add32(1679838761n);
+ it('test operator "add" overload (euint256, euint16) => euint256 test 4 (18592, 18590)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(18592n);
+ input.add16(18590n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.gt_euint64_euint32(
+ const tx = await this.contract9.add_euint256_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(37182n);
});
- it('test operator "gt" overload (euint64, euint32) => ebool test 3 (1679838761, 1679838761)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(1679838761n);
- input.add32(1679838761n);
+ it('test operator "sub" overload (euint256, euint16) => euint256 test 1 (46280, 46280)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(46280n);
+ input.add16(46280n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.gt_euint64_euint32(
+ const tx = await this.contract9.sub_euint256_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(0n);
});
- it('test operator "gt" overload (euint64, euint32) => ebool test 4 (1679838761, 1679838757)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(1679838761n);
- input.add32(1679838757n);
+ it('test operator "sub" overload (euint256, euint16) => euint256 test 2 (46280, 46276)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(46280n);
+ input.add16(46276n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.gt_euint64_euint32(
+ const tx = await this.contract9.sub_euint256_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(4n);
});
- it('test operator "le" overload (euint64, euint32) => ebool test 1 (18443133688534935497, 622548585)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18443133688534935497n);
- input.add32(622548585n);
+ it('test operator "mul" overload (euint256, euint16) => euint256 test 1 (16385, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(16385n);
+ input.add16(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_euint64_euint32(
+ const tx = await this.contract9.mul_euint256_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(32770n);
});
- it('test operator "le" overload (euint64, euint32) => ebool test 2 (622548581, 622548585)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(622548581n);
- input.add32(622548585n);
+ it('test operator "mul" overload (euint256, euint16) => euint256 test 2 (233, 233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(233n);
+ input.add16(233n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_euint64_euint32(
+ const tx = await this.contract9.mul_euint256_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(54289n);
});
- it('test operator "le" overload (euint64, euint32) => ebool test 3 (622548585, 622548585)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(622548585n);
- input.add32(622548585n);
+ it('test operator "mul" overload (euint256, euint16) => euint256 test 3 (233, 233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(233n);
+ input.add16(233n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_euint64_euint32(
+ const tx = await this.contract9.mul_euint256_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(54289n);
});
- it('test operator "le" overload (euint64, euint32) => ebool test 4 (622548585, 622548581)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(622548585n);
- input.add32(622548581n);
+ it('test operator "mul" overload (euint256, euint16) => euint256 test 4 (233, 233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(233n);
+ input.add16(233n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_euint64_euint32(
+ const tx = await this.contract9.mul_euint256_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(54289n);
});
- it('test operator "lt" overload (euint64, euint32) => ebool test 1 (18446696862115863979, 853267915)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18446696862115863979n);
- input.add32(853267915n);
+ it('test operator "and" overload (euint256, euint16) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457581238581042328907, 21842)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581238581042328907n);
+ input.add16(21842n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_euint64_euint32(
+ const tx = await this.contract9.and_euint256_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(5442n);
});
- it('test operator "lt" overload (euint64, euint32) => ebool test 2 (853267911, 853267915)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(853267911n);
- input.add32(853267915n);
+ it('test operator "and" overload (euint256, euint16) => euint256 test 2 (21838, 21842)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(21838n);
+ input.add16(21842n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_euint64_euint32(
+ const tx = await this.contract9.and_euint256_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(21826n);
});
- it('test operator "lt" overload (euint64, euint32) => ebool test 3 (853267915, 853267915)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(853267915n);
- input.add32(853267915n);
+ it('test operator "and" overload (euint256, euint16) => euint256 test 3 (21842, 21842)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(21842n);
+ input.add16(21842n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_euint64_euint32(
+ const tx = await this.contract9.and_euint256_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(21842n);
});
- it('test operator "lt" overload (euint64, euint32) => ebool test 4 (853267915, 853267911)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(853267915n);
- input.add32(853267911n);
+ it('test operator "and" overload (euint256, euint16) => euint256 test 4 (21842, 21838)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(21842n);
+ input.add16(21838n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_euint64_euint32(
+ const tx = await this.contract9.and_euint256_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(21826n);
});
});
diff --git a/test/tfheOperations/tfheOperations11.ts b/test/tfheOperations/tfheOperations11.ts
index e1c19134..74694fec 100644
--- a/test/tfheOperations/tfheOperations11.ts
+++ b/test/tfheOperations/tfheOperations11.ts
@@ -7,7 +7,22 @@ import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'
import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance';
+import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
+import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
+import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
+import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
+import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
+import {
+ createInstances,
+ decrypt4,
+ decrypt8,
+ decrypt16,
+ decrypt32,
+ decrypt64,
+ decrypt128,
+ decrypt256,
+ decryptBool,
+} from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
@@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise {
return contract;
}
+async function deployTfheTestFixture7(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite7');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture8(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite8');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture9(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite9');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture10(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite10');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture11(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite11');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
describe('TFHE operations 11', function () {
before(async function () {
await initSigners(1);
@@ -101,2453 +171,4651 @@ describe('TFHE operations 11', function () {
this.contract5Address = await contract5.getAddress();
this.contract5 = contract5;
- const contract6 = await deployTfheTestFixture6();
- this.contract6Address = await contract6.getAddress();
- this.contract6 = contract6;
+ const contract6 = await deployTfheTestFixture6();
+ this.contract6Address = await contract6.getAddress();
+ this.contract6 = contract6;
+
+ const contract7 = await deployTfheTestFixture7();
+ this.contract7Address = await contract7.getAddress();
+ this.contract7 = contract7;
+
+ const contract8 = await deployTfheTestFixture8();
+ this.contract8Address = await contract8.getAddress();
+ this.contract8 = contract8;
+
+ const contract9 = await deployTfheTestFixture9();
+ this.contract9Address = await contract9.getAddress();
+ this.contract9 = contract9;
+
+ const contract10 = await deployTfheTestFixture10();
+ this.contract10Address = await contract10.getAddress();
+ this.contract10 = contract10;
+
+ const contract11 = await deployTfheTestFixture11();
+ this.contract11Address = await contract11.getAddress();
+ this.contract11 = contract11;
+
+ const instances = await createInstances(this.signers);
+ this.instances = instances;
+ });
+
+ it('test operator "or" overload (euint256, euint16) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582624616109811381, 9754)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582624616109811381n);
+ input.add16(9754n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.or_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457582624616109811391n);
+ });
+
+ it('test operator "or" overload (euint256, euint16) => euint256 test 2 (9750, 9754)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(9750n);
+ input.add16(9754n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.or_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(9758n);
+ });
+
+ it('test operator "or" overload (euint256, euint16) => euint256 test 3 (9754, 9754)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(9754n);
+ input.add16(9754n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.or_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(9754n);
+ });
+
+ it('test operator "or" overload (euint256, euint16) => euint256 test 4 (9754, 9750)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(9754n);
+ input.add16(9750n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.or_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(9758n);
+ });
+
+ it('test operator "xor" overload (euint256, euint16) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457583698273346637887, 24298)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457583698273346637887n);
+ input.add16(24298n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.xor_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457583698273346621141n);
+ });
+
+ it('test operator "xor" overload (euint256, euint16) => euint256 test 2 (24294, 24298)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(24294n);
+ input.add16(24298n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.xor_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "xor" overload (euint256, euint16) => euint256 test 3 (24298, 24298)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(24298n);
+ input.add16(24298n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.xor_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint256, euint16) => euint256 test 4 (24298, 24294)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(24298n);
+ input.add16(24294n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.xor_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "eq" overload (euint256, euint16) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457581937945784624293, 42555)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581937945784624293n);
+ input.add16(42555n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.eq_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint256, euint16) => ebool test 2 (42551, 42555)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(42551n);
+ input.add16(42555n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.eq_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint256, euint16) => ebool test 3 (42555, 42555)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(42555n);
+ input.add16(42555n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.eq_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint256, euint16) => ebool test 4 (42555, 42551)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(42555n);
+ input.add16(42551n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.eq_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint256, euint16) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457575904968867077761, 30382)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575904968867077761n);
+ input.add16(30382n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ne_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint256, euint16) => ebool test 2 (30378, 30382)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(30378n);
+ input.add16(30382n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ne_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint256, euint16) => ebool test 3 (30382, 30382)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(30382n);
+ input.add16(30382n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ne_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint256, euint16) => ebool test 4 (30382, 30378)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(30382n);
+ input.add16(30378n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ne_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint256, euint16) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457575882393460599321, 29301)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575882393460599321n);
+ input.add16(29301n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ge_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint256, euint16) => ebool test 2 (29297, 29301)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(29297n);
+ input.add16(29301n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ge_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint256, euint16) => ebool test 3 (29301, 29301)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(29301n);
+ input.add16(29301n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ge_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint256, euint16) => ebool test 4 (29301, 29297)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(29301n);
+ input.add16(29297n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.ge_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint256, euint16) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457580207253841161561, 59068)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580207253841161561n);
+ input.add16(59068n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.gt_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint256, euint16) => ebool test 2 (59064, 59068)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(59064n);
+ input.add16(59068n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.gt_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint256, euint16) => ebool test 3 (59068, 59068)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(59068n);
+ input.add16(59068n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.gt_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint256, euint16) => ebool test 4 (59068, 59064)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(59068n);
+ input.add16(59064n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.gt_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint256, euint16) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457582351250639102167, 47994)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582351250639102167n);
+ input.add16(47994n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.le_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "le" overload (euint256, euint16) => ebool test 2 (47990, 47994)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(47990n);
+ input.add16(47994n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.le_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint256, euint16) => ebool test 3 (47994, 47994)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(47994n);
+ input.add16(47994n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.le_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint256, euint16) => ebool test 4 (47994, 47990)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(47994n);
+ input.add16(47990n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.le_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint256, euint16) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457581793657869781609, 60020)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581793657869781609n);
+ input.add16(60020n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.lt_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint256, euint16) => ebool test 2 (60016, 60020)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(60016n);
+ input.add16(60020n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.lt_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint256, euint16) => ebool test 3 (60020, 60020)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(60020n);
+ input.add16(60020n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.lt_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint256, euint16) => ebool test 4 (60020, 60016)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(60020n);
+ input.add16(60016n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.lt_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract9.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint256, euint16) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579076951559173157, 24679)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579076951559173157n);
+ input.add16(24679n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.min_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(24679n);
+ });
+
+ it('test operator "min" overload (euint256, euint16) => euint256 test 2 (24675, 24679)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(24675n);
+ input.add16(24679n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.min_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(24675n);
+ });
+
+ it('test operator "min" overload (euint256, euint16) => euint256 test 3 (24679, 24679)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(24679n);
+ input.add16(24679n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.min_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(24679n);
+ });
+
+ it('test operator "min" overload (euint256, euint16) => euint256 test 4 (24679, 24675)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(24679n);
+ input.add16(24675n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.min_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(24675n);
+ });
+
+ it('test operator "max" overload (euint256, euint16) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457580891899920920375, 31998)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580891899920920375n);
+ input.add16(31998n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.max_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457580891899920920375n);
+ });
+
+ it('test operator "max" overload (euint256, euint16) => euint256 test 2 (31994, 31998)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(31994n);
+ input.add16(31998n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.max_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(31998n);
+ });
+
+ it('test operator "max" overload (euint256, euint16) => euint256 test 3 (31998, 31998)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(31998n);
+ input.add16(31998n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.max_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(31998n);
+ });
+
+ it('test operator "max" overload (euint256, euint16) => euint256 test 4 (31998, 31994)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address);
+ input.add256(31998n);
+ input.add16(31994n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract9.max_euint256_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract9.res256());
+ expect(res).to.equal(31998n);
+ });
+
+ it('test operator "add" overload (euint256, euint32) => euint256 test 1 (2147483649, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(2147483649n);
+ input.add32(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.add_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(2147483651n);
+ });
+
+ it('test operator "add" overload (euint256, euint32) => euint256 test 2 (1298573356, 1298573358)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(1298573356n);
+ input.add32(1298573358n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.add_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(2597146714n);
+ });
+
+ it('test operator "add" overload (euint256, euint32) => euint256 test 3 (1298573358, 1298573358)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(1298573358n);
+ input.add32(1298573358n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.add_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(2597146716n);
+ });
+
+ it('test operator "add" overload (euint256, euint32) => euint256 test 4 (1298573358, 1298573356)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(1298573358n);
+ input.add32(1298573356n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.add_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(2597146714n);
+ });
+
+ it('test operator "sub" overload (euint256, euint32) => euint256 test 1 (2775500374, 2775500374)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(2775500374n);
+ input.add32(2775500374n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.sub_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint256, euint32) => euint256 test 2 (2775500374, 2775500370)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(2775500374n);
+ input.add32(2775500370n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.sub_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint256, euint32) => euint256 test 1 (1073741825, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(1073741825n);
+ input.add32(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.mul_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(2147483650n);
+ });
+
+ it('test operator "mul" overload (euint256, euint32) => euint256 test 2 (60165, 60165)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(60165n);
+ input.add32(60165n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.mul_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(3619827225n);
+ });
+
+ it('test operator "mul" overload (euint256, euint32) => euint256 test 3 (60165, 60165)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(60165n);
+ input.add32(60165n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.mul_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(3619827225n);
+ });
+
+ it('test operator "mul" overload (euint256, euint32) => euint256 test 4 (60165, 60165)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(60165n);
+ input.add32(60165n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.mul_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(3619827225n);
+ });
+
+ it('test operator "and" overload (euint256, euint32) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579114687562092581, 2312861009)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579114687562092581n);
+ input.add32(2312861009n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.and_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(1642497n);
+ });
+
+ it('test operator "and" overload (euint256, euint32) => euint256 test 2 (2312861005, 2312861009)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(2312861005n);
+ input.add32(2312861009n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.and_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(2312860993n);
+ });
+
+ it('test operator "and" overload (euint256, euint32) => euint256 test 3 (2312861009, 2312861009)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(2312861009n);
+ input.add32(2312861009n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.and_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(2312861009n);
+ });
+
+ it('test operator "and" overload (euint256, euint32) => euint256 test 4 (2312861009, 2312861005)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(2312861009n);
+ input.add32(2312861005n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.and_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(2312860993n);
+ });
+
+ it('test operator "or" overload (euint256, euint32) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457577374322978195673, 2490018786)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577374322978195673n);
+ input.add32(2490018786n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.or_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577374323247328251n);
+ });
+
+ it('test operator "or" overload (euint256, euint32) => euint256 test 2 (2490018782, 2490018786)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(2490018782n);
+ input.add32(2490018786n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.or_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(2490018814n);
+ });
+
+ it('test operator "or" overload (euint256, euint32) => euint256 test 3 (2490018786, 2490018786)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(2490018786n);
+ input.add32(2490018786n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.or_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(2490018786n);
+ });
+
+ it('test operator "or" overload (euint256, euint32) => euint256 test 4 (2490018786, 2490018782)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(2490018786n);
+ input.add32(2490018782n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.or_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(2490018814n);
+ });
+
+ it('test operator "xor" overload (euint256, euint32) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457575870021368542809, 1137098251)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575870021368542809n);
+ input.add32(1137098251n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.xor_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457575870020349413458n);
+ });
+
+ it('test operator "xor" overload (euint256, euint32) => euint256 test 2 (1137098247, 1137098251)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(1137098247n);
+ input.add32(1137098251n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.xor_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "xor" overload (euint256, euint32) => euint256 test 3 (1137098251, 1137098251)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(1137098251n);
+ input.add32(1137098251n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.xor_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint256, euint32) => euint256 test 4 (1137098251, 1137098247)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(1137098251n);
+ input.add32(1137098247n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.xor_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "eq" overload (euint256, euint32) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457580556825298662935, 2172668277)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580556825298662935n);
+ input.add32(2172668277n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.eq_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint256, euint32) => ebool test 2 (2172668273, 2172668277)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(2172668273n);
+ input.add32(2172668277n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.eq_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint256, euint32) => ebool test 3 (2172668277, 2172668277)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(2172668277n);
+ input.add32(2172668277n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.eq_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint256, euint32) => ebool test 4 (2172668277, 2172668273)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(2172668277n);
+ input.add32(2172668273n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.eq_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint256, euint32) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457583230004924210357, 3013060698)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457583230004924210357n);
+ input.add32(3013060698n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ne_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint256, euint32) => ebool test 2 (3013060694, 3013060698)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(3013060694n);
+ input.add32(3013060698n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ne_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint256, euint32) => ebool test 3 (3013060698, 3013060698)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(3013060698n);
+ input.add32(3013060698n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ne_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint256, euint32) => ebool test 4 (3013060698, 3013060694)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(3013060698n);
+ input.add32(3013060694n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ne_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint256, euint32) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457576727756037416977, 2466446241)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457576727756037416977n);
+ input.add32(2466446241n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ge_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint256, euint32) => ebool test 2 (2466446237, 2466446241)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(2466446237n);
+ input.add32(2466446241n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ge_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint256, euint32) => ebool test 3 (2466446241, 2466446241)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(2466446241n);
+ input.add32(2466446241n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ge_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint256, euint32) => ebool test 4 (2466446241, 2466446237)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(2466446241n);
+ input.add32(2466446237n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ge_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint256, euint32) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457580729313167530831, 902297828)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580729313167530831n);
+ input.add32(902297828n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.gt_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint256, euint32) => ebool test 2 (902297824, 902297828)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(902297824n);
+ input.add32(902297828n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.gt_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint256, euint32) => ebool test 3 (902297828, 902297828)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(902297828n);
+ input.add32(902297828n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.gt_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint256, euint32) => ebool test 4 (902297828, 902297824)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(902297828n);
+ input.add32(902297824n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.gt_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint256, euint32) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457582845443410851747, 1340548693)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582845443410851747n);
+ input.add32(1340548693n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.le_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "le" overload (euint256, euint32) => ebool test 2 (1340548689, 1340548693)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(1340548689n);
+ input.add32(1340548693n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.le_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint256, euint32) => ebool test 3 (1340548693, 1340548693)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(1340548693n);
+ input.add32(1340548693n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.le_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint256, euint32) => ebool test 4 (1340548693, 1340548689)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(1340548693n);
+ input.add32(1340548689n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.le_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint256, euint32) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457577148837567008665, 1716202338)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577148837567008665n);
+ input.add32(1716202338n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.lt_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint256, euint32) => ebool test 2 (1716202334, 1716202338)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(1716202334n);
+ input.add32(1716202338n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.lt_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint256, euint32) => ebool test 3 (1716202338, 1716202338)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(1716202338n);
+ input.add32(1716202338n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.lt_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint256, euint32) => ebool test 4 (1716202338, 1716202334)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(1716202338n);
+ input.add32(1716202334n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.lt_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint256, euint32) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582240718630307135, 1248940496)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582240718630307135n);
+ input.add32(1248940496n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.min_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(1248940496n);
+ });
+
+ it('test operator "min" overload (euint256, euint32) => euint256 test 2 (1248940492, 1248940496)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(1248940492n);
+ input.add32(1248940496n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.min_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(1248940492n);
+ });
+
+ it('test operator "min" overload (euint256, euint32) => euint256 test 3 (1248940496, 1248940496)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(1248940496n);
+ input.add32(1248940496n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.min_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(1248940496n);
+ });
+
+ it('test operator "min" overload (euint256, euint32) => euint256 test 4 (1248940496, 1248940492)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(1248940496n);
+ input.add32(1248940492n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.min_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(1248940492n);
+ });
+
+ it('test operator "max" overload (euint256, euint32) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457581701635304814489, 4274177144)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581701635304814489n);
+ input.add32(4274177144n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.max_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457581701635304814489n);
+ });
+
+ it('test operator "max" overload (euint256, euint32) => euint256 test 2 (4274177140, 4274177144)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(4274177140n);
+ input.add32(4274177144n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.max_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(4274177144n);
+ });
+
+ it('test operator "max" overload (euint256, euint32) => euint256 test 3 (4274177144, 4274177144)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(4274177144n);
+ input.add32(4274177144n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.max_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(4274177144n);
+ });
+
+ it('test operator "max" overload (euint256, euint32) => euint256 test 4 (4274177144, 4274177140)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(4274177144n);
+ input.add32(4274177140n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.max_euint256_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(4274177144n);
+ });
+
+ it('test operator "add" overload (euint256, euint64) => euint256 test 1 (9223372036854775809, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(9223372036854775809n);
+ input.add64(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.add_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(9223372036854775811n);
+ });
+
+ it('test operator "add" overload (euint256, euint64) => euint256 test 2 (9220748041203345234, 9220748041203345236)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(9220748041203345234n);
+ input.add64(9220748041203345236n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.add_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(18441496082406690470n);
+ });
+
+ it('test operator "add" overload (euint256, euint64) => euint256 test 3 (9220748041203345236, 9220748041203345236)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(9220748041203345236n);
+ input.add64(9220748041203345236n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.add_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(18441496082406690472n);
+ });
+
+ it('test operator "add" overload (euint256, euint64) => euint256 test 4 (9220748041203345236, 9220748041203345234)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(9220748041203345236n);
+ input.add64(9220748041203345234n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.add_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(18441496082406690470n);
+ });
+
+ it('test operator "sub" overload (euint256, euint64) => euint256 test 1 (18445296154698553701, 18445296154698553701)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18445296154698553701n);
+ input.add64(18445296154698553701n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.sub_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint256, euint64) => euint256 test 2 (18445296154698553701, 18445296154698553697)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18445296154698553701n);
+ input.add64(18445296154698553697n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.sub_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint256, euint64) => euint256 test 1 (4611686018427387905, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(4611686018427387905n);
+ input.add64(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.mul_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(9223372036854775810n);
+ });
+
+ it('test operator "mul" overload (euint256, euint64) => euint256 test 2 (4292912378, 4292912378)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(4292912378n);
+ input.add64(4292912378n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.mul_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(18429096685185614884n);
+ });
+
+ it('test operator "mul" overload (euint256, euint64) => euint256 test 3 (4292912378, 4292912378)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(4292912378n);
+ input.add64(4292912378n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.mul_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(18429096685185614884n);
+ });
+
+ it('test operator "mul" overload (euint256, euint64) => euint256 test 4 (4292912378, 4292912378)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(4292912378n);
+ input.add64(4292912378n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.mul_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(18429096685185614884n);
+ });
+
+ it('test operator "and" overload (euint256, euint64) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457578396814970518645, 18439393076952901085)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457578396814970518645n);
+ input.add64(18439393076952901085n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.and_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(18438862826454918229n);
+ });
+
+ it('test operator "and" overload (euint256, euint64) => euint256 test 2 (18439393076952901081, 18439393076952901085)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18439393076952901081n);
+ input.add64(18439393076952901085n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.and_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(18439393076952901081n);
+ });
+
+ it('test operator "and" overload (euint256, euint64) => euint256 test 3 (18439393076952901085, 18439393076952901085)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18439393076952901085n);
+ input.add64(18439393076952901085n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.and_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(18439393076952901085n);
+ });
+
+ it('test operator "and" overload (euint256, euint64) => euint256 test 4 (18439393076952901085, 18439393076952901081)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18439393076952901085n);
+ input.add64(18439393076952901081n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.and_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(18439393076952901081n);
+ });
+
+ it('test operator "or" overload (euint256, euint64) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457575138878497255467, 18441296418739792919)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575138878497255467n);
+ input.add64(18441296418739792919n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.or_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457578657599316786239n);
+ });
+
+ it('test operator "or" overload (euint256, euint64) => euint256 test 2 (18441296418739792915, 18441296418739792919)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18441296418739792915n);
+ input.add64(18441296418739792919n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.or_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(18441296418739792919n);
+ });
+
+ it('test operator "or" overload (euint256, euint64) => euint256 test 3 (18441296418739792919, 18441296418739792919)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18441296418739792919n);
+ input.add64(18441296418739792919n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.or_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(18441296418739792919n);
+ });
+
+ it('test operator "or" overload (euint256, euint64) => euint256 test 4 (18441296418739792919, 18441296418739792915)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18441296418739792919n);
+ input.add64(18441296418739792915n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.or_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(18441296418739792919n);
+ });
+
+ it('test operator "xor" overload (euint256, euint64) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457581449682348833995, 18444753228810258299)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581449682348833995n);
+ input.add64(18444753228810258299n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.xor_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039439141209004043664304n);
+ });
+
+ it('test operator "xor" overload (euint256, euint64) => euint256 test 2 (18444753228810258295, 18444753228810258299)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18444753228810258295n);
+ input.add64(18444753228810258299n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.xor_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "xor" overload (euint256, euint64) => euint256 test 3 (18444753228810258299, 18444753228810258299)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18444753228810258299n);
+ input.add64(18444753228810258299n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.xor_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint256, euint64) => euint256 test 4 (18444753228810258299, 18444753228810258295)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18444753228810258299n);
+ input.add64(18444753228810258295n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.xor_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "eq" overload (euint256, euint64) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457579655327337947495, 18438962761364358079)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579655327337947495n);
+ input.add64(18438962761364358079n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.eq_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint256, euint64) => ebool test 2 (18438962761364358075, 18438962761364358079)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18438962761364358075n);
+ input.add64(18438962761364358079n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.eq_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint256, euint64) => ebool test 3 (18438962761364358079, 18438962761364358079)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18438962761364358079n);
+ input.add64(18438962761364358079n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.eq_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint256, euint64) => ebool test 4 (18438962761364358079, 18438962761364358075)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18438962761364358079n);
+ input.add64(18438962761364358075n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.eq_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint256, euint64) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457578997655721966093, 18437968835725654059)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457578997655721966093n);
+ input.add64(18437968835725654059n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ne_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint256, euint64) => ebool test 2 (18437968835725654055, 18437968835725654059)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18437968835725654055n);
+ input.add64(18437968835725654059n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ne_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint256, euint64) => ebool test 3 (18437968835725654059, 18437968835725654059)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18437968835725654059n);
+ input.add64(18437968835725654059n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ne_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint256, euint64) => ebool test 4 (18437968835725654059, 18437968835725654055)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18437968835725654059n);
+ input.add64(18437968835725654055n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ne_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint256, euint64) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457577778171434629241, 18443676400252575763)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577778171434629241n);
+ input.add64(18443676400252575763n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ge_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint256, euint64) => ebool test 2 (18443676400252575759, 18443676400252575763)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18443676400252575759n);
+ input.add64(18443676400252575763n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ge_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint256, euint64) => ebool test 3 (18443676400252575763, 18443676400252575763)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18443676400252575763n);
+ input.add64(18443676400252575763n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ge_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint256, euint64) => ebool test 4 (18443676400252575763, 18443676400252575759)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18443676400252575763n);
+ input.add64(18443676400252575759n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ge_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint256, euint64) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457582386276584123553, 18443192077233247397)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582386276584123553n);
+ input.add64(18443192077233247397n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.gt_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint256, euint64) => ebool test 2 (18443192077233247393, 18443192077233247397)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18443192077233247393n);
+ input.add64(18443192077233247397n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.gt_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint256, euint64) => ebool test 3 (18443192077233247397, 18443192077233247397)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18443192077233247397n);
+ input.add64(18443192077233247397n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.gt_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint256, euint64) => ebool test 4 (18443192077233247397, 18443192077233247393)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18443192077233247397n);
+ input.add64(18443192077233247393n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.gt_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint256, euint64) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457576194967854445761, 18441295092771573001)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457576194967854445761n);
+ input.add64(18441295092771573001n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.le_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "le" overload (euint256, euint64) => ebool test 2 (18441295092771572997, 18441295092771573001)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18441295092771572997n);
+ input.add64(18441295092771573001n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.le_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint256, euint64) => ebool test 3 (18441295092771573001, 18441295092771573001)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18441295092771573001n);
+ input.add64(18441295092771573001n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.le_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint256, euint64) => ebool test 4 (18441295092771573001, 18441295092771572997)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18441295092771573001n);
+ input.add64(18441295092771572997n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.le_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint256, euint64) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457577348858503949249, 18446356831740760619)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577348858503949249n);
+ input.add64(18446356831740760619n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.lt_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint256, euint64) => ebool test 2 (18446356831740760615, 18446356831740760619)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18446356831740760615n);
+ input.add64(18446356831740760619n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.lt_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint256, euint64) => ebool test 3 (18446356831740760619, 18446356831740760619)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18446356831740760619n);
+ input.add64(18446356831740760619n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.lt_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
- const instances = await createInstances(this.signers);
- this.instances = instances;
+ it('test operator "lt" overload (euint256, euint64) => ebool test 4 (18446356831740760619, 18446356831740760615)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18446356831740760619n);
+ input.add64(18446356831740760615n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.lt_euint256_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
});
- it('test operator "min" overload (euint64, euint32) => euint64 test 1 (18440186743754430625, 4137891061)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18440186743754430625n);
- input.add32(4137891061n);
+ it('test operator "min" overload (euint256, euint64) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579813847565218665, 18443636668516069273)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579813847565218665n);
+ input.add64(18443636668516069273n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_euint64_euint32(
+ const tx = await this.contract10.min_euint256_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(4137891061n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(18443636668516069273n);
});
- it('test operator "min" overload (euint64, euint32) => euint64 test 2 (4137891057, 4137891061)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(4137891057n);
- input.add32(4137891061n);
+ it('test operator "min" overload (euint256, euint64) => euint256 test 2 (18443636668516069269, 18443636668516069273)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18443636668516069269n);
+ input.add64(18443636668516069273n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_euint64_euint32(
+ const tx = await this.contract10.min_euint256_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(4137891057n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(18443636668516069269n);
});
- it('test operator "min" overload (euint64, euint32) => euint64 test 3 (4137891061, 4137891061)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(4137891061n);
- input.add32(4137891061n);
+ it('test operator "min" overload (euint256, euint64) => euint256 test 3 (18443636668516069273, 18443636668516069273)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18443636668516069273n);
+ input.add64(18443636668516069273n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_euint64_euint32(
+ const tx = await this.contract10.min_euint256_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(4137891061n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(18443636668516069273n);
});
- it('test operator "min" overload (euint64, euint32) => euint64 test 4 (4137891061, 4137891057)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(4137891061n);
- input.add32(4137891057n);
+ it('test operator "min" overload (euint256, euint64) => euint256 test 4 (18443636668516069273, 18443636668516069269)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18443636668516069273n);
+ input.add64(18443636668516069269n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_euint64_euint32(
+ const tx = await this.contract10.min_euint256_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(4137891057n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(18443636668516069269n);
});
- it('test operator "max" overload (euint64, euint32) => euint64 test 1 (18445662984886583599, 303914102)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18445662984886583599n);
- input.add32(303914102n);
+ it('test operator "max" overload (euint256, euint64) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457583257576614099953, 18438250957457099341)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457583257576614099953n);
+ input.add64(18438250957457099341n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_euint64_euint32(
+ const tx = await this.contract10.max_euint256_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18445662984886583599n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457583257576614099953n);
});
- it('test operator "max" overload (euint64, euint32) => euint64 test 2 (303914098, 303914102)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(303914098n);
- input.add32(303914102n);
+ it('test operator "max" overload (euint256, euint64) => euint256 test 2 (18438250957457099337, 18438250957457099341)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18438250957457099337n);
+ input.add64(18438250957457099341n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_euint64_euint32(
+ const tx = await this.contract10.max_euint256_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(303914102n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(18438250957457099341n);
});
- it('test operator "max" overload (euint64, euint32) => euint64 test 3 (303914102, 303914102)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(303914102n);
- input.add32(303914102n);
+ it('test operator "max" overload (euint256, euint64) => euint256 test 3 (18438250957457099341, 18438250957457099341)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18438250957457099341n);
+ input.add64(18438250957457099341n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_euint64_euint32(
+ const tx = await this.contract10.max_euint256_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(303914102n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(18438250957457099341n);
});
- it('test operator "max" overload (euint64, euint32) => euint64 test 4 (303914102, 303914098)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(303914102n);
- input.add32(303914098n);
+ it('test operator "max" overload (euint256, euint64) => euint256 test 4 (18438250957457099341, 18438250957457099337)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(18438250957457099341n);
+ input.add64(18438250957457099337n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_euint64_euint32(
+ const tx = await this.contract10.max_euint256_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(303914102n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(18438250957457099341n);
});
- it('test operator "add" overload (euint64, euint64) => euint64 test 1 (9219336648067240893, 9223239842705786428)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(9219336648067240893n);
- input.add64(9223239842705786428n);
+ it('test operator "add" overload (euint256, euint128) => euint256 test 1 (170141183460469231731687303715884105729, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(170141183460469231731687303715884105729n);
+ input.add128(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.add_euint64_euint64(
+ const tx = await this.contract10.add_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18442576490773027321n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(170141183460469231731687303715884105731n);
});
- it('test operator "add" overload (euint64, euint64) => euint64 test 2 (9219336648067240891, 9219336648067240893)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(9219336648067240891n);
- input.add64(9219336648067240893n);
+ it('test operator "add" overload (euint256, euint128) => euint256 test 2 (170141183460469231731684278054029333276, 170141183460469231731684278054029333278)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(170141183460469231731684278054029333276n);
+ input.add128(170141183460469231731684278054029333278n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.add_euint64_euint64(
+ const tx = await this.contract10.add_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18438673296134481784n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(340282366920938463463368556108058666554n);
});
- it('test operator "add" overload (euint64, euint64) => euint64 test 3 (9219336648067240893, 9219336648067240893)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(9219336648067240893n);
- input.add64(9219336648067240893n);
+ it('test operator "add" overload (euint256, euint128) => euint256 test 3 (170141183460469231731684278054029333278, 170141183460469231731684278054029333278)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(170141183460469231731684278054029333278n);
+ input.add128(170141183460469231731684278054029333278n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.add_euint64_euint64(
+ const tx = await this.contract10.add_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18438673296134481786n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(340282366920938463463368556108058666556n);
});
- it('test operator "add" overload (euint64, euint64) => euint64 test 4 (9219336648067240893, 9219336648067240891)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(9219336648067240893n);
- input.add64(9219336648067240891n);
+ it('test operator "add" overload (euint256, euint128) => euint256 test 4 (170141183460469231731684278054029333278, 170141183460469231731684278054029333276)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(170141183460469231731684278054029333278n);
+ input.add128(170141183460469231731684278054029333276n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.add_euint64_euint64(
+ const tx = await this.contract10.add_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18438673296134481784n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(340282366920938463463368556108058666554n);
});
- it('test operator "sub" overload (euint64, euint64) => euint64 test 1 (18442295292010752223, 18442295292010752223)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442295292010752223n);
- input.add64(18442295292010752223n);
+ it('test operator "sub" overload (euint256, euint128) => euint256 test 1 (340282366920938463463373776145256730539, 340282366920938463463373776145256730539)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463373776145256730539n);
+ input.add128(340282366920938463463373776145256730539n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.sub_euint64_euint64(
+ const tx = await this.contract10.sub_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
+ const res = await decrypt256(await this.contract10.res256());
expect(res).to.equal(0n);
});
- it('test operator "sub" overload (euint64, euint64) => euint64 test 2 (18442295292010752223, 18442295292010752219)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442295292010752223n);
- input.add64(18442295292010752219n);
+ it('test operator "sub" overload (euint256, euint128) => euint256 test 2 (340282366920938463463373776145256730539, 340282366920938463463373776145256730535)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463373776145256730539n);
+ input.add128(340282366920938463463373776145256730535n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.sub_euint64_euint64(
+ const tx = await this.contract10.sub_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
+ const res = await decrypt256(await this.contract10.res256());
expect(res).to.equal(4n);
});
- it('test operator "mul" overload (euint64, euint64) => euint64 test 1 (4294744203, 4293841776)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(4294744203n);
- input.add64(4293841776n);
+ it('test operator "mul" overload (euint256, euint128) => euint256 test 1 (85070591730234615865843651857942052865, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(85070591730234615865843651857942052865n);
+ input.add128(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.mul_euint64_euint64(
+ const tx = await this.contract10.mul_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18440952076075224528n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(170141183460469231731687303715884105730n);
});
- it('test operator "mul" overload (euint64, euint64) => euint64 test 2 (4293841776, 4293841776)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(4293841776n);
- input.add64(4293841776n);
+ it('test operator "mul" overload (euint256, euint128) => euint256 test 2 (9223372036854775809, 9223372036854775809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(9223372036854775809n);
+ input.add128(9223372036854775809n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.mul_euint64_euint64(
+ const tx = await this.contract10.mul_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18437077197322834176n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(85070591730234615884290395931651604481n);
});
- it('test operator "mul" overload (euint64, euint64) => euint64 test 3 (4293841776, 4293841776)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(4293841776n);
- input.add64(4293841776n);
+ it('test operator "mul" overload (euint256, euint128) => euint256 test 3 (9223372036854775809, 9223372036854775809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(9223372036854775809n);
+ input.add128(9223372036854775809n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.mul_euint64_euint64(
+ const tx = await this.contract10.mul_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18437077197322834176n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(85070591730234615884290395931651604481n);
});
- it('test operator "mul" overload (euint64, euint64) => euint64 test 4 (4293841776, 4293841776)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(4293841776n);
- input.add64(4293841776n);
+ it('test operator "mul" overload (euint256, euint128) => euint256 test 4 (9223372036854775809, 9223372036854775809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(9223372036854775809n);
+ input.add128(9223372036854775809n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.mul_euint64_euint64(
+ const tx = await this.contract10.mul_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18437077197322834176n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(85070591730234615884290395931651604481n);
});
- it('test operator "and" overload (euint64, euint64) => euint64 test 1 (18444924635377016941, 18446173308524975411)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18444924635377016941n);
- input.add64(18446173308524975411n);
+ it('test operator "and" overload (euint256, euint128) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582929951159672455, 340282366920938463463365847322826293787)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582929951159672455n);
+ input.add128(340282366920938463463365847322826293787n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.and_euint64_euint64(
+ const tx = await this.contract10.and_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18444923419899985953n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(340282366920938463463365636070292242947n);
});
- it('test operator "and" overload (euint64, euint64) => euint64 test 2 (18444924635377016937, 18444924635377016941)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18444924635377016937n);
- input.add64(18444924635377016941n);
+ it('test operator "and" overload (euint256, euint128) => euint256 test 2 (340282366920938463463365847322826293783, 340282366920938463463365847322826293787)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463365847322826293783n);
+ input.add128(340282366920938463463365847322826293787n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.and_euint64_euint64(
+ const tx = await this.contract10.and_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18444924635377016937n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(340282366920938463463365847322826293779n);
});
- it('test operator "and" overload (euint64, euint64) => euint64 test 3 (18444924635377016941, 18444924635377016941)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18444924635377016941n);
- input.add64(18444924635377016941n);
+ it('test operator "and" overload (euint256, euint128) => euint256 test 3 (340282366920938463463365847322826293787, 340282366920938463463365847322826293787)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463365847322826293787n);
+ input.add128(340282366920938463463365847322826293787n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.and_euint64_euint64(
+ const tx = await this.contract10.and_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18444924635377016941n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(340282366920938463463365847322826293787n);
});
- it('test operator "and" overload (euint64, euint64) => euint64 test 4 (18444924635377016941, 18444924635377016937)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18444924635377016941n);
- input.add64(18444924635377016937n);
+ it('test operator "and" overload (euint256, euint128) => euint256 test 4 (340282366920938463463365847322826293787, 340282366920938463463365847322826293783)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463365847322826293787n);
+ input.add128(340282366920938463463365847322826293783n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.and_euint64_euint64(
+ const tx = await this.contract10.and_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18444924635377016937n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(340282366920938463463365847322826293779n);
});
- it('test operator "or" overload (euint64, euint64) => euint64 test 1 (18442105052999173891, 18440193626964063709)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442105052999173891n);
- input.add64(18440193626964063709n);
+ it('test operator "or" overload (euint256, euint128) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457581776378743047187, 340282366920938463463373551062299472959)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581776378743047187n);
+ input.add128(340282366920938463463373551062299472959n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.or_euint64_euint64(
+ const tx = await this.contract10.or_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18442168970778769375n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457582951827808547903n);
});
- it('test operator "or" overload (euint64, euint64) => euint64 test 2 (18440193626964063705, 18440193626964063709)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18440193626964063705n);
- input.add64(18440193626964063709n);
+ it('test operator "or" overload (euint256, euint128) => euint256 test 2 (340282366920938463463373551062299472955, 340282366920938463463373551062299472959)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463373551062299472955n);
+ input.add128(340282366920938463463373551062299472959n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.or_euint64_euint64(
+ const tx = await this.contract10.or_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18440193626964063709n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(340282366920938463463373551062299472959n);
});
- it('test operator "or" overload (euint64, euint64) => euint64 test 3 (18440193626964063709, 18440193626964063709)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18440193626964063709n);
- input.add64(18440193626964063709n);
+ it('test operator "or" overload (euint256, euint128) => euint256 test 3 (340282366920938463463373551062299472959, 340282366920938463463373551062299472959)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463373551062299472959n);
+ input.add128(340282366920938463463373551062299472959n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.or_euint64_euint64(
+ const tx = await this.contract10.or_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18440193626964063709n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(340282366920938463463373551062299472959n);
});
- it('test operator "or" overload (euint64, euint64) => euint64 test 4 (18440193626964063709, 18440193626964063705)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18440193626964063709n);
- input.add64(18440193626964063705n);
+ it('test operator "or" overload (euint256, euint128) => euint256 test 4 (340282366920938463463373551062299472959, 340282366920938463463373551062299472955)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463373551062299472959n);
+ input.add128(340282366920938463463373551062299472955n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.or_euint64_euint64(
+ const tx = await this.contract10.or_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18440193626964063709n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(340282366920938463463373551062299472959n);
});
- it('test operator "xor" overload (euint64, euint64) => euint64 test 1 (18440379911699358599, 18444259094994538125)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18440379911699358599n);
- input.add64(18444259094994538125n);
+ it('test operator "xor" overload (euint256, euint128) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582608158223098943, 340282366920938463463373070389452427715)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582608158223098943n);
+ input.add128(340282366920938463463373070389452427715n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.xor_euint64_euint64(
+ const tx = await this.contract10.xor_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(8523658389368074n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907852929702298719625575994209836984672105980n);
});
- it('test operator "xor" overload (euint64, euint64) => euint64 test 2 (18440379911699358595, 18440379911699358599)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18440379911699358595n);
- input.add64(18440379911699358599n);
+ it('test operator "xor" overload (euint256, euint128) => euint256 test 2 (340282366920938463463373070389452427711, 340282366920938463463373070389452427715)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463373070389452427711n);
+ input.add128(340282366920938463463373070389452427715n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.xor_euint64_euint64(
+ const tx = await this.contract10.xor_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(4n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(124n);
});
- it('test operator "xor" overload (euint64, euint64) => euint64 test 3 (18440379911699358599, 18440379911699358599)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18440379911699358599n);
- input.add64(18440379911699358599n);
+ it('test operator "xor" overload (euint256, euint128) => euint256 test 3 (340282366920938463463373070389452427715, 340282366920938463463373070389452427715)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463373070389452427715n);
+ input.add128(340282366920938463463373070389452427715n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.xor_euint64_euint64(
+ const tx = await this.contract10.xor_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
+ const res = await decrypt256(await this.contract10.res256());
expect(res).to.equal(0n);
});
- it('test operator "xor" overload (euint64, euint64) => euint64 test 4 (18440379911699358599, 18440379911699358595)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18440379911699358599n);
- input.add64(18440379911699358595n);
+ it('test operator "xor" overload (euint256, euint128) => euint256 test 4 (340282366920938463463373070389452427715, 340282366920938463463373070389452427711)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463373070389452427715n);
+ input.add128(340282366920938463463373070389452427711n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.xor_euint64_euint64(
+ const tx = await this.contract10.xor_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(4n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(124n);
});
- it('test operator "eq" overload (euint64, euint64) => ebool test 1 (18442470885463520691, 18445888562756211467)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442470885463520691n);
- input.add64(18445888562756211467n);
+ it('test operator "eq" overload (euint256, euint128) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457583147947133304483, 340282366920938463463373080930672512019)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457583147947133304483n);
+ input.add128(340282366920938463463373080930672512019n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.eq_euint64_euint64(
+ const tx = await this.contract10.eq_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint64, euint64) => ebool test 2 (18442470885463520687, 18442470885463520691)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442470885463520687n);
- input.add64(18442470885463520691n);
+ it('test operator "eq" overload (euint256, euint128) => ebool test 2 (340282366920938463463373080930672512015, 340282366920938463463373080930672512019)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463373080930672512015n);
+ input.add128(340282366920938463463373080930672512019n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.eq_euint64_euint64(
+ const tx = await this.contract10.eq_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint64, euint64) => ebool test 3 (18442470885463520691, 18442470885463520691)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442470885463520691n);
- input.add64(18442470885463520691n);
+ it('test operator "eq" overload (euint256, euint128) => ebool test 3 (340282366920938463463373080930672512019, 340282366920938463463373080930672512019)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463373080930672512019n);
+ input.add128(340282366920938463463373080930672512019n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.eq_euint64_euint64(
+ const tx = await this.contract10.eq_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint64, euint64) => ebool test 4 (18442470885463520691, 18442470885463520687)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442470885463520691n);
- input.add64(18442470885463520687n);
+ it('test operator "eq" overload (euint256, euint128) => ebool test 4 (340282366920938463463373080930672512019, 340282366920938463463373080930672512015)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463373080930672512019n);
+ input.add128(340282366920938463463373080930672512015n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.eq_euint64_euint64(
+ const tx = await this.contract10.eq_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint64, euint64) => ebool test 1 (18442343533763371027, 18438477816592523453)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442343533763371027n);
- input.add64(18438477816592523453n);
+ it('test operator "ne" overload (euint256, euint128) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457576673614745401783, 340282366920938463463373230674573043227)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457576673614745401783n);
+ input.add128(340282366920938463463373230674573043227n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ne_euint64_euint64(
+ const tx = await this.contract10.ne_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint64, euint64) => ebool test 2 (18438477816592523449, 18438477816592523453)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438477816592523449n);
- input.add64(18438477816592523453n);
+ it('test operator "ne" overload (euint256, euint128) => ebool test 2 (340282366920938463463373230674573043223, 340282366920938463463373230674573043227)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463373230674573043223n);
+ input.add128(340282366920938463463373230674573043227n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ne_euint64_euint64(
+ const tx = await this.contract10.ne_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint64, euint64) => ebool test 3 (18438477816592523453, 18438477816592523453)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438477816592523453n);
- input.add64(18438477816592523453n);
+ it('test operator "ne" overload (euint256, euint128) => ebool test 3 (340282366920938463463373230674573043227, 340282366920938463463373230674573043227)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463373230674573043227n);
+ input.add128(340282366920938463463373230674573043227n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ne_euint64_euint64(
+ const tx = await this.contract10.ne_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint64, euint64) => ebool test 4 (18438477816592523453, 18438477816592523449)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438477816592523453n);
- input.add64(18438477816592523449n);
+ it('test operator "ne" overload (euint256, euint128) => ebool test 4 (340282366920938463463373230674573043227, 340282366920938463463373230674573043223)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463373230674573043227n);
+ input.add128(340282366920938463463373230674573043223n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ne_euint64_euint64(
+ const tx = await this.contract10.ne_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint64, euint64) => ebool test 1 (18441951286640352465, 18443086804815428517)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18441951286640352465n);
- input.add64(18443086804815428517n);
+ it('test operator "ge" overload (euint256, euint128) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457581781091933664799, 340282366920938463463369397462507033255)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581781091933664799n);
+ input.add128(340282366920938463463369397462507033255n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ge_euint64_euint64(
+ const tx = await this.contract10.ge_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint64, euint64) => ebool test 2 (18441951286640352461, 18441951286640352465)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18441951286640352461n);
- input.add64(18441951286640352465n);
+ it('test operator "ge" overload (euint256, euint128) => ebool test 2 (340282366920938463463369397462507033251, 340282366920938463463369397462507033255)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463369397462507033251n);
+ input.add128(340282366920938463463369397462507033255n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ge_euint64_euint64(
+ const tx = await this.contract10.ge_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint64, euint64) => ebool test 3 (18441951286640352465, 18441951286640352465)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18441951286640352465n);
- input.add64(18441951286640352465n);
+ it('test operator "ge" overload (euint256, euint128) => ebool test 3 (340282366920938463463369397462507033255, 340282366920938463463369397462507033255)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463369397462507033255n);
+ input.add128(340282366920938463463369397462507033255n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ge_euint64_euint64(
+ const tx = await this.contract10.ge_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint64, euint64) => ebool test 4 (18441951286640352465, 18441951286640352461)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18441951286640352465n);
- input.add64(18441951286640352461n);
+ it('test operator "ge" overload (euint256, euint128) => ebool test 4 (340282366920938463463369397462507033255, 340282366920938463463369397462507033251)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463369397462507033255n);
+ input.add128(340282366920938463463369397462507033251n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ge_euint64_euint64(
+ const tx = await this.contract10.ge_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint64, euint64) => ebool test 1 (18443021258691337483, 18443593997946075985)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18443021258691337483n);
- input.add64(18443593997946075985n);
+ it('test operator "gt" overload (euint256, euint128) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457583305927195076375, 340282366920938463463370153073900549113)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457583305927195076375n);
+ input.add128(340282366920938463463370153073900549113n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.gt_euint64_euint64(
+ const tx = await this.contract10.gt_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint64, euint64) => ebool test 2 (18443021258691337479, 18443021258691337483)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18443021258691337479n);
- input.add64(18443021258691337483n);
+ it('test operator "gt" overload (euint256, euint128) => ebool test 2 (340282366920938463463370153073900549109, 340282366920938463463370153073900549113)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463370153073900549109n);
+ input.add128(340282366920938463463370153073900549113n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.gt_euint64_euint64(
+ const tx = await this.contract10.gt_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint64, euint64) => ebool test 3 (18443021258691337483, 18443021258691337483)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18443021258691337483n);
- input.add64(18443021258691337483n);
+ it('test operator "gt" overload (euint256, euint128) => ebool test 3 (340282366920938463463370153073900549113, 340282366920938463463370153073900549113)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463370153073900549113n);
+ input.add128(340282366920938463463370153073900549113n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.gt_euint64_euint64(
+ const tx = await this.contract10.gt_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint64, euint64) => ebool test 4 (18443021258691337483, 18443021258691337479)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18443021258691337483n);
- input.add64(18443021258691337479n);
+ it('test operator "gt" overload (euint256, euint128) => ebool test 4 (340282366920938463463370153073900549113, 340282366920938463463370153073900549109)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463370153073900549113n);
+ input.add128(340282366920938463463370153073900549109n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.gt_euint64_euint64(
+ const tx = await this.contract10.gt_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint64, euint64) => ebool test 1 (18443782238591650169, 18441978790273961913)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18443782238591650169n);
- input.add64(18441978790273961913n);
+ it('test operator "le" overload (euint256, euint128) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457580916980779426235, 340282366920938463463367434270493244717)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580916980779426235n);
+ input.add128(340282366920938463463367434270493244717n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_euint64_euint64(
+ const tx = await this.contract10.le_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(false);
});
- it('test operator "le" overload (euint64, euint64) => ebool test 2 (18441978790273961909, 18441978790273961913)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18441978790273961909n);
- input.add64(18441978790273961913n);
+ it('test operator "le" overload (euint256, euint128) => ebool test 2 (340282366920938463463367434270493244713, 340282366920938463463367434270493244717)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463367434270493244713n);
+ input.add128(340282366920938463463367434270493244717n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_euint64_euint64(
+ const tx = await this.contract10.le_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint64, euint64) => ebool test 3 (18441978790273961913, 18441978790273961913)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18441978790273961913n);
- input.add64(18441978790273961913n);
+ it('test operator "le" overload (euint256, euint128) => ebool test 3 (340282366920938463463367434270493244717, 340282366920938463463367434270493244717)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463367434270493244717n);
+ input.add128(340282366920938463463367434270493244717n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_euint64_euint64(
+ const tx = await this.contract10.le_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint64, euint64) => ebool test 4 (18441978790273961913, 18441978790273961909)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18441978790273961913n);
- input.add64(18441978790273961909n);
+ it('test operator "le" overload (euint256, euint128) => ebool test 4 (340282366920938463463367434270493244717, 340282366920938463463367434270493244713)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463367434270493244717n);
+ input.add128(340282366920938463463367434270493244713n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_euint64_euint64(
+ const tx = await this.contract10.le_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint64, euint64) => ebool test 1 (18445972196307174659, 18438760003066140571)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18445972196307174659n);
- input.add64(18438760003066140571n);
+ it('test operator "lt" overload (euint256, euint128) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457582200169426284819, 340282366920938463463367486483424293599)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582200169426284819n);
+ input.add128(340282366920938463463367486483424293599n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_euint64_euint64(
+ const tx = await this.contract10.lt_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint64, euint64) => ebool test 2 (18438760003066140567, 18438760003066140571)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438760003066140567n);
- input.add64(18438760003066140571n);
+ it('test operator "lt" overload (euint256, euint128) => ebool test 2 (340282366920938463463367486483424293595, 340282366920938463463367486483424293599)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463367486483424293595n);
+ input.add128(340282366920938463463367486483424293599n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_euint64_euint64(
+ const tx = await this.contract10.lt_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint64, euint64) => ebool test 3 (18438760003066140571, 18438760003066140571)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438760003066140571n);
- input.add64(18438760003066140571n);
+ it('test operator "lt" overload (euint256, euint128) => ebool test 3 (340282366920938463463367486483424293599, 340282366920938463463367486483424293599)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463367486483424293599n);
+ input.add128(340282366920938463463367486483424293599n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_euint64_euint64(
+ const tx = await this.contract10.lt_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint64, euint64) => ebool test 4 (18438760003066140571, 18438760003066140567)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438760003066140571n);
- input.add64(18438760003066140567n);
+ it('test operator "lt" overload (euint256, euint128) => ebool test 4 (340282366920938463463367486483424293599, 340282366920938463463367486483424293595)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463367486483424293599n);
+ input.add128(340282366920938463463367486483424293595n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_euint64_euint64(
+ const tx = await this.contract10.lt_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(false);
});
- it('test operator "min" overload (euint64, euint64) => euint64 test 1 (18446277918636147641, 18439099819121701507)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18446277918636147641n);
- input.add64(18439099819121701507n);
+ it('test operator "min" overload (euint256, euint128) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457578748486524440321, 340282366920938463463370032475222092647)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457578748486524440321n);
+ input.add128(340282366920938463463370032475222092647n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_euint64_euint64(
+ const tx = await this.contract10.min_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18439099819121701507n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(340282366920938463463370032475222092647n);
});
- it('test operator "min" overload (euint64, euint64) => euint64 test 2 (18439099819121701503, 18439099819121701507)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18439099819121701503n);
- input.add64(18439099819121701507n);
+ it('test operator "min" overload (euint256, euint128) => euint256 test 2 (340282366920938463463370032475222092643, 340282366920938463463370032475222092647)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463370032475222092643n);
+ input.add128(340282366920938463463370032475222092647n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_euint64_euint64(
+ const tx = await this.contract10.min_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18439099819121701503n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(340282366920938463463370032475222092643n);
});
- it('test operator "min" overload (euint64, euint64) => euint64 test 3 (18439099819121701507, 18439099819121701507)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18439099819121701507n);
- input.add64(18439099819121701507n);
+ it('test operator "min" overload (euint256, euint128) => euint256 test 3 (340282366920938463463370032475222092647, 340282366920938463463370032475222092647)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463370032475222092647n);
+ input.add128(340282366920938463463370032475222092647n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_euint64_euint64(
+ const tx = await this.contract10.min_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18439099819121701507n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(340282366920938463463370032475222092647n);
});
- it('test operator "min" overload (euint64, euint64) => euint64 test 4 (18439099819121701507, 18439099819121701503)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18439099819121701507n);
- input.add64(18439099819121701503n);
+ it('test operator "min" overload (euint256, euint128) => euint256 test 4 (340282366920938463463370032475222092647, 340282366920938463463370032475222092643)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463370032475222092647n);
+ input.add128(340282366920938463463370032475222092643n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_euint64_euint64(
+ const tx = await this.contract10.min_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18439099819121701503n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(340282366920938463463370032475222092643n);
});
- it('test operator "max" overload (euint64, euint64) => euint64 test 1 (18438631683554897479, 18438807769877774597)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438631683554897479n);
- input.add64(18438807769877774597n);
+ it('test operator "max" overload (euint256, euint128) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457580295384680552043, 340282366920938463463368511201134180813)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580295384680552043n);
+ input.add128(340282366920938463463368511201134180813n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_euint64_euint64(
+ const tx = await this.contract10.max_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18438807769877774597n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457580295384680552043n);
});
- it('test operator "max" overload (euint64, euint64) => euint64 test 2 (18438631683554897475, 18438631683554897479)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438631683554897475n);
- input.add64(18438631683554897479n);
+ it('test operator "max" overload (euint256, euint128) => euint256 test 2 (340282366920938463463368511201134180809, 340282366920938463463368511201134180813)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463368511201134180809n);
+ input.add128(340282366920938463463368511201134180813n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_euint64_euint64(
+ const tx = await this.contract10.max_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18438631683554897479n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(340282366920938463463368511201134180813n);
});
- it('test operator "max" overload (euint64, euint64) => euint64 test 3 (18438631683554897479, 18438631683554897479)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438631683554897479n);
- input.add64(18438631683554897479n);
+ it('test operator "max" overload (euint256, euint128) => euint256 test 3 (340282366920938463463368511201134180813, 340282366920938463463368511201134180813)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463368511201134180813n);
+ input.add128(340282366920938463463368511201134180813n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_euint64_euint64(
+ const tx = await this.contract10.max_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18438631683554897479n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(340282366920938463463368511201134180813n);
});
- it('test operator "max" overload (euint64, euint64) => euint64 test 4 (18438631683554897479, 18438631683554897475)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438631683554897479n);
- input.add64(18438631683554897475n);
+ it('test operator "max" overload (euint256, euint128) => euint256 test 4 (340282366920938463463368511201134180813, 340282366920938463463368511201134180809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(340282366920938463463368511201134180813n);
+ input.add128(340282366920938463463368511201134180809n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_euint64_euint64(
+ const tx = await this.contract10.max_euint256_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18438631683554897479n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(340282366920938463463368511201134180813n);
});
- it('test operator "add" overload (euint64, uint64) => euint64 test 1 (9219336648067240893, 9219865027937887870)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(9219336648067240893n);
-
+ it('test operator "add" overload (euint256, euint256) => euint256 test 1 (57896044618658097711785492504343953926634992332820282019728789013802824080146, 57896044618658097711785492504343953926634992332820282019728788109485910742180)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(57896044618658097711785492504343953926634992332820282019728789013802824080146n);
+ input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742180n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.add_euint64_uint64(
+ const tx = await this.contract10.add_euint256_euint256(
encryptedAmount.handles[0],
- 9219865027937887870n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18439201676005128763n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577123288734822326n);
});
- it('test operator "add" overload (euint64, uint64) => euint64 test 2 (9219336648067240891, 9219336648067240893)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(9219336648067240891n);
-
+ it('test operator "add" overload (euint256, euint256) => euint256 test 2 (57896044618658097711785492504343953926634992332820282019728788109485910742178, 57896044618658097711785492504343953926634992332820282019728788109485910742180)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742178n);
+ input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742180n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.add_euint64_uint64(
+ const tx = await this.contract10.add_euint256_euint256(
encryptedAmount.handles[0],
- 9219336648067240893n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18438673296134481784n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484358n);
});
- it('test operator "add" overload (euint64, uint64) => euint64 test 3 (9219336648067240893, 9219336648067240893)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(9219336648067240893n);
-
+ it('test operator "add" overload (euint256, euint256) => euint256 test 3 (57896044618658097711785492504343953926634992332820282019728788109485910742180, 57896044618658097711785492504343953926634992332820282019728788109485910742180)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742180n);
+ input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742180n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.add_euint64_uint64(
+ const tx = await this.contract10.add_euint256_euint256(
encryptedAmount.handles[0],
- 9219336648067240893n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18438673296134481786n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484360n);
});
- it('test operator "add" overload (euint64, uint64) => euint64 test 4 (9219336648067240893, 9219336648067240891)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(9219336648067240893n);
-
+ it('test operator "add" overload (euint256, euint256) => euint256 test 4 (57896044618658097711785492504343953926634992332820282019728788109485910742180, 57896044618658097711785492504343953926634992332820282019728788109485910742178)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742180n);
+ input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742178n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.add_euint64_uint64(
+ const tx = await this.contract10.add_euint256_euint256(
encryptedAmount.handles[0],
- 9219336648067240891n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18438673296134481784n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484358n);
});
- it('test operator "add" overload (uint64, euint64) => euint64 test 1 (9221821645145019755, 9219865027937887870)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
-
- input.add64(9219865027937887870n);
+ it('test operator "sub" overload (euint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579667871013646565, 115792089237316195423570985008687907853269984665640564039457579667871013646565)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579667871013646565n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579667871013646565n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.add_uint64_euint64(
- 9221821645145019755n,
+ const tx = await this.contract10.sub_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18441686673082907625n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(0n);
});
- it('test operator "add" overload (uint64, euint64) => euint64 test 2 (9219336648067240891, 9219336648067240893)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
-
- input.add64(9219336648067240893n);
+ it('test operator "sub" overload (euint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457579667871013646565, 115792089237316195423570985008687907853269984665640564039457579667871013646561)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579667871013646565n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579667871013646561n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.add_uint64_euint64(
- 9219336648067240891n,
+ const tx = await this.contract10.sub_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18438673296134481784n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(4n);
});
- it('test operator "add" overload (uint64, euint64) => euint64 test 3 (9219336648067240893, 9219336648067240893)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
-
- input.add64(9219336648067240893n);
+ it('test operator "mul" overload (euint256, euint256) => euint256 test 1 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(170141183460469231731687303715884105729n);
+ input.add256(170141183460469231731687303715884105729n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.add_uint64_euint64(
- 9219336648067240893n,
+ const tx = await this.contract10.mul_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18438673296134481786n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n);
});
- it('test operator "add" overload (uint64, euint64) => euint64 test 4 (9219336648067240893, 9219336648067240891)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
-
- input.add64(9219336648067240891n);
+ it('test operator "mul" overload (euint256, euint256) => euint256 test 2 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(170141183460469231731687303715884105729n);
+ input.add256(170141183460469231731687303715884105729n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.add_uint64_euint64(
- 9219336648067240893n,
+ const tx = await this.contract10.mul_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18438673296134481784n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n);
});
- it('test operator "sub" overload (euint64, uint64) => euint64 test 1 (18442295292010752223, 18442295292010752223)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442295292010752223n);
-
+ it('test operator "mul" overload (euint256, euint256) => euint256 test 3 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(170141183460469231731687303715884105729n);
+ input.add256(170141183460469231731687303715884105729n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.sub_euint64_uint64(
+ const tx = await this.contract10.mul_euint256_euint256(
encryptedAmount.handles[0],
- 18442295292010752223n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(0n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n);
});
- it('test operator "sub" overload (euint64, uint64) => euint64 test 2 (18442295292010752223, 18442295292010752219)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442295292010752223n);
-
+ it('test operator "mul" overload (euint256, euint256) => euint256 test 4 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(170141183460469231731687303715884105729n);
+ input.add256(170141183460469231731687303715884105729n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.sub_euint64_uint64(
+ const tx = await this.contract10.mul_euint256_euint256(
encryptedAmount.handles[0],
- 18442295292010752219n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(4n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n);
});
- it('test operator "sub" overload (uint64, euint64) => euint64 test 1 (18442295292010752223, 18442295292010752223)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
-
- input.add64(18442295292010752223n);
+ it('test operator "and" overload (euint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457580473854578773963, 115792089237316195423570985008687907853269984665640564039457579064265044491325)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580473854578773963n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491325n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.sub_uint64_euint64(
- 18442295292010752223n,
+ const tx = await this.contract10.and_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(0n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457575671150140541961n);
});
- it('test operator "sub" overload (uint64, euint64) => euint64 test 2 (18442295292010752223, 18442295292010752219)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
-
- input.add64(18442295292010752219n);
+ it('test operator "and" overload (euint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457579064265044491321, 115792089237316195423570985008687907853269984665640564039457579064265044491325)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491321n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491325n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.sub_uint64_euint64(
- 18442295292010752223n,
+ const tx = await this.contract10.and_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(4n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491321n);
});
- it('test operator "mul" overload (euint64, uint64) => euint64 test 1 (4294744203, 4294589707)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(4294744203n);
-
+ it('test operator "and" overload (euint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457579064265044491325, 115792089237316195423570985008687907853269984665640564039457579064265044491325)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491325n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491325n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.mul_euint64_uint64(
+ const tx = await this.contract10.and_euint256_euint256(
encryptedAmount.handles[0],
- 4294589707n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18444164248401718521n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491325n);
});
- it('test operator "mul" overload (euint64, uint64) => euint64 test 2 (4293841776, 4293841776)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(4293841776n);
-
+ it('test operator "and" overload (euint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457579064265044491325, 115792089237316195423570985008687907853269984665640564039457579064265044491321)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491325n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491321n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.mul_euint64_uint64(
+ const tx = await this.contract10.and_euint256_euint256(
encryptedAmount.handles[0],
- 4293841776n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18437077197322834176n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491321n);
});
- it('test operator "mul" overload (euint64, uint64) => euint64 test 3 (4293841776, 4293841776)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(4293841776n);
-
+ it('test operator "or" overload (euint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579093390716184697, 115792089237316195423570985008687907853269984665640564039457580393822758166581)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184697n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580393822758166581n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.mul_euint64_uint64(
+ const tx = await this.contract10.or_euint256_euint256(
encryptedAmount.handles[0],
- 4293841776n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18437077197322834176n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457583914753535699069n);
});
- it('test operator "mul" overload (euint64, uint64) => euint64 test 4 (4293841776, 4293841776)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(4293841776n);
-
+ it('test operator "or" overload (euint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457579093390716184693, 115792089237316195423570985008687907853269984665640564039457579093390716184697)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184693n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184697n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.mul_euint64_uint64(
+ const tx = await this.contract10.or_euint256_euint256(
encryptedAmount.handles[0],
- 4293841776n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18437077197322834176n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184701n);
});
- it('test operator "mul" overload (uint64, euint64) => euint64 test 1 (4293263967, 4294589707)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
-
- input.add64(4294589707n);
+ it('test operator "or" overload (euint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457579093390716184697, 115792089237316195423570985008687907853269984665640564039457579093390716184697)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184697n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184697n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.mul_uint64_euint64(
- 4293263967n,
+ const tx = await this.contract10.or_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18437807242112187669n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184697n);
});
- it('test operator "mul" overload (uint64, euint64) => euint64 test 2 (4293841776, 4293841776)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
-
- input.add64(4293841776n);
+ it('test operator "or" overload (euint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457579093390716184697, 115792089237316195423570985008687907853269984665640564039457579093390716184693)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184697n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184693n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.mul_uint64_euint64(
- 4293841776n,
+ const tx = await this.contract10.or_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18437077197322834176n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184701n);
});
- it('test operator "mul" overload (uint64, euint64) => euint64 test 3 (4293841776, 4293841776)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
-
- input.add64(4293841776n);
+ it('test operator "xor" overload (euint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582495469225451093, 115792089237316195423570985008687907853269984665640564039457581801761034193859)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582495469225451093n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193859n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.mul_uint64_euint64(
- 4293841776n,
+ const tx = await this.contract10.xor_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18437077197322834176n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(714633272808854n);
});
- it('test operator "mul" overload (uint64, euint64) => euint64 test 4 (4293841776, 4293841776)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
-
- input.add64(4293841776n);
+ it('test operator "xor" overload (euint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457581801761034193855, 115792089237316195423570985008687907853269984665640564039457581801761034193859)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193855n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193859n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.mul_uint64_euint64(
- 4293841776n,
+ const tx = await this.contract10.xor_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18437077197322834176n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(124n);
});
- it('test operator "div" overload (euint64, uint64) => euint64 test 1 (18442885434890559161, 18443612733078410209)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442885434890559161n);
-
+ it('test operator "xor" overload (euint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457581801761034193859, 115792089237316195423570985008687907853269984665640564039457581801761034193859)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193859n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193859n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.div_euint64_uint64(
+ const tx = await this.contract10.xor_euint256_euint256(
encryptedAmount.handles[0],
- 18443612733078410209n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
+ const res = await decrypt256(await this.contract10.res256());
expect(res).to.equal(0n);
});
- it('test operator "div" overload (euint64, uint64) => euint64 test 2 (18442885434890559157, 18442885434890559161)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442885434890559157n);
-
+ it('test operator "xor" overload (euint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457581801761034193859, 115792089237316195423570985008687907853269984665640564039457581801761034193855)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193859n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193855n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.div_euint64_uint64(
+ const tx = await this.contract10.xor_euint256_euint256(
encryptedAmount.handles[0],
- 18442885434890559161n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(0n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(124n);
});
- it('test operator "div" overload (euint64, uint64) => euint64 test 3 (18442885434890559161, 18442885434890559161)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442885434890559161n);
-
+ it('test operator "eq" overload (euint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457579028937132718443, 115792089237316195423570985008687907853269984665640564039457575281612927984431)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579028937132718443n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984431n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.div_euint64_uint64(
+ const tx = await this.contract10.eq_euint256_euint256(
encryptedAmount.handles[0],
- 18442885434890559161n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(1n);
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
});
- it('test operator "div" overload (euint64, uint64) => euint64 test 4 (18442885434890559161, 18442885434890559157)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442885434890559161n);
-
+ it('test operator "eq" overload (euint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457575281612927984427, 115792089237316195423570985008687907853269984665640564039457575281612927984431)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984427n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984431n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.div_euint64_uint64(
+ const tx = await this.contract10.eq_euint256_euint256(
encryptedAmount.handles[0],
- 18442885434890559157n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(1n);
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
});
- it('test operator "rem" overload (euint64, uint64) => euint64 test 1 (18445299104872939013, 18441298343819074757)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18445299104872939013n);
-
+ it('test operator "eq" overload (euint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457575281612927984431, 115792089237316195423570985008687907853269984665640564039457575281612927984431)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984431n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984431n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rem_euint64_uint64(
+ const tx = await this.contract10.eq_euint256_euint256(
encryptedAmount.handles[0],
- 18441298343819074757n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(4000761053864256n);
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
});
- it('test operator "rem" overload (euint64, uint64) => euint64 test 2 (18441202573467232859, 18441202573467232863)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18441202573467232859n);
-
+ it('test operator "eq" overload (euint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457575281612927984431, 115792089237316195423570985008687907853269984665640564039457575281612927984427)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984431n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984427n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rem_euint64_uint64(
+ const tx = await this.contract10.eq_euint256_euint256(
encryptedAmount.handles[0],
- 18441202573467232863n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18441202573467232859n);
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
});
- it('test operator "rem" overload (euint64, uint64) => euint64 test 3 (18441202573467232863, 18441202573467232863)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18441202573467232863n);
-
+ it('test operator "ne" overload (euint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457581421114730215071, 115792089237316195423570985008687907853269984665640564039457577745710288733723)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581421114730215071n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733723n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rem_euint64_uint64(
+ const tx = await this.contract10.ne_euint256_euint256(
encryptedAmount.handles[0],
- 18441202573467232863n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(0n);
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
});
- it('test operator "rem" overload (euint64, uint64) => euint64 test 4 (18441202573467232863, 18441202573467232859)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18441202573467232863n);
-
+ it('test operator "ne" overload (euint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457577745710288733719, 115792089237316195423570985008687907853269984665640564039457577745710288733723)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733719n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733723n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rem_euint64_uint64(
+ const tx = await this.contract10.ne_euint256_euint256(
encryptedAmount.handles[0],
- 18441202573467232859n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(4n);
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint64, uint64) => ebool test 1 (18442470885463520691, 18444839379902899701)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442470885463520691n);
-
+ it('test operator "ne" overload (euint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457577745710288733723, 115792089237316195423570985008687907853269984665640564039457577745710288733723)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733723n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733723n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.eq_euint64_uint64(
+ const tx = await this.contract10.ne_euint256_euint256(
encryptedAmount.handles[0],
- 18444839379902899701n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint64, uint64) => ebool test 2 (18442470885463520687, 18442470885463520691)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442470885463520687n);
-
+ it('test operator "ne" overload (euint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457577745710288733723, 115792089237316195423570985008687907853269984665640564039457577745710288733719)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733723n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733719n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.eq_euint64_uint64(
+ const tx = await this.contract10.ne_euint256_euint256(
encryptedAmount.handles[0],
- 18442470885463520691n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint64, uint64) => ebool test 3 (18442470885463520691, 18442470885463520691)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442470885463520691n);
-
+ it('test operator "ge" overload (euint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457579759156646767465, 115792089237316195423570985008687907853269984665640564039457581776880742255263)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767465n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581776880742255263n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.eq_euint64_uint64(
+ const tx = await this.contract10.ge_euint256_euint256(
encryptedAmount.handles[0],
- 18442470885463520691n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint64, uint64) => ebool test 4 (18442470885463520691, 18442470885463520687)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442470885463520691n);
-
+ it('test operator "ge" overload (euint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457579759156646767461, 115792089237316195423570985008687907853269984665640564039457579759156646767465)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767461n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767465n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.eq_euint64_uint64(
+ const tx = await this.contract10.ge_euint256_euint256(
encryptedAmount.handles[0],
- 18442470885463520687n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (uint64, euint64) => ebool test 1 (18446106064654681685, 18444839379902899701)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
-
- input.add64(18444839379902899701n);
+ it('test operator "ge" overload (euint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457579759156646767465, 115792089237316195423570985008687907853269984665640564039457579759156646767465)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767465n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767465n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.eq_uint64_euint64(
- 18446106064654681685n,
+ const tx = await this.contract10.ge_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
});
- it('test operator "eq" overload (uint64, euint64) => ebool test 2 (18442470885463520687, 18442470885463520691)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
-
- input.add64(18442470885463520691n);
+ it('test operator "ge" overload (euint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457579759156646767465, 115792089237316195423570985008687907853269984665640564039457579759156646767461)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767465n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767461n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.eq_uint64_euint64(
- 18442470885463520687n,
+ const tx = await this.contract10.ge_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
});
- it('test operator "eq" overload (uint64, euint64) => ebool test 3 (18442470885463520691, 18442470885463520691)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
-
- input.add64(18442470885463520691n);
+ it('test operator "gt" overload (euint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457580885855005541993, 115792089237316195423570985008687907853269984665640564039457582339622165148199)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541993n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582339622165148199n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.eq_uint64_euint64(
- 18442470885463520691n,
+ const tx = await this.contract10.gt_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
});
- it('test operator "eq" overload (uint64, euint64) => ebool test 4 (18442470885463520691, 18442470885463520687)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
-
- input.add64(18442470885463520687n);
+ it('test operator "gt" overload (euint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457580885855005541989, 115792089237316195423570985008687907853269984665640564039457580885855005541993)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541989n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541993n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.eq_uint64_euint64(
- 18442470885463520691n,
+ const tx = await this.contract10.gt_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint64, uint64) => ebool test 1 (18442343533763371027, 18445982647402256701)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18442343533763371027n);
-
+ it('test operator "gt" overload (euint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457580885855005541993, 115792089237316195423570985008687907853269984665640564039457580885855005541993)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541993n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541993n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ne_euint64_uint64(
+ const tx = await this.contract10.gt_euint256_euint256(
encryptedAmount.handles[0],
- 18445982647402256701n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint64, uint64) => ebool test 2 (18438477816592523449, 18438477816592523453)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438477816592523449n);
-
+ it('test operator "gt" overload (euint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457580885855005541993, 115792089237316195423570985008687907853269984665640564039457580885855005541989)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541993n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541989n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ne_euint64_uint64(
+ const tx = await this.contract10.gt_euint256_euint256(
encryptedAmount.handles[0],
- 18438477816592523453n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint64, uint64) => ebool test 3 (18438477816592523453, 18438477816592523453)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438477816592523453n);
-
+ it('test operator "le" overload (euint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457583300217912499775, 115792089237316195423570985008687907853269984665640564039457582857952818399809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457583300217912499775n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399809n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ne_euint64_uint64(
+ const tx = await this.contract10.le_euint256_euint256(
encryptedAmount.handles[0],
- 18438477816592523453n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint64, uint64) => ebool test 4 (18438477816592523453, 18438477816592523449)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438477816592523453n);
-
+ it('test operator "le" overload (euint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457582857952818399805, 115792089237316195423570985008687907853269984665640564039457582857952818399809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399805n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399809n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ne_euint64_uint64(
+ const tx = await this.contract10.le_euint256_euint256(
encryptedAmount.handles[0],
- 18438477816592523449n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (uint64, euint64) => ebool test 1 (18440875682349733785, 18445982647402256701)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
-
- input.add64(18445982647402256701n);
+ it('test operator "le" overload (euint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457582857952818399809, 115792089237316195423570985008687907853269984665640564039457582857952818399809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399809n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399809n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ne_uint64_euint64(
- 18440875682349733785n,
+ const tx = await this.contract10.le_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (uint64, euint64) => ebool test 2 (18438477816592523449, 18438477816592523453)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
-
- input.add64(18438477816592523453n);
+ it('test operator "le" overload (euint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457582857952818399809, 115792089237316195423570985008687907853269984665640564039457582857952818399805)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399809n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399805n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ne_uint64_euint64(
- 18438477816592523449n,
+ const tx = await this.contract10.le_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ne" overload (uint64, euint64) => ebool test 3 (18438477816592523453, 18438477816592523453)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
-
- input.add64(18438477816592523453n);
+ it('test operator "lt" overload (euint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457579345439988102233, 115792089237316195423570985008687907853269984665640564039457575518813902238261)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579345439988102233n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238261n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ne_uint64_euint64(
- 18438477816592523453n,
+ const tx = await this.contract10.lt_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (uint64, euint64) => ebool test 4 (18438477816592523453, 18438477816592523449)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
-
- input.add64(18438477816592523449n);
+ it('test operator "lt" overload (euint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457575518813902238257, 115792089237316195423570985008687907853269984665640564039457575518813902238261)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238257n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238261n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ne_uint64_euint64(
- 18438477816592523453n,
+ const tx = await this.contract10.lt_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint64, uint64) => ebool test 1 (18441951286640352465, 18443569233121144247)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18441951286640352465n);
-
+ it('test operator "lt" overload (euint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457575518813902238261, 115792089237316195423570985008687907853269984665640564039457575518813902238261)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238261n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238261n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ge_euint64_uint64(
+ const tx = await this.contract10.lt_euint256_euint256(
encryptedAmount.handles[0],
- 18443569233121144247n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint64, uint64) => ebool test 2 (18441951286640352461, 18441951286640352465)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18441951286640352461n);
-
+ it('test operator "lt" overload (euint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457575518813902238261, 115792089237316195423570985008687907853269984665640564039457575518813902238257)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238261n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238257n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ge_euint64_uint64(
+ const tx = await this.contract10.lt_euint256_euint256(
encryptedAmount.handles[0],
- 18441951286640352465n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
+ const res = await decryptBool(await this.contract10.resb());
expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint64, uint64) => ebool test 3 (18441951286640352465, 18441951286640352465)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18441951286640352465n);
-
+ it('test operator "min" overload (euint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579091097262441647, 115792089237316195423570985008687907853269984665640564039457577447088911778291)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579091097262441647n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778291n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ge_euint64_uint64(
+ const tx = await this.contract10.min_euint256_euint256(
encryptedAmount.handles[0],
- 18441951286640352465n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778291n);
});
- it('test operator "ge" overload (euint64, uint64) => ebool test 4 (18441951286640352465, 18441951286640352461)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18441951286640352465n);
-
+ it('test operator "min" overload (euint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457577447088911778287, 115792089237316195423570985008687907853269984665640564039457577447088911778291)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778287n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778291n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ge_euint64_uint64(
+ const tx = await this.contract10.min_euint256_euint256(
encryptedAmount.handles[0],
- 18441951286640352461n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778287n);
});
- it('test operator "ge" overload (uint64, euint64) => ebool test 1 (18439035083186430691, 18443569233121144247)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
-
- input.add64(18443569233121144247n);
+ it('test operator "min" overload (euint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457577447088911778291, 115792089237316195423570985008687907853269984665640564039457577447088911778291)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778291n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778291n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ge_uint64_euint64(
- 18439035083186430691n,
+ const tx = await this.contract10.min_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778291n);
});
- it('test operator "ge" overload (uint64, euint64) => ebool test 2 (18441951286640352461, 18441951286640352465)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
-
- input.add64(18441951286640352465n);
+ it('test operator "min" overload (euint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457577447088911778291, 115792089237316195423570985008687907853269984665640564039457577447088911778287)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778291n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778287n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ge_uint64_euint64(
- 18441951286640352461n,
+ const tx = await this.contract10.min_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778287n);
});
- it('test operator "ge" overload (uint64, euint64) => ebool test 3 (18441951286640352465, 18441951286640352465)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "max" overload (euint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457577915867722108039, 115792089237316195423570985008687907853269984665640564039457577809030115355409)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577915867722108039n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355409n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.max_euint256_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577915867722108039n);
+ });
- input.add64(18441951286640352465n);
+ it('test operator "max" overload (euint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457577809030115355405, 115792089237316195423570985008687907853269984665640564039457577809030115355409)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355405n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355409n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ge_uint64_euint64(
- 18441951286640352465n,
+ const tx = await this.contract10.max_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577809030115355409n);
});
- it('test operator "ge" overload (uint64, euint64) => ebool test 4 (18441951286640352465, 18441951286640352461)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "max" overload (euint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457577809030115355409, 115792089237316195423570985008687907853269984665640564039457577809030115355409)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355409n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355409n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.max_euint256_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577809030115355409n);
+ });
- input.add64(18441951286640352461n);
+ it('test operator "max" overload (euint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457577809030115355409, 115792089237316195423570985008687907853269984665640564039457577809030115355405)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355409n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355405n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.ge_uint64_euint64(
- 18441951286640352465n,
+ const tx = await this.contract10.max_euint256_euint256(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577809030115355409n);
});
- it('test operator "gt" overload (euint64, uint64) => ebool test 1 (18443021258691337483, 18440565481263531071)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18443021258691337483n);
+ it('test operator "add" overload (euint256, uint256) => euint256 test 1 (57896044618658097711785492504343953926634992332820282019728789013802824080146, 57896044618658097711785492504343953926634992332820282019728788733583887971237)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(57896044618658097711785492504343953926634992332820282019728789013802824080146n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.gt_euint64_uint64(
+ const tx = await this.contract10.add_euint256_uint256(
encryptedAmount.handles[0],
- 18440565481263531071n,
+ 57896044618658097711785492504343953926634992332820282019728788733583887971237n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577747386712051383n);
});
- it('test operator "gt" overload (euint64, uint64) => ebool test 2 (18443021258691337479, 18443021258691337483)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18443021258691337479n);
+ it('test operator "add" overload (euint256, uint256) => euint256 test 2 (57896044618658097711785492504343953926634992332820282019728788109485910742178, 57896044618658097711785492504343953926634992332820282019728788109485910742180)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742178n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.gt_euint64_uint64(
+ const tx = await this.contract10.add_euint256_uint256(
encryptedAmount.handles[0],
- 18443021258691337483n,
+ 57896044618658097711785492504343953926634992332820282019728788109485910742180n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484358n);
});
- it('test operator "gt" overload (euint64, uint64) => ebool test 3 (18443021258691337483, 18443021258691337483)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18443021258691337483n);
+ it('test operator "add" overload (euint256, uint256) => euint256 test 3 (57896044618658097711785492504343953926634992332820282019728788109485910742180, 57896044618658097711785492504343953926634992332820282019728788109485910742180)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742180n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.gt_euint64_uint64(
+ const tx = await this.contract10.add_euint256_uint256(
encryptedAmount.handles[0],
- 18443021258691337483n,
+ 57896044618658097711785492504343953926634992332820282019728788109485910742180n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484360n);
});
- it('test operator "gt" overload (euint64, uint64) => ebool test 4 (18443021258691337483, 18443021258691337479)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18443021258691337483n);
+ it('test operator "add" overload (euint256, uint256) => euint256 test 4 (57896044618658097711785492504343953926634992332820282019728788109485910742180, 57896044618658097711785492504343953926634992332820282019728788109485910742178)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742180n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.gt_euint64_uint64(
+ const tx = await this.contract10.add_euint256_uint256(
encryptedAmount.handles[0],
- 18443021258691337479n,
+ 57896044618658097711785492504343953926634992332820282019728788109485910742178n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484358n);
});
- it('test operator "gt" overload (uint64, euint64) => ebool test 1 (18439903764692512057, 18440565481263531071)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "add" overload (uint256, euint256) => euint256 test 1 (57896044618658097711785492504343953926634992332820282019728789372175656948236, 57896044618658097711785492504343953926634992332820282019728788733583887971237)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
- input.add64(18440565481263531071n);
+ input.add256(57896044618658097711785492504343953926634992332820282019728788733583887971237n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.gt_uint64_euint64(
- 18439903764692512057n,
+ const tx = await this.contract10.add_uint256_euint256(
+ 57896044618658097711785492504343953926634992332820282019728789372175656948236n,
encryptedAmount.handles[0],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457578105759544919473n);
});
- it('test operator "gt" overload (uint64, euint64) => ebool test 2 (18443021258691337479, 18443021258691337483)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "add" overload (uint256, euint256) => euint256 test 2 (57896044618658097711785492504343953926634992332820282019728788109485910742178, 57896044618658097711785492504343953926634992332820282019728788109485910742180)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
- input.add64(18443021258691337483n);
+ input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742180n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.gt_uint64_euint64(
- 18443021258691337479n,
+ const tx = await this.contract10.add_uint256_euint256(
+ 57896044618658097711785492504343953926634992332820282019728788109485910742178n,
encryptedAmount.handles[0],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484358n);
});
- it('test operator "gt" overload (uint64, euint64) => ebool test 3 (18443021258691337483, 18443021258691337483)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "add" overload (uint256, euint256) => euint256 test 3 (57896044618658097711785492504343953926634992332820282019728788109485910742180, 57896044618658097711785492504343953926634992332820282019728788109485910742180)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
- input.add64(18443021258691337483n);
+ input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742180n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.gt_uint64_euint64(
- 18443021258691337483n,
+ const tx = await this.contract10.add_uint256_euint256(
+ 57896044618658097711785492504343953926634992332820282019728788109485910742180n,
encryptedAmount.handles[0],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484360n);
});
- it('test operator "gt" overload (uint64, euint64) => ebool test 4 (18443021258691337483, 18443021258691337479)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "add" overload (uint256, euint256) => euint256 test 4 (57896044618658097711785492504343953926634992332820282019728788109485910742180, 57896044618658097711785492504343953926634992332820282019728788109485910742178)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
- input.add64(18443021258691337479n);
+ input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742178n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.gt_uint64_euint64(
- 18443021258691337483n,
+ const tx = await this.contract10.add_uint256_euint256(
+ 57896044618658097711785492504343953926634992332820282019728788109485910742180n,
encryptedAmount.handles[0],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484358n);
});
- it('test operator "le" overload (euint64, uint64) => ebool test 1 (18443782238591650169, 18439298139086159343)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18443782238591650169n);
+ it('test operator "sub" overload (euint256, uint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579667871013646565, 115792089237316195423570985008687907853269984665640564039457579667871013646565)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579667871013646565n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_euint64_uint64(
+ const tx = await this.contract10.sub_euint256_uint256(
encryptedAmount.handles[0],
- 18439298139086159343n,
+ 115792089237316195423570985008687907853269984665640564039457579667871013646565n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(0n);
});
- it('test operator "le" overload (euint64, uint64) => ebool test 2 (18441978790273961909, 18441978790273961913)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18441978790273961909n);
+ it('test operator "sub" overload (euint256, uint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457579667871013646565, 115792089237316195423570985008687907853269984665640564039457579667871013646561)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579667871013646565n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_euint64_uint64(
+ const tx = await this.contract10.sub_euint256_uint256(
encryptedAmount.handles[0],
- 18441978790273961913n,
+ 115792089237316195423570985008687907853269984665640564039457579667871013646561n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(4n);
});
- it('test operator "le" overload (euint64, uint64) => ebool test 3 (18441978790273961913, 18441978790273961913)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18441978790273961913n);
+ it('test operator "sub" overload (uint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579667871013646565, 115792089237316195423570985008687907853269984665640564039457579667871013646565)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579667871013646565n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_euint64_uint64(
+ const tx = await this.contract10.sub_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457579667871013646565n,
encryptedAmount.handles[0],
- 18441978790273961913n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(0n);
});
- it('test operator "le" overload (euint64, uint64) => ebool test 4 (18441978790273961913, 18441978790273961909)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18441978790273961913n);
+ it('test operator "sub" overload (uint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457579667871013646565, 115792089237316195423570985008687907853269984665640564039457579667871013646561)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579667871013646561n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_euint64_uint64(
+ const tx = await this.contract10.sub_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457579667871013646565n,
encryptedAmount.handles[0],
- 18441978790273961909n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(4n);
});
- it('test operator "le" overload (uint64, euint64) => ebool test 1 (18438386930936343347, 18439298139086159343)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "mul" overload (euint256, uint256) => euint256 test 1 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(170141183460469231731687303715884105729n);
- input.add64(18439298139086159343n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_uint64_euint64(
- 18438386930936343347n,
+ const tx = await this.contract10.mul_euint256_uint256(
encryptedAmount.handles[0],
+ 170141183460469231731687303715884105729n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n);
});
- it('test operator "le" overload (uint64, euint64) => ebool test 2 (18441978790273961909, 18441978790273961913)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "mul" overload (euint256, uint256) => euint256 test 2 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(170141183460469231731687303715884105729n);
- input.add64(18441978790273961913n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_uint64_euint64(
- 18441978790273961909n,
+ const tx = await this.contract10.mul_euint256_uint256(
encryptedAmount.handles[0],
+ 170141183460469231731687303715884105729n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n);
});
- it('test operator "le" overload (uint64, euint64) => ebool test 3 (18441978790273961913, 18441978790273961913)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "mul" overload (euint256, uint256) => euint256 test 3 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(170141183460469231731687303715884105729n);
- input.add64(18441978790273961913n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_uint64_euint64(
- 18441978790273961913n,
+ const tx = await this.contract10.mul_euint256_uint256(
encryptedAmount.handles[0],
+ 170141183460469231731687303715884105729n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n);
});
- it('test operator "le" overload (uint64, euint64) => ebool test 4 (18441978790273961913, 18441978790273961909)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "mul" overload (euint256, uint256) => euint256 test 4 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(170141183460469231731687303715884105729n);
- input.add64(18441978790273961909n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.le_uint64_euint64(
- 18441978790273961913n,
+ const tx = await this.contract10.mul_euint256_uint256(
encryptedAmount.handles[0],
+ 170141183460469231731687303715884105729n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n);
});
- it('test operator "lt" overload (euint64, uint64) => ebool test 1 (18445972196307174659, 18441359463085216855)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18445972196307174659n);
+ it('test operator "mul" overload (uint256, euint256) => euint256 test 1 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(170141183460469231731687303715884105729n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_euint64_uint64(
+ const tx = await this.contract10.mul_uint256_euint256(
+ 170141183460469231731687303715884105729n,
encryptedAmount.handles[0],
- 18441359463085216855n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n);
});
- it('test operator "lt" overload (euint64, uint64) => ebool test 2 (18438760003066140567, 18438760003066140571)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438760003066140567n);
+ it('test operator "mul" overload (uint256, euint256) => euint256 test 2 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(170141183460469231731687303715884105729n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_euint64_uint64(
+ const tx = await this.contract10.mul_uint256_euint256(
+ 170141183460469231731687303715884105729n,
encryptedAmount.handles[0],
- 18438760003066140571n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n);
});
- it('test operator "lt" overload (euint64, uint64) => ebool test 3 (18438760003066140571, 18438760003066140571)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438760003066140571n);
+ it('test operator "mul" overload (uint256, euint256) => euint256 test 3 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(170141183460469231731687303715884105729n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_euint64_uint64(
+ const tx = await this.contract10.mul_uint256_euint256(
+ 170141183460469231731687303715884105729n,
encryptedAmount.handles[0],
- 18438760003066140571n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n);
});
- it('test operator "lt" overload (euint64, uint64) => ebool test 4 (18438760003066140571, 18438760003066140567)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438760003066140571n);
+ it('test operator "mul" overload (uint256, euint256) => euint256 test 4 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(170141183460469231731687303715884105729n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_euint64_uint64(
+ const tx = await this.contract10.mul_uint256_euint256(
+ 170141183460469231731687303715884105729n,
encryptedAmount.handles[0],
- 18438760003066140567n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n);
});
- it('test operator "lt" overload (uint64, euint64) => ebool test 1 (18440565799944043085, 18441359463085216855)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "div" overload (euint256, uint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457583310417243027629, 115792089237316195423570985008687907853269984665640564039457577919950085050983)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457583310417243027629n);
- input.add64(18441359463085216855n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_uint64_euint64(
- 18440565799944043085n,
+ const tx = await this.contract10.div_euint256_uint256(
encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457577919950085050983n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(1n);
});
- it('test operator "lt" overload (uint64, euint64) => ebool test 2 (18438760003066140567, 18438760003066140571)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "div" overload (euint256, uint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457576535097376895415, 115792089237316195423570985008687907853269984665640564039457576535097376895419)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457576535097376895415n);
- input.add64(18438760003066140571n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_uint64_euint64(
- 18438760003066140567n,
+ const tx = await this.contract10.div_euint256_uint256(
encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457576535097376895419n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(0n);
});
- it('test operator "lt" overload (uint64, euint64) => ebool test 3 (18438760003066140571, 18438760003066140571)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "div" overload (euint256, uint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457576535097376895419, 115792089237316195423570985008687907853269984665640564039457576535097376895419)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457576535097376895419n);
- input.add64(18438760003066140571n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_uint64_euint64(
- 18438760003066140571n,
+ const tx = await this.contract10.div_euint256_uint256(
encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457576535097376895419n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(1n);
});
- it('test operator "lt" overload (uint64, euint64) => ebool test 4 (18438760003066140571, 18438760003066140567)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "div" overload (euint256, uint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457576535097376895419, 115792089237316195423570985008687907853269984665640564039457576535097376895415)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457576535097376895419n);
- input.add64(18438760003066140567n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.lt_uint64_euint64(
- 18438760003066140571n,
+ const tx = await this.contract10.div_euint256_uint256(
encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457576535097376895415n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract5.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(1n);
});
- it('test operator "min" overload (euint64, uint64) => euint64 test 1 (18446277918636147641, 18444361908116912137)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18446277918636147641n);
+ it('test operator "rem" overload (euint256, uint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457578502975350831453, 115792089237316195423570985008687907853269984665640564039457581127377285906497)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457578502975350831453n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_euint64_uint64(
+ const tx = await this.contract10.rem_euint256_uint256(
encryptedAmount.handles[0],
- 18444361908116912137n,
+ 115792089237316195423570985008687907853269984665640564039457581127377285906497n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18444361908116912137n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457578502975350831453n);
});
- it('test operator "min" overload (euint64, uint64) => euint64 test 2 (18439099819121701503, 18439099819121701507)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18439099819121701503n);
+ it('test operator "rem" overload (euint256, uint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457577137781640958323, 115792089237316195423570985008687907853269984665640564039457577137781640958327)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577137781640958323n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_euint64_uint64(
+ const tx = await this.contract10.rem_euint256_uint256(
encryptedAmount.handles[0],
- 18439099819121701507n,
+ 115792089237316195423570985008687907853269984665640564039457577137781640958327n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18439099819121701503n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577137781640958323n);
});
- it('test operator "min" overload (euint64, uint64) => euint64 test 3 (18439099819121701507, 18439099819121701507)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18439099819121701507n);
+ it('test operator "rem" overload (euint256, uint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457577137781640958327, 115792089237316195423570985008687907853269984665640564039457577137781640958327)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577137781640958327n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_euint64_uint64(
+ const tx = await this.contract10.rem_euint256_uint256(
encryptedAmount.handles[0],
- 18439099819121701507n,
+ 115792089237316195423570985008687907853269984665640564039457577137781640958327n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18439099819121701507n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(0n);
});
- it('test operator "min" overload (euint64, uint64) => euint64 test 4 (18439099819121701507, 18439099819121701503)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18439099819121701507n);
+ it('test operator "rem" overload (euint256, uint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457577137781640958327, 115792089237316195423570985008687907853269984665640564039457577137781640958323)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577137781640958327n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_euint64_uint64(
+ const tx = await this.contract10.rem_euint256_uint256(
encryptedAmount.handles[0],
- 18439099819121701503n,
+ 115792089237316195423570985008687907853269984665640564039457577137781640958323n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18439099819121701503n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(4n);
});
- it('test operator "min" overload (uint64, euint64) => euint64 test 1 (18445356693251014369, 18444361908116912137)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "and" overload (euint256, uint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457580473854578773963, 115792089237316195423570985008687907853269984665640564039457581816489991853517)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580473854578773963n);
- input.add64(18444361908116912137n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_uint64_euint64(
- 18445356693251014369n,
+ const tx = await this.contract10.and_euint256_uint256(
encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457581816489991853517n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18444361908116912137n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579557951374476745n);
});
- it('test operator "min" overload (uint64, euint64) => euint64 test 2 (18439099819121701503, 18439099819121701507)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "and" overload (euint256, uint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457579064265044491321, 115792089237316195423570985008687907853269984665640564039457579064265044491325)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491321n);
- input.add64(18439099819121701507n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_uint64_euint64(
- 18439099819121701503n,
+ const tx = await this.contract10.and_euint256_uint256(
encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457579064265044491325n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18439099819121701503n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491321n);
});
- it('test operator "min" overload (uint64, euint64) => euint64 test 3 (18439099819121701507, 18439099819121701507)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "and" overload (euint256, uint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457579064265044491325, 115792089237316195423570985008687907853269984665640564039457579064265044491325)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491325n);
- input.add64(18439099819121701507n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_uint64_euint64(
- 18439099819121701507n,
+ const tx = await this.contract10.and_euint256_uint256(
encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457579064265044491325n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18439099819121701507n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491325n);
});
- it('test operator "min" overload (uint64, euint64) => euint64 test 4 (18439099819121701507, 18439099819121701503)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "and" overload (euint256, uint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457579064265044491325, 115792089237316195423570985008687907853269984665640564039457579064265044491321)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491325n);
- input.add64(18439099819121701503n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.min_uint64_euint64(
- 18439099819121701507n,
+ const tx = await this.contract10.and_euint256_uint256(
encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457579064265044491321n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18439099819121701503n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491321n);
});
- it('test operator "max" overload (euint64, uint64) => euint64 test 1 (18438631683554897479, 18445384533883180417)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438631683554897479n);
+ it('test operator "and" overload (uint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457576516611416206839, 115792089237316195423570985008687907853269984665640564039457581816489991853517)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581816489991853517n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_euint64_uint64(
+ const tx = await this.contract10.and_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457576516611416206839n,
encryptedAmount.handles[0],
- 18445384533883180417n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18445384533883180417n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457575038788798842309n);
});
- it('test operator "max" overload (euint64, uint64) => euint64 test 2 (18438631683554897475, 18438631683554897479)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438631683554897475n);
+ it('test operator "and" overload (uint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457579064265044491321, 115792089237316195423570985008687907853269984665640564039457579064265044491325)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491325n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_euint64_uint64(
+ const tx = await this.contract10.and_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457579064265044491321n,
encryptedAmount.handles[0],
- 18438631683554897479n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18438631683554897479n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491321n);
});
- it('test operator "max" overload (euint64, uint64) => euint64 test 3 (18438631683554897479, 18438631683554897479)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438631683554897479n);
+ it('test operator "and" overload (uint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457579064265044491325, 115792089237316195423570985008687907853269984665640564039457579064265044491325)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491325n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_euint64_uint64(
+ const tx = await this.contract10.and_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457579064265044491325n,
encryptedAmount.handles[0],
- 18438631683554897479n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18438631683554897479n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491325n);
});
- it('test operator "max" overload (euint64, uint64) => euint64 test 4 (18438631683554897479, 18438631683554897475)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18438631683554897479n);
+ it('test operator "and" overload (uint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457579064265044491325, 115792089237316195423570985008687907853269984665640564039457579064265044491321)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491321n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_euint64_uint64(
+ const tx = await this.contract10.and_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457579064265044491325n,
encryptedAmount.handles[0],
- 18438631683554897475n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18438631683554897479n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491321n);
});
- it('test operator "max" overload (uint64, euint64) => euint64 test 1 (18440833161069655121, 18445384533883180417)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "or" overload (euint256, uint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579093390716184697, 115792089237316195423570985008687907853269984665640564039457575617602160724601)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184697n);
- input.add64(18445384533883180417n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_uint64_euint64(
- 18440833161069655121n,
+ const tx = await this.contract10.or_euint256_uint256(
encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457575617602160724601n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18445384533883180417n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579147311516134009n);
});
- it('test operator "max" overload (uint64, euint64) => euint64 test 2 (18438631683554897475, 18438631683554897479)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "or" overload (euint256, uint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457579093390716184693, 115792089237316195423570985008687907853269984665640564039457579093390716184697)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184693n);
- input.add64(18438631683554897479n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_uint64_euint64(
- 18438631683554897475n,
+ const tx = await this.contract10.or_euint256_uint256(
encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457579093390716184697n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18438631683554897479n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184701n);
});
- it('test operator "max" overload (uint64, euint64) => euint64 test 3 (18438631683554897479, 18438631683554897479)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "or" overload (euint256, uint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457579093390716184697, 115792089237316195423570985008687907853269984665640564039457579093390716184697)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184697n);
- input.add64(18438631683554897479n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_uint64_euint64(
- 18438631683554897479n,
+ const tx = await this.contract10.or_euint256_uint256(
encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457579093390716184697n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18438631683554897479n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184697n);
});
- it('test operator "max" overload (uint64, euint64) => euint64 test 4 (18438631683554897479, 18438631683554897475)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ it('test operator "or" overload (euint256, uint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457579093390716184697, 115792089237316195423570985008687907853269984665640564039457579093390716184693)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184697n);
- input.add64(18438631683554897475n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.max_uint64_euint64(
- 18438631683554897479n,
+ const tx = await this.contract10.or_euint256_uint256(
encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457579093390716184693n,
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18438631683554897479n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184701n);
});
- it('test operator "shl" overload (euint4, uint8) => euint4 test 1 (4, 1)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add4(4n);
+ it('test operator "or" overload (uint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457580060042571469423, 115792089237316195423570985008687907853269984665640564039457575617602160724601)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575617602160724601n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint4_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof);
+ const tx = await this.contract10.or_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457580060042571469423n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract5.res4());
- expect(res).to.equal(8n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457580622993567439487n);
});
- it('test operator "shl" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add4(4n);
+ it('test operator "or" overload (uint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457579093390716184693, 115792089237316195423570985008687907853269984665640564039457579093390716184697)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184697n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract10.or_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457579093390716184693n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract5.res4());
- expect(res).to.equal(4n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184701n);
});
- it('test operator "shl" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add4(8n);
+ it('test operator "or" overload (uint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457579093390716184697, 115792089237316195423570985008687907853269984665640564039457579093390716184697)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184697n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract10.or_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457579093390716184697n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract5.res4());
- expect(res).to.equal(8n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184697n);
});
- it('test operator "shl" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add4(8n);
+ it('test operator "or" overload (uint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457579093390716184697, 115792089237316195423570985008687907853269984665640564039457579093390716184693)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184693n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract10.or_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457579093390716184697n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract5.res4());
- expect(res).to.equal(8n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184701n);
});
- it('test operator "shr" overload (euint4, uint8) => euint4 test 1 (7, 7)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add4(7n);
+ it('test operator "xor" overload (euint256, uint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582495469225451093, 115792089237316195423570985008687907853269984665640564039457579143464719512889)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582495469225451093n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint4_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof);
+ const tx = await this.contract10.xor_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457579143464719512889n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract5.res4());
- expect(res).to.equal(0n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(5655612635835244n);
});
- it('test operator "shr" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add4(4n);
+ it('test operator "xor" overload (euint256, uint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457581801761034193855, 115792089237316195423570985008687907853269984665640564039457581801761034193859)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193855n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract10.xor_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457581801761034193859n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract5.res4());
- expect(res).to.equal(4n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(124n);
});
- it('test operator "shr" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add4(8n);
+ it('test operator "xor" overload (euint256, uint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457581801761034193859, 115792089237316195423570985008687907853269984665640564039457581801761034193859)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193859n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract10.xor_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457581801761034193859n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract5.res4());
- expect(res).to.equal(8n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add4(8n);
+ it('test operator "xor" overload (euint256, uint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457581801761034193859, 115792089237316195423570985008687907853269984665640564039457581801761034193855)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193859n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract10.xor_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457581801761034193855n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract5.res4());
- expect(res).to.equal(8n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(124n);
});
- it('test operator "rotl" overload (euint4, uint8) => euint4 test 1 (14, 7)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add4(14n);
+ it('test operator "xor" overload (uint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579014577469369511, 115792089237316195423570985008687907853269984665640564039457579143464719512889)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579143464719512889n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint4_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof);
+ const tx = await this.contract10.xor_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457579014577469369511n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract5.res4());
- expect(res).to.equal(7n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(269763301726622n);
});
- it('test operator "rotl" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add4(4n);
+ it('test operator "xor" overload (uint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457581801761034193855, 115792089237316195423570985008687907853269984665640564039457581801761034193859)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193859n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract10.xor_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457581801761034193855n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract5.res4());
- expect(res).to.equal(4n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(124n);
});
- it('test operator "rotl" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add4(8n);
+ it('test operator "xor" overload (uint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457581801761034193859, 115792089237316195423570985008687907853269984665640564039457581801761034193859)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193859n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract10.xor_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457581801761034193859n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract5.res4());
- expect(res).to.equal(8n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(0n);
});
- it('test operator "rotl" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add4(8n);
+ it('test operator "xor" overload (uint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457581801761034193859, 115792089237316195423570985008687907853269984665640564039457581801761034193855)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193855n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract10.xor_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457581801761034193859n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract5.res4());
- expect(res).to.equal(8n);
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(124n);
});
});
diff --git a/test/tfheOperations/tfheOperations12.ts b/test/tfheOperations/tfheOperations12.ts
index 9a753ae6..3c4e4b0f 100644
--- a/test/tfheOperations/tfheOperations12.ts
+++ b/test/tfheOperations/tfheOperations12.ts
@@ -7,7 +7,22 @@ import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'
import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance';
+import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
+import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
+import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
+import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
+import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
+import {
+ createInstances,
+ decrypt4,
+ decrypt8,
+ decrypt16,
+ decrypt32,
+ decrypt64,
+ decrypt128,
+ decrypt256,
+ decryptBool,
+} from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
@@ -76,1844 +91,3863 @@ async function deployTfheTestFixture6(): Promise {
return contract;
}
+async function deployTfheTestFixture7(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite7');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture8(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite8');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture9(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite9');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture10(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite10');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture11(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite11');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
describe('TFHE operations 12', function () {
before(async function () {
await initSigners(1);
this.signers = await getSigners();
- const contract1 = await deployTfheTestFixture1();
- this.contract1Address = await contract1.getAddress();
- this.contract1 = contract1;
+ const contract1 = await deployTfheTestFixture1();
+ this.contract1Address = await contract1.getAddress();
+ this.contract1 = contract1;
+
+ const contract2 = await deployTfheTestFixture2();
+ this.contract2Address = await contract2.getAddress();
+ this.contract2 = contract2;
+
+ const contract3 = await deployTfheTestFixture3();
+ this.contract3Address = await contract3.getAddress();
+ this.contract3 = contract3;
+
+ const contract4 = await deployTfheTestFixture4();
+ this.contract4Address = await contract4.getAddress();
+ this.contract4 = contract4;
+
+ const contract5 = await deployTfheTestFixture5();
+ this.contract5Address = await contract5.getAddress();
+ this.contract5 = contract5;
+
+ const contract6 = await deployTfheTestFixture6();
+ this.contract6Address = await contract6.getAddress();
+ this.contract6 = contract6;
+
+ const contract7 = await deployTfheTestFixture7();
+ this.contract7Address = await contract7.getAddress();
+ this.contract7 = contract7;
+
+ const contract8 = await deployTfheTestFixture8();
+ this.contract8Address = await contract8.getAddress();
+ this.contract8 = contract8;
+
+ const contract9 = await deployTfheTestFixture9();
+ this.contract9Address = await contract9.getAddress();
+ this.contract9 = contract9;
+
+ const contract10 = await deployTfheTestFixture10();
+ this.contract10Address = await contract10.getAddress();
+ this.contract10 = contract10;
+
+ const contract11 = await deployTfheTestFixture11();
+ this.contract11Address = await contract11.getAddress();
+ this.contract11 = contract11;
+
+ const instances = await createInstances(this.signers);
+ this.instances = instances;
+ });
+
+ it('test operator "eq" overload (euint256, uint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457579028937132718443, 115792089237316195423570985008687907853269984665640564039457576393900678416361)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579028937132718443n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.eq_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457576393900678416361n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint256, uint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457575281612927984427, 115792089237316195423570985008687907853269984665640564039457575281612927984431)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984427n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.eq_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457575281612927984431n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint256, uint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457575281612927984431, 115792089237316195423570985008687907853269984665640564039457575281612927984431)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984431n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.eq_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457575281612927984431n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint256, uint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457575281612927984431, 115792089237316195423570985008687907853269984665640564039457575281612927984427)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984431n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.eq_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457575281612927984427n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (uint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457577173439170014457, 115792089237316195423570985008687907853269984665640564039457576393900678416361)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457576393900678416361n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.eq_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457577173439170014457n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (uint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457575281612927984427, 115792089237316195423570985008687907853269984665640564039457575281612927984431)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984431n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.eq_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457575281612927984427n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (uint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457575281612927984431, 115792089237316195423570985008687907853269984665640564039457575281612927984431)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984431n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.eq_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457575281612927984431n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (uint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457575281612927984431, 115792089237316195423570985008687907853269984665640564039457575281612927984427)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984427n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.eq_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457575281612927984431n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint256, uint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457581421114730215071, 115792089237316195423570985008687907853269984665640564039457583491257588609271)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581421114730215071n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ne_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457583491257588609271n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint256, uint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457577745710288733719, 115792089237316195423570985008687907853269984665640564039457577745710288733723)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733719n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ne_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457577745710288733723n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint256, uint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457577745710288733723, 115792089237316195423570985008687907853269984665640564039457577745710288733723)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733723n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ne_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457577745710288733723n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint256, uint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457577745710288733723, 115792089237316195423570985008687907853269984665640564039457577745710288733719)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733723n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ne_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457577745710288733719n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (uint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457583026693216867801, 115792089237316195423570985008687907853269984665640564039457583491257588609271)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457583491257588609271n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ne_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457583026693216867801n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (uint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457577745710288733719, 115792089237316195423570985008687907853269984665640564039457577745710288733723)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733723n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ne_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457577745710288733719n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (uint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457577745710288733723, 115792089237316195423570985008687907853269984665640564039457577745710288733723)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733723n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ne_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457577745710288733723n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (uint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457577745710288733723, 115792089237316195423570985008687907853269984665640564039457577745710288733719)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733719n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ne_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457577745710288733723n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint256, uint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457579759156646767465, 115792089237316195423570985008687907853269984665640564039457580411660636009627)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767465n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ge_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457580411660636009627n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint256, uint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457579759156646767461, 115792089237316195423570985008687907853269984665640564039457579759156646767465)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767461n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ge_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457579759156646767465n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint256, uint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457579759156646767465, 115792089237316195423570985008687907853269984665640564039457579759156646767465)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767465n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ge_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457579759156646767465n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint256, uint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457579759156646767465, 115792089237316195423570985008687907853269984665640564039457579759156646767461)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767465n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ge_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457579759156646767461n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (uint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457581430272333247909, 115792089237316195423570985008687907853269984665640564039457580411660636009627)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457580411660636009627n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ge_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457581430272333247909n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (uint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457579759156646767461, 115792089237316195423570985008687907853269984665640564039457579759156646767465)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767465n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ge_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457579759156646767461n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (uint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457579759156646767465, 115792089237316195423570985008687907853269984665640564039457579759156646767465)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767465n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ge_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457579759156646767465n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (uint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457579759156646767465, 115792089237316195423570985008687907853269984665640564039457579759156646767461)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767461n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.ge_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457579759156646767465n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint256, uint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457580885855005541993, 115792089237316195423570985008687907853269984665640564039457576330419987992913)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541993n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.gt_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457576330419987992913n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint256, uint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457580885855005541989, 115792089237316195423570985008687907853269984665640564039457580885855005541993)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541989n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.gt_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457580885855005541993n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint256, uint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457580885855005541993, 115792089237316195423570985008687907853269984665640564039457580885855005541993)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541993n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.gt_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457580885855005541993n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint256, uint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457580885855005541993, 115792089237316195423570985008687907853269984665640564039457580885855005541989)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541993n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.gt_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457580885855005541989n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (uint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457583273117366659453, 115792089237316195423570985008687907853269984665640564039457576330419987992913)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457576330419987992913n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.gt_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457583273117366659453n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (uint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457580885855005541989, 115792089237316195423570985008687907853269984665640564039457580885855005541993)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541993n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.gt_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457580885855005541989n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (uint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457580885855005541993, 115792089237316195423570985008687907853269984665640564039457580885855005541993)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541993n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.gt_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457580885855005541993n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (uint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457580885855005541993, 115792089237316195423570985008687907853269984665640564039457580885855005541989)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541989n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.gt_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457580885855005541993n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint256, uint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457583300217912499775, 115792089237316195423570985008687907853269984665640564039457580310546116642945)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457583300217912499775n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.le_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457580310546116642945n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "le" overload (euint256, uint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457582857952818399805, 115792089237316195423570985008687907853269984665640564039457582857952818399809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399805n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.le_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457582857952818399809n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint256, uint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457582857952818399809, 115792089237316195423570985008687907853269984665640564039457582857952818399809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399809n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.le_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457582857952818399809n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint256, uint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457582857952818399809, 115792089237316195423570985008687907853269984665640564039457582857952818399805)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399809n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.le_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457582857952818399805n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "le" overload (uint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457579919776168086147, 115792089237316195423570985008687907853269984665640564039457580310546116642945)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457580310546116642945n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.le_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457579919776168086147n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (uint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457582857952818399805, 115792089237316195423570985008687907853269984665640564039457582857952818399809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399809n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.le_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457582857952818399805n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (uint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457582857952818399809, 115792089237316195423570985008687907853269984665640564039457582857952818399809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399809n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.le_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457582857952818399809n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (uint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457582857952818399809, 115792089237316195423570985008687907853269984665640564039457582857952818399805)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399805n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.le_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457582857952818399809n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint256, uint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457579345439988102233, 115792089237316195423570985008687907853269984665640564039457581362267810923471)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579345439988102233n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.lt_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457581362267810923471n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint256, uint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457575518813902238257, 115792089237316195423570985008687907853269984665640564039457575518813902238261)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238257n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.lt_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457575518813902238261n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint256, uint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457575518813902238261, 115792089237316195423570985008687907853269984665640564039457575518813902238261)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238261n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.lt_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457575518813902238261n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint256, uint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457575518813902238261, 115792089237316195423570985008687907853269984665640564039457575518813902238257)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238261n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.lt_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457575518813902238257n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (uint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457578628645763210627, 115792089237316195423570985008687907853269984665640564039457581362267810923471)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457581362267810923471n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.lt_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457578628645763210627n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (uint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457575518813902238257, 115792089237316195423570985008687907853269984665640564039457575518813902238261)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238261n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.lt_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457575518813902238257n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (uint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457575518813902238261, 115792089237316195423570985008687907853269984665640564039457575518813902238261)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238261n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.lt_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457575518813902238261n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (uint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457575518813902238261, 115792089237316195423570985008687907853269984665640564039457575518813902238257)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238257n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.lt_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457575518813902238261n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract10.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint256, uint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579091097262441647, 115792089237316195423570985008687907853269984665640564039457576915935387349417)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579091097262441647n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.min_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457576915935387349417n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576915935387349417n);
+ });
+
+ it('test operator "min" overload (euint256, uint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457577447088911778287, 115792089237316195423570985008687907853269984665640564039457577447088911778291)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778287n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.min_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457577447088911778291n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778287n);
+ });
+
+ it('test operator "min" overload (euint256, uint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457577447088911778291, 115792089237316195423570985008687907853269984665640564039457577447088911778291)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778291n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.min_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457577447088911778291n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778291n);
+ });
+
+ it('test operator "min" overload (euint256, uint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457577447088911778291, 115792089237316195423570985008687907853269984665640564039457577447088911778287)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778291n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.min_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457577447088911778287n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778287n);
+ });
+
+ it('test operator "min" overload (uint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579127166009597401, 115792089237316195423570985008687907853269984665640564039457576915935387349417)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457576915935387349417n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.min_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457579127166009597401n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576915935387349417n);
+ });
+
+ it('test operator "min" overload (uint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457577447088911778287, 115792089237316195423570985008687907853269984665640564039457577447088911778291)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778291n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.min_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457577447088911778287n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778287n);
+ });
+
+ it('test operator "min" overload (uint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457577447088911778291, 115792089237316195423570985008687907853269984665640564039457577447088911778291)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778291n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.min_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457577447088911778291n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778291n);
+ });
+
+ it('test operator "min" overload (uint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457577447088911778291, 115792089237316195423570985008687907853269984665640564039457577447088911778287)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778287n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.min_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457577447088911778291n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778287n);
+ });
+
+ it('test operator "max" overload (euint256, uint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457577915867722108039, 115792089237316195423570985008687907853269984665640564039457582764130067775401)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577915867722108039n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.max_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457582764130067775401n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457582764130067775401n);
+ });
+
+ it('test operator "max" overload (euint256, uint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457577809030115355405, 115792089237316195423570985008687907853269984665640564039457577809030115355409)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355405n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.max_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457577809030115355409n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577809030115355409n);
+ });
+
+ it('test operator "max" overload (euint256, uint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457577809030115355409, 115792089237316195423570985008687907853269984665640564039457577809030115355409)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355409n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.max_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457577809030115355409n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577809030115355409n);
+ });
+
+ it('test operator "max" overload (euint256, uint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457577809030115355409, 115792089237316195423570985008687907853269984665640564039457577809030115355405)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355409n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.max_euint256_uint256(
+ encryptedAmount.handles[0],
+ 115792089237316195423570985008687907853269984665640564039457577809030115355405n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577809030115355409n);
+ });
+
+ it('test operator "max" overload (uint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582906409122638869, 115792089237316195423570985008687907853269984665640564039457582764130067775401)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457582764130067775401n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.max_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457582906409122638869n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457582906409122638869n);
+ });
+
+ it('test operator "max" overload (uint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457577809030115355405, 115792089237316195423570985008687907853269984665640564039457577809030115355409)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355409n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.max_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457577809030115355405n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577809030115355409n);
+ });
+
+ it('test operator "max" overload (uint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457577809030115355409, 115792089237316195423570985008687907853269984665640564039457577809030115355409)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355409n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.max_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457577809030115355409n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577809030115355409n);
+ });
+
+ it('test operator "max" overload (uint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457577809030115355409, 115792089237316195423570985008687907853269984665640564039457577809030115355405)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+
+ input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355405n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.max_uint256_euint256(
+ 115792089237316195423570985008687907853269984665640564039457577809030115355409n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract10.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577809030115355409n);
+ });
+
+ it('test operator "shl" overload (euint4, uint8) => euint4 test 1 (1, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add4(1n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.shl_euint4_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract10.res4());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "shl" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add4(4n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.shl_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract10.res4());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "shl" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add4(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.shl_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract10.res4());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "shl" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add4(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.shl_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract10.res4());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "shr" overload (euint4, uint8) => euint4 test 1 (4, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add4(4n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.shr_euint4_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract10.res4());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "shr" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add4(4n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.shr_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract10.res4());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "shr" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add4(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.shr_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract10.res4());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "shr" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add4(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.shr_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract10.res4());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "rotl" overload (euint4, uint8) => euint4 test 1 (1, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add4(1n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.rotl_euint4_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract10.res4());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "rotl" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add4(4n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.rotl_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract10.res4());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "rotl" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add4(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.rotl_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract10.res4());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "rotl" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add4(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.rotl_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract10.res4());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "rotr" overload (euint4, uint8) => euint4 test 1 (14, 1)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add4(14n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.rotr_euint4_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract10.res4());
+ expect(res).to.equal(7n);
+ });
+
+ it('test operator "rotr" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add4(4n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.rotr_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract10.res4());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "rotr" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add4(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.rotr_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract10.res4());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "rotr" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address);
+ input.add4(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract10.rotr_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract10.res4());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "shl" overload (euint8, euint8) => euint8 test 1 (44, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(44n);
+ input.add8(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shl_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(192n);
+ });
+
+ it('test operator "shl" overload (euint8, euint8) => euint8 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(4n);
+ input.add8(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shl_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "shl" overload (euint8, euint8) => euint8 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add8(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shl_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "shl" overload (euint8, euint8) => euint8 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add8(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shl_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(128n);
+ });
+
+ it('test operator "shl" overload (euint8, uint8) => euint8 test 1 (44, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(44n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shl_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(192n);
+ });
+
+ it('test operator "shl" overload (euint8, uint8) => euint8 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(4n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shl_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "shl" overload (euint8, uint8) => euint8 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shl_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "shl" overload (euint8, uint8) => euint8 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shl_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(128n);
+ });
+
+ it('test operator "shr" overload (euint8, euint8) => euint8 test 1 (160, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(160n);
+ input.add8(3n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shr_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(20n);
+ });
+
+ it('test operator "shr" overload (euint8, euint8) => euint8 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(4n);
+ input.add8(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shr_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "shr" overload (euint8, euint8) => euint8 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add8(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shr_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "shr" overload (euint8, euint8) => euint8 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add8(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shr_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "shr" overload (euint8, uint8) => euint8 test 1 (160, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(160n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shr_euint8_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(20n);
+ });
+
+ it('test operator "shr" overload (euint8, uint8) => euint8 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(4n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shr_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "shr" overload (euint8, uint8) => euint8 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shr_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "shr" overload (euint8, uint8) => euint8 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shr_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "rotl" overload (euint8, euint8) => euint8 test 1 (150, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(150n);
+ input.add8(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotl_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(105n);
+ });
+
+ it('test operator "rotl" overload (euint8, euint8) => euint8 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(4n);
+ input.add8(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotl_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "rotl" overload (euint8, euint8) => euint8 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add8(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotl_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "rotl" overload (euint8, euint8) => euint8 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add8(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotl_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(128n);
+ });
+
+ it('test operator "rotl" overload (euint8, uint8) => euint8 test 1 (150, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(150n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotl_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(105n);
+ });
+
+ it('test operator "rotl" overload (euint8, uint8) => euint8 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(4n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotl_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "rotl" overload (euint8, uint8) => euint8 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotl_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "rotl" overload (euint8, uint8) => euint8 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotl_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(128n);
+ });
+
+ it('test operator "rotr" overload (euint8, euint8) => euint8 test 1 (52, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(52n);
+ input.add8(6n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotr_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(208n);
+ });
+
+ it('test operator "rotr" overload (euint8, euint8) => euint8 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(4n);
+ input.add8(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotr_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "rotr" overload (euint8, euint8) => euint8 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add8(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotr_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "rotr" overload (euint8, euint8) => euint8 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add8(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotr_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(128n);
+ });
+
+ it('test operator "rotr" overload (euint8, uint8) => euint8 test 1 (52, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(52n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotr_euint8_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(208n);
+ });
+
+ it('test operator "rotr" overload (euint8, uint8) => euint8 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(4n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotr_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "rotr" overload (euint8, uint8) => euint8 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotr_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "rotr" overload (euint8, uint8) => euint8 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotr_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(128n);
+ });
+
+ it('test operator "shl" overload (euint16, euint8) => euint16 test 1 (10029, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(10029n);
+ input.add8(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shl_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(58784n);
+ });
+
+ it('test operator "shl" overload (euint16, euint8) => euint16 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(4n);
+ input.add8(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shl_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(1024n);
+ });
+
+ it('test operator "shl" overload (euint16, euint8) => euint16 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add8(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shl_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(2048n);
+ });
+
+ it('test operator "shl" overload (euint16, euint8) => euint16 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add8(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shl_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(128n);
+ });
+
+ it('test operator "shl" overload (euint16, uint8) => euint16 test 1 (10029, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(10029n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shl_euint16_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(58784n);
+ });
+
+ it('test operator "shl" overload (euint16, uint8) => euint16 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(4n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shl_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(1024n);
+ });
+
+ it('test operator "shl" overload (euint16, uint8) => euint16 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shl_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(2048n);
+ });
+
+ it('test operator "shl" overload (euint16, uint8) => euint16 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shl_euint16_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(128n);
+ });
+
+ it('test operator "shr" overload (euint16, euint8) => euint16 test 1 (63034, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(63034n);
+ input.add8(6n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shr_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(984n);
+ });
+
+ it('test operator "shr" overload (euint16, euint8) => euint16 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(4n);
+ input.add8(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shr_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "shr" overload (euint16, euint8) => euint16 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add8(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shr_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "shr" overload (euint16, euint8) => euint16 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add8(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shr_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "shr" overload (euint16, uint8) => euint16 test 1 (63034, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(63034n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shr_euint16_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(984n);
+ });
+
+ it('test operator "shr" overload (euint16, uint8) => euint16 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(4n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shr_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "shr" overload (euint16, uint8) => euint16 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shr_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "shr" overload (euint16, uint8) => euint16 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.shr_euint16_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "rotl" overload (euint16, euint8) => euint16 test 1 (34007, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(34007n);
+ input.add8(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotl_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(19832n);
+ });
+
+ it('test operator "rotl" overload (euint16, euint8) => euint16 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(4n);
+ input.add8(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotl_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(1024n);
+ });
+
+ it('test operator "rotl" overload (euint16, euint8) => euint16 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add8(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotl_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(2048n);
+ });
+
+ it('test operator "rotl" overload (euint16, euint8) => euint16 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add8(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotl_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(128n);
+ });
- const contract2 = await deployTfheTestFixture2();
- this.contract2Address = await contract2.getAddress();
- this.contract2 = contract2;
+ it('test operator "rotl" overload (euint16, uint8) => euint16 test 1 (34007, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(34007n);
- const contract3 = await deployTfheTestFixture3();
- this.contract3Address = await contract3.getAddress();
- this.contract3 = contract3;
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotl_euint16_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(19832n);
+ });
- const contract4 = await deployTfheTestFixture4();
- this.contract4Address = await contract4.getAddress();
- this.contract4 = contract4;
+ it('test operator "rotl" overload (euint16, uint8) => euint16 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(4n);
- const contract5 = await deployTfheTestFixture5();
- this.contract5Address = await contract5.getAddress();
- this.contract5 = contract5;
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotl_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(1024n);
+ });
- const contract6 = await deployTfheTestFixture6();
- this.contract6Address = await contract6.getAddress();
- this.contract6 = contract6;
+ it('test operator "rotl" overload (euint16, uint8) => euint16 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(8n);
- const instances = await createInstances(this.signers);
- this.instances = instances;
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotl_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(2048n);
});
- it('test operator "rotr" overload (euint4, uint8) => euint4 test 1 (14, 7)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add4(14n);
+ it('test operator "rotl" overload (euint16, uint8) => euint16 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint4_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotl_euint16_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract5.res4());
- expect(res).to.equal(13n);
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(128n);
});
- it('test operator "rotr" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add4(4n);
+ it('test operator "rotr" overload (euint16, euint8) => euint16 test 1 (32201, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(32201n);
+ input.add8(3n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotr_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(12217n);
+ });
+ it('test operator "rotr" overload (euint16, euint8) => euint16 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(4n);
+ input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotr_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract5.res4());
- expect(res).to.equal(4n);
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(1024n);
});
- it('test operator "rotr" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add4(8n);
+ it('test operator "rotr" overload (euint16, euint8) => euint16 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add8(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotr_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(2048n);
+ });
+
+ it('test operator "rotr" overload (euint16, euint8) => euint16 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add8(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotr_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(32768n);
+ });
+
+ it('test operator "rotr" overload (euint16, uint8) => euint16 test 1 (32201, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(32201n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotr_euint16_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract5.res4());
- expect(res).to.equal(8n);
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(12217n);
});
- it('test operator "rotr" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add4(8n);
+ it('test operator "rotr" overload (euint16, uint8) => euint16 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotr_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract5.res4());
- expect(res).to.equal(8n);
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(1024n);
});
- it('test operator "shl" overload (euint8, euint8) => euint8 test 1 (201, 7)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(201n);
- input.add8(7n);
+ it('test operator "rotr" overload (euint16, uint8) => euint16 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotr_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(2048n);
+ });
+
+ it('test operator "rotr" overload (euint16, uint8) => euint16 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.rotr_euint16_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(32768n);
+ });
+
+ it('test operator "shl" overload (euint32, euint8) => euint32 test 1 (3189891720, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(3189891720n);
+ input.add8(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint8_euint8(
+ const tx = await this.contract11.shl_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(128n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(3793627264n);
});
- it('test operator "shl" overload (euint8, euint8) => euint8 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(4n);
+ it('test operator "shl" overload (euint32, euint8) => euint32 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(4n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint8_euint8(
+ const tx = await this.contract11.shl_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(4n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(1024n);
});
- it('test operator "shl" overload (euint8, euint8) => euint8 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(8n);
+ it('test operator "shl" overload (euint32, euint8) => euint32 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(8n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint8_euint8(
+ const tx = await this.contract11.shl_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(8n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(2048n);
});
- it('test operator "shl" overload (euint8, euint8) => euint8 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(8n);
+ it('test operator "shl" overload (euint32, euint8) => euint32 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(8n);
input.add8(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint8_euint8(
+ const tx = await this.contract11.shl_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
+ const res = await decrypt32(await this.contract11.res32());
expect(res).to.equal(128n);
});
- it('test operator "shl" overload (euint8, uint8) => euint8 test 1 (201, 7)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(201n);
+ it('test operator "shl" overload (euint32, uint8) => euint32 test 1 (3189891720, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(3189891720n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint8_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shl_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(128n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(3793627264n);
});
- it('test operator "shl" overload (euint8, uint8) => euint8 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(4n);
+ it('test operator "shl" overload (euint32, uint8) => euint32 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shl_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(4n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(1024n);
});
- it('test operator "shl" overload (euint8, uint8) => euint8 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(8n);
+ it('test operator "shl" overload (euint32, uint8) => euint32 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shl_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(8n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(2048n);
});
- it('test operator "shl" overload (euint8, uint8) => euint8 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(8n);
+ it('test operator "shl" overload (euint32, uint8) => euint32 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shl_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
+ const res = await decrypt32(await this.contract11.res32());
expect(res).to.equal(128n);
});
- it('test operator "shr" overload (euint8, euint8) => euint8 test 1 (15, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(15n);
+ it('test operator "shr" overload (euint32, euint8) => euint32 test 1 (1720949149, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(1720949149n);
input.add8(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint8_euint8(
+ const tx = await this.contract11.shr_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(0n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(107559321n);
});
- it('test operator "shr" overload (euint8, euint8) => euint8 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(4n);
+ it('test operator "shr" overload (euint32, euint8) => euint32 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(4n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint8_euint8(
+ const tx = await this.contract11.shr_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(4n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint8, euint8) => euint8 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(8n);
+ it('test operator "shr" overload (euint32, euint8) => euint32 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(8n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint8_euint8(
+ const tx = await this.contract11.shr_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(8n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint8, euint8) => euint8 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(8n);
+ it('test operator "shr" overload (euint32, euint8) => euint32 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(8n);
input.add8(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint8_euint8(
+ const tx = await this.contract11.shr_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
+ const res = await decrypt32(await this.contract11.res32());
expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint8, uint8) => euint8 test 1 (15, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(15n);
+ it('test operator "shr" overload (euint32, uint8) => euint32 test 1 (1720949149, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(1720949149n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shr_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(0n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(107559321n);
});
- it('test operator "shr" overload (euint8, uint8) => euint8 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(4n);
+ it('test operator "shr" overload (euint32, uint8) => euint32 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shr_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(4n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint8, uint8) => euint8 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(8n);
+ it('test operator "shr" overload (euint32, uint8) => euint32 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shr_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(8n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint8, uint8) => euint8 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(8n);
+ it('test operator "shr" overload (euint32, uint8) => euint32 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shr_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
+ const res = await decrypt32(await this.contract11.res32());
expect(res).to.equal(0n);
});
- it('test operator "rotl" overload (euint8, euint8) => euint8 test 1 (52, 1)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(52n);
- input.add8(1n);
+ it('test operator "rotl" overload (euint32, euint8) => euint32 test 1 (10430463, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(10430463n);
+ input.add8(3n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint8_euint8(
+ const tx = await this.contract11.rotl_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(104n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(83443704n);
});
- it('test operator "rotl" overload (euint8, euint8) => euint8 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(4n);
+ it('test operator "rotl" overload (euint32, euint8) => euint32 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(4n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint8_euint8(
+ const tx = await this.contract11.rotl_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(4n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(1024n);
});
- it('test operator "rotl" overload (euint8, euint8) => euint8 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(8n);
+ it('test operator "rotl" overload (euint32, euint8) => euint32 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(8n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint8_euint8(
+ const tx = await this.contract11.rotl_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(8n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(2048n);
});
- it('test operator "rotl" overload (euint8, euint8) => euint8 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(8n);
+ it('test operator "rotl" overload (euint32, euint8) => euint32 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(8n);
input.add8(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint8_euint8(
+ const tx = await this.contract11.rotl_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
+ const res = await decrypt32(await this.contract11.res32());
expect(res).to.equal(128n);
});
- it('test operator "rotl" overload (euint8, uint8) => euint8 test 1 (52, 1)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(52n);
+ it('test operator "rotl" overload (euint32, uint8) => euint32 test 1 (10430463, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(10430463n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint8_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotl_euint32_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(104n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(83443704n);
});
- it('test operator "rotl" overload (euint8, uint8) => euint8 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(4n);
+ it('test operator "rotl" overload (euint32, uint8) => euint32 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotl_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(4n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(1024n);
});
- it('test operator "rotl" overload (euint8, uint8) => euint8 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(8n);
+ it('test operator "rotl" overload (euint32, uint8) => euint32 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotl_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(8n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(2048n);
});
- it('test operator "rotl" overload (euint8, uint8) => euint8 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(8n);
+ it('test operator "rotl" overload (euint32, uint8) => euint32 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotl_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
+ const res = await decrypt32(await this.contract11.res32());
expect(res).to.equal(128n);
});
- it('test operator "rotr" overload (euint8, euint8) => euint8 test 1 (50, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(50n);
- input.add8(4n);
+ it('test operator "rotr" overload (euint32, euint8) => euint32 test 1 (3489309750, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(3489309750n);
+ input.add8(7n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint8_euint8(
+ const tx = await this.contract11.rotr_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(35n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(1839199560n);
});
- it('test operator "rotr" overload (euint8, euint8) => euint8 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(4n);
+ it('test operator "rotr" overload (euint32, euint8) => euint32 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(4n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint8_euint8(
+ const tx = await this.contract11.rotr_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(4n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(67108864n);
});
- it('test operator "rotr" overload (euint8, euint8) => euint8 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(8n);
+ it('test operator "rotr" overload (euint32, euint8) => euint32 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(8n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint8_euint8(
+ const tx = await this.contract11.rotr_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(8n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(134217728n);
});
- it('test operator "rotr" overload (euint8, euint8) => euint8 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(8n);
+ it('test operator "rotr" overload (euint32, euint8) => euint32 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(8n);
input.add8(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint8_euint8(
+ const tx = await this.contract11.rotr_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(128n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(2147483648n);
});
- it('test operator "rotr" overload (euint8, uint8) => euint8 test 1 (50, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(50n);
+ it('test operator "rotr" overload (euint32, uint8) => euint32 test 1 (3489309750, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(3489309750n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotr_euint32_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(35n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(1839199560n);
});
- it('test operator "rotr" overload (euint8, uint8) => euint8 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(4n);
+ it('test operator "rotr" overload (euint32, uint8) => euint32 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotr_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(4n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(67108864n);
});
- it('test operator "rotr" overload (euint8, uint8) => euint8 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(8n);
+ it('test operator "rotr" overload (euint32, uint8) => euint32 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotr_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(8n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(134217728n);
});
- it('test operator "rotr" overload (euint8, uint8) => euint8 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(8n);
+ it('test operator "rotr" overload (euint32, uint8) => euint32 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotr_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract5.res8());
- expect(res).to.equal(128n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(2147483648n);
});
- it('test operator "shl" overload (euint16, euint8) => euint16 test 1 (43733, 1)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(43733n);
- input.add8(1n);
+ it('test operator "shl" overload (euint64, euint8) => euint64 test 1 (18438852048643145403, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(18438852048643145403n);
+ input.add8(6n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint16_euint8(
+ const tx = await this.contract11.shl_euint64_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
- expect(res).to.equal(21930n);
+ const res = await decrypt64(await this.contract11.res64());
+ expect(res).to.equal(17941654469459553984n);
});
- it('test operator "shl" overload (euint16, euint8) => euint16 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(4n);
+ it('test operator "shl" overload (euint64, euint8) => euint64 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(4n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint16_euint8(
+ const tx = await this.contract11.shl_euint64_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
+ const res = await decrypt64(await this.contract11.res64());
expect(res).to.equal(1024n);
});
- it('test operator "shl" overload (euint16, euint8) => euint16 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(8n);
+ it('test operator "shl" overload (euint64, euint8) => euint64 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(8n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint16_euint8(
+ const tx = await this.contract11.shl_euint64_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
+ const res = await decrypt64(await this.contract11.res64());
expect(res).to.equal(2048n);
});
- it('test operator "shl" overload (euint16, euint8) => euint16 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(8n);
+ it('test operator "shl" overload (euint64, euint8) => euint64 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(8n);
input.add8(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint16_euint8(
+ const tx = await this.contract11.shl_euint64_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
+ const res = await decrypt64(await this.contract11.res64());
expect(res).to.equal(128n);
});
- it('test operator "shl" overload (euint16, uint8) => euint16 test 1 (43733, 1)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(43733n);
+ it('test operator "shl" overload (euint64, uint8) => euint64 test 1 (18438852048643145403, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(18438852048643145403n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint16_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shl_euint64_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
- expect(res).to.equal(21930n);
+ const res = await decrypt64(await this.contract11.res64());
+ expect(res).to.equal(17941654469459553984n);
});
- it('test operator "shl" overload (euint16, uint8) => euint16 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(4n);
+ it('test operator "shl" overload (euint64, uint8) => euint64 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shl_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
+ const res = await decrypt64(await this.contract11.res64());
expect(res).to.equal(1024n);
});
- it('test operator "shl" overload (euint16, uint8) => euint16 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(8n);
+ it('test operator "shl" overload (euint64, uint8) => euint64 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shl_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
+ const res = await decrypt64(await this.contract11.res64());
expect(res).to.equal(2048n);
});
- it('test operator "shl" overload (euint16, uint8) => euint16 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(8n);
+ it('test operator "shl" overload (euint64, uint8) => euint64 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint16_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shl_euint64_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
+ const res = await decrypt64(await this.contract11.res64());
expect(res).to.equal(128n);
});
- it('test operator "shr" overload (euint16, euint8) => euint16 test 1 (55114, 1)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(55114n);
- input.add8(1n);
+ it('test operator "shr" overload (euint64, euint8) => euint64 test 1 (18444486134915793097, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(18444486134915793097n);
+ input.add8(6n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint16_euint8(
+ const tx = await this.contract11.shr_euint64_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
- expect(res).to.equal(27557n);
+ const res = await decrypt64(await this.contract11.res64());
+ expect(res).to.equal(288195095858059267n);
});
- it('test operator "shr" overload (euint16, euint8) => euint16 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(4n);
+ it('test operator "shr" overload (euint64, euint8) => euint64 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(4n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint16_euint8(
+ const tx = await this.contract11.shr_euint64_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
+ const res = await decrypt64(await this.contract11.res64());
expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint16, euint8) => euint16 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(8n);
+ it('test operator "shr" overload (euint64, euint8) => euint64 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(8n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint16_euint8(
+ const tx = await this.contract11.shr_euint64_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
+ const res = await decrypt64(await this.contract11.res64());
expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint16, euint8) => euint16 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(8n);
+ it('test operator "shr" overload (euint64, euint8) => euint64 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(8n);
input.add8(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint16_euint8(
+ const tx = await this.contract11.shr_euint64_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
+ const res = await decrypt64(await this.contract11.res64());
expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint16, uint8) => euint16 test 1 (55114, 1)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(55114n);
+ it('test operator "shr" overload (euint64, uint8) => euint64 test 1 (18444486134915793097, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(18444486134915793097n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint16_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shr_euint64_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
- expect(res).to.equal(27557n);
+ const res = await decrypt64(await this.contract11.res64());
+ expect(res).to.equal(288195095858059267n);
});
- it('test operator "shr" overload (euint16, uint8) => euint16 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(4n);
+ it('test operator "shr" overload (euint64, uint8) => euint64 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shr_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
+ const res = await decrypt64(await this.contract11.res64());
expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint16, uint8) => euint16 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(8n);
+ it('test operator "shr" overload (euint64, uint8) => euint64 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shr_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
+ const res = await decrypt64(await this.contract11.res64());
expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint16, uint8) => euint16 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(8n);
+ it('test operator "shr" overload (euint64, uint8) => euint64 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint16_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shr_euint64_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
+ const res = await decrypt64(await this.contract11.res64());
expect(res).to.equal(0n);
});
- it('test operator "rotl" overload (euint16, euint8) => euint16 test 1 (12143, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(12143n);
- input.add8(3n);
+ it('test operator "rotl" overload (euint64, euint8) => euint64 test 1 (18440494415218168649, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(18440494415218168649n);
+ input.add8(7n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint16_euint8(
+ const tx = await this.contract11.rotl_euint64_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
- expect(res).to.equal(31609n);
+ const res = await decrypt64(await this.contract11.res64());
+ expect(res).to.equal(17646787786812531967n);
});
- it('test operator "rotl" overload (euint16, euint8) => euint16 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(4n);
+ it('test operator "rotl" overload (euint64, euint8) => euint64 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(4n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint16_euint8(
+ const tx = await this.contract11.rotl_euint64_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
+ const res = await decrypt64(await this.contract11.res64());
expect(res).to.equal(1024n);
});
- it('test operator "rotl" overload (euint16, euint8) => euint16 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(8n);
+ it('test operator "rotl" overload (euint64, euint8) => euint64 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(8n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint16_euint8(
+ const tx = await this.contract11.rotl_euint64_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
+ const res = await decrypt64(await this.contract11.res64());
expect(res).to.equal(2048n);
});
- it('test operator "rotl" overload (euint16, euint8) => euint16 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(8n);
+ it('test operator "rotl" overload (euint64, euint8) => euint64 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(8n);
input.add8(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint16_euint8(
+ const tx = await this.contract11.rotl_euint64_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
+ const res = await decrypt64(await this.contract11.res64());
expect(res).to.equal(128n);
});
- it('test operator "rotl" overload (euint16, uint8) => euint16 test 1 (12143, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(12143n);
+ it('test operator "rotl" overload (euint64, uint8) => euint64 test 1 (18440494415218168649, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(18440494415218168649n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint16_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotl_euint64_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
- expect(res).to.equal(31609n);
+ const res = await decrypt64(await this.contract11.res64());
+ expect(res).to.equal(17646787786812531967n);
});
- it('test operator "rotl" overload (euint16, uint8) => euint16 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(4n);
+ it('test operator "rotl" overload (euint64, uint8) => euint64 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotl_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
+ const res = await decrypt64(await this.contract11.res64());
expect(res).to.equal(1024n);
});
- it('test operator "rotl" overload (euint16, uint8) => euint16 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(8n);
+ it('test operator "rotl" overload (euint64, uint8) => euint64 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotl_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
+ const res = await decrypt64(await this.contract11.res64());
expect(res).to.equal(2048n);
});
- it('test operator "rotl" overload (euint16, uint8) => euint16 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(8n);
+ it('test operator "rotl" overload (euint64, uint8) => euint64 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint16_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotl_euint64_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
+ const res = await decrypt64(await this.contract11.res64());
expect(res).to.equal(128n);
});
- it('test operator "rotr" overload (euint16, euint8) => euint16 test 1 (63583, 1)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(63583n);
- input.add8(1n);
+ it('test operator "rotr" overload (euint64, euint8) => euint64 test 1 (18444475066789617897, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(18444475066789617897n);
+ input.add8(3n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint16_euint8(
+ const tx = await this.contract11.rotr_euint64_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
- expect(res).to.equal(64559n);
+ const res = await decrypt64(await this.contract11.res64());
+ expect(res).to.equal(4611402392562396189n);
});
- it('test operator "rotr" overload (euint16, euint8) => euint16 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(4n);
+ it('test operator "rotr" overload (euint64, euint8) => euint64 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(4n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint16_euint8(
+ const tx = await this.contract11.rotr_euint64_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
- expect(res).to.equal(1024n);
+ const res = await decrypt64(await this.contract11.res64());
+ expect(res).to.equal(288230376151711744n);
});
- it('test operator "rotr" overload (euint16, euint8) => euint16 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(8n);
+ it('test operator "rotr" overload (euint64, euint8) => euint64 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(8n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint16_euint8(
+ const tx = await this.contract11.rotr_euint64_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
- expect(res).to.equal(2048n);
+ const res = await decrypt64(await this.contract11.res64());
+ expect(res).to.equal(576460752303423488n);
});
- it('test operator "rotr" overload (euint16, euint8) => euint16 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(8n);
+ it('test operator "rotr" overload (euint64, euint8) => euint64 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(8n);
input.add8(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint16_euint8(
+ const tx = await this.contract11.rotr_euint64_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
- expect(res).to.equal(32768n);
+ const res = await decrypt64(await this.contract11.res64());
+ expect(res).to.equal(9223372036854775808n);
});
- it('test operator "rotr" overload (euint16, uint8) => euint16 test 1 (63583, 1)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(63583n);
+ it('test operator "rotr" overload (euint64, uint8) => euint64 test 1 (18444475066789617897, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(18444475066789617897n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint16_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotr_euint64_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
- expect(res).to.equal(64559n);
+ const res = await decrypt64(await this.contract11.res64());
+ expect(res).to.equal(4611402392562396189n);
});
- it('test operator "rotr" overload (euint16, uint8) => euint16 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(4n);
+ it('test operator "rotr" overload (euint64, uint8) => euint64 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotr_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
- expect(res).to.equal(1024n);
+ const res = await decrypt64(await this.contract11.res64());
+ expect(res).to.equal(288230376151711744n);
});
- it('test operator "rotr" overload (euint16, uint8) => euint16 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(8n);
+ it('test operator "rotr" overload (euint64, uint8) => euint64 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotr_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
- expect(res).to.equal(2048n);
+ const res = await decrypt64(await this.contract11.res64());
+ expect(res).to.equal(576460752303423488n);
});
- it('test operator "rotr" overload (euint16, uint8) => euint16 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add16(8n);
+ it('test operator "rotr" overload (euint64, uint8) => euint64 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint16_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotr_euint64_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract5.res16());
- expect(res).to.equal(32768n);
+ const res = await decrypt64(await this.contract11.res64());
+ expect(res).to.equal(9223372036854775808n);
});
- it('test operator "shl" overload (euint32, euint8) => euint32 test 1 (1317463952, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(1317463952n);
- input.add8(4n);
+ it('test operator "shl" overload (euint128, euint8) => euint128 test 1 (340282366920938463463366293596486217477, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(340282366920938463463366293596486217477n);
+ input.add8(5n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint32_euint8(
+ const tx = await this.contract11.shl_euint128_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
- expect(res).to.equal(3899554048n);
+ const res = await decrypt128(await this.contract11.res128());
+ expect(res).to.equal(340282366920938463463108564702744404128n);
});
- it('test operator "shl" overload (euint32, euint8) => euint32 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(4n);
+ it('test operator "shl" overload (euint128, euint8) => euint128 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(4n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint32_euint8(
+ const tx = await this.contract11.shl_euint128_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
+ const res = await decrypt128(await this.contract11.res128());
expect(res).to.equal(1024n);
});
- it('test operator "shl" overload (euint32, euint8) => euint32 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(8n);
+ it('test operator "shl" overload (euint128, euint8) => euint128 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(8n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint32_euint8(
+ const tx = await this.contract11.shl_euint128_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
+ const res = await decrypt128(await this.contract11.res128());
expect(res).to.equal(2048n);
});
- it('test operator "shl" overload (euint32, euint8) => euint32 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(8n);
+ it('test operator "shl" overload (euint128, euint8) => euint128 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(8n);
input.add8(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint32_euint8(
+ const tx = await this.contract11.shl_euint128_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
+ const res = await decrypt128(await this.contract11.res128());
expect(res).to.equal(128n);
});
- it('test operator "shl" overload (euint32, uint8) => euint32 test 1 (1317463952, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(1317463952n);
+ it('test operator "shl" overload (euint128, uint8) => euint128 test 1 (340282366920938463463366293596486217477, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(340282366920938463463366293596486217477n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shl_euint128_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
- expect(res).to.equal(3899554048n);
+ const res = await decrypt128(await this.contract11.res128());
+ expect(res).to.equal(340282366920938463463108564702744404128n);
});
- it('test operator "shl" overload (euint32, uint8) => euint32 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(4n);
+ it('test operator "shl" overload (euint128, uint8) => euint128 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shl_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
+ const res = await decrypt128(await this.contract11.res128());
expect(res).to.equal(1024n);
});
- it('test operator "shl" overload (euint32, uint8) => euint32 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(8n);
+ it('test operator "shl" overload (euint128, uint8) => euint128 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shl_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
+ const res = await decrypt128(await this.contract11.res128());
expect(res).to.equal(2048n);
});
- it('test operator "shl" overload (euint32, uint8) => euint32 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(8n);
+ it('test operator "shl" overload (euint128, uint8) => euint128 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shl_euint128_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
+ const res = await decrypt128(await this.contract11.res128());
expect(res).to.equal(128n);
});
- it('test operator "shr" overload (euint32, euint8) => euint32 test 1 (3048369776, 1)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(3048369776n);
- input.add8(1n);
+ it('test operator "shr" overload (euint128, euint8) => euint128 test 1 (340282366920938463463368208225205051841, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(340282366920938463463368208225205051841n);
+ input.add8(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint32_euint8(
+ const tx = await this.contract11.shr_euint128_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
- expect(res).to.equal(1524184888n);
+ const res = await decrypt128(await this.contract11.res128());
+ expect(res).to.equal(85070591730234615865842052056301262960n);
});
- it('test operator "shr" overload (euint32, euint8) => euint32 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(4n);
+ it('test operator "shr" overload (euint128, euint8) => euint128 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(4n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint32_euint8(
+ const tx = await this.contract11.shr_euint128_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
+ const res = await decrypt128(await this.contract11.res128());
expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint32, euint8) => euint32 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(8n);
+ it('test operator "shr" overload (euint128, euint8) => euint128 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(8n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint32_euint8(
+ const tx = await this.contract11.shr_euint128_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
+ const res = await decrypt128(await this.contract11.res128());
expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint32, euint8) => euint32 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(8n);
+ it('test operator "shr" overload (euint128, euint8) => euint128 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(8n);
input.add8(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint32_euint8(
+ const tx = await this.contract11.shr_euint128_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
+ const res = await decrypt128(await this.contract11.res128());
expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint32, uint8) => euint32 test 1 (3048369776, 1)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(3048369776n);
+ it('test operator "shr" overload (euint128, uint8) => euint128 test 1 (340282366920938463463368208225205051841, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(340282366920938463463368208225205051841n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint32_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shr_euint128_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
- expect(res).to.equal(1524184888n);
+ const res = await decrypt128(await this.contract11.res128());
+ expect(res).to.equal(85070591730234615865842052056301262960n);
});
- it('test operator "shr" overload (euint32, uint8) => euint32 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(4n);
+ it('test operator "shr" overload (euint128, uint8) => euint128 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shr_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
+ const res = await decrypt128(await this.contract11.res128());
expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint32, uint8) => euint32 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(8n);
+ it('test operator "shr" overload (euint128, uint8) => euint128 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shr_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
+ const res = await decrypt128(await this.contract11.res128());
expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint32, uint8) => euint32 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(8n);
+ it('test operator "shr" overload (euint128, uint8) => euint128 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shr_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shr_euint128_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
+ const res = await decrypt128(await this.contract11.res128());
expect(res).to.equal(0n);
});
- it('test operator "rotl" overload (euint32, euint8) => euint32 test 1 (2219902125, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(2219902125n);
- input.add8(2n);
+ it('test operator "rotl" overload (euint128, euint8) => euint128 test 1 (340282366920938463463369231473752264653, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(340282366920938463463369231473752264653n);
+ input.add8(3n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint32_euint8(
+ const tx = await this.contract11.rotl_euint128_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
- expect(res).to.equal(289673910n);
+ const res = await decrypt128(await this.contract11.res128());
+ expect(res).to.equal(340282366920938463463331599767640637039n);
});
- it('test operator "rotl" overload (euint32, euint8) => euint32 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(4n);
+ it('test operator "rotl" overload (euint128, euint8) => euint128 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(4n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint32_euint8(
+ const tx = await this.contract11.rotl_euint128_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
+ const res = await decrypt128(await this.contract11.res128());
expect(res).to.equal(1024n);
});
- it('test operator "rotl" overload (euint32, euint8) => euint32 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(8n);
+ it('test operator "rotl" overload (euint128, euint8) => euint128 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(8n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint32_euint8(
+ const tx = await this.contract11.rotl_euint128_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
+ const res = await decrypt128(await this.contract11.res128());
expect(res).to.equal(2048n);
});
- it('test operator "rotl" overload (euint32, euint8) => euint32 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(8n);
+ it('test operator "rotl" overload (euint128, euint8) => euint128 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(8n);
input.add8(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint32_euint8(
+ const tx = await this.contract11.rotl_euint128_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
+ const res = await decrypt128(await this.contract11.res128());
expect(res).to.equal(128n);
});
- it('test operator "rotl" overload (euint32, uint8) => euint32 test 1 (2219902125, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(2219902125n);
+ it('test operator "rotl" overload (euint128, uint8) => euint128 test 1 (340282366920938463463369231473752264653, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(340282366920938463463369231473752264653n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint32_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotl_euint128_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
- expect(res).to.equal(289673910n);
+ const res = await decrypt128(await this.contract11.res128());
+ expect(res).to.equal(340282366920938463463331599767640637039n);
});
- it('test operator "rotl" overload (euint32, uint8) => euint32 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(4n);
+ it('test operator "rotl" overload (euint128, uint8) => euint128 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotl_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
+ const res = await decrypt128(await this.contract11.res128());
expect(res).to.equal(1024n);
});
- it('test operator "rotl" overload (euint32, uint8) => euint32 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(8n);
+ it('test operator "rotl" overload (euint128, uint8) => euint128 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotl_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
+ const res = await decrypt128(await this.contract11.res128());
expect(res).to.equal(2048n);
});
- it('test operator "rotl" overload (euint32, uint8) => euint32 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(8n);
+ it('test operator "rotl" overload (euint128, uint8) => euint128 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotl_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotl_euint128_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
+ const res = await decrypt128(await this.contract11.res128());
expect(res).to.equal(128n);
});
- it('test operator "rotr" overload (euint32, euint8) => euint32 test 1 (4127207673, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(4127207673n);
- input.add8(5n);
+ it('test operator "rotr" overload (euint128, euint8) => euint128 test 1 (340282366920938463463366872490223703215, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(340282366920938463463366872490223703215n);
+ input.add8(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint32_euint8(
+ const tx = await this.contract11.rotr_euint128_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
- expect(res).to.equal(3484418439n);
+ const res = await decrypt128(await this.contract11.res128());
+ expect(res).to.equal(340282366920938463463372673696382084395n);
});
- it('test operator "rotr" overload (euint32, euint8) => euint32 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(4n);
+ it('test operator "rotr" overload (euint128, euint8) => euint128 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(4n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint32_euint8(
+ const tx = await this.contract11.rotr_euint128_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
- expect(res).to.equal(67108864n);
+ const res = await decrypt128(await this.contract11.res128());
+ expect(res).to.equal(5316911983139663491615228241121378304n);
});
- it('test operator "rotr" overload (euint32, euint8) => euint32 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(8n);
+ it('test operator "rotr" overload (euint128, euint8) => euint128 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(8n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint32_euint8(
+ const tx = await this.contract11.rotr_euint128_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
- expect(res).to.equal(134217728n);
+ const res = await decrypt128(await this.contract11.res128());
+ expect(res).to.equal(10633823966279326983230456482242756608n);
});
- it('test operator "rotr" overload (euint32, euint8) => euint32 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(8n);
+ it('test operator "rotr" overload (euint128, euint8) => euint128 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(8n);
input.add8(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint32_euint8(
+ const tx = await this.contract11.rotr_euint128_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
- expect(res).to.equal(2147483648n);
+ const res = await decrypt128(await this.contract11.res128());
+ expect(res).to.equal(170141183460469231731687303715884105728n);
});
- it('test operator "rotr" overload (euint32, uint8) => euint32 test 1 (4127207673, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(4127207673n);
+ it('test operator "rotr" overload (euint128, uint8) => euint128 test 1 (340282366920938463463366872490223703215, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(340282366920938463463366872490223703215n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint32_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotr_euint128_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
- expect(res).to.equal(3484418439n);
+ const res = await decrypt128(await this.contract11.res128());
+ expect(res).to.equal(340282366920938463463372673696382084395n);
});
- it('test operator "rotr" overload (euint32, uint8) => euint32 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(4n);
+ it('test operator "rotr" overload (euint128, uint8) => euint128 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotr_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
- expect(res).to.equal(67108864n);
+ const res = await decrypt128(await this.contract11.res128());
+ expect(res).to.equal(5316911983139663491615228241121378304n);
});
- it('test operator "rotr" overload (euint32, uint8) => euint32 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(8n);
+ it('test operator "rotr" overload (euint128, uint8) => euint128 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotr_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
- expect(res).to.equal(134217728n);
+ const res = await decrypt128(await this.contract11.res128());
+ expect(res).to.equal(10633823966279326983230456482242756608n);
});
- it('test operator "rotr" overload (euint32, uint8) => euint32 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add32(8n);
+ it('test operator "rotr" overload (euint128, uint8) => euint128 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.rotr_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotr_euint128_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt32(await this.contract5.res32());
- expect(res).to.equal(2147483648n);
+ const res = await decrypt128(await this.contract11.res128());
+ expect(res).to.equal(170141183460469231731687303715884105728n);
});
- it('test operator "shl" overload (euint64, euint8) => euint64 test 1 (18445637206389853441, 6)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18445637206389853441n);
- input.add8(6n);
+ it('test operator "shl" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457578572299000463425, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457578572299000463425n);
+ input.add8(7n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint64_euint8(
+ const tx = await this.contract11.shl_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18375904565248868416n);
+ const res = await decrypt256(await this.contract11.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039456888249304595046528n);
});
- it('test operator "shl" overload (euint64, euint8) => euint64 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(4n);
+ it('test operator "shl" overload (euint256, euint8) => euint256 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(4n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint64_euint8(
+ const tx = await this.contract11.shl_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
+ const res = await decrypt256(await this.contract11.res256());
expect(res).to.equal(1024n);
});
- it('test operator "shl" overload (euint64, euint8) => euint64 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(8n);
+ it('test operator "shl" overload (euint256, euint8) => euint256 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(8n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint64_euint8(
+ const tx = await this.contract11.shl_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
+ const res = await decrypt256(await this.contract11.res256());
expect(res).to.equal(2048n);
});
- it('test operator "shl" overload (euint64, euint8) => euint64 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(8n);
+ it('test operator "shl" overload (euint256, euint8) => euint256 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(8n);
input.add8(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint64_euint8(
+ const tx = await this.contract11.shl_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
+ const res = await decrypt256(await this.contract11.res256());
expect(res).to.equal(128n);
});
- it('test operator "shl" overload (euint64, uint8) => euint64 test 1 (18445637206389853441, 6)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(18445637206389853441n);
+ it('test operator "shl" overload (euint256, uint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457578572299000463425, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457578572299000463425n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint64_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shl_euint256_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
- expect(res).to.equal(18375904565248868416n);
+ const res = await decrypt256(await this.contract11.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039456888249304595046528n);
});
- it('test operator "shl" overload (euint64, uint8) => euint64 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(4n);
+ it('test operator "shl" overload (euint256, uint8) => euint256 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shl_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
+ const res = await decrypt256(await this.contract11.res256());
expect(res).to.equal(1024n);
});
- it('test operator "shl" overload (euint64, uint8) => euint64 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(8n);
+ it('test operator "shl" overload (euint256, uint8) => euint256 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shl_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
+ const res = await decrypt256(await this.contract11.res256());
expect(res).to.equal(2048n);
});
- it('test operator "shl" overload (euint64, uint8) => euint64 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add64(8n);
+ it('test operator "shl" overload (euint256, uint8) => euint256 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract5.shl_euint64_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shl_euint256_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract5.res64());
+ const res = await decrypt256(await this.contract11.res256());
expect(res).to.equal(128n);
});
- it('test operator "shr" overload (euint64, euint8) => euint64 test 1 (18438869893773583255, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(18438869893773583255n);
- input.add8(5n);
+ it('test operator "shr" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457578470671649972655, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457578470671649972655n);
+ input.add8(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.shr_euint64_euint8(
+ const tx = await this.contract11.shr_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
- expect(res).to.equal(576214684180424476n);
+ const res = await decrypt256(await this.contract11.res256());
+ expect(res).to.equal(28948022309329048855892746252171976963317496166410141009864394617667912493163n);
});
- it('test operator "shr" overload (euint64, euint8) => euint64 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(4n);
+ it('test operator "shr" overload (euint256, euint8) => euint256 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(4n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.shr_euint64_euint8(
+ const tx = await this.contract11.shr_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
+ const res = await decrypt256(await this.contract11.res256());
expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint64, euint8) => euint64 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(8n);
+ it('test operator "shr" overload (euint256, euint8) => euint256 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(8n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.shr_euint64_euint8(
+ const tx = await this.contract11.shr_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
+ const res = await decrypt256(await this.contract11.res256());
expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint64, euint8) => euint64 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(8n);
+ it('test operator "shr" overload (euint256, euint8) => euint256 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(8n);
input.add8(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.shr_euint64_euint8(
+ const tx = await this.contract11.shr_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
+ const res = await decrypt256(await this.contract11.res256());
expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint64, uint8) => euint64 test 1 (18438869893773583255, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(18438869893773583255n);
+ it('test operator "shr" overload (euint256, uint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457578470671649972655, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457578470671649972655n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.shr_euint64_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shr_euint256_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
- expect(res).to.equal(576214684180424476n);
+ const res = await decrypt256(await this.contract11.res256());
+ expect(res).to.equal(28948022309329048855892746252171976963317496166410141009864394617667912493163n);
});
- it('test operator "shr" overload (euint64, uint8) => euint64 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(4n);
+ it('test operator "shr" overload (euint256, uint8) => euint256 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.shr_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shr_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
+ const res = await decrypt256(await this.contract11.res256());
expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint64, uint8) => euint64 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(8n);
+ it('test operator "shr" overload (euint256, uint8) => euint256 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.shr_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shr_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
+ const res = await decrypt256(await this.contract11.res256());
expect(res).to.equal(0n);
});
- it('test operator "shr" overload (euint64, uint8) => euint64 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(8n);
+ it('test operator "shr" overload (euint256, uint8) => euint256 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.shr_euint64_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract11.shr_euint256_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
+ const res = await decrypt256(await this.contract11.res256());
expect(res).to.equal(0n);
});
- it('test operator "rotl" overload (euint64, euint8) => euint64 test 1 (18442278686771288481, 1)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(18442278686771288481n);
- input.add8(1n);
+ it('test operator "rotl" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582882208711886349, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582882208711886349n);
+ input.add8(7n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.rotl_euint64_euint8(
+ const tx = await this.contract11.rotl_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
- expect(res).to.equal(18437813299833025347n);
+ const res = await decrypt256(await this.contract11.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457439917747657180927n);
});
- it('test operator "rotl" overload (euint64, euint8) => euint64 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(4n);
+ it('test operator "rotl" overload (euint256, euint8) => euint256 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(4n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.rotl_euint64_euint8(
+ const tx = await this.contract11.rotl_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
+ const res = await decrypt256(await this.contract11.res256());
expect(res).to.equal(1024n);
});
- it('test operator "rotl" overload (euint64, euint8) => euint64 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(8n);
+ it('test operator "rotl" overload (euint256, euint8) => euint256 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(8n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.rotl_euint64_euint8(
+ const tx = await this.contract11.rotl_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
+ const res = await decrypt256(await this.contract11.res256());
expect(res).to.equal(2048n);
});
- it('test operator "rotl" overload (euint64, euint8) => euint64 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(8n);
+ it('test operator "rotl" overload (euint256, euint8) => euint256 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(8n);
input.add8(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.rotl_euint64_euint8(
+ const tx = await this.contract11.rotl_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
+ const res = await decrypt256(await this.contract11.res256());
expect(res).to.equal(128n);
});
- it('test operator "rotl" overload (euint64, uint8) => euint64 test 1 (18442278686771288481, 1)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(18442278686771288481n);
+ it('test operator "rotl" overload (euint256, uint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582882208711886349, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582882208711886349n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.rotl_euint64_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotl_euint256_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
- expect(res).to.equal(18437813299833025347n);
+ const res = await decrypt256(await this.contract11.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457439917747657180927n);
});
- it('test operator "rotl" overload (euint64, uint8) => euint64 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(4n);
+ it('test operator "rotl" overload (euint256, uint8) => euint256 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.rotl_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotl_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
+ const res = await decrypt256(await this.contract11.res256());
expect(res).to.equal(1024n);
});
- it('test operator "rotl" overload (euint64, uint8) => euint64 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(8n);
+ it('test operator "rotl" overload (euint256, uint8) => euint256 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.rotl_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotl_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
+ const res = await decrypt256(await this.contract11.res256());
expect(res).to.equal(2048n);
});
- it('test operator "rotl" overload (euint64, uint8) => euint64 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(8n);
+ it('test operator "rotl" overload (euint256, uint8) => euint256 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.rotl_euint64_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotl_euint256_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
+ const res = await decrypt256(await this.contract11.res256());
expect(res).to.equal(128n);
});
- it('test operator "rotr" overload (euint64, euint8) => euint64 test 1 (18441051342909802901, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(18441051342909802901n);
- input.add8(3n);
+ it('test operator "rotr" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457581545102921797223, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581545102921797223n);
+ input.add8(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.rotr_euint64_euint8(
+ const tx = await this.contract11.rotr_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
- expect(res).to.equal(13834346463932195122n);
+ const res = await decrypt256(await this.contract11.res256());
+ expect(res).to.equal(57896044618658097711785492504343953926634992332820282019728791850030926829798n);
});
- it('test operator "rotr" overload (euint64, euint8) => euint64 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(4n);
+ it('test operator "rotr" overload (euint256, euint8) => euint256 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(4n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.rotr_euint64_euint8(
+ const tx = await this.contract11.rotr_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
- expect(res).to.equal(288230376151711744n);
+ const res = await decrypt256(await this.contract11.res256());
+ expect(res).to.equal(1809251394333065553493296640760748560207343510400633813116524750123642650624n);
});
- it('test operator "rotr" overload (euint64, euint8) => euint64 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(8n);
+ it('test operator "rotr" overload (euint256, euint8) => euint256 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(8n);
input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.rotr_euint64_euint8(
+ const tx = await this.contract11.rotr_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
- expect(res).to.equal(576460752303423488n);
+ const res = await decrypt256(await this.contract11.res256());
+ expect(res).to.equal(3618502788666131106986593281521497120414687020801267626233049500247285301248n);
});
- it('test operator "rotr" overload (euint64, euint8) => euint64 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(8n);
+ it('test operator "rotr" overload (euint256, euint8) => euint256 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(8n);
input.add8(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.rotr_euint64_euint8(
+ const tx = await this.contract11.rotr_euint256_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
- expect(res).to.equal(9223372036854775808n);
+ const res = await decrypt256(await this.contract11.res256());
+ expect(res).to.equal(57896044618658097711785492504343953926634992332820282019728792003956564819968n);
});
- it('test operator "rotr" overload (euint64, uint8) => euint64 test 1 (18441051342909802901, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(18441051342909802901n);
+ it('test operator "rotr" overload (euint256, uint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457581545102921797223, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581545102921797223n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.rotr_euint64_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotr_euint256_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
- expect(res).to.equal(13834346463932195122n);
+ const res = await decrypt256(await this.contract11.res256());
+ expect(res).to.equal(57896044618658097711785492504343953926634992332820282019728791850030926829798n);
});
- it('test operator "rotr" overload (euint64, uint8) => euint64 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(4n);
+ it('test operator "rotr" overload (euint256, uint8) => euint256 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.rotr_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotr_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
- expect(res).to.equal(288230376151711744n);
+ const res = await decrypt256(await this.contract11.res256());
+ expect(res).to.equal(1809251394333065553493296640760748560207343510400633813116524750123642650624n);
});
- it('test operator "rotr" overload (euint64, uint8) => euint64 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(8n);
+ it('test operator "rotr" overload (euint256, uint8) => euint256 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.rotr_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotr_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
- expect(res).to.equal(576460752303423488n);
+ const res = await decrypt256(await this.contract11.res256());
+ expect(res).to.equal(3618502788666131106986593281521497120414687020801267626233049500247285301248n);
});
- it('test operator "rotr" overload (euint64, uint8) => euint64 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(8n);
+ it('test operator "rotr" overload (euint256, uint8) => euint256 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.rotr_euint64_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract11.rotr_euint256_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
- expect(res).to.equal(9223372036854775808n);
+ const res = await decrypt256(await this.contract11.res256());
+ expect(res).to.equal(57896044618658097711785492504343953926634992332820282019728792003956564819968n);
});
- it('test operator "neg" overload (euint4) => euint4 test 1 (6)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add4(6n);
+ it('test operator "neg" overload (euint4) => euint4 test 1 (7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add4(7n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.neg_euint4(encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract11.neg_euint4(encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract6.res4());
- expect(res).to.equal(10n);
+ const res = await decrypt4(await this.contract11.res4());
+ expect(res).to.equal(9n);
});
it('test operator "not" overload (euint4) => euint4 test 1 (4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.not_euint4(encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract11.not_euint4(encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract6.res4());
+ const res = await decrypt4(await this.contract11.res4());
expect(res).to.equal(11n);
});
- it('test operator "neg" overload (euint8) => euint8 test 1 (186)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add8(186n);
+ it('test operator "neg" overload (euint8) => euint8 test 1 (211)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(211n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.neg_euint8(encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(45n);
+ });
+
+ it('test operator "not" overload (euint8) => euint8 test 1 (221)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add8(221n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.not_euint8(encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract11.res8());
+ expect(res).to.equal(34n);
+ });
+
+ it('test operator "neg" overload (euint16) => euint16 test 1 (26686)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(26686n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.neg_euint8(encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract11.neg_euint16(encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract6.res8());
- expect(res).to.equal(70n);
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(38850n);
});
- it('test operator "not" overload (euint8) => euint8 test 1 (29)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add8(29n);
+ it('test operator "not" overload (euint16) => euint16 test 1 (1813)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add16(1813n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.not_euint8(encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract11.not_euint16(encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract6.res8());
- expect(res).to.equal(226n);
+ const res = await decrypt16(await this.contract11.res16());
+ expect(res).to.equal(63722n);
});
- it('test operator "neg" overload (euint16) => euint16 test 1 (3993)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add16(3993n);
+ it('test operator "neg" overload (euint32) => euint32 test 1 (3401457377)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(3401457377n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.neg_euint16(encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract11.neg_euint32(encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract6.res16());
- expect(res).to.equal(61543n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(893509919n);
});
- it('test operator "not" overload (euint16) => euint16 test 1 (47885)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add16(47885n);
+ it('test operator "not" overload (euint32) => euint32 test 1 (2456808918)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add32(2456808918n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.not_euint16(encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract11.not_euint32(encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract6.res16());
- expect(res).to.equal(17650n);
+ const res = await decrypt32(await this.contract11.res32());
+ expect(res).to.equal(1838158377n);
});
- it('test operator "neg" overload (euint32) => euint32 test 1 (2747701293)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add32(2747701293n);
+ it('test operator "neg" overload (euint64) => euint64 test 1 (18441984683925217775)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(18441984683925217775n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.neg_euint32(encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract11.neg_euint64(encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt32(await this.contract6.res32());
- expect(res).to.equal(1547266003n);
+ const res = await decrypt64(await this.contract11.res64());
+ expect(res).to.equal(4759389784333841n);
});
- it('test operator "not" overload (euint32) => euint32 test 1 (3731607282)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add32(3731607282n);
+ it('test operator "not" overload (euint64) => euint64 test 1 (18438471929660169839)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add64(18438471929660169839n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.not_euint32(encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract11.not_euint64(encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt32(await this.contract6.res32());
- expect(res).to.equal(563360013n);
+ const res = await decrypt64(await this.contract11.res64());
+ expect(res).to.equal(8272144049381776n);
});
- it('test operator "neg" overload (euint64) => euint64 test 1 (18446646312005372999)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(18446646312005372999n);
+ it('test operator "neg" overload (euint128) => euint128 test 1 (340282366920938463463373162594455712433)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(340282366920938463463373162594455712433n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.neg_euint64(encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract11.neg_euint128(encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
- expect(res).to.equal(97761704178617n);
+ const res = await decrypt128(await this.contract11.res128());
+ expect(res).to.equal(1444837312499023n);
});
- it('test operator "not" overload (euint64) => euint64 test 1 (18443812023863287611)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add64(18443812023863287611n);
+ it('test operator "not" overload (euint128) => euint128 test 1 (340282366920938463463374264817331350741)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add128(340282366920938463463374264817331350741n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract6.not_euint64(encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract11.not_euint128(encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract6.res64());
- expect(res).to.equal(2932049846264004n);
+ const res = await decrypt128(await this.contract11.res128());
+ expect(res).to.equal(342614436860714n);
});
});
diff --git a/test/tfheOperations/tfheOperations13.ts b/test/tfheOperations/tfheOperations13.ts
new file mode 100644
index 00000000..db18a0e6
--- /dev/null
+++ b/test/tfheOperations/tfheOperations13.ts
@@ -0,0 +1,221 @@
+import { expect } from 'chai';
+import { ethers } from 'hardhat';
+
+import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1';
+import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2';
+import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3';
+import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
+import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
+import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
+import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
+import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
+import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
+import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
+import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
+import {
+ createInstances,
+ decrypt4,
+ decrypt8,
+ decrypt16,
+ decrypt32,
+ decrypt64,
+ decrypt128,
+ decrypt256,
+ decryptBool,
+} from '../instance';
+import { getSigners, initSigners } from '../signers';
+
+async function deployTfheTestFixture1(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite1');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture2(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite2');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture3(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite3');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture4(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite4');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture5(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite5');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture6(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite6');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture7(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite7');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture8(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite8');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture9(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite9');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture10(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite10');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture11(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite11');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+describe('TFHE operations 13', function () {
+ before(async function () {
+ await initSigners(1);
+ this.signers = await getSigners();
+
+ const contract1 = await deployTfheTestFixture1();
+ this.contract1Address = await contract1.getAddress();
+ this.contract1 = contract1;
+
+ const contract2 = await deployTfheTestFixture2();
+ this.contract2Address = await contract2.getAddress();
+ this.contract2 = contract2;
+
+ const contract3 = await deployTfheTestFixture3();
+ this.contract3Address = await contract3.getAddress();
+ this.contract3 = contract3;
+
+ const contract4 = await deployTfheTestFixture4();
+ this.contract4Address = await contract4.getAddress();
+ this.contract4 = contract4;
+
+ const contract5 = await deployTfheTestFixture5();
+ this.contract5Address = await contract5.getAddress();
+ this.contract5 = contract5;
+
+ const contract6 = await deployTfheTestFixture6();
+ this.contract6Address = await contract6.getAddress();
+ this.contract6 = contract6;
+
+ const contract7 = await deployTfheTestFixture7();
+ this.contract7Address = await contract7.getAddress();
+ this.contract7 = contract7;
+
+ const contract8 = await deployTfheTestFixture8();
+ this.contract8Address = await contract8.getAddress();
+ this.contract8 = contract8;
+
+ const contract9 = await deployTfheTestFixture9();
+ this.contract9Address = await contract9.getAddress();
+ this.contract9 = contract9;
+
+ const contract10 = await deployTfheTestFixture10();
+ this.contract10Address = await contract10.getAddress();
+ this.contract10 = contract10;
+
+ const contract11 = await deployTfheTestFixture11();
+ this.contract11Address = await contract11.getAddress();
+ this.contract11 = contract11;
+
+ const instances = await createInstances(this.signers);
+ this.instances = instances;
+ });
+
+ it('test operator "neg" overload (euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457578680357072424439)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457578680357072424439n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.neg_euint256(encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt256(await this.contract11.res256());
+ expect(res).to.equal(5327556057215497n);
+ });
+
+ it('test operator "not" overload (euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457581938347870429377)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581938347870429377n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract11.not_euint256(encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt256(await this.contract11.res256());
+ expect(res).to.equal(2069565259210558n);
+ });
+});
diff --git a/test/tfheOperations/tfheOperations2.ts b/test/tfheOperations/tfheOperations2.ts
index 6b8b15fe..93245365 100644
--- a/test/tfheOperations/tfheOperations2.ts
+++ b/test/tfheOperations/tfheOperations2.ts
@@ -7,7 +7,22 @@ import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'
import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance';
+import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
+import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
+import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
+import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
+import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
+import {
+ createInstances,
+ decrypt4,
+ decrypt8,
+ decrypt16,
+ decrypt32,
+ decrypt64,
+ decrypt128,
+ decrypt256,
+ decryptBool,
+} from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
@@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise {
return contract;
}
+async function deployTfheTestFixture7(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite7');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture8(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite8');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture9(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite9');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture10(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite10');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture11(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite11');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
describe('TFHE operations 2', function () {
before(async function () {
await initSigners(1);
@@ -105,2227 +175,4183 @@ describe('TFHE operations 2', function () {
this.contract6Address = await contract6.getAddress();
this.contract6 = contract6;
+ const contract7 = await deployTfheTestFixture7();
+ this.contract7Address = await contract7.getAddress();
+ this.contract7 = contract7;
+
+ const contract8 = await deployTfheTestFixture8();
+ this.contract8Address = await contract8.getAddress();
+ this.contract8 = contract8;
+
+ const contract9 = await deployTfheTestFixture9();
+ this.contract9Address = await contract9.getAddress();
+ this.contract9 = contract9;
+
+ const contract10 = await deployTfheTestFixture10();
+ this.contract10Address = await contract10.getAddress();
+ this.contract10 = contract10;
+
+ const contract11 = await deployTfheTestFixture11();
+ this.contract11Address = await contract11.getAddress();
+ this.contract11 = contract11;
+
const instances = await createInstances(this.signers);
this.instances = instances;
});
- it('test operator "sub" overload (euint4, euint32) => euint32 test 1 (8, 8)', async function () {
+ it('test operator "le" overload (euint4, euint128) => ebool test 1 (5, 340282366920938463463372463025889881069)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add32(8n);
+ input.add4(5n);
+ input.add128(340282366920938463463372463025889881069n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.sub_euint4_euint32(
+ const tx = await this.contract1.le_euint4_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(0n);
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
});
- it('test operator "sub" overload (euint4, euint32) => euint32 test 2 (8, 4)', async function () {
+ it('test operator "le" overload (euint4, euint128) => ebool test 2 (4, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add32(4n);
+ input.add4(4n);
+ input.add128(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.sub_euint4_euint32(
+ const tx = await this.contract1.le_euint4_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(4n);
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
});
- it('test operator "mul" overload (euint4, euint32) => euint32 test 1 (2, 5)', async function () {
+ it('test operator "le" overload (euint4, euint128) => ebool test 3 (8, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(2n);
- input.add32(5n);
+ input.add4(8n);
+ input.add128(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.mul_euint4_euint32(
+ const tx = await this.contract1.le_euint4_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(10n);
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
});
- it('test operator "mul" overload (euint4, euint32) => euint32 test 2 (3, 3)', async function () {
+ it('test operator "le" overload (euint4, euint128) => ebool test 4 (8, 4)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(3n);
- input.add32(3n);
+ input.add4(8n);
+ input.add128(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.mul_euint4_euint32(
+ const tx = await this.contract1.le_euint4_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(9n);
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
});
- it('test operator "mul" overload (euint4, euint32) => euint32 test 3 (3, 3)', async function () {
+ it('test operator "lt" overload (euint4, euint128) => ebool test 1 (8, 340282366920938463463367828600285579945)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(3n);
- input.add32(3n);
+ input.add4(8n);
+ input.add128(340282366920938463463367828600285579945n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.mul_euint4_euint32(
+ const tx = await this.contract1.lt_euint4_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(9n);
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
});
- it('test operator "mul" overload (euint4, euint32) => euint32 test 4 (3, 3)', async function () {
+ it('test operator "lt" overload (euint4, euint128) => ebool test 2 (4, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(3n);
- input.add32(3n);
+ input.add4(4n);
+ input.add128(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.mul_euint4_euint32(
+ const tx = await this.contract1.lt_euint4_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(9n);
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(true);
});
- it('test operator "and" overload (euint4, euint32) => euint32 test 1 (1, 1067388092)', async function () {
+ it('test operator "lt" overload (euint4, euint128) => ebool test 3 (8, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(1n);
- input.add32(1067388092n);
+ input.add4(8n);
+ input.add128(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.and_euint4_euint32(
+ const tx = await this.contract1.lt_euint4_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(0n);
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
});
- it('test operator "and" overload (euint4, euint32) => euint32 test 2 (4, 8)', async function () {
+ it('test operator "lt" overload (euint4, euint128) => ebool test 4 (8, 4)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add32(8n);
+ input.add4(8n);
+ input.add128(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.and_euint4_euint32(
+ const tx = await this.contract1.lt_euint4_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(0n);
+ const res = await decryptBool(await this.contract1.resb());
+ expect(res).to.equal(false);
});
- it('test operator "and" overload (euint4, euint32) => euint32 test 3 (8, 8)', async function () {
+ it('test operator "min" overload (euint4, euint128) => euint128 test 1 (14, 340282366920938463463373484167219835469)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add32(8n);
+ input.add4(14n);
+ input.add128(340282366920938463463373484167219835469n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.and_euint4_euint32(
+ const tx = await this.contract1.min_euint4_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(8n);
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(14n);
});
- it('test operator "and" overload (euint4, euint32) => euint32 test 4 (8, 4)', async function () {
+ it('test operator "min" overload (euint4, euint128) => euint128 test 2 (10, 14)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add32(4n);
+ input.add4(10n);
+ input.add128(14n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.and_euint4_euint32(
+ const tx = await this.contract1.min_euint4_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(0n);
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(10n);
});
- it('test operator "or" overload (euint4, euint32) => euint32 test 1 (12, 3045135587)', async function () {
+ it('test operator "min" overload (euint4, euint128) => euint128 test 3 (14, 14)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(12n);
- input.add32(3045135587n);
+ input.add4(14n);
+ input.add128(14n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.or_euint4_euint32(
+ const tx = await this.contract1.min_euint4_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(3045135599n);
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(14n);
});
- it('test operator "or" overload (euint4, euint32) => euint32 test 2 (8, 12)', async function () {
+ it('test operator "min" overload (euint4, euint128) => euint128 test 4 (14, 10)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add32(12n);
+ input.add4(14n);
+ input.add128(10n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.or_euint4_euint32(
+ const tx = await this.contract1.min_euint4_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(12n);
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(10n);
});
- it('test operator "or" overload (euint4, euint32) => euint32 test 3 (12, 12)', async function () {
+ it('test operator "max" overload (euint4, euint128) => euint128 test 1 (1, 340282366920938463463366284713062311837)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(12n);
- input.add32(12n);
+ input.add4(1n);
+ input.add128(340282366920938463463366284713062311837n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.or_euint4_euint32(
+ const tx = await this.contract1.max_euint4_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(12n);
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(340282366920938463463366284713062311837n);
});
- it('test operator "or" overload (euint4, euint32) => euint32 test 4 (12, 8)', async function () {
+ it('test operator "max" overload (euint4, euint128) => euint128 test 2 (4, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(12n);
- input.add32(8n);
+ input.add4(4n);
+ input.add128(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.or_euint4_euint32(
+ const tx = await this.contract1.max_euint4_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(12n);
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(8n);
});
- it('test operator "xor" overload (euint4, euint32) => euint32 test 1 (6, 1855370868)', async function () {
+ it('test operator "max" overload (euint4, euint128) => euint128 test 3 (8, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(6n);
- input.add32(1855370868n);
+ input.add4(8n);
+ input.add128(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.xor_euint4_euint32(
+ const tx = await this.contract1.max_euint4_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(1855370866n);
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(8n);
});
- it('test operator "xor" overload (euint4, euint32) => euint32 test 2 (4, 8)', async function () {
+ it('test operator "max" overload (euint4, euint128) => euint128 test 4 (8, 4)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add32(8n);
+ input.add4(8n);
+ input.add128(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.xor_euint4_euint32(
+ const tx = await this.contract1.max_euint4_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(12n);
+ const res = await decrypt128(await this.contract1.res128());
+ expect(res).to.equal(8n);
});
- it('test operator "xor" overload (euint4, euint32) => euint32 test 3 (8, 8)', async function () {
+ it('test operator "add" overload (euint4, euint256) => euint256 test 1 (2, 9)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add32(8n);
+ input.add4(2n);
+ input.add256(9n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.xor_euint4_euint32(
+ const tx = await this.contract1.add_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(0n);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(11n);
});
- it('test operator "xor" overload (euint4, euint32) => euint32 test 4 (8, 4)', async function () {
+ it('test operator "add" overload (euint4, euint256) => euint256 test 2 (4, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add32(4n);
+ input.add4(4n);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.xor_euint4_euint32(
+ const tx = await this.contract1.add_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
+ const res = await decrypt256(await this.contract1.res256());
expect(res).to.equal(12n);
});
- it('test operator "eq" overload (euint4, euint32) => ebool test 1 (2, 183972195)', async function () {
+ it('test operator "add" overload (euint4, euint256) => euint256 test 3 (5, 5)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(2n);
- input.add32(183972195n);
+ input.add4(5n);
+ input.add256(5n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.eq_euint4_euint32(
+ const tx = await this.contract1.add_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(10n);
});
- it('test operator "eq" overload (euint4, euint32) => ebool test 2 (4, 8)', async function () {
+ it('test operator "add" overload (euint4, euint256) => euint256 test 4 (8, 4)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add32(8n);
+ input.add4(8n);
+ input.add256(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.eq_euint4_euint32(
+ const tx = await this.contract1.add_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(12n);
});
- it('test operator "eq" overload (euint4, euint32) => ebool test 3 (8, 8)', async function () {
+ it('test operator "sub" overload (euint4, euint256) => euint256 test 1 (14, 14)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add32(8n);
+ input.add4(14n);
+ input.add256(14n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.eq_euint4_euint32(
+ const tx = await this.contract1.sub_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(0n);
});
- it('test operator "eq" overload (euint4, euint32) => ebool test 4 (8, 4)', async function () {
+ it('test operator "sub" overload (euint4, euint256) => euint256 test 2 (14, 10)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add32(4n);
+ input.add4(14n);
+ input.add256(10n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.eq_euint4_euint32(
+ const tx = await this.contract1.sub_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(4n);
});
- it('test operator "ne" overload (euint4, euint32) => ebool test 1 (14, 1312265251)', async function () {
+ it('test operator "mul" overload (euint4, euint256) => euint256 test 1 (2, 5)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(14n);
- input.add32(1312265251n);
+ input.add4(2n);
+ input.add256(5n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ne_euint4_euint32(
+ const tx = await this.contract1.mul_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(10n);
});
- it('test operator "ne" overload (euint4, euint32) => ebool test 2 (10, 14)', async function () {
+ it('test operator "mul" overload (euint4, euint256) => euint256 test 2 (3, 5)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add32(14n);
+ input.add4(3n);
+ input.add256(5n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ne_euint4_euint32(
+ const tx = await this.contract1.mul_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(15n);
});
- it('test operator "ne" overload (euint4, euint32) => ebool test 3 (14, 14)', async function () {
+ it('test operator "mul" overload (euint4, euint256) => euint256 test 3 (3, 3)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(14n);
- input.add32(14n);
+ input.add4(3n);
+ input.add256(3n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ne_euint4_euint32(
+ const tx = await this.contract1.mul_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(9n);
});
- it('test operator "ne" overload (euint4, euint32) => ebool test 4 (14, 10)', async function () {
+ it('test operator "mul" overload (euint4, euint256) => euint256 test 4 (5, 3)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(14n);
- input.add32(10n);
+ input.add4(5n);
+ input.add256(3n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ne_euint4_euint32(
+ const tx = await this.contract1.mul_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(15n);
});
- it('test operator "ge" overload (euint4, euint32) => ebool test 1 (3, 735253791)', async function () {
+ it('test operator "and" overload (euint4, euint256) => euint256 test 1 (3, 115792089237316195423570985008687907853269984665640564039457581650107790454269)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
input.add4(3n);
- input.add32(735253791n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581650107790454269n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ge_euint4_euint32(
+ const tx = await this.contract1.and_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(1n);
});
- it('test operator "ge" overload (euint4, euint32) => ebool test 2 (4, 8)', async function () {
+ it('test operator "and" overload (euint4, euint256) => euint256 test 2 (4, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
input.add4(4n);
- input.add32(8n);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ge_euint4_euint32(
+ const tx = await this.contract1.and_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(0n);
});
- it('test operator "ge" overload (euint4, euint32) => ebool test 3 (8, 8)', async function () {
+ it('test operator "and" overload (euint4, euint256) => euint256 test 3 (8, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
input.add4(8n);
- input.add32(8n);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ge_euint4_euint32(
+ const tx = await this.contract1.and_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(8n);
});
- it('test operator "ge" overload (euint4, euint32) => ebool test 4 (8, 4)', async function () {
+ it('test operator "and" overload (euint4, euint256) => euint256 test 4 (8, 4)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
input.add4(8n);
- input.add32(4n);
+ input.add256(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ge_euint4_euint32(
+ const tx = await this.contract1.and_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(0n);
});
- it('test operator "gt" overload (euint4, euint32) => ebool test 1 (1, 2112514560)', async function () {
+ it('test operator "or" overload (euint4, euint256) => euint256 test 1 (8, 115792089237316195423570985008687907853269984665640564039457583166606888282231)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(1n);
- input.add32(2112514560n);
+ input.add4(8n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457583166606888282231n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.gt_euint4_euint32(
+ const tx = await this.contract1.or_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457583166606888282239n);
});
- it('test operator "gt" overload (euint4, euint32) => ebool test 2 (4, 8)', async function () {
+ it('test operator "or" overload (euint4, euint256) => euint256 test 2 (4, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
input.add4(4n);
- input.add32(8n);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.gt_euint4_euint32(
+ const tx = await this.contract1.or_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(12n);
});
- it('test operator "gt" overload (euint4, euint32) => ebool test 3 (8, 8)', async function () {
+ it('test operator "or" overload (euint4, euint256) => euint256 test 3 (8, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
input.add4(8n);
- input.add32(8n);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.gt_euint4_euint32(
+ const tx = await this.contract1.or_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(8n);
});
- it('test operator "gt" overload (euint4, euint32) => ebool test 4 (8, 4)', async function () {
+ it('test operator "or" overload (euint4, euint256) => euint256 test 4 (8, 4)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
input.add4(8n);
- input.add32(4n);
+ input.add256(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.gt_euint4_euint32(
+ const tx = await this.contract1.or_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(12n);
});
- it('test operator "le" overload (euint4, euint32) => ebool test 1 (5, 3704560179)', async function () {
+ it('test operator "xor" overload (euint4, euint256) => euint256 test 1 (5, 115792089237316195423570985008687907853269984665640564039457578855535245251769)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
input.add4(5n);
- input.add32(3704560179n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457578855535245251769n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.le_euint4_euint32(
+ const tx = await this.contract1.xor_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457578855535245251772n);
});
- it('test operator "le" overload (euint4, euint32) => ebool test 2 (4, 8)', async function () {
+ it('test operator "xor" overload (euint4, euint256) => euint256 test 2 (4, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
input.add4(4n);
- input.add32(8n);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.le_euint4_euint32(
+ const tx = await this.contract1.xor_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(12n);
});
- it('test operator "le" overload (euint4, euint32) => ebool test 3 (8, 8)', async function () {
+ it('test operator "xor" overload (euint4, euint256) => euint256 test 3 (8, 8)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
input.add4(8n);
- input.add32(8n);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.le_euint4_euint32(
+ const tx = await this.contract1.xor_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(0n);
});
- it('test operator "le" overload (euint4, euint32) => ebool test 4 (8, 4)', async function () {
+ it('test operator "xor" overload (euint4, euint256) => euint256 test 4 (8, 4)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
input.add4(8n);
- input.add32(4n);
+ input.add256(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.le_euint4_euint32(
+ const tx = await this.contract1.xor_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt256(await this.contract1.res256());
+ expect(res).to.equal(12n);
});
- it('test operator "lt" overload (euint4, euint32) => ebool test 1 (6, 2034411051)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(6n);
- input.add32(2034411051n);
+ it('test operator "eq" overload (euint4, euint256) => ebool test 1 (14, 115792089237316195423570985008687907853269984665640564039457583778640701263885)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(14n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457583778640701263885n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.lt_euint4_euint32(
+ const tx = await this.contract2.eq_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint4, euint32) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add32(8n);
+ it('test operator "eq" overload (euint4, euint256) => ebool test 2 (10, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(10n);
+ input.add256(14n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.lt_euint4_euint32(
+ const tx = await this.contract2.eq_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint4, euint32) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add32(8n);
+ it('test operator "eq" overload (euint4, euint256) => ebool test 3 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(14n);
+ input.add256(14n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.lt_euint4_euint32(
+ const tx = await this.contract2.eq_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint4, euint32) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add32(4n);
+ it('test operator "eq" overload (euint4, euint256) => ebool test 4 (14, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(14n);
+ input.add256(10n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.lt_euint4_euint32(
+ const tx = await this.contract2.eq_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(false);
});
- it('test operator "min" overload (euint4, euint32) => euint32 test 1 (10, 421626494)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add32(421626494n);
+ it('test operator "ne" overload (euint4, euint256) => ebool test 1 (14, 115792089237316195423570985008687907853269984665640564039457581114073806378677)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(14n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581114073806378677n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.min_euint4_euint32(
+ const tx = await this.contract2.ne_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(10n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (euint4, euint32) => euint32 test 2 (6, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(6n);
- input.add32(10n);
+ it('test operator "ne" overload (euint4, euint256) => ebool test 2 (10, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(10n);
+ input.add256(14n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.min_euint4_euint32(
+ const tx = await this.contract2.ne_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(6n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (euint4, euint32) => euint32 test 3 (10, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add32(10n);
+ it('test operator "ne" overload (euint4, euint256) => ebool test 3 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(14n);
+ input.add256(14n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.min_euint4_euint32(
+ const tx = await this.contract2.ne_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(10n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "min" overload (euint4, euint32) => euint32 test 4 (10, 6)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add32(6n);
+ it('test operator "ne" overload (euint4, euint256) => ebool test 4 (14, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(14n);
+ input.add256(10n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.min_euint4_euint32(
+ const tx = await this.contract2.ne_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(6n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "max" overload (euint4, euint32) => euint32 test 1 (12, 3887686486)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(12n);
- input.add32(3887686486n);
+ it('test operator "ge" overload (euint4, euint256) => ebool test 1 (5, 115792089237316195423570985008687907853269984665640564039457582400238586978263)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(5n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582400238586978263n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.max_euint4_euint32(
+ const tx = await this.contract2.ge_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(3887686486n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "max" overload (euint4, euint32) => euint32 test 2 (8, 12)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add32(12n);
+ it('test operator "ge" overload (euint4, euint256) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.max_euint4_euint32(
+ const tx = await this.contract2.ge_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(12n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "max" overload (euint4, euint32) => euint32 test 3 (12, 12)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(12n);
- input.add32(12n);
+ it('test operator "ge" overload (euint4, euint256) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.max_euint4_euint32(
+ const tx = await this.contract2.ge_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(12n);
- });
-
- it('test operator "max" overload (euint4, euint32) => euint32 test 4 (12, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(12n);
- input.add32(8n);
- const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.max_euint4_euint32(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
- await tx.wait();
- const res = await decrypt32(await this.contract1.res32());
- expect(res).to.equal(12n);
- });
-
- it('test operator "add" overload (euint4, euint64) => euint64 test 1 (2, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(2n);
- input.add64(9n);
- const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.add_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
- await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(11n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "add" overload (euint4, euint64) => euint64 test 2 (6, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(6n);
- input.add64(8n);
+ it('test operator "ge" overload (euint4, euint256) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add256(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.add_euint4_euint64(
+ const tx = await this.contract2.ge_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(14n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "add" overload (euint4, euint64) => euint64 test 3 (5, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(5n);
- input.add64(5n);
+ it('test operator "gt" overload (euint4, euint256) => ebool test 1 (1, 115792089237316195423570985008687907853269984665640564039457576918680285784187)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(1n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457576918680285784187n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.add_euint4_euint64(
+ const tx = await this.contract2.gt_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(10n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "add" overload (euint4, euint64) => euint64 test 4 (8, 6)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add64(6n);
+ it('test operator "gt" overload (euint4, euint256) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(4n);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.add_euint4_euint64(
+ const tx = await this.contract2.gt_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(14n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "sub" overload (euint4, euint64) => euint64 test 1 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "gt" overload (euint4, euint256) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
input.add4(8n);
- input.add64(8n);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.sub_euint4_euint64(
+ const tx = await this.contract2.gt_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(0n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "sub" overload (euint4, euint64) => euint64 test 2 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "gt" overload (euint4, euint256) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
input.add4(8n);
- input.add64(4n);
+ input.add256(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.sub_euint4_euint64(
+ const tx = await this.contract2.gt_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(4n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "mul" overload (euint4, euint64) => euint64 test 1 (2, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(2n);
- input.add64(5n);
+ it('test operator "le" overload (euint4, euint256) => ebool test 1 (12, 115792089237316195423570985008687907853269984665640564039457582708981712427829)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(12n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582708981712427829n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.mul_euint4_euint64(
+ const tx = await this.contract2.le_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(10n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "mul" overload (euint4, euint64) => euint64 test 2 (3, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(3n);
- input.add64(5n);
+ it('test operator "le" overload (euint4, euint256) => ebool test 2 (8, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
+ input.add256(12n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.mul_euint4_euint64(
+ const tx = await this.contract2.le_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(15n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "mul" overload (euint4, euint64) => euint64 test 3 (3, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(3n);
- input.add64(3n);
+ it('test operator "le" overload (euint4, euint256) => ebool test 3 (12, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(12n);
+ input.add256(12n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.mul_euint4_euint64(
+ const tx = await this.contract2.le_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(9n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "mul" overload (euint4, euint64) => euint64 test 4 (5, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(5n);
- input.add64(3n);
+ it('test operator "le" overload (euint4, euint256) => ebool test 4 (12, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(12n);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.mul_euint4_euint64(
+ const tx = await this.contract2.le_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(15n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "and" overload (euint4, euint64) => euint64 test 1 (11, 18444970625118669221)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "lt" overload (euint4, euint256) => ebool test 1 (11, 115792089237316195423570985008687907853269984665640564039457582432165171824629)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
input.add4(11n);
- input.add64(18444970625118669221n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582432165171824629n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.and_euint4_euint64(
+ const tx = await this.contract2.lt_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(1n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "and" overload (euint4, euint64) => euint64 test 2 (7, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "lt" overload (euint4, euint256) => ebool test 2 (7, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
input.add4(7n);
- input.add64(11n);
+ input.add256(11n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.and_euint4_euint64(
+ const tx = await this.contract2.lt_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(3n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "and" overload (euint4, euint64) => euint64 test 3 (11, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "lt" overload (euint4, euint256) => ebool test 3 (11, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
input.add4(11n);
- input.add64(11n);
+ input.add256(11n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.and_euint4_euint64(
+ const tx = await this.contract2.lt_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(11n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "and" overload (euint4, euint64) => euint64 test 4 (11, 7)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "lt" overload (euint4, euint256) => ebool test 4 (11, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
input.add4(11n);
- input.add64(7n);
+ input.add256(7n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.and_euint4_euint64(
+ const tx = await this.contract2.lt_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(3n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "or" overload (euint4, euint64) => euint64 test 1 (5, 18439458059788568419)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(5n);
- input.add64(18439458059788568419n);
+ it('test operator "min" overload (euint4, euint256) => euint256 test 1 (1, 115792089237316195423570985008687907853269984665640564039457580584483222103041)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(1n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580584483222103041n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.or_euint4_euint64(
+ const tx = await this.contract2.min_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(18439458059788568423n);
+ const res = await decrypt256(await this.contract2.res256());
+ expect(res).to.equal(1n);
});
- it('test operator "or" overload (euint4, euint64) => euint64 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "min" overload (euint4, euint256) => euint256 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
input.add4(4n);
- input.add64(8n);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.or_euint4_euint64(
+ const tx = await this.contract2.min_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(12n);
+ const res = await decrypt256(await this.contract2.res256());
+ expect(res).to.equal(4n);
});
- it('test operator "or" overload (euint4, euint64) => euint64 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "min" overload (euint4, euint256) => euint256 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
input.add4(8n);
- input.add64(8n);
+ input.add256(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.or_euint4_euint64(
+ const tx = await this.contract2.min_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
+ const res = await decrypt256(await this.contract2.res256());
expect(res).to.equal(8n);
});
- it('test operator "or" overload (euint4, euint64) => euint64 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "min" overload (euint4, euint256) => euint256 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
input.add4(8n);
- input.add64(4n);
+ input.add256(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.or_euint4_euint64(
+ const tx = await this.contract2.min_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(12n);
+ const res = await decrypt256(await this.contract2.res256());
+ expect(res).to.equal(4n);
});
- it('test operator "xor" overload (euint4, euint64) => euint64 test 1 (2, 18446366816185499095)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(2n);
- input.add64(18446366816185499095n);
+ it('test operator "max" overload (euint4, euint256) => euint256 test 1 (9, 115792089237316195423570985008687907853269984665640564039457577693528211281505)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(9n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577693528211281505n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.xor_euint4_euint64(
+ const tx = await this.contract2.max_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(18446366816185499093n);
+ const res = await decrypt256(await this.contract2.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577693528211281505n);
});
- it('test operator "xor" overload (euint4, euint64) => euint64 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add64(8n);
+ it('test operator "max" overload (euint4, euint256) => euint256 test 2 (5, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(5n);
+ input.add256(9n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.xor_euint4_euint64(
+ const tx = await this.contract2.max_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(12n);
+ const res = await decrypt256(await this.contract2.res256());
+ expect(res).to.equal(9n);
});
- it('test operator "xor" overload (euint4, euint64) => euint64 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add64(8n);
+ it('test operator "max" overload (euint4, euint256) => euint256 test 3 (9, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(9n);
+ input.add256(9n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.xor_euint4_euint64(
+ const tx = await this.contract2.max_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(0n);
+ const res = await decrypt256(await this.contract2.res256());
+ expect(res).to.equal(9n);
});
- it('test operator "xor" overload (euint4, euint64) => euint64 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add64(4n);
+ it('test operator "max" overload (euint4, euint256) => euint256 test 4 (9, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(9n);
+ input.add256(5n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.xor_euint4_euint64(
+ const tx = await this.contract2.max_euint4_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(12n);
+ const res = await decrypt256(await this.contract2.res256());
+ expect(res).to.equal(9n);
});
- it('test operator "eq" overload (euint4, euint64) => ebool test 1 (9, 18438414163462572393)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "add" overload (euint4, uint8) => euint4 test 1 (9, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
input.add4(9n);
- input.add64(18438414163462572393n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.eq_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.add_euint4_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(11n);
});
- it('test operator "eq" overload (euint4, euint64) => ebool test 2 (5, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "add" overload (euint4, uint8) => euint4 test 2 (5, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
input.add4(5n);
- input.add64(9n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.eq_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.add_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(14n);
});
- it('test operator "eq" overload (euint4, euint64) => ebool test 3 (9, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(9n);
- input.add64(9n);
+ it('test operator "add" overload (euint4, uint8) => euint4 test 3 (5, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(5n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.eq_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.add_euint4_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(10n);
});
- it('test operator "eq" overload (euint4, euint64) => ebool test 4 (9, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "add" overload (euint4, uint8) => euint4 test 4 (9, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
input.add4(9n);
- input.add64(5n);
- const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.eq_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
- await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
- });
- it('test operator "ne" overload (euint4, euint64) => ebool test 1 (7, 18441024342807508949)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(7n);
- input.add64(18441024342807508949n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ne_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.add_euint4_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(14n);
});
- it('test operator "ne" overload (euint4, euint64) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add64(8n);
+ it('test operator "add" overload (uint8, euint4) => euint4 test 1 (6, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(9n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ne_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.add_uint8_euint4(6n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(15n);
});
- it('test operator "ne" overload (euint4, euint64) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add64(8n);
+ it('test operator "add" overload (uint8, euint4) => euint4 test 2 (5, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(9n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ne_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.add_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(14n);
});
- it('test operator "ne" overload (euint4, euint64) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add64(4n);
+ it('test operator "add" overload (uint8, euint4) => euint4 test 3 (5, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(5n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ne_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.add_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(10n);
});
- it('test operator "ge" overload (euint4, euint64) => ebool test 1 (7, 18446430329213146395)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(7n);
- input.add64(18446430329213146395n);
+ it('test operator "add" overload (uint8, euint4) => euint4 test 4 (9, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(5n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ge_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.add_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(14n);
});
- it('test operator "ge" overload (euint4, euint64) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add64(8n);
+ it('test operator "sub" overload (euint4, uint8) => euint4 test 1 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ge_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.sub_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(0n);
});
- it('test operator "ge" overload (euint4, euint64) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "sub" overload (euint4, uint8) => euint4 test 2 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
input.add4(8n);
- input.add64(8n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ge_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.sub_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(4n);
});
- it('test operator "ge" overload (euint4, euint64) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add64(4n);
+ it('test operator "sub" overload (uint8, euint4) => euint4 test 1 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(14n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ge_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.sub_uint8_euint4(14n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(0n);
});
- it('test operator "gt" overload (euint4, euint64) => ebool test 1 (10, 18442574847292216251)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "sub" overload (uint8, euint4) => euint4 test 2 (14, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
input.add4(10n);
- input.add64(18442574847292216251n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.gt_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.sub_uint8_euint4(14n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(4n);
});
- it('test operator "gt" overload (euint4, euint64) => ebool test 2 (6, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(6n);
- input.add64(10n);
+ it('test operator "mul" overload (euint4, uint8) => euint4 test 1 (3, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(3n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.gt_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.mul_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(12n);
});
- it('test operator "gt" overload (euint4, euint64) => ebool test 3 (10, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add64(10n);
+ it('test operator "mul" overload (euint4, uint8) => euint4 test 2 (3, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(3n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.gt_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.mul_euint4_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(15n);
});
- it('test operator "gt" overload (euint4, euint64) => ebool test 4 (10, 6)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
- input.add64(6n);
+ it('test operator "mul" overload (euint4, uint8) => euint4 test 3 (3, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(3n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.gt_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.mul_euint4_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(9n);
});
- it('test operator "le" overload (euint4, euint64) => ebool test 1 (9, 18445100928210525947)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(9n);
- input.add64(18445100928210525947n);
+ it('test operator "mul" overload (euint4, uint8) => euint4 test 4 (5, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(5n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.le_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.mul_euint4_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(15n);
});
- it('test operator "le" overload (euint4, euint64) => ebool test 2 (5, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "mul" overload (uint8, euint4) => euint4 test 1 (2, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.mul_uint8_euint4(2n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "mul" overload (uint8, euint4) => euint4 test 2 (3, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
input.add4(5n);
- input.add64(9n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.le_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.mul_uint8_euint4(3n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(15n);
});
- it('test operator "le" overload (euint4, euint64) => ebool test 3 (9, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(9n);
- input.add64(9n);
+ it('test operator "mul" overload (uint8, euint4) => euint4 test 3 (3, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(3n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.le_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.mul_uint8_euint4(3n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(9n);
});
- it('test operator "le" overload (euint4, euint64) => ebool test 4 (9, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(9n);
- input.add64(5n);
+ it('test operator "mul" overload (uint8, euint4) => euint4 test 4 (5, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(3n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.le_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.mul_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(15n);
});
- it('test operator "lt" overload (euint4, euint64) => ebool test 1 (7, 18445391148064274615)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(7n);
- input.add64(18445391148064274615n);
+ it('test operator "div" overload (euint4, uint8) => euint4 test 1 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(14n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.lt_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.div_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(1n);
});
- it('test operator "lt" overload (euint4, euint64) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add64(8n);
+ it('test operator "div" overload (euint4, uint8) => euint4 test 2 (10, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(10n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.lt_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.div_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(0n);
});
- it('test operator "lt" overload (euint4, euint64) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add64(8n);
+ it('test operator "div" overload (euint4, uint8) => euint4 test 3 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(14n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.lt_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.div_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(1n);
});
- it('test operator "lt" overload (euint4, euint64) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add64(4n);
+ it('test operator "div" overload (euint4, uint8) => euint4 test 4 (14, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(14n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.lt_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.div_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(1n);
});
- it('test operator "min" overload (euint4, euint64) => euint64 test 1 (12, 18438956406288597713)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(12n);
- input.add64(18438956406288597713n);
+ it('test operator "rem" overload (euint4, uint8) => euint4 test 1 (13, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(13n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.min_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.rem_euint4_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(12n);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(1n);
});
- it('test operator "min" overload (euint4, euint64) => euint64 test 2 (8, 12)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
- input.add64(12n);
+ it('test operator "rem" overload (euint4, uint8) => euint4 test 2 (9, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(9n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.min_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.rem_euint4_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(8n);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(9n);
});
- it('test operator "min" overload (euint4, euint64) => euint64 test 3 (12, 12)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(12n);
- input.add64(12n);
+ it('test operator "rem" overload (euint4, uint8) => euint4 test 3 (13, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(13n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.min_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.rem_euint4_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(12n);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(0n);
});
- it('test operator "min" overload (euint4, euint64) => euint64 test 4 (12, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(12n);
- input.add64(8n);
+ it('test operator "rem" overload (euint4, uint8) => euint4 test 4 (13, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(13n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.min_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.rem_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(8n);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(4n);
});
- it('test operator "max" overload (euint4, euint64) => euint64 test 1 (5, 18446478225770660877)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(5n);
- input.add64(18446478225770660877n);
+ it('test operator "and" overload (euint4, uint8) => euint4 test 1 (10, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(10n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.max_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.and_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(18446478225770660877n);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(0n);
});
- it('test operator "max" overload (euint4, euint64) => euint64 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
- input.add64(8n);
+ it('test operator "and" overload (euint4, uint8) => euint4 test 2 (6, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(6n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.max_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.and_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(8n);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(2n);
});
- it('test operator "max" overload (euint4, euint64) => euint64 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "and" overload (euint4, uint8) => euint4 test 3 (10, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(10n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.and_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "and" overload (euint4, uint8) => euint4 test 4 (10, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(10n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.and_euint4_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(2n);
+ });
+
+ it('test operator "and" overload (uint8, euint4) => euint4 test 1 (12, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.and_uint8_euint4(12n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "and" overload (uint8, euint4) => euint4 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
input.add4(8n);
- input.add64(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.max_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.and_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
- expect(res).to.equal(8n);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(0n);
});
- it('test operator "max" overload (euint4, euint64) => euint64 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "and" overload (uint8, euint4) => euint4 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
input.add4(8n);
- input.add64(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.max_euint4_euint64(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract2.and_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt64(await this.contract1.res64());
+ const res = await decrypt4(await this.contract2.res4());
expect(res).to.equal(8n);
});
- it('test operator "add" overload (euint4, uint8) => euint4 test 1 (1, 1)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(1n);
+ it('test operator "and" overload (uint8, euint4) => euint4 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.add_euint4_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof);
+ const tx = await this.contract2.and_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(2n);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(0n);
});
- it('test operator "add" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "or" overload (euint4, uint8) => euint4 test 1 (8, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.or_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(9n);
+ });
+
+ it('test operator "or" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.add_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract2.or_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
+ const res = await decrypt4(await this.contract2.res4());
expect(res).to.equal(12n);
});
- it('test operator "add" overload (euint4, uint8) => euint4 test 3 (5, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(5n);
+ it('test operator "or" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.add_euint4_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof);
+ const tx = await this.contract2.or_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(10n);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(8n);
});
- it('test operator "add" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "or" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.add_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract2.or_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
+ const res = await decrypt4(await this.contract2.res4());
expect(res).to.equal(12n);
});
- it('test operator "add" overload (uint8, euint4) => euint4 test 1 (1, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "or" overload (uint8, euint4) => euint4 test 1 (13, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add4(2n);
+ input.add4(3n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.add_uint8_euint4(1n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.or_uint8_euint4(13n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(3n);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(15n);
});
- it('test operator "add" overload (uint8, euint4) => euint4 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "or" overload (uint8, euint4) => euint4 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.add_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.or_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
+ const res = await decrypt4(await this.contract2.res4());
expect(res).to.equal(12n);
});
- it('test operator "add" overload (uint8, euint4) => euint4 test 3 (5, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "or" overload (uint8, euint4) => euint4 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add4(5n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.add_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.or_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(10n);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(8n);
});
- it('test operator "add" overload (uint8, euint4) => euint4 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "or" overload (uint8, euint4) => euint4 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.add_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.or_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
+ const res = await decrypt4(await this.contract2.res4());
expect(res).to.equal(12n);
});
- it('test operator "sub" overload (euint4, uint8) => euint4 test 1 (10, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "xor" overload (euint4, uint8) => euint4 test 1 (10, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
input.add4(10n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.sub_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof);
+ const tx = await this.contract2.xor_euint4_uint8(encryptedAmount.handles[0], 12n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(0n);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(6n);
});
- it('test operator "sub" overload (euint4, uint8) => euint4 test 2 (10, 6)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
+ it('test operator "xor" overload (euint4, uint8) => euint4 test 2 (6, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(6n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.sub_euint4_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof);
+ const tx = await this.contract2.xor_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(4n);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(12n);
});
- it('test operator "sub" overload (uint8, euint4) => euint4 test 1 (9, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "xor" overload (euint4, uint8) => euint4 test 3 (10, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(10n);
- input.add4(9n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.sub_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.xor_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
+ const res = await decrypt4(await this.contract2.res4());
expect(res).to.equal(0n);
});
- it('test operator "sub" overload (uint8, euint4) => euint4 test 2 (9, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "xor" overload (euint4, uint8) => euint4 test 4 (10, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(10n);
- input.add4(5n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.sub_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.xor_euint4_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(4n);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(12n);
});
- it('test operator "mul" overload (euint4, uint8) => euint4 test 1 (5, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(5n);
+ it('test operator "xor" overload (uint8, euint4) => euint4 test 1 (1, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.mul_euint4_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof);
+ const tx = await this.contract2.xor_uint8_euint4(1n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(10n);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(5n);
});
- it('test operator "mul" overload (euint4, uint8) => euint4 test 2 (3, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(3n);
+ it('test operator "xor" overload (uint8, euint4) => euint4 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.mul_euint4_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof);
+ const tx = await this.contract2.xor_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(9n);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(12n);
});
- it('test operator "mul" overload (euint4, uint8) => euint4 test 3 (3, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(3n);
+ it('test operator "xor" overload (uint8, euint4) => euint4 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.mul_euint4_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof);
+ const tx = await this.contract2.xor_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(9n);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(0n);
});
- it('test operator "mul" overload (euint4, uint8) => euint4 test 4 (3, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(3n);
+ it('test operator "xor" overload (uint8, euint4) => euint4 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.mul_euint4_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof);
+ const tx = await this.contract2.xor_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(9n);
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(12n);
});
- it('test operator "mul" overload (uint8, euint4) => euint4 test 1 (3, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "eq" overload (euint4, uint8) => ebool test 1 (14, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(14n);
- input.add4(3n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.mul_uint8_euint4(3n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.eq_euint4_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(9n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "mul" overload (uint8, euint4) => euint4 test 2 (3, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "eq" overload (euint4, uint8) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(4n);
- input.add4(5n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.mul_uint8_euint4(3n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.eq_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(15n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "mul" overload (uint8, euint4) => euint4 test 3 (3, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "eq" overload (euint4, uint8) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
- input.add4(3n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.mul_uint8_euint4(3n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.eq_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(9n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "mul" overload (uint8, euint4) => euint4 test 4 (5, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "eq" overload (euint4, uint8) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
- input.add4(3n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.mul_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.eq_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(15n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "div" overload (euint4, uint8) => euint4 test 1 (14, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(14n);
+ it('test operator "eq" overload (uint8, euint4) => ebool test 1 (1, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(9n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.div_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof);
+ const tx = await this.contract2.eq_uint8_euint4(1n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(1n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "div" overload (euint4, uint8) => euint4 test 2 (10, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
+ it('test operator "eq" overload (uint8, euint4) => ebool test 2 (5, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(9n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.div_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof);
+ const tx = await this.contract2.eq_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(0n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "div" overload (euint4, uint8) => euint4 test 3 (14, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(14n);
+ it('test operator "eq" overload (uint8, euint4) => ebool test 3 (9, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.eq_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (uint8, euint4) => ebool test 4 (9, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(5n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.div_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof);
+ const tx = await this.contract2.eq_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(1n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "div" overload (euint4, uint8) => euint4 test 4 (14, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(14n);
+ it('test operator "ne" overload (euint4, uint8) => ebool test 1 (8, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.div_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof);
+ const tx = await this.contract2.ne_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(1n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "rem" overload (euint4, uint8) => euint4 test 1 (9, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(9n);
+ it('test operator "ne" overload (euint4, uint8) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.rem_euint4_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof);
+ const tx = await this.contract2.ne_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(4n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "rem" overload (euint4, uint8) => euint4 test 2 (5, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(5n);
+ it('test operator "ne" overload (euint4, uint8) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.rem_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof);
+ const tx = await this.contract2.ne_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(5n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "rem" overload (euint4, uint8) => euint4 test 3 (9, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(9n);
+ it('test operator "ne" overload (euint4, uint8) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.rem_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof);
+ const tx = await this.contract2.ne_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(0n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "rem" overload (euint4, uint8) => euint4 test 4 (9, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(9n);
+ it('test operator "ne" overload (uint8, euint4) => ebool test 1 (9, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(13n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.rem_euint4_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof);
+ const tx = await this.contract2.ne_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(4n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint4, uint8) => ebool test 1 (4, 1)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
+ it('test operator "ne" overload (uint8, euint4) => ebool test 2 (9, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(13n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.eq_euint4_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof);
+ const tx = await this.contract2.ne_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint4, uint8) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
+ it('test operator "ne" overload (uint8, euint4) => ebool test 3 (13, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(13n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.eq_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract2.ne_uint8_euint4(13n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint4, uint8) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
+ it('test operator "ne" overload (uint8, euint4) => ebool test 4 (13, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(9n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.eq_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract2.ne_uint8_euint4(13n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint4, uint8) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
+ it('test operator "ge" overload (euint4, uint8) => ebool test 1 (3, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(3n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.eq_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract2.ge_euint4_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (uint8, euint4) => ebool test 1 (2, 7)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "ge" overload (euint4, uint8) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(4n);
- input.add4(7n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.eq_uint8_euint4(2n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.ge_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (uint8, euint4) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "ge" overload (euint4, uint8) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.ge_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+ it('test operator "ge" overload (euint4, uint8) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
input.add4(8n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.eq_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.ge_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "eq" overload (uint8, euint4) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "ge" overload (uint8, euint4) => ebool test 1 (14, 1)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add4(8n);
+ input.add4(1n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.eq_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.ge_uint8_euint4(14n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(true);
});
- it('test operator "eq" overload (uint8, euint4) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "ge" overload (uint8, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add4(4n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.eq_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.ge_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint4, uint8) => ebool test 1 (4, 6)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
+ it('test operator "ge" overload (uint8, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ne_euint4_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof);
+ const tx = await this.contract2.ge_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint4, uint8) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
+ it('test operator "ge" overload (uint8, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ne_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract2.ge_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint4, uint8) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
+ it('test operator "gt" overload (euint4, uint8) => ebool test 1 (1, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(1n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ne_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract2.gt_euint4_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint4, uint8) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
+ it('test operator "gt" overload (euint4, uint8) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ne_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract2.gt_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ne" overload (uint8, euint4) => ebool test 1 (3, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "gt" overload (euint4, uint8) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
- input.add4(14n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ne_uint8_euint4(3n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.gt_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ne" overload (uint8, euint4) => ebool test 2 (10, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "gt" overload (euint4, uint8) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
- input.add4(14n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ne_uint8_euint4(10n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.gt_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (uint8, euint4) => ebool test 3 (14, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "gt" overload (uint8, euint4) => ebool test 1 (1, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add4(14n);
+ input.add4(5n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ne_uint8_euint4(14n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.gt_uint8_euint4(1n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (uint8, euint4) => ebool test 4 (14, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "gt" overload (uint8, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add4(10n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ne_uint8_euint4(14n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.gt_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint4, uint8) => ebool test 1 (13, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
+ it('test operator "gt" overload (uint8, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ge_euint4_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof);
+ const tx = await this.contract2.gt_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint4, uint8) => ebool test 2 (9, 13)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(9n);
+ it('test operator "gt" overload (uint8, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ge_euint4_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof);
+ const tx = await this.contract2.gt_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint4, uint8) => ebool test 3 (13, 13)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
+ it('test operator "le" overload (euint4, uint8) => ebool test 1 (1, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(1n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ge_euint4_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof);
+ const tx = await this.contract2.le_euint4_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint4, uint8) => ebool test 4 (13, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
+ it('test operator "le" overload (euint4, uint8) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ge_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof);
+ const tx = await this.contract2.le_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (uint8, euint4) => ebool test 1 (1, 12)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "le" overload (euint4, uint8) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
- input.add4(12n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ge_uint8_euint4(1n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.le_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "ge" overload (uint8, euint4) => ebool test 2 (8, 12)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "le" overload (euint4, uint8) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
- input.add4(12n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ge_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.le_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(false);
});
- it('test operator "ge" overload (uint8, euint4) => ebool test 3 (12, 12)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "le" overload (uint8, euint4) => ebool test 1 (11, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add4(12n);
+ input.add4(10n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ge_uint8_euint4(12n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.le_uint8_euint4(11n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ge" overload (uint8, euint4) => ebool test 4 (12, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "le" overload (uint8, euint4) => ebool test 2 (6, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add4(8n);
+ input.add4(10n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.ge_uint8_euint4(12n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.le_uint8_euint4(6n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint4, uint8) => ebool test 1 (14, 13)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(14n);
+ it('test operator "le" overload (uint8, euint4) => ebool test 3 (10, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(10n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.gt_euint4_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof);
+ const tx = await this.contract2.le_uint8_euint4(10n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint4, uint8) => ebool test 2 (10, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(10n);
+ it('test operator "le" overload (uint8, euint4) => ebool test 4 (10, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(6n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.gt_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof);
+ const tx = await this.contract2.le_uint8_euint4(10n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint4, uint8) => ebool test 3 (14, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(14n);
+ it('test operator "lt" overload (euint4, uint8) => ebool test 1 (12, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(12n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.gt_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof);
+ const tx = await this.contract2.lt_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint4, uint8) => ebool test 4 (14, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(14n);
+ it('test operator "lt" overload (euint4, uint8) => ebool test 2 (8, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.gt_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof);
+ const tx = await this.contract2.lt_euint4_uint8(encryptedAmount.handles[0], 12n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (uint8, euint4) => ebool test 1 (1, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "lt" overload (euint4, uint8) => ebool test 3 (12, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(12n);
- input.add4(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.gt_uint8_euint4(1n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.lt_euint4_uint8(encryptedAmount.handles[0], 12n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (uint8, euint4) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "lt" overload (euint4, uint8) => ebool test 4 (12, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(12n);
- input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.gt_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.lt_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (uint8, euint4) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "lt" overload (uint8, euint4) => ebool test 1 (5, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(11n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.lt_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (uint8, euint4) => ebool test 2 (7, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(11n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.lt_uint8_euint4(7n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (uint8, euint4) => ebool test 3 (11, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(11n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.lt_uint8_euint4(11n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (uint8, euint4) => ebool test 4 (11, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(7n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.lt_uint8_euint4(11n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint4, uint8) => euint4 test 1 (5, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(5n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.min_euint4_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(5n);
+ });
+
+ it('test operator "min" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(4n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.min_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "min" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.min_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "min" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(8n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.min_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "min" overload (uint8, euint4) => euint4 test 1 (5, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(11n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.min_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(5n);
+ });
+
+ it('test operator "min" overload (uint8, euint4) => euint4 test 2 (7, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(11n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.min_uint8_euint4(7n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(7n);
+ });
+
+ it('test operator "min" overload (uint8, euint4) => euint4 test 3 (11, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(11n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.min_uint8_euint4(11n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(11n);
+ });
+
+ it('test operator "min" overload (uint8, euint4) => euint4 test 4 (11, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(7n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.min_uint8_euint4(11n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(7n);
+ });
+
+ it('test operator "max" overload (euint4, uint8) => euint4 test 1 (14, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(14n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.max_euint4_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(14n);
+ });
+
+ it('test operator "max" overload (euint4, uint8) => euint4 test 2 (10, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(10n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.max_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(14n);
+ });
+
+ it('test operator "max" overload (euint4, uint8) => euint4 test 3 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(14n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.max_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(14n);
+ });
+
+ it('test operator "max" overload (euint4, uint8) => euint4 test 4 (14, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add4(14n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.max_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(14n);
+ });
+
+ it('test operator "max" overload (uint8, euint4) => euint4 test 1 (14, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.max_uint8_euint4(14n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(14n);
+ });
+
+ it('test operator "max" overload (uint8, euint4) => euint4 test 2 (9, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.max_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(13n);
+ });
+
+ it('test operator "max" overload (uint8, euint4) => euint4 test 3 (13, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.max_uint8_euint4(13n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(13n);
+ });
+
+ it('test operator "max" overload (uint8, euint4) => euint4 test 4 (13, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+
+ input.add4(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.max_uint8_euint4(13n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt4(await this.contract2.res4());
+ expect(res).to.equal(13n);
+ });
+
+ it('test operator "add" overload (euint8, euint4) => euint8 test 1 (10, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(10n);
+ input.add4(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.add_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "add" overload (euint8, euint4) => euint8 test 2 (5, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(5n);
+ input.add4(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.add_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(14n);
+ });
+
+ it('test operator "add" overload (euint8, euint4) => euint8 test 3 (5, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(5n);
+ input.add4(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.add_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "add" overload (euint8, euint4) => euint8 test 4 (9, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(9n);
+ input.add4(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.add_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(14n);
+ });
+
+ it('test operator "sub" overload (euint8, euint4) => euint8 test 1 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(14n);
+ input.add4(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.sub_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint8, euint4) => euint8 test 2 (14, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(14n);
+ input.add4(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.sub_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint8, euint4) => euint8 test 1 (7, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(7n);
+ input.add4(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.mul_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(14n);
+ });
+
+ it('test operator "mul" overload (euint8, euint4) => euint8 test 2 (3, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(3n);
+ input.add4(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.mul_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(15n);
+ });
+
+ it('test operator "mul" overload (euint8, euint4) => euint8 test 3 (3, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(3n);
+ input.add4(3n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.mul_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(9n);
+ });
+
+ it('test operator "mul" overload (euint8, euint4) => euint8 test 4 (5, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(5n);
+ input.add4(3n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.mul_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(15n);
+ });
+
+ it('test operator "and" overload (euint8, euint4) => euint8 test 1 (118, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(118n);
+ input.add4(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.and_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "and" overload (euint8, euint4) => euint8 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.and_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "and" overload (euint8, euint4) => euint8 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.and_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "and" overload (euint8, euint4) => euint8 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.and_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "or" overload (euint8, euint4) => euint8 test 1 (189, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(189n);
+ input.add4(3n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.or_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(191n);
+ });
+
+ it('test operator "or" overload (euint8, euint4) => euint8 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.or_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "or" overload (euint8, euint4) => euint8 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.or_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "or" overload (euint8, euint4) => euint8 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.or_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "xor" overload (euint8, euint4) => euint8 test 1 (104, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(104n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.xor_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(108n);
+ });
+
+ it('test operator "xor" overload (euint8, euint4) => euint8 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.xor_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "xor" overload (euint8, euint4) => euint8 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.xor_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint8, euint4) => euint8 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.xor_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "eq" overload (euint8, euint4) => ebool test 1 (65, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(65n);
+ input.add4(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.eq_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint8, euint4) => ebool test 2 (5, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(5n);
+ input.add4(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.eq_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint8, euint4) => ebool test 3 (9, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(9n);
+ input.add4(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.eq_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint8, euint4) => ebool test 4 (9, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(9n);
+ input.add4(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.eq_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint8, euint4) => ebool test 1 (27, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(27n);
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.ne_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint8, euint4) => ebool test 2 (9, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(9n);
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.ne_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint8, euint4) => ebool test 3 (13, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(13n);
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.ne_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint8, euint4) => ebool test 4 (13, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(13n);
+ input.add4(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.ne_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint8, euint4) => ebool test 1 (53, 1)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(53n);
+ input.add4(1n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.ge_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint8, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.ge_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint8, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.ge_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint8, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.ge_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint8, euint4) => ebool test 1 (94, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(94n);
+ input.add4(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.gt_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint8, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.gt_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint8, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.gt_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint8, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.gt_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint8, euint4) => ebool test 1 (26, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(26n);
+ input.add4(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.le_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "le" overload (euint8, euint4) => ebool test 2 (6, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(6n);
+ input.add4(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.le_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint8, euint4) => ebool test 3 (10, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(10n);
+ input.add4(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.le_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint8, euint4) => ebool test 4 (10, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(10n);
+ input.add4(6n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.le_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint8, euint4) => ebool test 1 (163, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(163n);
+ input.add4(11n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.lt_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint8, euint4) => ebool test 2 (7, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(7n);
+ input.add4(11n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.lt_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint8, euint4) => ebool test 3 (11, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(11n);
+ input.add4(11n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.lt_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint8, euint4) => ebool test 4 (11, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(11n);
+ input.add4(7n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.lt_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint8, euint4) => euint8 test 1 (51, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(51n);
+ input.add4(11n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.min_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(11n);
+ });
+
+ it('test operator "min" overload (euint8, euint4) => euint8 test 2 (7, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(7n);
+ input.add4(11n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.min_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(7n);
+ });
+
+ it('test operator "min" overload (euint8, euint4) => euint8 test 3 (11, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(11n);
+ input.add4(11n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.min_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(11n);
+ });
+
+ it('test operator "min" overload (euint8, euint4) => euint8 test 4 (11, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(11n);
+ input.add4(7n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.min_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(7n);
+ });
+
+ it('test operator "max" overload (euint8, euint4) => euint8 test 1 (62, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(62n);
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.max_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(62n);
+ });
+
+ it('test operator "max" overload (euint8, euint4) => euint8 test 2 (9, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(9n);
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.max_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(13n);
+ });
+
+ it('test operator "max" overload (euint8, euint4) => euint8 test 3 (13, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(13n);
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.max_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(13n);
+ });
+
+ it('test operator "max" overload (euint8, euint4) => euint8 test 4 (13, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(13n);
+ input.add4(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.max_euint8_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(13n);
+ });
+
+ it('test operator "add" overload (euint8, euint8) => euint8 test 1 (219, 18)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(219n);
+ input.add8(18n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.add_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(237n);
+ });
+
+ it('test operator "add" overload (euint8, euint8) => euint8 test 2 (14, 18)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(14n);
+ input.add8(18n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.add_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(32n);
+ });
+
+ it('test operator "add" overload (euint8, euint8) => euint8 test 3 (18, 18)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(18n);
+ input.add8(18n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.add_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(36n);
+ });
+
+ it('test operator "add" overload (euint8, euint8) => euint8 test 4 (18, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(18n);
+ input.add8(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.add_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(32n);
+ });
+
+ it('test operator "sub" overload (euint8, euint8) => euint8 test 1 (152, 152)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(152n);
+ input.add8(152n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.sub_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint8, euint8) => euint8 test 2 (152, 148)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(152n);
+ input.add8(148n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.sub_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint8, euint8) => euint8 test 1 (8, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add8(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.mul_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(96n);
+ });
+
+ it('test operator "mul" overload (euint8, euint8) => euint8 test 2 (12, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(12n);
+ input.add8(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.mul_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(168n);
+ });
+
+ it('test operator "mul" overload (euint8, euint8) => euint8 test 3 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(14n);
+ input.add8(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.mul_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(196n);
+ });
+
+ it('test operator "mul" overload (euint8, euint8) => euint8 test 4 (14, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(14n);
+ input.add8(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.mul_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(168n);
+ });
+
+ it('test operator "and" overload (euint8, euint8) => euint8 test 1 (183, 135)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(183n);
+ input.add8(135n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.and_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(135n);
+ });
+
+ it('test operator "and" overload (euint8, euint8) => euint8 test 2 (131, 135)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(131n);
+ input.add8(135n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.and_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(131n);
+ });
+
+ it('test operator "and" overload (euint8, euint8) => euint8 test 3 (135, 135)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(135n);
+ input.add8(135n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.and_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(135n);
+ });
+
+ it('test operator "and" overload (euint8, euint8) => euint8 test 4 (135, 131)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(135n);
+ input.add8(131n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.and_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(131n);
+ });
+
+ it('test operator "or" overload (euint8, euint8) => euint8 test 1 (189, 251)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(189n);
+ input.add8(251n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.or_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(255n);
+ });
+
+ it('test operator "or" overload (euint8, euint8) => euint8 test 2 (185, 189)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(185n);
+ input.add8(189n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.or_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(189n);
+ });
+
+ it('test operator "or" overload (euint8, euint8) => euint8 test 3 (189, 189)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(189n);
+ input.add8(189n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.or_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(189n);
+ });
+
+ it('test operator "or" overload (euint8, euint8) => euint8 test 4 (189, 185)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(189n);
+ input.add8(185n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.or_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(189n);
+ });
+
+ it('test operator "xor" overload (euint8, euint8) => euint8 test 1 (234, 150)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(234n);
+ input.add8(150n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.xor_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(124n);
+ });
+
+ it('test operator "xor" overload (euint8, euint8) => euint8 test 2 (146, 150)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(146n);
+ input.add8(150n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.xor_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "xor" overload (euint8, euint8) => euint8 test 3 (150, 150)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(150n);
+ input.add8(150n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.xor_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint8, euint8) => euint8 test 4 (150, 146)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(150n);
+ input.add8(146n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.xor_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "eq" overload (euint8, euint8) => ebool test 1 (175, 224)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(175n);
+ input.add8(224n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.eq_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint8, euint8) => ebool test 2 (171, 175)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(171n);
+ input.add8(175n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.eq_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint8, euint8) => ebool test 3 (175, 175)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(175n);
+ input.add8(175n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.eq_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint8, euint8) => ebool test 4 (175, 171)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(175n);
+ input.add8(171n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.eq_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint8, euint8) => ebool test 1 (197, 245)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(197n);
+ input.add8(245n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.ne_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint8, euint8) => ebool test 2 (193, 197)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(193n);
+ input.add8(197n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.ne_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint8, euint8) => ebool test 3 (197, 197)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(197n);
+ input.add8(197n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.ne_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint8, euint8) => ebool test 4 (197, 193)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(197n);
+ input.add8(193n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.ne_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint8, euint8) => ebool test 1 (63, 190)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(63n);
+ input.add8(190n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.ge_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint8, euint8) => ebool test 2 (59, 63)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(59n);
+ input.add8(63n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.ge_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint8, euint8) => ebool test 3 (63, 63)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(63n);
+ input.add8(63n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.ge_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint8, euint8) => ebool test 4 (63, 59)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(63n);
+ input.add8(59n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.ge_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint8, euint8) => ebool test 1 (239, 212)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(239n);
+ input.add8(212n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.gt_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint8, euint8) => ebool test 2 (208, 212)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(208n);
+ input.add8(212n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.gt_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint8, euint8) => ebool test 3 (212, 212)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(212n);
+ input.add8(212n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.gt_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
- input.add4(8n);
+ it('test operator "gt" overload (euint8, euint8) => ebool test 4 (212, 208)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(212n);
+ input.add8(208n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.gt_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.gt_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint8, euint8) => ebool test 1 (124, 71)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(124n);
+ input.add8(71n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.le_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (uint8, euint4) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
+ it('test operator "le" overload (euint8, euint8) => ebool test 2 (67, 71)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(67n);
+ input.add8(71n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.le_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
- input.add4(4n);
+ it('test operator "le" overload (euint8, euint8) => ebool test 3 (71, 71)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(71n);
+ input.add8(71n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.gt_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.le_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint8, euint8) => ebool test 4 (71, 67)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(71n);
+ input.add8(67n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.le_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint8, euint8) => ebool test 1 (221, 45)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(221n);
+ input.add8(45n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.lt_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint8, euint8) => ebool test 2 (41, 45)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(41n);
+ input.add8(45n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.lt_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(true);
});
+
+ it('test operator "lt" overload (euint8, euint8) => ebool test 3 (45, 45)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(45n);
+ input.add8(45n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.lt_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint8, euint8) => ebool test 4 (45, 41)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(45n);
+ input.add8(41n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.lt_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint8, euint8) => euint8 test 1 (183, 84)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(183n);
+ input.add8(84n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.min_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(84n);
+ });
+
+ it('test operator "min" overload (euint8, euint8) => euint8 test 2 (80, 84)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(80n);
+ input.add8(84n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.min_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(80n);
+ });
+
+ it('test operator "min" overload (euint8, euint8) => euint8 test 3 (84, 84)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(84n);
+ input.add8(84n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.min_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(84n);
+ });
+
+ it('test operator "min" overload (euint8, euint8) => euint8 test 4 (84, 80)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(84n);
+ input.add8(80n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.min_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(80n);
+ });
+
+ it('test operator "max" overload (euint8, euint8) => euint8 test 1 (17, 182)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(17n);
+ input.add8(182n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.max_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(182n);
+ });
+
+ it('test operator "max" overload (euint8, euint8) => euint8 test 2 (13, 17)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(13n);
+ input.add8(17n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.max_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(17n);
+ });
+
+ it('test operator "max" overload (euint8, euint8) => euint8 test 3 (17, 17)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(17n);
+ input.add8(17n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.max_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(17n);
+ });
+
+ it('test operator "max" overload (euint8, euint8) => euint8 test 4 (17, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(17n);
+ input.add8(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.max_euint8_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt8(await this.contract2.res8());
+ expect(res).to.equal(17n);
+ });
+
+ it('test operator "add" overload (euint8, euint16) => euint16 test 1 (2, 132)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(2n);
+ input.add16(132n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.add_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(134n);
+ });
+
+ it('test operator "add" overload (euint8, euint16) => euint16 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(4n);
+ input.add16(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.add_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "add" overload (euint8, euint16) => euint16 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add16(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.add_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(16n);
+ });
+
+ it('test operator "add" overload (euint8, euint16) => euint16 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add16(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.add_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "sub" overload (euint8, euint16) => euint16 test 1 (32, 32)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(32n);
+ input.add16(32n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.sub_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint8, euint16) => euint16 test 2 (32, 28)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(32n);
+ input.add16(28n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.sub_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint8, euint16) => euint16 test 1 (2, 60)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(2n);
+ input.add16(60n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.mul_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(120n);
+ });
+
+ it('test operator "mul" overload (euint8, euint16) => euint16 test 2 (13, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(13n);
+ input.add16(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.mul_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(169n);
+ });
+
+ it('test operator "mul" overload (euint8, euint16) => euint16 test 3 (13, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(13n);
+ input.add16(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.mul_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(169n);
+ });
+
+ it('test operator "mul" overload (euint8, euint16) => euint16 test 4 (13, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(13n);
+ input.add16(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.mul_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(169n);
+ });
+
+ it('test operator "and" overload (euint8, euint16) => euint16 test 1 (225, 29113)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(225n);
+ input.add16(29113n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.and_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(161n);
+ });
+
+ it('test operator "and" overload (euint8, euint16) => euint16 test 2 (221, 225)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(221n);
+ input.add16(225n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.and_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(193n);
+ });
+
+ it('test operator "and" overload (euint8, euint16) => euint16 test 3 (225, 225)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(225n);
+ input.add16(225n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.and_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(225n);
+ });
+
+ it('test operator "and" overload (euint8, euint16) => euint16 test 4 (225, 221)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(225n);
+ input.add16(221n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract2.and_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(193n);
+ });
});
diff --git a/test/tfheOperations/tfheOperations3.ts b/test/tfheOperations/tfheOperations3.ts
index 8fd24457..33df958e 100644
--- a/test/tfheOperations/tfheOperations3.ts
+++ b/test/tfheOperations/tfheOperations3.ts
@@ -7,7 +7,22 @@ import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'
import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance';
+import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
+import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
+import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
+import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
+import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
+import {
+ createInstances,
+ decrypt4,
+ decrypt8,
+ decrypt16,
+ decrypt32,
+ decrypt64,
+ decrypt128,
+ decrypt256,
+ decryptBool,
+} from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
@@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise {
return contract;
}
+async function deployTfheTestFixture7(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite7');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture8(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite8');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture9(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite9');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture10(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite10');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture11(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite11');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
describe('TFHE operations 3', function () {
before(async function () {
await initSigners(1);
@@ -105,878 +175,996 @@ describe('TFHE operations 3', function () {
this.contract6Address = await contract6.getAddress();
this.contract6 = contract6;
+ const contract7 = await deployTfheTestFixture7();
+ this.contract7Address = await contract7.getAddress();
+ this.contract7 = contract7;
+
+ const contract8 = await deployTfheTestFixture8();
+ this.contract8Address = await contract8.getAddress();
+ this.contract8 = contract8;
+
+ const contract9 = await deployTfheTestFixture9();
+ this.contract9Address = await contract9.getAddress();
+ this.contract9 = contract9;
+
+ const contract10 = await deployTfheTestFixture10();
+ this.contract10Address = await contract10.getAddress();
+ this.contract10 = contract10;
+
+ const contract11 = await deployTfheTestFixture11();
+ this.contract11Address = await contract11.getAddress();
+ this.contract11 = contract11;
+
const instances = await createInstances(this.signers);
this.instances = instances;
});
- it('test operator "le" overload (euint4, uint8) => ebool test 1 (13, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
-
+ it('test operator "or" overload (euint8, euint16) => euint16 test 1 (20, 28056)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(20n);
+ input.add16(28056n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.le_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof);
+ const tx = await this.contract2.or_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(28060n);
});
- it('test operator "le" overload (euint4, uint8) => ebool test 2 (9, 13)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(9n);
-
+ it('test operator "or" overload (euint8, euint16) => euint16 test 2 (16, 20)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(16n);
+ input.add16(20n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.le_euint4_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof);
+ const tx = await this.contract2.or_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(20n);
});
- it('test operator "le" overload (euint4, uint8) => ebool test 3 (13, 13)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
-
+ it('test operator "or" overload (euint8, euint16) => euint16 test 3 (20, 20)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(20n);
+ input.add16(20n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.le_euint4_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof);
+ const tx = await this.contract2.or_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(20n);
});
- it('test operator "le" overload (euint4, uint8) => ebool test 4 (13, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
-
+ it('test operator "or" overload (euint8, euint16) => euint16 test 4 (20, 16)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(20n);
+ input.add16(16n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.le_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof);
+ const tx = await this.contract2.or_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(20n);
});
- it('test operator "le" overload (uint8, euint4) => ebool test 1 (8, 13)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
-
- input.add4(13n);
+ it('test operator "xor" overload (euint8, euint16) => euint16 test 1 (233, 6463)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(233n);
+ input.add16(6463n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.le_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.xor_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(6614n);
});
- it('test operator "le" overload (uint8, euint4) => ebool test 2 (9, 13)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
-
- input.add4(13n);
+ it('test operator "xor" overload (euint8, euint16) => euint16 test 2 (229, 233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(229n);
+ input.add16(233n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.le_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.xor_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(12n);
});
- it('test operator "le" overload (uint8, euint4) => ebool test 3 (13, 13)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
-
- input.add4(13n);
+ it('test operator "xor" overload (euint8, euint16) => euint16 test 3 (233, 233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(233n);
+ input.add16(233n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.le_uint8_euint4(13n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.xor_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(0n);
});
- it('test operator "le" overload (uint8, euint4) => ebool test 4 (13, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
-
- input.add4(9n);
+ it('test operator "xor" overload (euint8, euint16) => euint16 test 4 (233, 229)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(233n);
+ input.add16(229n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.le_uint8_euint4(13n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.xor_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(12n);
});
- it('test operator "lt" overload (euint4, uint8) => ebool test 1 (13, 1)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
-
+ it('test operator "eq" overload (euint8, euint16) => ebool test 1 (205, 56577)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(205n);
+ input.add16(56577n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.lt_euint4_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof);
+ const tx = await this.contract2.eq_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint4, uint8) => ebool test 2 (9, 13)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(9n);
-
+ it('test operator "eq" overload (euint8, euint16) => ebool test 2 (201, 205)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(201n);
+ input.add16(205n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.lt_euint4_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof);
+ const tx = await this.contract2.eq_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint4, uint8) => ebool test 3 (13, 13)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
-
+ it('test operator "eq" overload (euint8, euint16) => ebool test 3 (205, 205)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(205n);
+ input.add16(205n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.lt_euint4_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof);
+ const tx = await this.contract2.eq_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint4, uint8) => ebool test 4 (13, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(13n);
-
+ it('test operator "eq" overload (euint8, euint16) => ebool test 4 (205, 201)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(205n);
+ input.add16(201n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.lt_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof);
+ const tx = await this.contract2.eq_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (uint8, euint4) => ebool test 1 (11, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
-
- input.add4(14n);
+ it('test operator "ne" overload (euint8, euint16) => ebool test 1 (128, 47128)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(128n);
+ input.add16(47128n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.lt_uint8_euint4(11n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.ne_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (uint8, euint4) => ebool test 2 (10, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
-
- input.add4(14n);
+ it('test operator "ne" overload (euint8, euint16) => ebool test 2 (124, 128)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(124n);
+ input.add16(128n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.lt_uint8_euint4(10n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.ne_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (uint8, euint4) => ebool test 3 (14, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
-
- input.add4(14n);
+ it('test operator "ne" overload (euint8, euint16) => ebool test 3 (128, 128)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(128n);
+ input.add16(128n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.lt_uint8_euint4(14n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.ne_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
+ const res = await decryptBool(await this.contract2.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (uint8, euint4) => ebool test 4 (14, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
-
- input.add4(10n);
+ it('test operator "ne" overload (euint8, euint16) => ebool test 4 (128, 124)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(128n);
+ input.add16(124n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.lt_uint8_euint4(14n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.ne_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract1.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (euint4, uint8) => euint4 test 1 (8, 7)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
-
+ it('test operator "ge" overload (euint8, euint16) => ebool test 1 (93, 62769)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(93n);
+ input.add16(62769n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.min_euint4_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof);
+ const tx = await this.contract2.ge_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(7n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "min" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
-
+ it('test operator "ge" overload (euint8, euint16) => ebool test 2 (89, 93)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(89n);
+ input.add16(93n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.min_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract2.ge_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(4n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "min" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
-
+ it('test operator "ge" overload (euint8, euint16) => ebool test 3 (93, 93)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(93n);
+ input.add16(93n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.min_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract2.ge_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(8n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
-
+ it('test operator "ge" overload (euint8, euint16) => ebool test 4 (93, 89)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(93n);
+ input.add16(89n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.min_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract2.ge_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(4n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (uint8, euint4) => euint4 test 1 (5, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
-
- input.add4(3n);
+ it('test operator "gt" overload (euint8, euint16) => ebool test 1 (207, 17375)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(207n);
+ input.add16(17375n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.min_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.gt_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(3n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "min" overload (uint8, euint4) => euint4 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
-
- input.add4(8n);
+ it('test operator "gt" overload (euint8, euint16) => ebool test 2 (203, 207)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(203n);
+ input.add16(207n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.min_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.gt_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(4n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "min" overload (uint8, euint4) => euint4 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
-
- input.add4(8n);
+ it('test operator "gt" overload (euint8, euint16) => ebool test 3 (207, 207)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(207n);
+ input.add16(207n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.min_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.gt_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(8n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "min" overload (uint8, euint4) => euint4 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
-
- input.add4(4n);
+ it('test operator "gt" overload (euint8, euint16) => ebool test 4 (207, 203)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(207n);
+ input.add16(203n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.min_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof);
- await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(4n);
- });
-
- it('test operator "max" overload (euint4, uint8) => euint4 test 1 (1, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(1n);
-
- const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.max_euint4_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof);
- await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(2n);
- });
-
- it('test operator "max" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(4n);
-
- const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.max_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract2.gt_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(8n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "max" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
-
+ it('test operator "le" overload (euint8, euint16) => ebool test 1 (32, 25116)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(32n);
+ input.add16(25116n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.max_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof);
+ const tx = await this.contract2.le_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(8n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "max" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add4(8n);
-
+ it('test operator "le" overload (euint8, euint16) => ebool test 2 (28, 32)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(28n);
+ input.add16(32n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.max_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof);
+ const tx = await this.contract2.le_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(8n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "max" overload (uint8, euint4) => euint4 test 1 (10, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
-
- input.add4(11n);
+ it('test operator "le" overload (euint8, euint16) => ebool test 3 (32, 32)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(32n);
+ input.add16(32n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.max_uint8_euint4(10n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.le_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(11n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "max" overload (uint8, euint4) => euint4 test 2 (7, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
-
- input.add4(11n);
+ it('test operator "le" overload (euint8, euint16) => ebool test 4 (32, 28)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(32n);
+ input.add16(28n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.max_uint8_euint4(7n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.le_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(11n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "max" overload (uint8, euint4) => euint4 test 3 (11, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
-
- input.add4(11n);
+ it('test operator "lt" overload (euint8, euint16) => ebool test 1 (31, 45682)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(31n);
+ input.add16(45682n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.max_uint8_euint4(11n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.lt_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(11n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "max" overload (uint8, euint4) => euint4 test 4 (11, 7)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
-
- input.add4(7n);
+ it('test operator "lt" overload (euint8, euint16) => ebool test 2 (27, 31)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(27n);
+ input.add16(31n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.max_uint8_euint4(11n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract2.lt_euint8_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt4(await this.contract1.res4());
- expect(res).to.equal(11n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "add" overload (euint8, euint4) => euint8 test 1 (10, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(10n);
- input.add4(2n);
+ it('test operator "lt" overload (euint8, euint16) => ebool test 3 (31, 31)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(31n);
+ input.add16(31n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.add_euint8_euint4(
+ const tx = await this.contract2.lt_euint8_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(12n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "add" overload (euint8, euint4) => euint8 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(4n);
- input.add4(8n);
+ it('test operator "lt" overload (euint8, euint16) => ebool test 4 (31, 27)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(31n);
+ input.add16(27n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.add_euint8_euint4(
+ const tx = await this.contract2.lt_euint8_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(12n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "add" overload (euint8, euint4) => euint8 test 3 (5, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(5n);
- input.add4(5n);
+ it('test operator "min" overload (euint8, euint16) => euint16 test 1 (83, 49187)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(83n);
+ input.add16(49187n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.add_euint8_euint4(
+ const tx = await this.contract2.min_euint8_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(10n);
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(83n);
});
- it('test operator "add" overload (euint8, euint4) => euint8 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(8n);
- input.add4(4n);
+ it('test operator "min" overload (euint8, euint16) => euint16 test 2 (79, 83)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(79n);
+ input.add16(83n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.add_euint8_euint4(
+ const tx = await this.contract2.min_euint8_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(12n);
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(79n);
});
- it('test operator "sub" overload (euint8, euint4) => euint8 test 1 (9, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(9n);
- input.add4(9n);
+ it('test operator "min" overload (euint8, euint16) => euint16 test 3 (83, 83)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(83n);
+ input.add16(83n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.sub_euint8_euint4(
+ const tx = await this.contract2.min_euint8_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(0n);
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(83n);
});
- it('test operator "sub" overload (euint8, euint4) => euint8 test 2 (9, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(9n);
- input.add4(5n);
+ it('test operator "min" overload (euint8, euint16) => euint16 test 4 (83, 79)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(83n);
+ input.add16(79n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.sub_euint8_euint4(
+ const tx = await this.contract2.min_euint8_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(4n);
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(79n);
});
- it('test operator "mul" overload (euint8, euint4) => euint8 test 1 (5, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(5n);
- input.add4(2n);
+ it('test operator "max" overload (euint8, euint16) => euint16 test 1 (252, 21942)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(252n);
+ input.add16(21942n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.mul_euint8_euint4(
+ const tx = await this.contract2.max_euint8_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(10n);
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(21942n);
});
- it('test operator "mul" overload (euint8, euint4) => euint8 test 2 (3, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(3n);
- input.add4(5n);
+ it('test operator "max" overload (euint8, euint16) => euint16 test 2 (248, 252)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(248n);
+ input.add16(252n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.mul_euint8_euint4(
+ const tx = await this.contract2.max_euint8_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(15n);
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(252n);
});
- it('test operator "mul" overload (euint8, euint4) => euint8 test 3 (3, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(3n);
- input.add4(3n);
+ it('test operator "max" overload (euint8, euint16) => euint16 test 3 (252, 252)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(252n);
+ input.add16(252n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.mul_euint8_euint4(
+ const tx = await this.contract2.max_euint8_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(9n);
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(252n);
});
- it('test operator "mul" overload (euint8, euint4) => euint8 test 4 (5, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(5n);
- input.add4(3n);
+ it('test operator "max" overload (euint8, euint16) => euint16 test 4 (252, 248)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(252n);
+ input.add16(248n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.mul_euint8_euint4(
+ const tx = await this.contract2.max_euint8_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(15n);
+ const res = await decrypt16(await this.contract2.res16());
+ expect(res).to.equal(252n);
});
- it('test operator "and" overload (euint8, euint4) => euint8 test 1 (185, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(185n);
- input.add4(9n);
+ it('test operator "add" overload (euint8, euint32) => euint32 test 1 (2, 251)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(2n);
+ input.add32(251n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.and_euint8_euint4(
+ const tx = await this.contract2.add_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(9n);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(253n);
});
- it('test operator "and" overload (euint8, euint4) => euint8 test 2 (5, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(5n);
- input.add4(9n);
+ it('test operator "add" overload (euint8, euint32) => euint32 test 2 (59, 63)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(59n);
+ input.add32(63n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.and_euint8_euint4(
+ const tx = await this.contract2.add_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(1n);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(122n);
});
- it('test operator "and" overload (euint8, euint4) => euint8 test 3 (9, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(9n);
- input.add4(9n);
+ it('test operator "add" overload (euint8, euint32) => euint32 test 3 (63, 63)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(63n);
+ input.add32(63n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.and_euint8_euint4(
+ const tx = await this.contract2.add_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(9n);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(126n);
});
- it('test operator "and" overload (euint8, euint4) => euint8 test 4 (9, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(9n);
- input.add4(5n);
+ it('test operator "add" overload (euint8, euint32) => euint32 test 4 (63, 59)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(63n);
+ input.add32(59n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.and_euint8_euint4(
+ const tx = await this.contract2.add_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(1n);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(122n);
});
- it('test operator "or" overload (euint8, euint4) => euint8 test 1 (37, 6)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(37n);
- input.add4(6n);
+ it('test operator "sub" overload (euint8, euint32) => euint32 test 1 (102, 102)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(102n);
+ input.add32(102n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.or_euint8_euint4(
+ const tx = await this.contract2.sub_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(39n);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "or" overload (euint8, euint4) => euint8 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(4n);
- input.add4(8n);
+ it('test operator "sub" overload (euint8, euint32) => euint32 test 2 (102, 98)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(102n);
+ input.add32(98n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.or_euint8_euint4(
+ const tx = await this.contract2.sub_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(12n);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(4n);
});
- it('test operator "or" overload (euint8, euint4) => euint8 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(8n);
- input.add4(8n);
+ it('test operator "mul" overload (euint8, euint32) => euint32 test 1 (2, 79)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(2n);
+ input.add32(79n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.or_euint8_euint4(
+ const tx = await this.contract2.mul_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(8n);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(158n);
});
- it('test operator "or" overload (euint8, euint4) => euint8 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(8n);
- input.add4(4n);
+ it('test operator "mul" overload (euint8, euint32) => euint32 test 2 (10, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(10n);
+ input.add32(14n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.or_euint8_euint4(
+ const tx = await this.contract2.mul_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(12n);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(140n);
});
- it('test operator "xor" overload (euint8, euint4) => euint8 test 1 (253, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(253n);
- input.add4(3n);
+ it('test operator "mul" overload (euint8, euint32) => euint32 test 3 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(14n);
+ input.add32(14n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.xor_euint8_euint4(
+ const tx = await this.contract2.mul_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(254n);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(196n);
});
- it('test operator "xor" overload (euint8, euint4) => euint8 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(4n);
- input.add4(8n);
+ it('test operator "mul" overload (euint8, euint32) => euint32 test 4 (14, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(14n);
+ input.add32(10n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.xor_euint8_euint4(
+ const tx = await this.contract2.mul_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(12n);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(140n);
});
- it('test operator "xor" overload (euint8, euint4) => euint8 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(8n);
- input.add4(8n);
+ it('test operator "and" overload (euint8, euint32) => euint32 test 1 (114, 3684671928)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(114n);
+ input.add32(3684671928n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.xor_euint8_euint4(
+ const tx = await this.contract2.and_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(0n);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(48n);
});
- it('test operator "xor" overload (euint8, euint4) => euint8 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address);
- input.add8(8n);
- input.add4(4n);
+ it('test operator "and" overload (euint8, euint32) => euint32 test 2 (110, 114)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ input.add8(110n);
+ input.add32(114n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract1.xor_euint8_euint4(
+ const tx = await this.contract2.and_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract1.res8());
- expect(res).to.equal(12n);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(98n);
});
- it('test operator "eq" overload (euint8, euint4) => ebool test 1 (37, 7)', async function () {
+ it('test operator "and" overload (euint8, euint32) => euint32 test 3 (114, 114)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(37n);
- input.add4(7n);
+ input.add8(114n);
+ input.add32(114n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_euint4(
+ const tx = await this.contract2.and_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(114n);
});
- it('test operator "eq" overload (euint8, euint4) => ebool test 2 (4, 8)', async function () {
+ it('test operator "and" overload (euint8, euint32) => euint32 test 4 (114, 110)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(4n);
- input.add4(8n);
+ input.add8(114n);
+ input.add32(110n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_euint4(
+ const tx = await this.contract2.and_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(98n);
});
- it('test operator "eq" overload (euint8, euint4) => ebool test 3 (8, 8)', async function () {
+ it('test operator "or" overload (euint8, euint32) => euint32 test 1 (64, 694910711)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(8n);
- input.add4(8n);
+ input.add8(64n);
+ input.add32(694910711n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_euint4(
+ const tx = await this.contract2.or_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(694910711n);
});
- it('test operator "eq" overload (euint8, euint4) => ebool test 4 (8, 4)', async function () {
+ it('test operator "or" overload (euint8, euint32) => euint32 test 2 (60, 64)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(8n);
- input.add4(4n);
+ input.add8(60n);
+ input.add32(64n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_euint4(
+ const tx = await this.contract2.or_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(124n);
});
- it('test operator "ne" overload (euint8, euint4) => ebool test 1 (145, 14)', async function () {
+ it('test operator "or" overload (euint8, euint32) => euint32 test 3 (64, 64)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(145n);
- input.add4(14n);
+ input.add8(64n);
+ input.add32(64n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_euint4(
+ const tx = await this.contract2.or_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(64n);
});
- it('test operator "ne" overload (euint8, euint4) => ebool test 2 (10, 14)', async function () {
+ it('test operator "or" overload (euint8, euint32) => euint32 test 4 (64, 60)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(10n);
- input.add4(14n);
+ input.add8(64n);
+ input.add32(60n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_euint4(
+ const tx = await this.contract2.or_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(124n);
});
- it('test operator "ne" overload (euint8, euint4) => ebool test 3 (14, 14)', async function () {
+ it('test operator "xor" overload (euint8, euint32) => euint32 test 1 (200, 3474428988)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(14n);
- input.add4(14n);
+ input.add8(200n);
+ input.add32(3474428988n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_euint4(
+ const tx = await this.contract2.xor_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(3474429172n);
});
- it('test operator "ne" overload (euint8, euint4) => ebool test 4 (14, 10)', async function () {
+ it('test operator "xor" overload (euint8, euint32) => euint32 test 2 (196, 200)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(14n);
- input.add4(10n);
+ input.add8(196n);
+ input.add32(200n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_euint4(
+ const tx = await this.contract2.xor_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(12n);
});
- it('test operator "ge" overload (euint8, euint4) => ebool test 1 (85, 12)', async function () {
+ it('test operator "xor" overload (euint8, euint32) => euint32 test 3 (200, 200)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(85n);
- input.add4(12n);
+ input.add8(200n);
+ input.add32(200n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_euint4(
+ const tx = await this.contract2.xor_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "ge" overload (euint8, euint4) => ebool test 2 (8, 12)', async function () {
+ it('test operator "xor" overload (euint8, euint32) => euint32 test 4 (200, 196)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(8n);
- input.add4(12n);
+ input.add8(200n);
+ input.add32(196n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_euint4(
+ const tx = await this.contract2.xor_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract2.res32());
+ expect(res).to.equal(12n);
});
- it('test operator "ge" overload (euint8, euint4) => ebool test 3 (12, 12)', async function () {
+ it('test operator "eq" overload (euint8, euint32) => ebool test 1 (226, 3320102390)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(12n);
- input.add4(12n);
+ input.add8(226n);
+ input.add32(3320102390n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_euint4(
+ const tx = await this.contract2.eq_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint8, euint4) => ebool test 4 (12, 8)', async function () {
+ it('test operator "eq" overload (euint8, euint32) => ebool test 2 (222, 226)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(12n);
- input.add4(8n);
+ input.add8(222n);
+ input.add32(226n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_euint4(
+ const tx = await this.contract2.eq_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint8, euint4) => ebool test 1 (248, 2)', async function () {
+ it('test operator "eq" overload (euint8, euint32) => ebool test 3 (226, 226)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(248n);
- input.add4(2n);
+ input.add8(226n);
+ input.add32(226n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_euint4(
+ const tx = await this.contract2.eq_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
@@ -986,12 +1174,12 @@ describe('TFHE operations 3', function () {
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint8, euint4) => ebool test 2 (4, 8)', async function () {
+ it('test operator "eq" overload (euint8, euint32) => ebool test 4 (226, 222)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(4n);
- input.add4(8n);
+ input.add8(226n);
+ input.add32(222n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_euint4(
+ const tx = await this.contract2.eq_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
@@ -1001,27 +1189,27 @@ describe('TFHE operations 3', function () {
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint8, euint4) => ebool test 3 (8, 8)', async function () {
+ it('test operator "ne" overload (euint8, euint32) => ebool test 1 (134, 943645708)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(8n);
- input.add4(8n);
+ input.add8(134n);
+ input.add32(943645708n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_euint4(
+ const tx = await this.contract2.ne_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint8, euint4) => ebool test 4 (8, 4)', async function () {
+ it('test operator "ne" overload (euint8, euint32) => ebool test 2 (130, 134)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(8n);
- input.add4(4n);
+ input.add8(130n);
+ input.add32(134n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_euint4(
+ const tx = await this.contract2.ne_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
@@ -1031,12 +1219,12 @@ describe('TFHE operations 3', function () {
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint8, euint4) => ebool test 1 (92, 13)', async function () {
+ it('test operator "ne" overload (euint8, euint32) => ebool test 3 (134, 134)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(92n);
- input.add4(13n);
+ input.add8(134n);
+ input.add32(134n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_euint4(
+ const tx = await this.contract2.ne_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
@@ -1046,12 +1234,12 @@ describe('TFHE operations 3', function () {
expect(res).to.equal(false);
});
- it('test operator "le" overload (euint8, euint4) => ebool test 2 (9, 13)', async function () {
+ it('test operator "ne" overload (euint8, euint32) => ebool test 4 (134, 130)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(9n);
- input.add4(13n);
+ input.add8(134n);
+ input.add32(130n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_euint4(
+ const tx = await this.contract2.ne_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
@@ -1061,27 +1249,27 @@ describe('TFHE operations 3', function () {
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint8, euint4) => ebool test 3 (13, 13)', async function () {
+ it('test operator "ge" overload (euint8, euint32) => ebool test 1 (108, 54055221)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(13n);
- input.add4(13n);
+ input.add8(108n);
+ input.add32(54055221n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_euint4(
+ const tx = await this.contract2.ge_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ expect(res).to.equal(false);
});
- it('test operator "le" overload (euint8, euint4) => ebool test 4 (13, 9)', async function () {
+ it('test operator "ge" overload (euint8, euint32) => ebool test 2 (104, 108)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(13n);
- input.add4(9n);
+ input.add8(104n);
+ input.add32(108n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_euint4(
+ const tx = await this.contract2.ge_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
@@ -1091,27 +1279,27 @@ describe('TFHE operations 3', function () {
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint8, euint4) => ebool test 1 (195, 14)', async function () {
+ it('test operator "ge" overload (euint8, euint32) => ebool test 3 (108, 108)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(195n);
- input.add4(14n);
+ input.add8(108n);
+ input.add32(108n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_euint4(
+ const tx = await this.contract2.ge_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint8, euint4) => ebool test 2 (10, 14)', async function () {
+ it('test operator "ge" overload (euint8, euint32) => ebool test 4 (108, 104)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(10n);
- input.add4(14n);
+ input.add8(108n);
+ input.add32(104n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_euint4(
+ const tx = await this.contract2.ge_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
@@ -1121,12 +1309,12 @@ describe('TFHE operations 3', function () {
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint8, euint4) => ebool test 3 (14, 14)', async function () {
+ it('test operator "gt" overload (euint8, euint32) => ebool test 1 (16, 2217853328)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(14n);
- input.add4(14n);
+ input.add8(16n);
+ input.add32(2217853328n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_euint4(
+ const tx = await this.contract2.gt_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
@@ -1136,12 +1324,12 @@ describe('TFHE operations 3', function () {
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint8, euint4) => ebool test 4 (14, 10)', async function () {
+ it('test operator "gt" overload (euint8, euint32) => ebool test 2 (12, 16)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(14n);
- input.add4(10n);
+ input.add8(12n);
+ input.add32(16n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_euint4(
+ const tx = await this.contract2.gt_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
@@ -1151,1323 +1339,3275 @@ describe('TFHE operations 3', function () {
expect(res).to.equal(false);
});
- it('test operator "min" overload (euint8, euint4) => euint8 test 1 (55, 3)', async function () {
+ it('test operator "gt" overload (euint8, euint32) => ebool test 3 (16, 16)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(55n);
- input.add4(3n);
+ input.add8(16n);
+ input.add32(16n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_euint4(
+ const tx = await this.contract2.gt_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(3n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(false);
});
- it('test operator "min" overload (euint8, euint4) => euint8 test 2 (4, 8)', async function () {
+ it('test operator "gt" overload (euint8, euint32) => ebool test 4 (16, 12)', async function () {
const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(4n);
- input.add4(8n);
+ input.add8(16n);
+ input.add32(12n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_euint4(
+ const tx = await this.contract2.gt_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(4n);
+ const res = await decryptBool(await this.contract2.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (euint8, euint4) => euint8 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(8n);
- input.add4(8n);
+ it('test operator "le" overload (euint8, euint32) => ebool test 1 (162, 1086789383)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(162n);
+ input.add32(1086789383n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_euint4(
+ const tx = await this.contract3.le_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(8n);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (euint8, euint4) => euint8 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(8n);
- input.add4(4n);
+ it('test operator "le" overload (euint8, euint32) => ebool test 2 (158, 162)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(158n);
+ input.add32(162n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_euint4(
+ const tx = await this.contract3.le_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(4n);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
});
- it('test operator "max" overload (euint8, euint4) => euint8 test 1 (41, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(41n);
- input.add4(11n);
+ it('test operator "le" overload (euint8, euint32) => ebool test 3 (162, 162)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(162n);
+ input.add32(162n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_euint4(
+ const tx = await this.contract3.le_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(41n);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
});
- it('test operator "max" overload (euint8, euint4) => euint8 test 2 (7, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(7n);
- input.add4(11n);
+ it('test operator "le" overload (euint8, euint32) => ebool test 4 (162, 158)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(162n);
+ input.add32(158n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_euint4(
+ const tx = await this.contract3.le_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(11n);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
});
- it('test operator "max" overload (euint8, euint4) => euint8 test 3 (11, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(11n);
- input.add4(11n);
+ it('test operator "lt" overload (euint8, euint32) => ebool test 1 (111, 1481942282)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(111n);
+ input.add32(1481942282n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_euint4(
+ const tx = await this.contract3.lt_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(11n);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
});
- it('test operator "max" overload (euint8, euint4) => euint8 test 4 (11, 7)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(11n);
- input.add4(7n);
+ it('test operator "lt" overload (euint8, euint32) => ebool test 2 (107, 111)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(107n);
+ input.add32(111n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_euint4(
+ const tx = await this.contract3.lt_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(11n);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
});
- it('test operator "add" overload (euint8, euint8) => euint8 test 1 (56, 89)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(56n);
- input.add8(89n);
+ it('test operator "lt" overload (euint8, euint32) => ebool test 3 (111, 111)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(111n);
+ input.add32(111n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint8_euint8(
+ const tx = await this.contract3.lt_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(145n);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
});
- it('test operator "add" overload (euint8, euint8) => euint8 test 2 (52, 56)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(52n);
- input.add8(56n);
+ it('test operator "lt" overload (euint8, euint32) => ebool test 4 (111, 107)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(111n);
+ input.add32(107n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint8_euint8(
+ const tx = await this.contract3.lt_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(108n);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
});
- it('test operator "add" overload (euint8, euint8) => euint8 test 3 (56, 56)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(56n);
- input.add8(56n);
+ it('test operator "min" overload (euint8, euint32) => euint32 test 1 (248, 4182541699)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(248n);
+ input.add32(4182541699n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint8_euint8(
+ const tx = await this.contract3.min_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(112n);
+ const res = await decrypt32(await this.contract3.res32());
+ expect(res).to.equal(248n);
});
- it('test operator "add" overload (euint8, euint8) => euint8 test 4 (56, 52)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(56n);
- input.add8(52n);
+ it('test operator "min" overload (euint8, euint32) => euint32 test 2 (244, 248)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(244n);
+ input.add32(248n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint8_euint8(
+ const tx = await this.contract3.min_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(108n);
+ const res = await decrypt32(await this.contract3.res32());
+ expect(res).to.equal(244n);
});
- it('test operator "sub" overload (euint8, euint8) => euint8 test 1 (64, 64)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(64n);
- input.add8(64n);
+ it('test operator "min" overload (euint8, euint32) => euint32 test 3 (248, 248)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(248n);
+ input.add32(248n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.sub_euint8_euint8(
+ const tx = await this.contract3.min_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(0n);
+ const res = await decrypt32(await this.contract3.res32());
+ expect(res).to.equal(248n);
});
- it('test operator "sub" overload (euint8, euint8) => euint8 test 2 (64, 60)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(64n);
- input.add8(60n);
+ it('test operator "min" overload (euint8, euint32) => euint32 test 4 (248, 244)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(248n);
+ input.add32(244n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.sub_euint8_euint8(
+ const tx = await this.contract3.min_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(4n);
+ const res = await decrypt32(await this.contract3.res32());
+ expect(res).to.equal(244n);
});
- it('test operator "mul" overload (euint8, euint8) => euint8 test 1 (14, 15)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(14n);
- input.add8(15n);
+ it('test operator "max" overload (euint8, euint32) => euint32 test 1 (31, 3976371021)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(31n);
+ input.add32(3976371021n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint8_euint8(
+ const tx = await this.contract3.max_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(210n);
+ const res = await decrypt32(await this.contract3.res32());
+ expect(res).to.equal(3976371021n);
});
- it('test operator "mul" overload (euint8, euint8) => euint8 test 2 (14, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(14n);
- input.add8(14n);
+ it('test operator "max" overload (euint8, euint32) => euint32 test 2 (27, 31)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(27n);
+ input.add32(31n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint8_euint8(
+ const tx = await this.contract3.max_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(196n);
+ const res = await decrypt32(await this.contract3.res32());
+ expect(res).to.equal(31n);
});
- it('test operator "mul" overload (euint8, euint8) => euint8 test 3 (14, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(14n);
- input.add8(14n);
+ it('test operator "max" overload (euint8, euint32) => euint32 test 3 (31, 31)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(31n);
+ input.add32(31n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint8_euint8(
+ const tx = await this.contract3.max_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(196n);
+ const res = await decrypt32(await this.contract3.res32());
+ expect(res).to.equal(31n);
});
- it('test operator "mul" overload (euint8, euint8) => euint8 test 4 (14, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(14n);
- input.add8(14n);
+ it('test operator "max" overload (euint8, euint32) => euint32 test 4 (31, 27)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(31n);
+ input.add32(27n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint8_euint8(
+ const tx = await this.contract3.max_euint8_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(196n);
+ const res = await decrypt32(await this.contract3.res32());
+ expect(res).to.equal(31n);
});
- it('test operator "and" overload (euint8, euint8) => euint8 test 1 (68, 245)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(68n);
- input.add8(245n);
+ it('test operator "add" overload (euint8, euint64) => euint64 test 1 (2, 129)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(2n);
+ input.add64(129n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.and_euint8_euint8(
+ const tx = await this.contract3.add_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(68n);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(131n);
});
- it('test operator "and" overload (euint8, euint8) => euint8 test 2 (64, 68)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(64n);
- input.add8(68n);
+ it('test operator "add" overload (euint8, euint64) => euint64 test 2 (87, 91)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(87n);
+ input.add64(91n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.and_euint8_euint8(
+ const tx = await this.contract3.add_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(64n);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(178n);
});
- it('test operator "and" overload (euint8, euint8) => euint8 test 3 (68, 68)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(68n);
- input.add8(68n);
+ it('test operator "add" overload (euint8, euint64) => euint64 test 3 (91, 91)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(91n);
+ input.add64(91n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.and_euint8_euint8(
+ const tx = await this.contract3.add_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(68n);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(182n);
});
- it('test operator "and" overload (euint8, euint8) => euint8 test 4 (68, 64)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(68n);
- input.add8(64n);
+ it('test operator "add" overload (euint8, euint64) => euint64 test 4 (91, 87)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(91n);
+ input.add64(87n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.and_euint8_euint8(
+ const tx = await this.contract3.add_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(64n);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(178n);
});
- it('test operator "or" overload (euint8, euint8) => euint8 test 1 (245, 47)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(245n);
- input.add8(47n);
+ it('test operator "sub" overload (euint8, euint64) => euint64 test 1 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add64(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.or_euint8_euint8(
+ const tx = await this.contract3.sub_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(255n);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(0n);
});
- it('test operator "or" overload (euint8, euint8) => euint8 test 2 (43, 47)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(43n);
- input.add8(47n);
+ it('test operator "sub" overload (euint8, euint64) => euint64 test 2 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add64(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.or_euint8_euint8(
+ const tx = await this.contract3.sub_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(47n);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(4n);
});
- it('test operator "or" overload (euint8, euint8) => euint8 test 3 (47, 47)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(47n);
- input.add8(47n);
+ it('test operator "mul" overload (euint8, euint64) => euint64 test 1 (2, 65)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(2n);
+ input.add64(65n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.or_euint8_euint8(
+ const tx = await this.contract3.mul_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(47n);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(130n);
});
- it('test operator "or" overload (euint8, euint8) => euint8 test 4 (47, 43)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(47n);
- input.add8(43n);
+ it('test operator "mul" overload (euint8, euint64) => euint64 test 2 (8, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add64(10n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.or_euint8_euint8(
+ const tx = await this.contract3.mul_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(47n);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(80n);
});
- it('test operator "xor" overload (euint8, euint8) => euint8 test 1 (213, 62)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(213n);
- input.add8(62n);
+ it('test operator "mul" overload (euint8, euint64) => euint64 test 3 (10, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(10n);
+ input.add64(10n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.xor_euint8_euint8(
+ const tx = await this.contract3.mul_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(235n);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(100n);
});
- it('test operator "xor" overload (euint8, euint8) => euint8 test 2 (58, 62)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(58n);
- input.add8(62n);
+ it('test operator "mul" overload (euint8, euint64) => euint64 test 4 (10, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(10n);
+ input.add64(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.xor_euint8_euint8(
+ const tx = await this.contract3.mul_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(4n);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(80n);
});
- it('test operator "xor" overload (euint8, euint8) => euint8 test 3 (62, 62)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(62n);
- input.add8(62n);
+ it('test operator "and" overload (euint8, euint64) => euint64 test 1 (203, 18443868996555285517)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(203n);
+ input.add64(18443868996555285517n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.xor_euint8_euint8(
+ const tx = await this.contract3.and_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(0n);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(9n);
});
- it('test operator "xor" overload (euint8, euint8) => euint8 test 4 (62, 58)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(62n);
- input.add8(58n);
+ it('test operator "and" overload (euint8, euint64) => euint64 test 2 (199, 203)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(199n);
+ input.add64(203n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.xor_euint8_euint8(
+ const tx = await this.contract3.and_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(4n);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(195n);
});
- it('test operator "eq" overload (euint8, euint8) => ebool test 1 (51, 70)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(51n);
- input.add8(70n);
+ it('test operator "and" overload (euint8, euint64) => euint64 test 3 (203, 203)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(203n);
+ input.add64(203n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_euint8(
+ const tx = await this.contract3.and_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(203n);
});
- it('test operator "eq" overload (euint8, euint8) => ebool test 2 (47, 51)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(47n);
- input.add8(51n);
+ it('test operator "and" overload (euint8, euint64) => euint64 test 4 (203, 199)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(203n);
+ input.add64(199n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_euint8(
+ const tx = await this.contract3.and_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(195n);
});
- it('test operator "eq" overload (euint8, euint8) => ebool test 3 (51, 51)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(51n);
- input.add8(51n);
+ it('test operator "or" overload (euint8, euint64) => euint64 test 1 (22, 18446578065470955215)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(22n);
+ input.add64(18446578065470955215n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_euint8(
+ const tx = await this.contract3.or_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(18446578065470955231n);
});
- it('test operator "eq" overload (euint8, euint8) => ebool test 4 (51, 47)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(51n);
- input.add8(47n);
+ it('test operator "or" overload (euint8, euint64) => euint64 test 2 (18, 22)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(18n);
+ input.add64(22n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_euint8(
+ const tx = await this.contract3.or_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(22n);
});
- it('test operator "ne" overload (euint8, euint8) => ebool test 1 (236, 26)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(236n);
- input.add8(26n);
+ it('test operator "or" overload (euint8, euint64) => euint64 test 3 (22, 22)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(22n);
+ input.add64(22n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_euint8(
+ const tx = await this.contract3.or_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(22n);
});
- it('test operator "ne" overload (euint8, euint8) => ebool test 2 (22, 26)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "or" overload (euint8, euint64) => euint64 test 4 (22, 18)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
input.add8(22n);
- input.add8(26n);
+ input.add64(18n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_euint8(
+ const tx = await this.contract3.or_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(22n);
});
- it('test operator "ne" overload (euint8, euint8) => ebool test 3 (26, 26)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(26n);
- input.add8(26n);
+ it('test operator "xor" overload (euint8, euint64) => euint64 test 1 (250, 18438760776575021013)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(250n);
+ input.add64(18438760776575021013n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_euint8(
+ const tx = await this.contract3.xor_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(18438760776575020847n);
});
- it('test operator "ne" overload (euint8, euint8) => ebool test 4 (26, 22)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(26n);
- input.add8(22n);
+ it('test operator "xor" overload (euint8, euint64) => euint64 test 2 (246, 250)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(246n);
+ input.add64(250n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_euint8(
+ const tx = await this.contract3.xor_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(12n);
});
- it('test operator "ge" overload (euint8, euint8) => ebool test 1 (89, 227)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(89n);
- input.add8(227n);
+ it('test operator "xor" overload (euint8, euint64) => euint64 test 3 (250, 250)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(250n);
+ input.add64(250n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_euint8(
+ const tx = await this.contract3.xor_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(0n);
});
- it('test operator "ge" overload (euint8, euint8) => ebool test 2 (85, 89)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(85n);
- input.add8(89n);
+ it('test operator "xor" overload (euint8, euint64) => euint64 test 4 (250, 246)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(250n);
+ input.add64(246n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_euint8(
+ const tx = await this.contract3.xor_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(12n);
});
- it('test operator "ge" overload (euint8, euint8) => ebool test 3 (89, 89)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(89n);
- input.add8(89n);
+ it('test operator "eq" overload (euint8, euint64) => ebool test 1 (141, 18441419220641833889)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(141n);
+ input.add64(18441419220641833889n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_euint8(
+ const tx = await this.contract3.eq_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint8, euint8) => ebool test 4 (89, 85)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(89n);
- input.add8(85n);
+ it('test operator "eq" overload (euint8, euint64) => ebool test 2 (137, 141)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(137n);
+ input.add64(141n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_euint8(
+ const tx = await this.contract3.eq_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint8, euint8) => ebool test 1 (247, 56)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(247n);
- input.add8(56n);
+ it('test operator "eq" overload (euint8, euint64) => ebool test 3 (141, 141)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(141n);
+ input.add64(141n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_euint8(
+ const tx = await this.contract3.eq_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract3.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint8, euint8) => ebool test 2 (52, 56)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(52n);
- input.add8(56n);
+ it('test operator "eq" overload (euint8, euint64) => ebool test 4 (141, 137)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(141n);
+ input.add64(137n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_euint8(
+ const tx = await this.contract3.eq_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract3.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint8, euint8) => ebool test 3 (56, 56)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(56n);
- input.add8(56n);
+ it('test operator "ne" overload (euint8, euint64) => ebool test 1 (99, 18445356789087657925)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(99n);
+ input.add64(18445356789087657925n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_euint8(
+ const tx = await this.contract3.ne_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint8, euint8) => ebool test 4 (56, 52)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(56n);
- input.add8(52n);
+ it('test operator "ne" overload (euint8, euint64) => ebool test 2 (95, 99)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(95n);
+ input.add64(99n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_euint8(
+ const tx = await this.contract3.ne_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract3.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint8, euint8) => ebool test 1 (182, 238)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(182n);
- input.add8(238n);
+ it('test operator "ne" overload (euint8, euint64) => ebool test 3 (99, 99)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(99n);
+ input.add64(99n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_euint8(
+ const tx = await this.contract3.ne_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
});
- it('test operator "le" overload (euint8, euint8) => ebool test 2 (178, 182)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(178n);
- input.add8(182n);
+ it('test operator "ne" overload (euint8, euint64) => ebool test 4 (99, 95)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(99n);
+ input.add64(95n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_euint8(
+ const tx = await this.contract3.ne_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract3.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint8, euint8) => ebool test 3 (182, 182)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(182n);
- input.add8(182n);
+ it('test operator "ge" overload (euint8, euint64) => ebool test 1 (27, 18441594146418724591)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(27n);
+ input.add64(18441594146418724591n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_euint8(
+ const tx = await this.contract3.ge_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
});
- it('test operator "le" overload (euint8, euint8) => ebool test 4 (182, 178)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(182n);
- input.add8(178n);
+ it('test operator "ge" overload (euint8, euint64) => ebool test 2 (23, 27)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(23n);
+ input.add64(27n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_euint8(
+ const tx = await this.contract3.ge_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract3.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint8, euint8) => ebool test 1 (44, 62)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(44n);
- input.add8(62n);
+ it('test operator "ge" overload (euint8, euint64) => ebool test 3 (27, 27)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(27n);
+ input.add64(27n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_euint8(
+ const tx = await this.contract3.ge_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract3.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint8, euint8) => ebool test 2 (40, 44)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(40n);
- input.add8(44n);
+ it('test operator "ge" overload (euint8, euint64) => ebool test 4 (27, 23)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(27n);
+ input.add64(23n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_euint8(
+ const tx = await this.contract3.ge_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract3.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint8, euint8) => ebool test 3 (44, 44)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(44n);
- input.add8(44n);
+ it('test operator "gt" overload (euint8, euint64) => ebool test 1 (58, 18442407989859516937)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(58n);
+ input.add64(18442407989859516937n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_euint8(
+ const tx = await this.contract3.gt_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract3.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint8, euint8) => ebool test 4 (44, 40)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(44n);
- input.add8(40n);
+ it('test operator "gt" overload (euint8, euint64) => ebool test 2 (54, 58)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(54n);
+ input.add64(58n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_euint8(
+ const tx = await this.contract3.gt_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract3.resb());
expect(res).to.equal(false);
});
- it('test operator "min" overload (euint8, euint8) => euint8 test 1 (254, 73)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(254n);
- input.add8(73n);
+ it('test operator "gt" overload (euint8, euint64) => ebool test 3 (58, 58)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(58n);
+ input.add64(58n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_euint8(
+ const tx = await this.contract3.gt_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(73n);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
});
- it('test operator "min" overload (euint8, euint8) => euint8 test 2 (69, 73)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(69n);
- input.add8(73n);
+ it('test operator "gt" overload (euint8, euint64) => ebool test 4 (58, 54)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(58n);
+ input.add64(54n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_euint8(
+ const tx = await this.contract3.gt_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(69n);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (euint8, euint8) => euint8 test 3 (73, 73)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(73n);
- input.add8(73n);
+ it('test operator "le" overload (euint8, euint64) => ebool test 1 (124, 18443185604881328715)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(124n);
+ input.add64(18443185604881328715n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_euint8(
+ const tx = await this.contract3.le_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(73n);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (euint8, euint8) => euint8 test 4 (73, 69)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(73n);
- input.add8(69n);
+ it('test operator "le" overload (euint8, euint64) => ebool test 2 (120, 124)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(120n);
+ input.add64(124n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_euint8(
+ const tx = await this.contract3.le_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(69n);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
});
- it('test operator "max" overload (euint8, euint8) => euint8 test 1 (227, 29)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(227n);
- input.add8(29n);
+ it('test operator "le" overload (euint8, euint64) => ebool test 3 (124, 124)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(124n);
+ input.add64(124n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_euint8(
+ const tx = await this.contract3.le_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(227n);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
});
- it('test operator "max" overload (euint8, euint8) => euint8 test 2 (25, 29)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(25n);
- input.add8(29n);
+ it('test operator "le" overload (euint8, euint64) => ebool test 4 (124, 120)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(124n);
+ input.add64(120n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_euint8(
+ const tx = await this.contract3.le_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(29n);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
});
- it('test operator "max" overload (euint8, euint8) => euint8 test 3 (29, 29)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(29n);
- input.add8(29n);
+ it('test operator "lt" overload (euint8, euint64) => ebool test 1 (213, 18441867518419136505)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(213n);
+ input.add64(18441867518419136505n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_euint8(
+ const tx = await this.contract3.lt_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(29n);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
});
- it('test operator "max" overload (euint8, euint8) => euint8 test 4 (29, 25)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(29n);
- input.add8(25n);
+ it('test operator "lt" overload (euint8, euint64) => ebool test 2 (209, 213)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(209n);
+ input.add64(213n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_euint8(
+ const tx = await this.contract3.lt_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(29n);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
});
- it('test operator "add" overload (euint8, euint16) => euint16 test 1 (2, 246)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(2n);
- input.add16(246n);
+ it('test operator "lt" overload (euint8, euint64) => ebool test 3 (213, 213)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(213n);
+ input.add64(213n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint8_euint16(
+ const tx = await this.contract3.lt_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(248n);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
});
- it('test operator "add" overload (euint8, euint16) => euint16 test 2 (104, 106)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(104n);
- input.add16(106n);
+ it('test operator "lt" overload (euint8, euint64) => ebool test 4 (213, 209)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(213n);
+ input.add64(209n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint8_euint16(
+ const tx = await this.contract3.lt_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(210n);
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
});
- it('test operator "add" overload (euint8, euint16) => euint16 test 3 (106, 106)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(106n);
- input.add16(106n);
+ it('test operator "min" overload (euint8, euint64) => euint64 test 1 (6, 18443833870782244811)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(6n);
+ input.add64(18443833870782244811n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint8_euint16(
+ const tx = await this.contract3.min_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(212n);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(6n);
});
- it('test operator "add" overload (euint8, euint16) => euint16 test 4 (106, 104)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(106n);
- input.add16(104n);
+ it('test operator "min" overload (euint8, euint64) => euint64 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(4n);
+ input.add64(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint8_euint16(
+ const tx = await this.contract3.min_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(210n);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(4n);
});
- it('test operator "sub" overload (euint8, euint16) => euint16 test 1 (17, 17)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(17n);
- input.add16(17n);
+ it('test operator "min" overload (euint8, euint64) => euint64 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add64(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.sub_euint8_euint16(
+ const tx = await this.contract3.min_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(0n);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(8n);
});
- it('test operator "sub" overload (euint8, euint16) => euint16 test 2 (17, 13)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(17n);
- input.add16(13n);
+ it('test operator "min" overload (euint8, euint64) => euint64 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add64(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.sub_euint8_euint16(
+ const tx = await this.contract3.min_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
+ const res = await decrypt64(await this.contract3.res64());
expect(res).to.equal(4n);
});
- it('test operator "mul" overload (euint8, euint16) => euint16 test 1 (2, 56)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(2n);
- input.add16(56n);
+ it('test operator "max" overload (euint8, euint64) => euint64 test 1 (217, 18441870389911940983)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(217n);
+ input.add64(18441870389911940983n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint8_euint16(
+ const tx = await this.contract3.max_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(112n);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(18441870389911940983n);
});
- it('test operator "mul" overload (euint8, euint16) => euint16 test 2 (10, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(10n);
- input.add16(10n);
+ it('test operator "max" overload (euint8, euint64) => euint64 test 2 (213, 217)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(213n);
+ input.add64(217n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint8_euint16(
+ const tx = await this.contract3.max_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(100n);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(217n);
});
- it('test operator "mul" overload (euint8, euint16) => euint16 test 3 (10, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(10n);
- input.add16(10n);
+ it('test operator "max" overload (euint8, euint64) => euint64 test 3 (217, 217)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(217n);
+ input.add64(217n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint8_euint16(
+ const tx = await this.contract3.max_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(100n);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(217n);
});
- it('test operator "mul" overload (euint8, euint16) => euint16 test 4 (10, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(10n);
- input.add16(10n);
+ it('test operator "max" overload (euint8, euint64) => euint64 test 4 (217, 213)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(217n);
+ input.add64(213n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint8_euint16(
+ const tx = await this.contract3.max_euint8_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(100n);
+ const res = await decrypt64(await this.contract3.res64());
+ expect(res).to.equal(217n);
});
- it('test operator "and" overload (euint8, euint16) => euint16 test 1 (140, 15292)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(140n);
- input.add16(15292n);
+ it('test operator "add" overload (euint8, euint128) => euint128 test 1 (2, 129)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(2n);
+ input.add128(129n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.and_euint8_euint16(
+ const tx = await this.contract3.add_euint8_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(140n);
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(131n);
});
- it('test operator "and" overload (euint8, euint16) => euint16 test 2 (136, 140)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(136n);
- input.add16(140n);
+ it('test operator "add" overload (euint8, euint128) => euint128 test 2 (16, 20)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(16n);
+ input.add128(20n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.and_euint8_euint16(
+ const tx = await this.contract3.add_euint8_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(136n);
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(36n);
});
- it('test operator "and" overload (euint8, euint16) => euint16 test 3 (140, 140)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(140n);
- input.add16(140n);
+ it('test operator "add" overload (euint8, euint128) => euint128 test 3 (20, 20)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(20n);
+ input.add128(20n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.and_euint8_euint16(
+ const tx = await this.contract3.add_euint8_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(140n);
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(40n);
});
- it('test operator "and" overload (euint8, euint16) => euint16 test 4 (140, 136)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(140n);
- input.add16(136n);
+ it('test operator "add" overload (euint8, euint128) => euint128 test 4 (20, 16)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(20n);
+ input.add128(16n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.and_euint8_euint16(
+ const tx = await this.contract3.add_euint8_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(136n);
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(36n);
});
- it('test operator "or" overload (euint8, euint16) => euint16 test 1 (140, 39215)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(140n);
- input.add16(39215n);
+ it('test operator "sub" overload (euint8, euint128) => euint128 test 1 (157, 157)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(157n);
+ input.add128(157n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.or_euint8_euint16(
+ const tx = await this.contract3.sub_euint8_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(39343n);
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(0n);
});
- it('test operator "or" overload (euint8, euint16) => euint16 test 2 (136, 140)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(136n);
- input.add16(140n);
+ it('test operator "sub" overload (euint8, euint128) => euint128 test 2 (157, 153)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(157n);
+ input.add128(153n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.or_euint8_euint16(
+ const tx = await this.contract3.sub_euint8_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(140n);
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(4n);
});
- it('test operator "or" overload (euint8, euint16) => euint16 test 3 (140, 140)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(140n);
- input.add16(140n);
+ it('test operator "mul" overload (euint8, euint128) => euint128 test 1 (2, 65)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(2n);
+ input.add128(65n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.or_euint8_euint16(
+ const tx = await this.contract3.mul_euint8_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(140n);
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(130n);
});
- it('test operator "or" overload (euint8, euint16) => euint16 test 4 (140, 136)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(140n);
- input.add16(136n);
+ it('test operator "mul" overload (euint8, euint128) => euint128 test 2 (9, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(9n);
+ input.add128(10n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.or_euint8_euint16(
+ const tx = await this.contract3.mul_euint8_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(140n);
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(90n);
});
- it('test operator "xor" overload (euint8, euint16) => euint16 test 1 (2, 64716)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(2n);
- input.add16(64716n);
+ it('test operator "mul" overload (euint8, euint128) => euint128 test 3 (10, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(10n);
+ input.add128(10n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.xor_euint8_euint16(
+ const tx = await this.contract3.mul_euint8_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(64718n);
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(100n);
});
- it('test operator "xor" overload (euint8, euint16) => euint16 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(4n);
- input.add16(8n);
+ it('test operator "mul" overload (euint8, euint128) => euint128 test 4 (10, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(10n);
+ input.add128(9n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.xor_euint8_euint16(
+ const tx = await this.contract3.mul_euint8_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(12n);
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(90n);
});
- it('test operator "xor" overload (euint8, euint16) => euint16 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(8n);
- input.add16(8n);
+ it('test operator "and" overload (euint8, euint128) => euint128 test 1 (72, 340282366920938463463369134248162755643)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(72n);
+ input.add128(340282366920938463463369134248162755643n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.xor_euint8_euint16(
+ const tx = await this.contract3.and_euint8_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(0n);
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(8n);
});
- it('test operator "xor" overload (euint8, euint16) => euint16 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(8n);
- input.add16(4n);
+ it('test operator "and" overload (euint8, euint128) => euint128 test 2 (68, 72)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(68n);
+ input.add128(72n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.xor_euint8_euint16(
+ const tx = await this.contract3.and_euint8_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(12n);
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(64n);
});
- it('test operator "eq" overload (euint8, euint16) => ebool test 1 (22, 5993)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(22n);
- input.add16(5993n);
+ it('test operator "and" overload (euint8, euint128) => euint128 test 3 (72, 72)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(72n);
+ input.add128(72n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_euint16(
+ const tx = await this.contract3.and_euint8_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(72n);
+ });
+
+ it('test operator "and" overload (euint8, euint128) => euint128 test 4 (72, 68)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(72n);
+ input.add128(68n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.and_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(64n);
+ });
+
+ it('test operator "or" overload (euint8, euint128) => euint128 test 1 (1, 340282366920938463463371478178042182733)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(1n);
+ input.add128(340282366920938463463371478178042182733n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.or_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(340282366920938463463371478178042182733n);
+ });
+
+ it('test operator "or" overload (euint8, euint128) => euint128 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(4n);
+ input.add128(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.or_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "or" overload (euint8, euint128) => euint128 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add128(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.or_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "or" overload (euint8, euint128) => euint128 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add128(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.or_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "xor" overload (euint8, euint128) => euint128 test 1 (142, 340282366920938463463373089327559876459)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(142n);
+ input.add128(340282366920938463463373089327559876459n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.xor_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(340282366920938463463373089327559876581n);
+ });
+
+ it('test operator "xor" overload (euint8, euint128) => euint128 test 2 (138, 142)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(138n);
+ input.add128(142n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.xor_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "xor" overload (euint8, euint128) => euint128 test 3 (142, 142)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(142n);
+ input.add128(142n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.xor_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint8, euint128) => euint128 test 4 (142, 138)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(142n);
+ input.add128(138n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.xor_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "eq" overload (euint8, euint128) => ebool test 1 (111, 340282366920938463463367365018688833419)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(111n);
+ input.add128(340282366920938463463367365018688833419n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.eq_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint8, euint16) => ebool test 2 (18, 22)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(18n);
- input.add16(22n);
+ it('test operator "eq" overload (euint8, euint128) => ebool test 2 (107, 111)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(107n);
+ input.add128(111n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_euint16(
+ const tx = await this.contract3.eq_euint8_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract3.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint8, euint16) => ebool test 3 (22, 22)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(22n);
- input.add16(22n);
+ it('test operator "eq" overload (euint8, euint128) => ebool test 3 (111, 111)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(111n);
+ input.add128(111n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_euint16(
+ const tx = await this.contract3.eq_euint8_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract3.resb());
expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint8, euint16) => ebool test 4 (22, 18)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(22n);
- input.add16(18n);
+ it('test operator "eq" overload (euint8, euint128) => ebool test 4 (111, 107)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(111n);
+ input.add128(107n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_euint16(
+ const tx = await this.contract3.eq_euint8_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint8, euint128) => ebool test 1 (226, 340282366920938463463366961237977601965)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(226n);
+ input.add128(340282366920938463463366961237977601965n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ne_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint8, euint128) => ebool test 2 (222, 226)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(222n);
+ input.add128(226n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ne_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint8, euint128) => ebool test 3 (226, 226)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(226n);
+ input.add128(226n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ne_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint8, euint128) => ebool test 4 (226, 222)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(226n);
+ input.add128(222n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ne_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint8, euint128) => ebool test 1 (198, 340282366920938463463372202187873997337)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(198n);
+ input.add128(340282366920938463463372202187873997337n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ge_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint8, euint128) => ebool test 2 (194, 198)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(194n);
+ input.add128(198n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ge_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint8, euint128) => ebool test 3 (198, 198)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(198n);
+ input.add128(198n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ge_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint8, euint128) => ebool test 4 (198, 194)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(198n);
+ input.add128(194n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ge_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint8, euint128) => ebool test 1 (246, 340282366920938463463368600113789095143)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(246n);
+ input.add128(340282366920938463463368600113789095143n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.gt_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint8, euint128) => ebool test 2 (242, 246)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(242n);
+ input.add128(246n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.gt_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint8, euint128) => ebool test 3 (246, 246)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(246n);
+ input.add128(246n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.gt_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint8, euint128) => ebool test 4 (246, 242)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(246n);
+ input.add128(242n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.gt_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint8, euint128) => ebool test 1 (108, 340282366920938463463369577015243486211)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(108n);
+ input.add128(340282366920938463463369577015243486211n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.le_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint8, euint128) => ebool test 2 (104, 108)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(104n);
+ input.add128(108n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.le_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint8, euint128) => ebool test 3 (108, 108)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(108n);
+ input.add128(108n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.le_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint8, euint128) => ebool test 4 (108, 104)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(108n);
+ input.add128(104n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.le_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
expect(res).to.equal(false);
});
+
+ it('test operator "lt" overload (euint8, euint128) => ebool test 1 (90, 340282366920938463463366855244560424809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(90n);
+ input.add128(340282366920938463463366855244560424809n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.lt_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint8, euint128) => ebool test 2 (86, 90)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(86n);
+ input.add128(90n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.lt_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint8, euint128) => ebool test 3 (90, 90)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(90n);
+ input.add128(90n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.lt_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint8, euint128) => ebool test 4 (90, 86)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(90n);
+ input.add128(86n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.lt_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint8, euint128) => euint128 test 1 (143, 340282366920938463463368314352737250889)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(143n);
+ input.add128(340282366920938463463368314352737250889n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.min_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(143n);
+ });
+
+ it('test operator "min" overload (euint8, euint128) => euint128 test 2 (139, 143)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(139n);
+ input.add128(143n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.min_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(139n);
+ });
+
+ it('test operator "min" overload (euint8, euint128) => euint128 test 3 (143, 143)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(143n);
+ input.add128(143n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.min_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(143n);
+ });
+
+ it('test operator "min" overload (euint8, euint128) => euint128 test 4 (143, 139)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(143n);
+ input.add128(139n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.min_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(139n);
+ });
+
+ it('test operator "max" overload (euint8, euint128) => euint128 test 1 (109, 340282366920938463463369292859038505161)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(109n);
+ input.add128(340282366920938463463369292859038505161n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.max_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(340282366920938463463369292859038505161n);
+ });
+
+ it('test operator "max" overload (euint8, euint128) => euint128 test 2 (105, 109)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(105n);
+ input.add128(109n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.max_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(109n);
+ });
+
+ it('test operator "max" overload (euint8, euint128) => euint128 test 3 (109, 109)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(109n);
+ input.add128(109n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.max_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(109n);
+ });
+
+ it('test operator "max" overload (euint8, euint128) => euint128 test 4 (109, 105)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(109n);
+ input.add128(105n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.max_euint8_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract3.res128());
+ expect(res).to.equal(109n);
+ });
+
+ it('test operator "add" overload (euint8, euint256) => euint256 test 1 (2, 129)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(2n);
+ input.add256(129n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.add_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(131n);
+ });
+
+ it('test operator "add" overload (euint8, euint256) => euint256 test 2 (82, 86)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(82n);
+ input.add256(86n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.add_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(168n);
+ });
+
+ it('test operator "add" overload (euint8, euint256) => euint256 test 3 (86, 86)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(86n);
+ input.add256(86n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.add_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(172n);
+ });
+
+ it('test operator "add" overload (euint8, euint256) => euint256 test 4 (86, 82)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(86n);
+ input.add256(82n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.add_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(168n);
+ });
+
+ it('test operator "sub" overload (euint8, euint256) => euint256 test 1 (224, 224)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(224n);
+ input.add256(224n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.sub_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint8, euint256) => euint256 test 2 (224, 220)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(224n);
+ input.add256(220n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.sub_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint8, euint256) => euint256 test 1 (2, 65)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(2n);
+ input.add256(65n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.mul_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(130n);
+ });
+
+ it('test operator "mul" overload (euint8, euint256) => euint256 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(4n);
+ input.add256(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.mul_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(32n);
+ });
+
+ it('test operator "mul" overload (euint8, euint256) => euint256 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add256(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.mul_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(64n);
+ });
+
+ it('test operator "mul" overload (euint8, euint256) => euint256 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(8n);
+ input.add256(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.mul_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(32n);
+ });
+
+ it('test operator "and" overload (euint8, euint256) => euint256 test 1 (180, 115792089237316195423570985008687907853269984665640564039457579349353950071771)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(180n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579349353950071771n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.and_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(144n);
+ });
+
+ it('test operator "and" overload (euint8, euint256) => euint256 test 2 (176, 180)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(176n);
+ input.add256(180n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.and_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(176n);
+ });
+
+ it('test operator "and" overload (euint8, euint256) => euint256 test 3 (180, 180)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(180n);
+ input.add256(180n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.and_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(180n);
+ });
+
+ it('test operator "and" overload (euint8, euint256) => euint256 test 4 (180, 176)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(180n);
+ input.add256(176n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.and_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(176n);
+ });
+
+ it('test operator "or" overload (euint8, euint256) => euint256 test 1 (46, 115792089237316195423570985008687907853269984665640564039457582375126935756687)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(46n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582375126935756687n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.or_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457582375126935756719n);
+ });
+
+ it('test operator "or" overload (euint8, euint256) => euint256 test 2 (42, 46)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(42n);
+ input.add256(46n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.or_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(46n);
+ });
+
+ it('test operator "or" overload (euint8, euint256) => euint256 test 3 (46, 46)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(46n);
+ input.add256(46n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.or_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(46n);
+ });
+
+ it('test operator "or" overload (euint8, euint256) => euint256 test 4 (46, 42)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(46n);
+ input.add256(42n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.or_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(46n);
+ });
+
+ it('test operator "xor" overload (euint8, euint256) => euint256 test 1 (244, 115792089237316195423570985008687907853269984665640564039457578624058101395789)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(244n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457578624058101395789n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.xor_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457578624058101395897n);
+ });
+
+ it('test operator "xor" overload (euint8, euint256) => euint256 test 2 (240, 244)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(240n);
+ input.add256(244n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.xor_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "xor" overload (euint8, euint256) => euint256 test 3 (244, 244)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(244n);
+ input.add256(244n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.xor_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint8, euint256) => euint256 test 4 (244, 240)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(244n);
+ input.add256(240n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.xor_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "eq" overload (euint8, euint256) => ebool test 1 (160, 115792089237316195423570985008687907853269984665640564039457581836943917626145)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(160n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581836943917626145n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.eq_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint8, euint256) => ebool test 2 (156, 160)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(156n);
+ input.add256(160n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.eq_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint8, euint256) => ebool test 3 (160, 160)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(160n);
+ input.add256(160n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.eq_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint8, euint256) => ebool test 4 (160, 156)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(160n);
+ input.add256(156n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.eq_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint8, euint256) => ebool test 1 (214, 115792089237316195423570985008687907853269984665640564039457580955238657941683)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(214n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457580955238657941683n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ne_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint8, euint256) => ebool test 2 (210, 214)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(210n);
+ input.add256(214n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ne_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint8, euint256) => ebool test 3 (214, 214)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(214n);
+ input.add256(214n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ne_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint8, euint256) => ebool test 4 (214, 210)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(214n);
+ input.add256(210n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ne_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint8, euint256) => ebool test 1 (195, 115792089237316195423570985008687907853269984665640564039457578830037010369755)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(195n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457578830037010369755n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ge_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint8, euint256) => ebool test 2 (191, 195)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(191n);
+ input.add256(195n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ge_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint8, euint256) => ebool test 3 (195, 195)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(195n);
+ input.add256(195n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ge_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint8, euint256) => ebool test 4 (195, 191)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(195n);
+ input.add256(191n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ge_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint8, euint256) => ebool test 1 (73, 115792089237316195423570985008687907853269984665640564039457582598668635855029)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(73n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582598668635855029n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.gt_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint8, euint256) => ebool test 2 (69, 73)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(69n);
+ input.add256(73n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.gt_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint8, euint256) => ebool test 3 (73, 73)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(73n);
+ input.add256(73n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.gt_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint8, euint256) => ebool test 4 (73, 69)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(73n);
+ input.add256(69n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.gt_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint8, euint256) => ebool test 1 (133, 115792089237316195423570985008687907853269984665640564039457576630649713670389)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(133n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457576630649713670389n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.le_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint8, euint256) => ebool test 2 (129, 133)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(129n);
+ input.add256(133n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.le_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint8, euint256) => ebool test 3 (133, 133)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(133n);
+ input.add256(133n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.le_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint8, euint256) => ebool test 4 (133, 129)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(133n);
+ input.add256(129n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.le_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint8, euint256) => ebool test 1 (142, 115792089237316195423570985008687907853269984665640564039457583972137475354729)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(142n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457583972137475354729n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.lt_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint8, euint256) => ebool test 2 (138, 142)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(138n);
+ input.add256(142n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.lt_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint8, euint256) => ebool test 3 (142, 142)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(142n);
+ input.add256(142n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.lt_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint8, euint256) => ebool test 4 (142, 138)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(142n);
+ input.add256(138n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.lt_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint8, euint256) => euint256 test 1 (227, 115792089237316195423570985008687907853269984665640564039457575642377411188527)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(227n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575642377411188527n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.min_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(227n);
+ });
+
+ it('test operator "min" overload (euint8, euint256) => euint256 test 2 (223, 227)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(223n);
+ input.add256(227n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.min_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(223n);
+ });
+
+ it('test operator "min" overload (euint8, euint256) => euint256 test 3 (227, 227)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(227n);
+ input.add256(227n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.min_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(227n);
+ });
+
+ it('test operator "min" overload (euint8, euint256) => euint256 test 4 (227, 223)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(227n);
+ input.add256(223n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.min_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(223n);
+ });
+
+ it('test operator "max" overload (euint8, euint256) => euint256 test 1 (187, 115792089237316195423570985008687907853269984665640564039457583763268749719689)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(187n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457583763268749719689n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.max_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457583763268749719689n);
+ });
+
+ it('test operator "max" overload (euint8, euint256) => euint256 test 2 (183, 187)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(183n);
+ input.add256(187n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.max_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(187n);
+ });
+
+ it('test operator "max" overload (euint8, euint256) => euint256 test 3 (187, 187)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(187n);
+ input.add256(187n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.max_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(187n);
+ });
+
+ it('test operator "max" overload (euint8, euint256) => euint256 test 4 (187, 183)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(187n);
+ input.add256(183n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.max_euint8_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract3.res256());
+ expect(res).to.equal(187n);
+ });
+
+ it('test operator "add" overload (euint8, uint8) => euint8 test 1 (110, 64)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(110n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.add_euint8_uint8(encryptedAmount.handles[0], 64n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(174n);
+ });
+
+ it('test operator "add" overload (euint8, uint8) => euint8 test 2 (14, 18)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(14n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.add_euint8_uint8(encryptedAmount.handles[0], 18n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(32n);
+ });
+
+ it('test operator "add" overload (euint8, uint8) => euint8 test 3 (18, 18)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(18n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.add_euint8_uint8(encryptedAmount.handles[0], 18n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(36n);
+ });
+
+ it('test operator "add" overload (euint8, uint8) => euint8 test 4 (18, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(18n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.add_euint8_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(32n);
+ });
+
+ it('test operator "add" overload (uint8, euint8) => euint8 test 1 (52, 126)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(126n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.add_uint8_euint8(52n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(178n);
+ });
+
+ it('test operator "add" overload (uint8, euint8) => euint8 test 2 (14, 18)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(18n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.add_uint8_euint8(14n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(32n);
+ });
+
+ it('test operator "add" overload (uint8, euint8) => euint8 test 3 (18, 18)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(18n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.add_uint8_euint8(18n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(36n);
+ });
+
+ it('test operator "add" overload (uint8, euint8) => euint8 test 4 (18, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.add_uint8_euint8(18n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(32n);
+ });
+
+ it('test operator "sub" overload (euint8, uint8) => euint8 test 1 (152, 152)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(152n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.sub_euint8_uint8(encryptedAmount.handles[0], 152n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint8, uint8) => euint8 test 2 (152, 148)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(152n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.sub_euint8_uint8(encryptedAmount.handles[0], 148n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "sub" overload (uint8, euint8) => euint8 test 1 (152, 152)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(152n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.sub_uint8_euint8(152n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (uint8, euint8) => euint8 test 2 (152, 148)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(148n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.sub_uint8_euint8(152n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint8, uint8) => euint8 test 1 (14, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(14n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.mul_euint8_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(84n);
+ });
+
+ it('test operator "mul" overload (euint8, uint8) => euint8 test 2 (12, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(12n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.mul_euint8_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(168n);
+ });
+
+ it('test operator "mul" overload (euint8, uint8) => euint8 test 3 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(14n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.mul_euint8_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(196n);
+ });
+
+ it('test operator "mul" overload (euint8, uint8) => euint8 test 4 (14, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(14n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.mul_euint8_uint8(encryptedAmount.handles[0], 12n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(168n);
+ });
+
+ it('test operator "mul" overload (uint8, euint8) => euint8 test 1 (12, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(11n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.mul_uint8_euint8(12n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(132n);
+ });
+
+ it('test operator "mul" overload (uint8, euint8) => euint8 test 2 (12, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.mul_uint8_euint8(12n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(168n);
+ });
+
+ it('test operator "mul" overload (uint8, euint8) => euint8 test 3 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.mul_uint8_euint8(14n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(196n);
+ });
+
+ it('test operator "mul" overload (uint8, euint8) => euint8 test 4 (14, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.mul_uint8_euint8(14n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(168n);
+ });
+
+ it('test operator "div" overload (euint8, uint8) => euint8 test 1 (87, 167)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(87n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.div_euint8_uint8(encryptedAmount.handles[0], 167n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "div" overload (euint8, uint8) => euint8 test 2 (31, 35)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(31n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.div_euint8_uint8(encryptedAmount.handles[0], 35n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "div" overload (euint8, uint8) => euint8 test 3 (35, 35)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(35n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.div_euint8_uint8(encryptedAmount.handles[0], 35n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(1n);
+ });
+
+ it('test operator "div" overload (euint8, uint8) => euint8 test 4 (35, 31)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(35n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.div_euint8_uint8(encryptedAmount.handles[0], 31n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(1n);
+ });
+
+ it('test operator "rem" overload (euint8, uint8) => euint8 test 1 (85, 232)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(85n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.rem_euint8_uint8(encryptedAmount.handles[0], 232n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(85n);
+ });
+
+ it('test operator "rem" overload (euint8, uint8) => euint8 test 2 (38, 42)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(38n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.rem_euint8_uint8(encryptedAmount.handles[0], 42n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(38n);
+ });
+
+ it('test operator "rem" overload (euint8, uint8) => euint8 test 3 (42, 42)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(42n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.rem_euint8_uint8(encryptedAmount.handles[0], 42n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "rem" overload (euint8, uint8) => euint8 test 4 (42, 38)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(42n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.rem_euint8_uint8(encryptedAmount.handles[0], 38n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "and" overload (euint8, uint8) => euint8 test 1 (183, 70)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(183n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.and_euint8_uint8(encryptedAmount.handles[0], 70n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(6n);
+ });
+
+ it('test operator "and" overload (euint8, uint8) => euint8 test 2 (131, 135)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(131n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.and_euint8_uint8(encryptedAmount.handles[0], 135n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(131n);
+ });
+
+ it('test operator "and" overload (euint8, uint8) => euint8 test 3 (135, 135)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(135n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.and_euint8_uint8(encryptedAmount.handles[0], 135n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(135n);
+ });
+
+ it('test operator "and" overload (euint8, uint8) => euint8 test 4 (135, 131)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(135n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.and_euint8_uint8(encryptedAmount.handles[0], 131n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(131n);
+ });
+
+ it('test operator "and" overload (uint8, euint8) => euint8 test 1 (146, 70)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(70n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.and_uint8_euint8(146n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(2n);
+ });
+
+ it('test operator "and" overload (uint8, euint8) => euint8 test 2 (131, 135)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(135n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.and_uint8_euint8(131n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(131n);
+ });
+
+ it('test operator "and" overload (uint8, euint8) => euint8 test 3 (135, 135)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(135n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.and_uint8_euint8(135n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(135n);
+ });
+
+ it('test operator "and" overload (uint8, euint8) => euint8 test 4 (135, 131)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(131n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.and_uint8_euint8(135n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(131n);
+ });
+
+ it('test operator "or" overload (euint8, uint8) => euint8 test 1 (189, 140)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(189n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.or_euint8_uint8(encryptedAmount.handles[0], 140n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(189n);
+ });
+
+ it('test operator "or" overload (euint8, uint8) => euint8 test 2 (185, 189)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(185n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.or_euint8_uint8(encryptedAmount.handles[0], 189n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(189n);
+ });
+
+ it('test operator "or" overload (euint8, uint8) => euint8 test 3 (189, 189)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(189n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.or_euint8_uint8(encryptedAmount.handles[0], 189n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(189n);
+ });
+
+ it('test operator "or" overload (euint8, uint8) => euint8 test 4 (189, 185)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(189n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.or_euint8_uint8(encryptedAmount.handles[0], 185n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(189n);
+ });
+
+ it('test operator "or" overload (uint8, euint8) => euint8 test 1 (139, 140)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(140n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.or_uint8_euint8(139n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(143n);
+ });
+
+ it('test operator "or" overload (uint8, euint8) => euint8 test 2 (185, 189)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(189n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.or_uint8_euint8(185n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(189n);
+ });
+
+ it('test operator "or" overload (uint8, euint8) => euint8 test 3 (189, 189)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(189n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.or_uint8_euint8(189n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(189n);
+ });
+
+ it('test operator "or" overload (uint8, euint8) => euint8 test 4 (189, 185)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(185n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.or_uint8_euint8(189n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(189n);
+ });
+
+ it('test operator "xor" overload (euint8, uint8) => euint8 test 1 (234, 201)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(234n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.xor_euint8_uint8(encryptedAmount.handles[0], 201n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(35n);
+ });
+
+ it('test operator "xor" overload (euint8, uint8) => euint8 test 2 (146, 150)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(146n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.xor_euint8_uint8(encryptedAmount.handles[0], 150n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "xor" overload (euint8, uint8) => euint8 test 3 (150, 150)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(150n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.xor_euint8_uint8(encryptedAmount.handles[0], 150n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint8, uint8) => euint8 test 4 (150, 146)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(150n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.xor_euint8_uint8(encryptedAmount.handles[0], 146n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "xor" overload (uint8, euint8) => euint8 test 1 (181, 201)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(201n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.xor_uint8_euint8(181n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(124n);
+ });
+
+ it('test operator "xor" overload (uint8, euint8) => euint8 test 2 (146, 150)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(150n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.xor_uint8_euint8(146n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "xor" overload (uint8, euint8) => euint8 test 3 (150, 150)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(150n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.xor_uint8_euint8(150n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (uint8, euint8) => euint8 test 4 (150, 146)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(146n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.xor_uint8_euint8(150n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(4n);
+ });
});
diff --git a/test/tfheOperations/tfheOperations4.ts b/test/tfheOperations/tfheOperations4.ts
index 3380044a..6dbd34d9 100644
--- a/test/tfheOperations/tfheOperations4.ts
+++ b/test/tfheOperations/tfheOperations4.ts
@@ -7,7 +7,22 @@ import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'
import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance';
+import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
+import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
+import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
+import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
+import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
+import {
+ createInstances,
+ decrypt4,
+ decrypt8,
+ decrypt16,
+ decrypt32,
+ decrypt64,
+ decrypt128,
+ decrypt256,
+ decryptBool,
+} from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
@@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise {
return contract;
}
+async function deployTfheTestFixture7(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite7');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture8(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite8');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture9(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite9');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture10(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite10');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture11(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite11');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
describe('TFHE operations 4', function () {
before(async function () {
await initSigners(1);
@@ -105,2355 +175,4421 @@ describe('TFHE operations 4', function () {
this.contract6Address = await contract6.getAddress();
this.contract6 = contract6;
+ const contract7 = await deployTfheTestFixture7();
+ this.contract7Address = await contract7.getAddress();
+ this.contract7 = contract7;
+
+ const contract8 = await deployTfheTestFixture8();
+ this.contract8Address = await contract8.getAddress();
+ this.contract8 = contract8;
+
+ const contract9 = await deployTfheTestFixture9();
+ this.contract9Address = await contract9.getAddress();
+ this.contract9 = contract9;
+
+ const contract10 = await deployTfheTestFixture10();
+ this.contract10Address = await contract10.getAddress();
+ this.contract10 = contract10;
+
+ const contract11 = await deployTfheTestFixture11();
+ this.contract11Address = await contract11.getAddress();
+ this.contract11 = contract11;
+
const instances = await createInstances(this.signers);
this.instances = instances;
});
- it('test operator "ne" overload (euint8, euint16) => ebool test 1 (201, 56595)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(201n);
- input.add16(56595n);
+ it('test operator "eq" overload (euint8, uint8) => ebool test 1 (175, 253)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(175n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.eq_euint8_uint8(encryptedAmount.handles[0], 253n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint8, uint8) => ebool test 2 (171, 175)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(171n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.eq_euint8_uint8(encryptedAmount.handles[0], 175n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint8, uint8) => ebool test 3 (175, 175)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(175n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.eq_euint8_uint8(encryptedAmount.handles[0], 175n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint8, uint8) => ebool test 4 (175, 171)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(175n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.eq_euint8_uint8(encryptedAmount.handles[0], 171n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (uint8, euint8) => ebool test 1 (158, 253)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(253n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.eq_uint8_euint8(158n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (uint8, euint8) => ebool test 2 (171, 175)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(175n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.eq_uint8_euint8(171n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (uint8, euint8) => ebool test 3 (175, 175)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(175n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.eq_uint8_euint8(175n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (uint8, euint8) => ebool test 4 (175, 171)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(171n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.eq_uint8_euint8(175n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint8, uint8) => ebool test 1 (197, 40)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(197n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ne_euint8_uint8(encryptedAmount.handles[0], 40n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint8, uint8) => ebool test 2 (193, 197)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(193n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ne_euint8_uint8(encryptedAmount.handles[0], 197n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint8, uint8) => ebool test 3 (197, 197)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(197n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ne_euint8_uint8(encryptedAmount.handles[0], 197n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint8, uint8) => ebool test 4 (197, 193)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(197n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ne_euint8_uint8(encryptedAmount.handles[0], 193n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (uint8, euint8) => ebool test 1 (243, 40)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(40n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ne_uint8_euint8(243n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (uint8, euint8) => ebool test 2 (193, 197)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(197n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ne_uint8_euint8(193n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (uint8, euint8) => ebool test 3 (197, 197)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(197n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ne_uint8_euint8(197n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (uint8, euint8) => ebool test 4 (197, 193)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(193n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ne_uint8_euint8(197n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint8, uint8) => ebool test 1 (63, 223)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(63n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ge_euint8_uint8(encryptedAmount.handles[0], 223n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint8, uint8) => ebool test 2 (59, 63)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(59n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ge_euint8_uint8(encryptedAmount.handles[0], 63n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint8, uint8) => ebool test 3 (63, 63)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(63n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ge_euint8_uint8(encryptedAmount.handles[0], 63n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint8, uint8) => ebool test 4 (63, 59)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(63n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ge_euint8_uint8(encryptedAmount.handles[0], 59n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (uint8, euint8) => ebool test 1 (3, 223)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(223n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ge_uint8_euint8(3n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (uint8, euint8) => ebool test 2 (59, 63)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(63n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ge_uint8_euint8(59n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (uint8, euint8) => ebool test 3 (63, 63)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(63n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ge_uint8_euint8(63n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (uint8, euint8) => ebool test 4 (63, 59)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(59n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ge_uint8_euint8(63n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint8, uint8) => ebool test 1 (239, 184)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(239n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.gt_euint8_uint8(encryptedAmount.handles[0], 184n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint8, uint8) => ebool test 2 (208, 212)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(208n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.gt_euint8_uint8(encryptedAmount.handles[0], 212n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint8, uint8) => ebool test 3 (212, 212)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(212n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.gt_euint8_uint8(encryptedAmount.handles[0], 212n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint8, uint8) => ebool test 4 (212, 208)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(212n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.gt_euint8_uint8(encryptedAmount.handles[0], 208n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (uint8, euint8) => ebool test 1 (188, 184)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(184n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.gt_uint8_euint8(188n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (uint8, euint8) => ebool test 2 (208, 212)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(212n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.gt_uint8_euint8(208n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (uint8, euint8) => ebool test 3 (212, 212)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(212n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.gt_uint8_euint8(212n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (uint8, euint8) => ebool test 4 (212, 208)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(208n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.gt_uint8_euint8(212n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint8, uint8) => ebool test 1 (124, 152)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(124n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.le_euint8_uint8(encryptedAmount.handles[0], 152n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint8, uint8) => ebool test 2 (67, 71)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(67n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.le_euint8_uint8(encryptedAmount.handles[0], 71n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint8, uint8) => ebool test 3 (71, 71)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(71n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.le_euint8_uint8(encryptedAmount.handles[0], 71n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint8, uint8) => ebool test 4 (71, 67)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(71n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.le_euint8_uint8(encryptedAmount.handles[0], 67n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "le" overload (uint8, euint8) => ebool test 1 (25, 152)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(152n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.le_uint8_euint8(25n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (uint8, euint8) => ebool test 2 (67, 71)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(71n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.le_uint8_euint8(67n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (uint8, euint8) => ebool test 3 (71, 71)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(71n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.le_uint8_euint8(71n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (uint8, euint8) => ebool test 4 (71, 67)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(67n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.le_uint8_euint8(71n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint8, uint8) => ebool test 1 (221, 96)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(221n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.lt_euint8_uint8(encryptedAmount.handles[0], 96n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint8, uint8) => ebool test 2 (41, 45)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(41n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.lt_euint8_uint8(encryptedAmount.handles[0], 45n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint8, uint8) => ebool test 3 (45, 45)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(45n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.lt_euint8_uint8(encryptedAmount.handles[0], 45n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint8, uint8) => ebool test 4 (45, 41)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(45n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.lt_euint8_uint8(encryptedAmount.handles[0], 41n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (uint8, euint8) => ebool test 1 (225, 96)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(96n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.lt_uint8_euint8(225n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (uint8, euint8) => ebool test 2 (41, 45)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(45n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.lt_uint8_euint8(41n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (uint8, euint8) => ebool test 3 (45, 45)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(45n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.lt_uint8_euint8(45n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (uint8, euint8) => ebool test 4 (45, 41)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(41n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.lt_uint8_euint8(45n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint8, uint8) => euint8 test 1 (183, 152)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(183n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.min_euint8_uint8(encryptedAmount.handles[0], 152n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(152n);
+ });
+
+ it('test operator "min" overload (euint8, uint8) => euint8 test 2 (80, 84)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(80n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.min_euint8_uint8(encryptedAmount.handles[0], 84n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(80n);
+ });
+
+ it('test operator "min" overload (euint8, uint8) => euint8 test 3 (84, 84)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(84n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.min_euint8_uint8(encryptedAmount.handles[0], 84n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(84n);
+ });
+
+ it('test operator "min" overload (euint8, uint8) => euint8 test 4 (84, 80)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(84n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.min_euint8_uint8(encryptedAmount.handles[0], 80n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(80n);
+ });
+
+ it('test operator "min" overload (uint8, euint8) => euint8 test 1 (22, 152)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(152n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.min_uint8_euint8(22n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(22n);
+ });
+
+ it('test operator "min" overload (uint8, euint8) => euint8 test 2 (80, 84)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(84n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.min_uint8_euint8(80n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(80n);
+ });
+
+ it('test operator "min" overload (uint8, euint8) => euint8 test 3 (84, 84)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(84n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.min_uint8_euint8(84n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(84n);
+ });
+
+ it('test operator "min" overload (uint8, euint8) => euint8 test 4 (84, 80)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(80n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.min_uint8_euint8(84n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(80n);
+ });
+
+ it('test operator "max" overload (euint8, uint8) => euint8 test 1 (17, 83)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(17n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.max_euint8_uint8(encryptedAmount.handles[0], 83n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(83n);
+ });
+
+ it('test operator "max" overload (euint8, uint8) => euint8 test 2 (13, 17)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(13n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.max_euint8_uint8(encryptedAmount.handles[0], 17n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(17n);
+ });
+
+ it('test operator "max" overload (euint8, uint8) => euint8 test 3 (17, 17)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(17n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.max_euint8_uint8(encryptedAmount.handles[0], 17n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(17n);
+ });
+
+ it('test operator "max" overload (euint8, uint8) => euint8 test 4 (17, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add8(17n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.max_euint8_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(17n);
+ });
+
+ it('test operator "max" overload (uint8, euint8) => euint8 test 1 (46, 83)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(83n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.max_uint8_euint8(46n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(83n);
+ });
+
+ it('test operator "max" overload (uint8, euint8) => euint8 test 2 (13, 17)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(17n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.max_uint8_euint8(13n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(17n);
+ });
+
+ it('test operator "max" overload (uint8, euint8) => euint8 test 3 (17, 17)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(17n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.max_uint8_euint8(17n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(17n);
+ });
+
+ it('test operator "max" overload (uint8, euint8) => euint8 test 4 (17, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+
+ input.add8(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.max_uint8_euint8(17n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt8(await this.contract3.res8());
+ expect(res).to.equal(17n);
+ });
+
+ it('test operator "add" overload (euint16, euint4) => euint16 test 1 (8, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add4(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.add_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "add" overload (euint16, euint4) => euint16 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.add_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "add" overload (euint16, euint4) => euint16 test 3 (5, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(5n);
+ input.add4(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.add_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "add" overload (euint16, euint4) => euint16 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.add_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "sub" overload (euint16, euint4) => euint16 test 1 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(14n);
+ input.add4(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.sub_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint16, euint4) => euint16 test 2 (14, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(14n);
+ input.add4(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.sub_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint16, euint4) => euint16 test 1 (5, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(5n);
+ input.add4(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.mul_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "mul" overload (euint16, euint4) => euint16 test 2 (3, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(3n);
+ input.add4(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.mul_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(15n);
+ });
+
+ it('test operator "mul" overload (euint16, euint4) => euint16 test 3 (3, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(3n);
+ input.add4(3n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.mul_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(9n);
+ });
+
+ it('test operator "mul" overload (euint16, euint4) => euint16 test 4 (5, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(5n);
+ input.add4(3n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.mul_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(15n);
+ });
+
+ it('test operator "and" overload (euint16, euint4) => euint16 test 1 (57634, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(57634n);
+ input.add4(7n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.and_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(2n);
+ });
+
+ it('test operator "and" overload (euint16, euint4) => euint16 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.and_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "and" overload (euint16, euint4) => euint16 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.and_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "and" overload (euint16, euint4) => euint16 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.and_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "or" overload (euint16, euint4) => euint16 test 1 (31310, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(31310n);
+ input.add4(6n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.or_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(31310n);
+ });
+
+ it('test operator "or" overload (euint16, euint4) => euint16 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.or_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "or" overload (euint16, euint4) => euint16 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.or_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "or" overload (euint16, euint4) => euint16 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.or_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "xor" overload (euint16, euint4) => euint16 test 1 (57076, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(57076n);
+ input.add4(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.xor_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(57082n);
+ });
+
+ it('test operator "xor" overload (euint16, euint4) => euint16 test 2 (10, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(10n);
+ input.add4(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.xor_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "xor" overload (euint16, euint4) => euint16 test 3 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(14n);
+ input.add4(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.xor_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint16, euint4) => euint16 test 4 (14, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(14n);
+ input.add4(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.xor_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "eq" overload (euint16, euint4) => ebool test 1 (51541, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(51541n);
+ input.add4(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.eq_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint16, euint4) => ebool test 2 (10, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(10n);
+ input.add4(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.eq_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint16, euint4) => ebool test 3 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(14n);
+ input.add4(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.eq_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint16, euint4) => ebool test 4 (14, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(14n);
+ input.add4(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.eq_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint16, euint4) => ebool test 1 (26709, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(26709n);
+ input.add4(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ne_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint16, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ne_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint16, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ne_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint16, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ne_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint16, euint4) => ebool test 1 (60257, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(60257n);
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ge_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint16, euint4) => ebool test 2 (9, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(9n);
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ge_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint16, euint4) => ebool test 3 (13, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(13n);
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ge_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint16, euint4) => ebool test 4 (13, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(13n);
+ input.add4(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.ge_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint16, euint4) => ebool test 1 (57987, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(57987n);
+ input.add4(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.gt_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint16, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.gt_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint16, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.gt_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint16, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.gt_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint16, euint4) => ebool test 1 (26735, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(26735n);
+ input.add4(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.le_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "le" overload (euint16, euint4) => ebool test 2 (8, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add4(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.le_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint16, euint4) => ebool test 3 (12, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(12n);
+ input.add4(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.le_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint16, euint4) => ebool test 4 (12, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(12n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.le_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint16, euint4) => ebool test 1 (38459, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(38459n);
+ input.add4(3n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.lt_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint16, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.lt_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint16, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.lt_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint16, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.lt_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract3.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint16, euint4) => euint16 test 1 (35993, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(35993n);
+ input.add4(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.min_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(14n);
+ });
+
+ it('test operator "min" overload (euint16, euint4) => euint16 test 2 (10, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(10n);
+ input.add4(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.min_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "min" overload (euint16, euint4) => euint16 test 3 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(14n);
+ input.add4(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.min_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(14n);
+ });
+
+ it('test operator "min" overload (euint16, euint4) => euint16 test 4 (14, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(14n);
+ input.add4(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.min_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "max" overload (euint16, euint4) => euint16 test 1 (22967, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(22967n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.max_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(22967n);
+ });
+
+ it('test operator "max" overload (euint16, euint4) => euint16 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.max_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "max" overload (euint16, euint4) => euint16 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.max_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "max" overload (euint16, euint4) => euint16 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract3.max_euint16_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract3.res16());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "add" overload (euint16, euint8) => euint16 test 1 (205, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(205n);
+ input.add8(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.add_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(207n);
+ });
+
+ it('test operator "add" overload (euint16, euint8) => euint16 test 2 (90, 94)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(90n);
+ input.add8(94n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.add_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(184n);
+ });
+
+ it('test operator "add" overload (euint16, euint8) => euint16 test 3 (94, 94)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(94n);
+ input.add8(94n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.add_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(188n);
+ });
+
+ it('test operator "add" overload (euint16, euint8) => euint16 test 4 (94, 90)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(94n);
+ input.add8(90n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.add_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(184n);
+ });
+
+ it('test operator "sub" overload (euint16, euint8) => euint16 test 1 (195, 195)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(195n);
+ input.add8(195n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.sub_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint16, euint8) => euint16 test 2 (195, 191)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(195n);
+ input.add8(191n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.sub_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint16, euint8) => euint16 test 1 (87, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(87n);
+ input.add8(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.mul_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(174n);
+ });
+
+ it('test operator "mul" overload (euint16, euint8) => euint16 test 2 (9, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(9n);
+ input.add8(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.mul_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(90n);
+ });
+
+ it('test operator "mul" overload (euint16, euint8) => euint16 test 3 (10, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(10n);
+ input.add8(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.mul_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(100n);
+ });
+
+ it('test operator "mul" overload (euint16, euint8) => euint16 test 4 (10, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(10n);
+ input.add8(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.mul_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(90n);
+ });
+
+ it('test operator "and" overload (euint16, euint8) => euint16 test 1 (41347, 138)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(41347n);
+ input.add8(138n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.and_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(130n);
+ });
+
+ it('test operator "and" overload (euint16, euint8) => euint16 test 2 (134, 138)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(134n);
+ input.add8(138n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.and_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(130n);
+ });
+
+ it('test operator "and" overload (euint16, euint8) => euint16 test 3 (138, 138)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(138n);
+ input.add8(138n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.and_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(138n);
+ });
+
+ it('test operator "and" overload (euint16, euint8) => euint16 test 4 (138, 134)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(138n);
+ input.add8(134n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.and_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(130n);
+ });
+
+ it('test operator "or" overload (euint16, euint8) => euint16 test 1 (20350, 200)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(20350n);
+ input.add8(200n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.or_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(20478n);
+ });
+
+ it('test operator "or" overload (euint16, euint8) => euint16 test 2 (196, 200)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(196n);
+ input.add8(200n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.or_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(204n);
+ });
+
+ it('test operator "or" overload (euint16, euint8) => euint16 test 3 (200, 200)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(200n);
+ input.add8(200n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.or_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(200n);
+ });
+
+ it('test operator "or" overload (euint16, euint8) => euint16 test 4 (200, 196)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(200n);
+ input.add8(196n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.or_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(204n);
+ });
+
+ it('test operator "xor" overload (euint16, euint8) => euint16 test 1 (14933, 231)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(14933n);
+ input.add8(231n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.xor_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(15026n);
+ });
+
+ it('test operator "xor" overload (euint16, euint8) => euint16 test 2 (227, 231)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(227n);
+ input.add8(231n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.xor_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "xor" overload (euint16, euint8) => euint16 test 3 (231, 231)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(231n);
+ input.add8(231n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.xor_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint16, euint8) => euint16 test 4 (231, 227)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(231n);
+ input.add8(227n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.xor_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "eq" overload (euint16, euint8) => ebool test 1 (33521, 144)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(33521n);
+ input.add8(144n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.eq_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint16, euint8) => ebool test 2 (140, 144)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(140n);
+ input.add8(144n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.eq_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint16, euint8) => ebool test 3 (144, 144)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(144n);
+ input.add8(144n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.eq_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint16, euint8) => ebool test 4 (144, 140)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(144n);
+ input.add8(140n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.eq_euint16_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint16, euint8) => ebool test 1 (13794, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(13794n);
+ input.add8(3n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_euint16(
+ const tx = await this.contract4.ne_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint8, euint16) => ebool test 2 (197, 201)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(197n);
- input.add16(201n);
+ it('test operator "ne" overload (euint16, euint8) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(4n);
+ input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_euint16(
+ const tx = await this.contract4.ne_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint8, euint16) => ebool test 3 (201, 201)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(201n);
- input.add16(201n);
+ it('test operator "ne" overload (euint16, euint8) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add8(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_euint16(
+ const tx = await this.contract4.ne_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint8, euint16) => ebool test 4 (201, 197)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(201n);
- input.add16(197n);
+ it('test operator "ne" overload (euint16, euint8) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(8n);
+ input.add8(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_euint16(
+ const tx = await this.contract4.ne_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint8, euint16) => ebool test 1 (12, 41571)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(12n);
- input.add16(41571n);
+ it('test operator "ge" overload (euint16, euint8) => ebool test 1 (8192, 143)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(8192n);
+ input.add8(143n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_euint16(
+ const tx = await this.contract4.ge_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint8, euint16) => ebool test 2 (8, 12)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(8n);
- input.add16(12n);
+ it('test operator "ge" overload (euint16, euint8) => ebool test 2 (139, 143)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(139n);
+ input.add8(143n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_euint16(
+ const tx = await this.contract4.ge_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint8, euint16) => ebool test 3 (12, 12)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(12n);
- input.add16(12n);
+ it('test operator "ge" overload (euint16, euint8) => ebool test 3 (143, 143)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(143n);
+ input.add8(143n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_euint16(
+ const tx = await this.contract4.ge_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint8, euint16) => ebool test 4 (12, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(12n);
- input.add16(8n);
+ it('test operator "ge" overload (euint16, euint8) => ebool test 4 (143, 139)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(143n);
+ input.add8(139n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_euint16(
+ const tx = await this.contract4.ge_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint8, euint16) => ebool test 1 (67, 34612)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(67n);
- input.add16(34612n);
+ it('test operator "gt" overload (euint16, euint8) => ebool test 1 (18049, 102)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(18049n);
+ input.add8(102n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_euint16(
+ const tx = await this.contract4.gt_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint8, euint16) => ebool test 2 (63, 67)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(63n);
- input.add16(67n);
+ it('test operator "gt" overload (euint16, euint8) => ebool test 2 (98, 102)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(98n);
+ input.add8(102n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_euint16(
+ const tx = await this.contract4.gt_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint8, euint16) => ebool test 3 (67, 67)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(67n);
- input.add16(67n);
+ it('test operator "gt" overload (euint16, euint8) => ebool test 3 (102, 102)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(102n);
+ input.add8(102n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_euint16(
+ const tx = await this.contract4.gt_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint8, euint16) => ebool test 4 (67, 63)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(67n);
- input.add16(63n);
+ it('test operator "gt" overload (euint16, euint8) => ebool test 4 (102, 98)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(102n);
+ input.add8(98n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_euint16(
+ const tx = await this.contract4.gt_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint8, euint16) => ebool test 1 (157, 25391)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(157n);
- input.add16(25391n);
+ it('test operator "le" overload (euint16, euint8) => ebool test 1 (7541, 42)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(7541n);
+ input.add8(42n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_euint16(
+ const tx = await this.contract4.le_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
});
- it('test operator "le" overload (euint8, euint16) => ebool test 2 (153, 157)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(153n);
- input.add16(157n);
+ it('test operator "le" overload (euint16, euint8) => ebool test 2 (38, 42)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(38n);
+ input.add8(42n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_euint16(
+ const tx = await this.contract4.le_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint8, euint16) => ebool test 3 (157, 157)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(157n);
- input.add16(157n);
+ it('test operator "le" overload (euint16, euint8) => ebool test 3 (42, 42)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(42n);
+ input.add8(42n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_euint16(
+ const tx = await this.contract4.le_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint8, euint16) => ebool test 4 (157, 153)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(157n);
- input.add16(153n);
+ it('test operator "le" overload (euint16, euint8) => ebool test 4 (42, 38)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(42n);
+ input.add8(38n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_euint16(
+ const tx = await this.contract4.le_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint8, euint16) => ebool test 1 (115, 9566)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(115n);
- input.add16(9566n);
+ it('test operator "lt" overload (euint16, euint8) => ebool test 1 (6772, 147)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(6772n);
+ input.add8(147n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_euint16(
+ const tx = await this.contract4.lt_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint8, euint16) => ebool test 2 (111, 115)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(111n);
- input.add16(115n);
+ it('test operator "lt" overload (euint16, euint8) => ebool test 2 (143, 147)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(143n);
+ input.add8(147n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_euint16(
+ const tx = await this.contract4.lt_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint8, euint16) => ebool test 3 (115, 115)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(115n);
- input.add16(115n);
+ it('test operator "lt" overload (euint16, euint8) => ebool test 3 (147, 147)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(147n);
+ input.add8(147n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_euint16(
+ const tx = await this.contract4.lt_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint8, euint16) => ebool test 4 (115, 111)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(115n);
- input.add16(111n);
+ it('test operator "lt" overload (euint16, euint8) => ebool test 4 (147, 143)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(147n);
+ input.add8(143n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_euint16(
+ const tx = await this.contract4.lt_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "min" overload (euint8, euint16) => euint16 test 1 (59, 17033)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(59n);
- input.add16(17033n);
+ it('test operator "min" overload (euint16, euint8) => euint16 test 1 (16954, 238)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(16954n);
+ input.add8(238n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_euint16(
+ const tx = await this.contract4.min_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(59n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(238n);
});
- it('test operator "min" overload (euint8, euint16) => euint16 test 2 (55, 59)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(55n);
- input.add16(59n);
+ it('test operator "min" overload (euint16, euint8) => euint16 test 2 (234, 238)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(234n);
+ input.add8(238n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_euint16(
+ const tx = await this.contract4.min_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(55n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(234n);
});
- it('test operator "min" overload (euint8, euint16) => euint16 test 3 (59, 59)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(59n);
- input.add16(59n);
+ it('test operator "min" overload (euint16, euint8) => euint16 test 3 (238, 238)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(238n);
+ input.add8(238n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_euint16(
+ const tx = await this.contract4.min_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(59n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(238n);
});
- it('test operator "min" overload (euint8, euint16) => euint16 test 4 (59, 55)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(59n);
- input.add16(55n);
+ it('test operator "min" overload (euint16, euint8) => euint16 test 4 (238, 234)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(238n);
+ input.add8(234n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_euint16(
+ const tx = await this.contract4.min_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(55n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(234n);
});
- it('test operator "max" overload (euint8, euint16) => euint16 test 1 (76, 60931)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(76n);
- input.add16(60931n);
+ it('test operator "max" overload (euint16, euint8) => euint16 test 1 (22246, 39)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(22246n);
+ input.add8(39n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_euint16(
+ const tx = await this.contract4.max_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(60931n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(22246n);
});
- it('test operator "max" overload (euint8, euint16) => euint16 test 2 (72, 76)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(72n);
- input.add16(76n);
+ it('test operator "max" overload (euint16, euint8) => euint16 test 2 (35, 39)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(35n);
+ input.add8(39n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_euint16(
+ const tx = await this.contract4.max_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(76n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(39n);
});
- it('test operator "max" overload (euint8, euint16) => euint16 test 3 (76, 76)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(76n);
- input.add16(76n);
+ it('test operator "max" overload (euint16, euint8) => euint16 test 3 (39, 39)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(39n);
+ input.add8(39n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_euint16(
+ const tx = await this.contract4.max_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(76n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(39n);
});
- it('test operator "max" overload (euint8, euint16) => euint16 test 4 (76, 72)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(76n);
- input.add16(72n);
+ it('test operator "max" overload (euint16, euint8) => euint16 test 4 (39, 35)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(39n);
+ input.add8(35n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_euint16(
+ const tx = await this.contract4.max_euint16_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(76n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(39n);
});
- it('test operator "add" overload (euint8, euint32) => euint32 test 1 (2, 131)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(2n);
- input.add32(131n);
+ it('test operator "add" overload (euint16, euint16) => euint16 test 1 (26028, 36322)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(26028n);
+ input.add16(36322n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint8_euint32(
+ const tx = await this.contract4.add_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(133n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(62350n);
});
- it('test operator "add" overload (euint8, euint32) => euint32 test 2 (88, 92)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(88n);
- input.add32(92n);
+ it('test operator "add" overload (euint16, euint16) => euint16 test 2 (26024, 26028)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(26024n);
+ input.add16(26028n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint8_euint32(
+ const tx = await this.contract4.add_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(180n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(52052n);
});
- it('test operator "add" overload (euint8, euint32) => euint32 test 3 (92, 92)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(92n);
- input.add32(92n);
+ it('test operator "add" overload (euint16, euint16) => euint16 test 3 (26028, 26028)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(26028n);
+ input.add16(26028n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint8_euint32(
+ const tx = await this.contract4.add_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(184n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(52056n);
});
- it('test operator "add" overload (euint8, euint32) => euint32 test 4 (92, 88)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(92n);
- input.add32(88n);
+ it('test operator "add" overload (euint16, euint16) => euint16 test 4 (26028, 26024)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(26028n);
+ input.add16(26024n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint8_euint32(
+ const tx = await this.contract4.add_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(180n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(52052n);
});
- it('test operator "sub" overload (euint8, euint32) => euint32 test 1 (10, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(10n);
- input.add32(10n);
+ it('test operator "sub" overload (euint16, euint16) => euint16 test 1 (14486, 14486)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(14486n);
+ input.add16(14486n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.sub_euint8_euint32(
+ const tx = await this.contract4.sub_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
+ const res = await decrypt16(await this.contract4.res16());
expect(res).to.equal(0n);
});
- it('test operator "sub" overload (euint8, euint32) => euint32 test 2 (10, 6)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(10n);
- input.add32(6n);
+ it('test operator "sub" overload (euint16, euint16) => euint16 test 2 (14486, 14482)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(14486n);
+ input.add16(14482n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.sub_euint8_euint32(
+ const tx = await this.contract4.sub_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
+ const res = await decrypt16(await this.contract4.res16());
expect(res).to.equal(4n);
});
- it('test operator "mul" overload (euint8, euint32) => euint32 test 1 (2, 79)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(2n);
- input.add32(79n);
+ it('test operator "mul" overload (euint16, euint16) => euint16 test 1 (117, 200)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(117n);
+ input.add16(200n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint8_euint32(
+ const tx = await this.contract4.mul_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(158n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(23400n);
});
- it('test operator "mul" overload (euint8, euint32) => euint32 test 2 (10, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(10n);
- input.add32(11n);
+ it('test operator "mul" overload (euint16, euint16) => euint16 test 2 (233, 233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(233n);
+ input.add16(233n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint8_euint32(
+ const tx = await this.contract4.mul_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(110n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(54289n);
});
- it('test operator "mul" overload (euint8, euint32) => euint32 test 3 (11, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(11n);
- input.add32(11n);
+ it('test operator "mul" overload (euint16, euint16) => euint16 test 3 (233, 233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(233n);
+ input.add16(233n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint8_euint32(
+ const tx = await this.contract4.mul_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(121n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(54289n);
});
- it('test operator "mul" overload (euint8, euint32) => euint32 test 4 (11, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(11n);
- input.add32(10n);
+ it('test operator "mul" overload (euint16, euint16) => euint16 test 4 (233, 233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(233n);
+ input.add16(233n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint8_euint32(
+ const tx = await this.contract4.mul_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(110n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(54289n);
});
- it('test operator "and" overload (euint8, euint32) => euint32 test 1 (39, 58691136)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(39n);
- input.add32(58691136n);
+ it('test operator "and" overload (euint16, euint16) => euint16 test 1 (25969, 38750)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(25969n);
+ input.add16(38750n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.and_euint8_euint32(
+ const tx = await this.contract4.and_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(0n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(1360n);
});
- it('test operator "and" overload (euint8, euint32) => euint32 test 2 (35, 39)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(35n);
- input.add32(39n);
+ it('test operator "and" overload (euint16, euint16) => euint16 test 2 (25965, 25969)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(25965n);
+ input.add16(25969n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.and_euint8_euint32(
+ const tx = await this.contract4.and_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(35n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(25953n);
});
- it('test operator "and" overload (euint8, euint32) => euint32 test 3 (39, 39)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(39n);
- input.add32(39n);
+ it('test operator "and" overload (euint16, euint16) => euint16 test 3 (25969, 25969)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(25969n);
+ input.add16(25969n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.and_euint8_euint32(
+ const tx = await this.contract4.and_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(39n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(25969n);
});
- it('test operator "and" overload (euint8, euint32) => euint32 test 4 (39, 35)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(39n);
- input.add32(35n);
+ it('test operator "and" overload (euint16, euint16) => euint16 test 4 (25969, 25965)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(25969n);
+ input.add16(25965n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.and_euint8_euint32(
+ const tx = await this.contract4.and_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(35n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(25953n);
});
- it('test operator "or" overload (euint8, euint32) => euint32 test 1 (99, 1264632675)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(99n);
- input.add32(1264632675n);
+ it('test operator "or" overload (euint16, euint16) => euint16 test 1 (41436, 37567)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(41436n);
+ input.add16(37567n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.or_euint8_euint32(
+ const tx = await this.contract4.or_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(1264632675n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(46079n);
});
- it('test operator "or" overload (euint8, euint32) => euint32 test 2 (95, 99)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(95n);
- input.add32(99n);
+ it('test operator "or" overload (euint16, euint16) => euint16 test 2 (37563, 37567)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(37563n);
+ input.add16(37567n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.or_euint8_euint32(
+ const tx = await this.contract4.or_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(127n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(37567n);
});
- it('test operator "or" overload (euint8, euint32) => euint32 test 3 (99, 99)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(99n);
- input.add32(99n);
+ it('test operator "or" overload (euint16, euint16) => euint16 test 3 (37567, 37567)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(37567n);
+ input.add16(37567n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.or_euint8_euint32(
+ const tx = await this.contract4.or_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(99n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(37567n);
});
- it('test operator "or" overload (euint8, euint32) => euint32 test 4 (99, 95)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(99n);
- input.add32(95n);
+ it('test operator "or" overload (euint16, euint16) => euint16 test 4 (37567, 37563)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(37567n);
+ input.add16(37563n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.or_euint8_euint32(
+ const tx = await this.contract4.or_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(127n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(37567n);
});
- it('test operator "xor" overload (euint8, euint32) => euint32 test 1 (184, 3590065955)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(184n);
- input.add32(3590065955n);
+ it('test operator "xor" overload (euint16, euint16) => euint16 test 1 (65327, 25546)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(65327n);
+ input.add16(25546n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.xor_euint8_euint32(
+ const tx = await this.contract4.xor_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(3590066075n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(40165n);
});
- it('test operator "xor" overload (euint8, euint32) => euint32 test 2 (180, 184)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(180n);
- input.add32(184n);
+ it('test operator "xor" overload (euint16, euint16) => euint16 test 2 (25542, 25546)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(25542n);
+ input.add16(25546n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.xor_euint8_euint32(
+ const tx = await this.contract4.xor_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
+ const res = await decrypt16(await this.contract4.res16());
expect(res).to.equal(12n);
});
- it('test operator "xor" overload (euint8, euint32) => euint32 test 3 (184, 184)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(184n);
- input.add32(184n);
+ it('test operator "xor" overload (euint16, euint16) => euint16 test 3 (25546, 25546)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(25546n);
+ input.add16(25546n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.xor_euint8_euint32(
+ const tx = await this.contract4.xor_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
+ const res = await decrypt16(await this.contract4.res16());
expect(res).to.equal(0n);
});
- it('test operator "xor" overload (euint8, euint32) => euint32 test 4 (184, 180)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(184n);
- input.add32(180n);
+ it('test operator "xor" overload (euint16, euint16) => euint16 test 4 (25546, 25542)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(25546n);
+ input.add16(25542n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.xor_euint8_euint32(
+ const tx = await this.contract4.xor_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
+ const res = await decrypt16(await this.contract4.res16());
expect(res).to.equal(12n);
});
- it('test operator "eq" overload (euint8, euint32) => ebool test 1 (110, 224862953)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(110n);
- input.add32(224862953n);
+ it('test operator "eq" overload (euint16, euint16) => ebool test 1 (45930, 43845)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(45930n);
+ input.add16(43845n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_euint32(
+ const tx = await this.contract4.eq_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint8, euint32) => ebool test 2 (106, 110)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(106n);
- input.add32(110n);
+ it('test operator "eq" overload (euint16, euint16) => ebool test 2 (43841, 43845)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(43841n);
+ input.add16(43845n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_euint32(
+ const tx = await this.contract4.eq_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint8, euint32) => ebool test 3 (110, 110)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(110n);
- input.add32(110n);
+ it('test operator "eq" overload (euint16, euint16) => ebool test 3 (43845, 43845)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(43845n);
+ input.add16(43845n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_euint32(
+ const tx = await this.contract4.eq_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint8, euint32) => ebool test 4 (110, 106)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(110n);
- input.add32(106n);
+ it('test operator "eq" overload (euint16, euint16) => ebool test 4 (43845, 43841)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(43845n);
+ input.add16(43841n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_euint32(
+ const tx = await this.contract4.eq_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint8, euint32) => ebool test 1 (189, 472792825)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(189n);
- input.add32(472792825n);
+ it('test operator "ne" overload (euint16, euint16) => ebool test 1 (16378, 60161)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(16378n);
+ input.add16(60161n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_euint32(
+ const tx = await this.contract4.ne_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint8, euint32) => ebool test 2 (185, 189)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(185n);
- input.add32(189n);
+ it('test operator "ne" overload (euint16, euint16) => ebool test 2 (16374, 16378)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(16374n);
+ input.add16(16378n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_euint32(
+ const tx = await this.contract4.ne_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint8, euint32) => ebool test 3 (189, 189)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(189n);
- input.add32(189n);
+ it('test operator "ne" overload (euint16, euint16) => ebool test 3 (16378, 16378)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(16378n);
+ input.add16(16378n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_euint32(
+ const tx = await this.contract4.ne_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint8, euint32) => ebool test 4 (189, 185)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(189n);
- input.add32(185n);
+ it('test operator "ne" overload (euint16, euint16) => ebool test 4 (16378, 16374)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(16378n);
+ input.add16(16374n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_euint32(
+ const tx = await this.contract4.ne_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint8, euint32) => ebool test 1 (222, 4025894176)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(222n);
- input.add32(4025894176n);
+ it('test operator "ge" overload (euint16, euint16) => ebool test 1 (51651, 13068)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(51651n);
+ input.add16(13068n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_euint32(
+ const tx = await this.contract4.ge_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint8, euint32) => ebool test 2 (218, 222)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(218n);
- input.add32(222n);
+ it('test operator "ge" overload (euint16, euint16) => ebool test 2 (13064, 13068)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(13064n);
+ input.add16(13068n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_euint32(
+ const tx = await this.contract4.ge_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint8, euint32) => ebool test 3 (222, 222)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(222n);
- input.add32(222n);
+ it('test operator "ge" overload (euint16, euint16) => ebool test 3 (13068, 13068)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(13068n);
+ input.add16(13068n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_euint32(
+ const tx = await this.contract4.ge_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint8, euint32) => ebool test 4 (222, 218)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(222n);
- input.add32(218n);
+ it('test operator "ge" overload (euint16, euint16) => ebool test 4 (13068, 13064)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(13068n);
+ input.add16(13064n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_euint32(
+ const tx = await this.contract4.ge_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint8, euint32) => ebool test 1 (193, 1536979513)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(193n);
- input.add32(1536979513n);
+ it('test operator "gt" overload (euint16, euint16) => ebool test 1 (49523, 63498)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(49523n);
+ input.add16(63498n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_euint32(
+ const tx = await this.contract4.gt_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint8, euint32) => ebool test 2 (189, 193)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(189n);
- input.add32(193n);
+ it('test operator "gt" overload (euint16, euint16) => ebool test 2 (49519, 49523)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(49519n);
+ input.add16(49523n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_euint32(
+ const tx = await this.contract4.gt_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint8, euint32) => ebool test 3 (193, 193)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(193n);
- input.add32(193n);
+ it('test operator "gt" overload (euint16, euint16) => ebool test 3 (49523, 49523)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(49523n);
+ input.add16(49523n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_euint32(
+ const tx = await this.contract4.gt_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint8, euint32) => ebool test 4 (193, 189)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(193n);
- input.add32(189n);
+ it('test operator "gt" overload (euint16, euint16) => ebool test 4 (49523, 49519)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(49523n);
+ input.add16(49519n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_euint32(
+ const tx = await this.contract4.gt_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint8, euint32) => ebool test 1 (217, 193633124)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(217n);
- input.add32(193633124n);
+ it('test operator "le" overload (euint16, euint16) => ebool test 1 (20803, 873)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(20803n);
+ input.add16(873n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_euint32(
+ const tx = await this.contract4.le_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
});
- it('test operator "le" overload (euint8, euint32) => ebool test 2 (213, 217)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(213n);
- input.add32(217n);
+ it('test operator "le" overload (euint16, euint16) => ebool test 2 (869, 873)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(869n);
+ input.add16(873n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_euint32(
+ const tx = await this.contract4.le_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint8, euint32) => ebool test 3 (217, 217)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(217n);
- input.add32(217n);
+ it('test operator "le" overload (euint16, euint16) => ebool test 3 (873, 873)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(873n);
+ input.add16(873n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_euint32(
+ const tx = await this.contract4.le_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint8, euint32) => ebool test 4 (217, 213)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(217n);
- input.add32(213n);
+ it('test operator "le" overload (euint16, euint16) => ebool test 4 (873, 869)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(873n);
+ input.add16(869n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_euint32(
+ const tx = await this.contract4.le_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint8, euint32) => ebool test 1 (97, 73387652)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(97n);
- input.add32(73387652n);
+ it('test operator "lt" overload (euint16, euint16) => ebool test 1 (34482, 5146)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(34482n);
+ input.add16(5146n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_euint32(
+ const tx = await this.contract4.lt_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint8, euint32) => ebool test 2 (93, 97)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(93n);
- input.add32(97n);
+ it('test operator "lt" overload (euint16, euint16) => ebool test 2 (5142, 5146)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(5142n);
+ input.add16(5146n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_euint32(
+ const tx = await this.contract4.lt_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint8, euint32) => ebool test 3 (97, 97)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(97n);
- input.add32(97n);
+ it('test operator "lt" overload (euint16, euint16) => ebool test 3 (5146, 5146)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(5146n);
+ input.add16(5146n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_euint32(
+ const tx = await this.contract4.lt_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint8, euint32) => ebool test 4 (97, 93)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(97n);
- input.add32(93n);
+ it('test operator "lt" overload (euint16, euint16) => ebool test 4 (5146, 5142)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(5146n);
+ input.add16(5142n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_euint32(
+ const tx = await this.contract4.lt_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "min" overload (euint8, euint32) => euint32 test 1 (47, 1833760772)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(47n);
- input.add32(1833760772n);
+ it('test operator "min" overload (euint16, euint16) => euint16 test 1 (32718, 8269)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(32718n);
+ input.add16(8269n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_euint32(
+ const tx = await this.contract4.min_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(47n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(8269n);
});
- it('test operator "min" overload (euint8, euint32) => euint32 test 2 (43, 47)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(43n);
- input.add32(47n);
+ it('test operator "min" overload (euint16, euint16) => euint16 test 2 (8265, 8269)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(8265n);
+ input.add16(8269n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_euint32(
+ const tx = await this.contract4.min_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(43n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(8265n);
});
- it('test operator "min" overload (euint8, euint32) => euint32 test 3 (47, 47)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(47n);
- input.add32(47n);
+ it('test operator "min" overload (euint16, euint16) => euint16 test 3 (8269, 8269)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(8269n);
+ input.add16(8269n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_euint32(
+ const tx = await this.contract4.min_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(47n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(8269n);
});
- it('test operator "min" overload (euint8, euint32) => euint32 test 4 (47, 43)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(47n);
- input.add32(43n);
+ it('test operator "min" overload (euint16, euint16) => euint16 test 4 (8269, 8265)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(8269n);
+ input.add16(8265n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_euint32(
+ const tx = await this.contract4.min_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(43n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(8265n);
});
- it('test operator "max" overload (euint8, euint32) => euint32 test 1 (103, 990460263)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(103n);
- input.add32(990460263n);
+ it('test operator "max" overload (euint16, euint16) => euint16 test 1 (37775, 22432)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(37775n);
+ input.add16(22432n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_euint32(
+ const tx = await this.contract4.max_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(990460263n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(37775n);
});
- it('test operator "max" overload (euint8, euint32) => euint32 test 2 (99, 103)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(99n);
- input.add32(103n);
+ it('test operator "max" overload (euint16, euint16) => euint16 test 2 (22428, 22432)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(22428n);
+ input.add16(22432n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_euint32(
+ const tx = await this.contract4.max_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(103n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(22432n);
});
- it('test operator "max" overload (euint8, euint32) => euint32 test 3 (103, 103)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(103n);
- input.add32(103n);
+ it('test operator "max" overload (euint16, euint16) => euint16 test 3 (22432, 22432)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(22432n);
+ input.add16(22432n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_euint32(
+ const tx = await this.contract4.max_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(103n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(22432n);
});
- it('test operator "max" overload (euint8, euint32) => euint32 test 4 (103, 99)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(103n);
- input.add32(99n);
+ it('test operator "max" overload (euint16, euint16) => euint16 test 4 (22432, 22428)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(22432n);
+ input.add16(22428n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_euint32(
+ const tx = await this.contract4.max_euint16_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract2.res32());
- expect(res).to.equal(103n);
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(22432n);
});
- it('test operator "add" overload (euint8, euint64) => euint64 test 1 (2, 129)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(2n);
- input.add64(129n);
+ it('test operator "add" overload (euint16, euint32) => euint32 test 1 (2, 52896)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(2n);
+ input.add32(52896n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint8_euint64(
+ const tx = await this.contract4.add_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(131n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(52898n);
});
- it('test operator "add" overload (euint8, euint64) => euint64 test 2 (12, 16)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(12n);
- input.add64(16n);
+ it('test operator "add" overload (euint16, euint32) => euint32 test 2 (19184, 19188)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(19184n);
+ input.add32(19188n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint8_euint64(
+ const tx = await this.contract4.add_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(28n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(38372n);
});
- it('test operator "add" overload (euint8, euint64) => euint64 test 3 (16, 16)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(16n);
- input.add64(16n);
+ it('test operator "add" overload (euint16, euint32) => euint32 test 3 (19188, 19188)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(19188n);
+ input.add32(19188n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint8_euint64(
+ const tx = await this.contract4.add_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(32n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(38376n);
});
- it('test operator "add" overload (euint8, euint64) => euint64 test 4 (16, 12)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(16n);
- input.add64(12n);
+ it('test operator "add" overload (euint16, euint32) => euint32 test 4 (19188, 19184)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(19188n);
+ input.add32(19184n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint8_euint64(
+ const tx = await this.contract4.add_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(28n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(38372n);
});
- it('test operator "sub" overload (euint8, euint64) => euint64 test 1 (15, 15)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(15n);
- input.add64(15n);
+ it('test operator "sub" overload (euint16, euint32) => euint32 test 1 (32818, 32818)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(32818n);
+ input.add32(32818n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.sub_euint8_euint64(
+ const tx = await this.contract4.sub_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
+ const res = await decrypt32(await this.contract4.res32());
expect(res).to.equal(0n);
});
- it('test operator "sub" overload (euint8, euint64) => euint64 test 2 (15, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(15n);
- input.add64(11n);
+ it('test operator "sub" overload (euint16, euint32) => euint32 test 2 (32818, 32814)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(32818n);
+ input.add32(32814n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.sub_euint8_euint64(
+ const tx = await this.contract4.sub_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
+ const res = await decrypt32(await this.contract4.res32());
expect(res).to.equal(4n);
});
- it('test operator "mul" overload (euint8, euint64) => euint64 test 1 (2, 65)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(2n);
- input.add64(65n);
+ it('test operator "mul" overload (euint16, euint32) => euint32 test 1 (2, 27164)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(2n);
+ input.add32(27164n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint8_euint64(
+ const tx = await this.contract4.mul_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(130n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(54328n);
});
- it('test operator "mul" overload (euint8, euint64) => euint64 test 2 (13, 13)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(13n);
- input.add64(13n);
+ it('test operator "mul" overload (euint16, euint32) => euint32 test 2 (244, 244)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(244n);
+ input.add32(244n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint8_euint64(
+ const tx = await this.contract4.mul_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(169n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(59536n);
});
- it('test operator "mul" overload (euint8, euint64) => euint64 test 3 (13, 13)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(13n);
- input.add64(13n);
+ it('test operator "mul" overload (euint16, euint32) => euint32 test 3 (244, 244)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(244n);
+ input.add32(244n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint8_euint64(
+ const tx = await this.contract4.mul_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(169n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(59536n);
});
- it('test operator "mul" overload (euint8, euint64) => euint64 test 4 (13, 13)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(13n);
- input.add64(13n);
+ it('test operator "mul" overload (euint16, euint32) => euint32 test 4 (244, 244)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(244n);
+ input.add32(244n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint8_euint64(
+ const tx = await this.contract4.mul_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(169n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(59536n);
});
- it('test operator "and" overload (euint8, euint64) => euint64 test 1 (62, 18441742416037218435)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(62n);
- input.add64(18441742416037218435n);
+ it('test operator "and" overload (euint16, euint32) => euint32 test 1 (10444, 4022047212)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(10444n);
+ input.add32(4022047212n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.and_euint8_euint64(
+ const tx = await this.contract4.and_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(2n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(204n);
});
- it('test operator "and" overload (euint8, euint64) => euint64 test 2 (58, 62)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(58n);
- input.add64(62n);
+ it('test operator "and" overload (euint16, euint32) => euint32 test 2 (10440, 10444)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(10440n);
+ input.add32(10444n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.and_euint8_euint64(
+ const tx = await this.contract4.and_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(58n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(10440n);
});
- it('test operator "and" overload (euint8, euint64) => euint64 test 3 (62, 62)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(62n);
- input.add64(62n);
+ it('test operator "and" overload (euint16, euint32) => euint32 test 3 (10444, 10444)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(10444n);
+ input.add32(10444n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.and_euint8_euint64(
+ const tx = await this.contract4.and_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(62n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(10444n);
});
- it('test operator "and" overload (euint8, euint64) => euint64 test 4 (62, 58)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(62n);
- input.add64(58n);
+ it('test operator "and" overload (euint16, euint32) => euint32 test 4 (10444, 10440)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(10444n);
+ input.add32(10440n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.and_euint8_euint64(
+ const tx = await this.contract4.and_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(58n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(10440n);
});
- it('test operator "or" overload (euint8, euint64) => euint64 test 1 (66, 18439693911625769587)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(66n);
- input.add64(18439693911625769587n);
+ it('test operator "or" overload (euint16, euint32) => euint32 test 1 (36595, 3887874863)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(36595n);
+ input.add32(3887874863n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.or_euint8_euint64(
+ const tx = await this.contract4.or_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(18439693911625769587n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(3887910911n);
});
- it('test operator "or" overload (euint8, euint64) => euint64 test 2 (62, 66)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(62n);
- input.add64(66n);
+ it('test operator "or" overload (euint16, euint32) => euint32 test 2 (36591, 36595)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(36591n);
+ input.add32(36595n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.or_euint8_euint64(
+ const tx = await this.contract4.or_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(126n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(36607n);
});
- it('test operator "or" overload (euint8, euint64) => euint64 test 3 (66, 66)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(66n);
- input.add64(66n);
+ it('test operator "or" overload (euint16, euint32) => euint32 test 3 (36595, 36595)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(36595n);
+ input.add32(36595n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.or_euint8_euint64(
+ const tx = await this.contract4.or_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(66n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(36595n);
});
- it('test operator "or" overload (euint8, euint64) => euint64 test 4 (66, 62)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(66n);
- input.add64(62n);
+ it('test operator "or" overload (euint16, euint32) => euint32 test 4 (36595, 36591)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(36595n);
+ input.add32(36591n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.or_euint8_euint64(
+ const tx = await this.contract4.or_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(126n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(36607n);
});
- it('test operator "xor" overload (euint8, euint64) => euint64 test 1 (212, 18437987864856647089)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(212n);
- input.add64(18437987864856647089n);
+ it('test operator "xor" overload (euint16, euint32) => euint32 test 1 (23121, 1351735572)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(23121n);
+ input.add32(1351735572n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.xor_euint8_euint64(
+ const tx = await this.contract4.xor_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(18437987864856647013n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(1351713605n);
});
- it('test operator "xor" overload (euint8, euint64) => euint64 test 2 (208, 212)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(208n);
- input.add64(212n);
+ it('test operator "xor" overload (euint16, euint32) => euint32 test 2 (23117, 23121)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(23117n);
+ input.add32(23121n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.xor_euint8_euint64(
+ const tx = await this.contract4.xor_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(4n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(28n);
});
- it('test operator "xor" overload (euint8, euint64) => euint64 test 3 (212, 212)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(212n);
- input.add64(212n);
+ it('test operator "xor" overload (euint16, euint32) => euint32 test 3 (23121, 23121)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(23121n);
+ input.add32(23121n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.xor_euint8_euint64(
+ const tx = await this.contract4.xor_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
+ const res = await decrypt32(await this.contract4.res32());
expect(res).to.equal(0n);
});
- it('test operator "xor" overload (euint8, euint64) => euint64 test 4 (212, 208)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(212n);
- input.add64(208n);
+ it('test operator "xor" overload (euint16, euint32) => euint32 test 4 (23121, 23117)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(23121n);
+ input.add32(23117n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.xor_euint8_euint64(
+ const tx = await this.contract4.xor_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(4n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(28n);
});
- it('test operator "eq" overload (euint8, euint64) => ebool test 1 (151, 18441484264494857597)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(151n);
- input.add64(18441484264494857597n);
+ it('test operator "eq" overload (euint16, euint32) => ebool test 1 (14585, 2487581396)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(14585n);
+ input.add32(2487581396n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_euint64(
+ const tx = await this.contract4.eq_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint8, euint64) => ebool test 2 (147, 151)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(147n);
- input.add64(151n);
+ it('test operator "eq" overload (euint16, euint32) => ebool test 2 (14581, 14585)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(14581n);
+ input.add32(14585n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_euint64(
+ const tx = await this.contract4.eq_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint8, euint64) => ebool test 3 (151, 151)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(151n);
- input.add64(151n);
+ it('test operator "eq" overload (euint16, euint32) => ebool test 3 (14585, 14585)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(14585n);
+ input.add32(14585n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_euint64(
+ const tx = await this.contract4.eq_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint8, euint64) => ebool test 4 (151, 147)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(151n);
- input.add64(147n);
+ it('test operator "eq" overload (euint16, euint32) => ebool test 4 (14585, 14581)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(14585n);
+ input.add32(14581n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_euint64(
+ const tx = await this.contract4.eq_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint8, euint64) => ebool test 1 (174, 18439836363494569405)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(174n);
- input.add64(18439836363494569405n);
+ it('test operator "ne" overload (euint16, euint32) => ebool test 1 (30095, 2933999842)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(30095n);
+ input.add32(2933999842n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_euint64(
+ const tx = await this.contract4.ne_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint8, euint64) => ebool test 2 (170, 174)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(170n);
- input.add64(174n);
+ it('test operator "ne" overload (euint16, euint32) => ebool test 2 (30091, 30095)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(30091n);
+ input.add32(30095n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_euint64(
+ const tx = await this.contract4.ne_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint8, euint64) => ebool test 3 (174, 174)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(174n);
- input.add64(174n);
+ it('test operator "ne" overload (euint16, euint32) => ebool test 3 (30095, 30095)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(30095n);
+ input.add32(30095n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_euint64(
+ const tx = await this.contract4.ne_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint8, euint64) => ebool test 4 (174, 170)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(174n);
- input.add64(170n);
+ it('test operator "ne" overload (euint16, euint32) => ebool test 4 (30095, 30091)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(30095n);
+ input.add32(30091n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_euint64(
+ const tx = await this.contract4.ne_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint8, euint64) => ebool test 1 (201, 18443640492228529453)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(201n);
- input.add64(18443640492228529453n);
+ it('test operator "ge" overload (euint16, euint32) => ebool test 1 (63432, 458410498)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(63432n);
+ input.add32(458410498n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_euint64(
+ const tx = await this.contract4.ge_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint8, euint64) => ebool test 2 (197, 201)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(197n);
- input.add64(201n);
+ it('test operator "ge" overload (euint16, euint32) => ebool test 2 (63428, 63432)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(63428n);
+ input.add32(63432n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_euint64(
+ const tx = await this.contract4.ge_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint8, euint64) => ebool test 3 (201, 201)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(201n);
- input.add64(201n);
+ it('test operator "ge" overload (euint16, euint32) => ebool test 3 (63432, 63432)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(63432n);
+ input.add32(63432n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_euint64(
+ const tx = await this.contract4.ge_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint8, euint64) => ebool test 4 (201, 197)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(201n);
- input.add64(197n);
+ it('test operator "ge" overload (euint16, euint32) => ebool test 4 (63432, 63428)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(63432n);
+ input.add32(63428n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_euint64(
+ const tx = await this.contract4.ge_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint8, euint64) => ebool test 1 (237, 18441103586480031265)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(237n);
- input.add64(18441103586480031265n);
+ it('test operator "gt" overload (euint16, euint32) => ebool test 1 (8095, 1426308540)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(8095n);
+ input.add32(1426308540n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_euint64(
+ const tx = await this.contract4.gt_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint8, euint64) => ebool test 2 (233, 237)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(233n);
- input.add64(237n);
+ it('test operator "gt" overload (euint16, euint32) => ebool test 2 (8091, 8095)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(8091n);
+ input.add32(8095n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_euint64(
+ const tx = await this.contract4.gt_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint8, euint64) => ebool test 3 (237, 237)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(237n);
- input.add64(237n);
+ it('test operator "gt" overload (euint16, euint32) => ebool test 3 (8095, 8095)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(8095n);
+ input.add32(8095n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_euint64(
+ const tx = await this.contract4.gt_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint8, euint64) => ebool test 4 (237, 233)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(237n);
- input.add64(233n);
+ it('test operator "gt" overload (euint16, euint32) => ebool test 4 (8095, 8091)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(8095n);
+ input.add32(8091n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_euint64(
+ const tx = await this.contract4.gt_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint8, euint64) => ebool test 1 (18, 18442364533783886901)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(18n);
- input.add64(18442364533783886901n);
+ it('test operator "le" overload (euint16, euint32) => ebool test 1 (44937, 2020262580)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(44937n);
+ input.add32(2020262580n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_euint64(
+ const tx = await this.contract4.le_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint8, euint64) => ebool test 2 (14, 18)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(14n);
- input.add64(18n);
+ it('test operator "le" overload (euint16, euint32) => ebool test 2 (44933, 44937)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(44933n);
+ input.add32(44937n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_euint64(
+ const tx = await this.contract4.le_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint8, euint64) => ebool test 3 (18, 18)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(18n);
- input.add64(18n);
+ it('test operator "le" overload (euint16, euint32) => ebool test 3 (44937, 44937)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(44937n);
+ input.add32(44937n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_euint64(
+ const tx = await this.contract4.le_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint8, euint64) => ebool test 4 (18, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(18n);
- input.add64(14n);
+ it('test operator "le" overload (euint16, euint32) => ebool test 4 (44937, 44933)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(44937n);
+ input.add32(44933n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_euint64(
+ const tx = await this.contract4.le_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint8, euint64) => ebool test 1 (1, 18442662886837590601)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(1n);
- input.add64(18442662886837590601n);
+ it('test operator "lt" overload (euint16, euint32) => ebool test 1 (31744, 3296344536)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(31744n);
+ input.add32(3296344536n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_euint64(
+ const tx = await this.contract4.lt_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint8, euint64) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(4n);
- input.add64(8n);
+ it('test operator "lt" overload (euint16, euint32) => ebool test 2 (31740, 31744)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(31740n);
+ input.add32(31744n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_euint64(
+ const tx = await this.contract4.lt_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint8, euint64) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(8n);
- input.add64(8n);
+ it('test operator "lt" overload (euint16, euint32) => ebool test 3 (31744, 31744)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(31744n);
+ input.add32(31744n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_euint64(
+ const tx = await this.contract4.lt_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint8, euint64) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(8n);
- input.add64(4n);
+ it('test operator "lt" overload (euint16, euint32) => ebool test 4 (31744, 31740)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(31744n);
+ input.add32(31740n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_euint64(
+ const tx = await this.contract4.lt_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "min" overload (euint8, euint64) => euint64 test 1 (240, 18439345293201198903)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(240n);
- input.add64(18439345293201198903n);
+ it('test operator "min" overload (euint16, euint32) => euint32 test 1 (8199, 2465008600)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(8199n);
+ input.add32(2465008600n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_euint64(
+ const tx = await this.contract4.min_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(240n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(8199n);
});
- it('test operator "min" overload (euint8, euint64) => euint64 test 2 (236, 240)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(236n);
- input.add64(240n);
+ it('test operator "min" overload (euint16, euint32) => euint32 test 2 (8195, 8199)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(8195n);
+ input.add32(8199n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_euint64(
+ const tx = await this.contract4.min_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(236n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(8195n);
});
- it('test operator "min" overload (euint8, euint64) => euint64 test 3 (240, 240)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(240n);
- input.add64(240n);
+ it('test operator "min" overload (euint16, euint32) => euint32 test 3 (8199, 8199)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(8199n);
+ input.add32(8199n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_euint64(
+ const tx = await this.contract4.min_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(240n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(8199n);
});
- it('test operator "min" overload (euint8, euint64) => euint64 test 4 (240, 236)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(240n);
- input.add64(236n);
+ it('test operator "min" overload (euint16, euint32) => euint32 test 4 (8199, 8195)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(8199n);
+ input.add32(8195n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_euint64(
+ const tx = await this.contract4.min_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(236n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(8195n);
});
- it('test operator "max" overload (euint8, euint64) => euint64 test 1 (180, 18445785341899355785)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(180n);
- input.add64(18445785341899355785n);
+ it('test operator "max" overload (euint16, euint32) => euint32 test 1 (6434, 2918687585)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(6434n);
+ input.add32(2918687585n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_euint64(
+ const tx = await this.contract4.max_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(18445785341899355785n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(2918687585n);
});
- it('test operator "max" overload (euint8, euint64) => euint64 test 2 (176, 180)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(176n);
- input.add64(180n);
+ it('test operator "max" overload (euint16, euint32) => euint32 test 2 (6430, 6434)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(6430n);
+ input.add32(6434n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_euint64(
+ const tx = await this.contract4.max_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(180n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(6434n);
});
- it('test operator "max" overload (euint8, euint64) => euint64 test 3 (180, 180)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(180n);
- input.add64(180n);
+ it('test operator "max" overload (euint16, euint32) => euint32 test 3 (6434, 6434)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(6434n);
+ input.add32(6434n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_euint64(
+ const tx = await this.contract4.max_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(180n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(6434n);
});
- it('test operator "max" overload (euint8, euint64) => euint64 test 4 (180, 176)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(180n);
- input.add64(176n);
+ it('test operator "max" overload (euint16, euint32) => euint32 test 4 (6434, 6430)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(6434n);
+ input.add32(6430n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_euint64(
+ const tx = await this.contract4.max_euint16_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract2.res64());
- expect(res).to.equal(180n);
+ const res = await decrypt32(await this.contract4.res32());
+ expect(res).to.equal(6434n);
});
- it('test operator "add" overload (euint8, uint8) => euint8 test 1 (56, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(56n);
-
+ it('test operator "add" overload (euint16, euint64) => euint64 test 1 (2, 65506)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(2n);
+ input.add64(65506n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint8_uint8(encryptedAmount.handles[0], 11n, encryptedAmount.inputProof);
+ const tx = await this.contract4.add_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(67n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(65508n);
});
- it('test operator "add" overload (euint8, uint8) => euint8 test 2 (52, 56)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(52n);
-
+ it('test operator "add" overload (euint16, euint64) => euint64 test 2 (32347, 32349)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(32347n);
+ input.add64(32349n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint8_uint8(encryptedAmount.handles[0], 56n, encryptedAmount.inputProof);
+ const tx = await this.contract4.add_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(108n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(64696n);
});
- it('test operator "add" overload (euint8, uint8) => euint8 test 3 (56, 56)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(56n);
-
+ it('test operator "add" overload (euint16, euint64) => euint64 test 3 (32349, 32349)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(32349n);
+ input.add64(32349n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint8_uint8(encryptedAmount.handles[0], 56n, encryptedAmount.inputProof);
+ const tx = await this.contract4.add_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(112n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(64698n);
});
- it('test operator "add" overload (euint8, uint8) => euint8 test 4 (56, 52)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(56n);
-
+ it('test operator "add" overload (euint16, euint64) => euint64 test 4 (32349, 32347)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(32349n);
+ input.add64(32347n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint8_uint8(encryptedAmount.handles[0], 52n, encryptedAmount.inputProof);
+ const tx = await this.contract4.add_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(108n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(64696n);
});
- it('test operator "add" overload (uint8, euint8) => euint8 test 1 (69, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
-
- input.add8(11n);
+ it('test operator "sub" overload (euint16, euint64) => euint64 test 1 (12596, 12596)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(12596n);
+ input.add64(12596n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_uint8_euint8(69n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract4.sub_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(80n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(0n);
});
- it('test operator "add" overload (uint8, euint8) => euint8 test 2 (52, 56)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
-
- input.add8(56n);
+ it('test operator "sub" overload (euint16, euint64) => euint64 test 2 (12596, 12592)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(12596n);
+ input.add64(12592n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_uint8_euint8(52n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract4.sub_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(108n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(4n);
});
- it('test operator "add" overload (uint8, euint8) => euint8 test 3 (56, 56)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
-
- input.add8(56n);
+ it('test operator "mul" overload (euint16, euint64) => euint64 test 1 (2, 32755)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(2n);
+ input.add64(32755n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_uint8_euint8(56n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract4.mul_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(112n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(65510n);
});
- it('test operator "add" overload (uint8, euint8) => euint8 test 4 (56, 52)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
-
- input.add8(52n);
+ it('test operator "mul" overload (euint16, euint64) => euint64 test 2 (216, 216)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(216n);
+ input.add64(216n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_uint8_euint8(56n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract4.mul_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(108n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(46656n);
});
- it('test operator "sub" overload (euint8, uint8) => euint8 test 1 (64, 64)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(64n);
-
+ it('test operator "mul" overload (euint16, euint64) => euint64 test 3 (216, 216)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(216n);
+ input.add64(216n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.sub_euint8_uint8(encryptedAmount.handles[0], 64n, encryptedAmount.inputProof);
+ const tx = await this.contract4.mul_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(0n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(46656n);
});
- it('test operator "sub" overload (euint8, uint8) => euint8 test 2 (64, 60)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(64n);
-
+ it('test operator "mul" overload (euint16, euint64) => euint64 test 4 (216, 216)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(216n);
+ input.add64(216n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.sub_euint8_uint8(encryptedAmount.handles[0], 60n, encryptedAmount.inputProof);
+ const tx = await this.contract4.mul_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(4n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(46656n);
});
- it('test operator "sub" overload (uint8, euint8) => euint8 test 1 (64, 64)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
-
- input.add8(64n);
+ it('test operator "and" overload (euint16, euint64) => euint64 test 1 (46498, 18443921867836499841)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(46498n);
+ input.add64(18443921867836499841n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.sub_uint8_euint8(64n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract4.and_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(0n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(9600n);
});
- it('test operator "sub" overload (uint8, euint8) => euint8 test 2 (64, 60)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
-
- input.add8(60n);
+ it('test operator "and" overload (euint16, euint64) => euint64 test 2 (46494, 46498)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(46494n);
+ input.add64(46498n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.sub_uint8_euint8(64n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract4.and_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(4n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(46466n);
});
- it('test operator "mul" overload (euint8, uint8) => euint8 test 1 (8, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(8n);
-
+ it('test operator "and" overload (euint16, euint64) => euint64 test 3 (46498, 46498)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(46498n);
+ input.add64(46498n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint8_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof);
+ const tx = await this.contract4.and_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(112n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(46498n);
});
- it('test operator "mul" overload (euint8, uint8) => euint8 test 2 (14, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(14n);
-
+ it('test operator "and" overload (euint16, euint64) => euint64 test 4 (46498, 46494)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(46498n);
+ input.add64(46494n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint8_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof);
+ const tx = await this.contract4.and_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(196n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(46466n);
});
- it('test operator "mul" overload (euint8, uint8) => euint8 test 3 (14, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(14n);
-
+ it('test operator "or" overload (euint16, euint64) => euint64 test 1 (8318, 18443891473910549169)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(8318n);
+ input.add64(18443891473910549169n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint8_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof);
+ const tx = await this.contract4.or_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(196n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(18443891473910557439n);
});
- it('test operator "mul" overload (euint8, uint8) => euint8 test 4 (14, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(14n);
-
+ it('test operator "or" overload (euint16, euint64) => euint64 test 2 (8314, 8318)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(8314n);
+ input.add64(8318n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint8_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof);
+ const tx = await this.contract4.or_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(196n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(8318n);
});
- it('test operator "mul" overload (uint8, euint8) => euint8 test 1 (8, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
-
- input.add8(14n);
+ it('test operator "or" overload (euint16, euint64) => euint64 test 3 (8318, 8318)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(8318n);
+ input.add64(8318n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_uint8_euint8(8n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract4.or_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(112n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(8318n);
});
- it('test operator "mul" overload (uint8, euint8) => euint8 test 2 (14, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
-
- input.add8(14n);
+ it('test operator "or" overload (euint16, euint64) => euint64 test 4 (8318, 8314)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(8318n);
+ input.add64(8314n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_uint8_euint8(14n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract4.or_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(196n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(8318n);
});
- it('test operator "mul" overload (uint8, euint8) => euint8 test 3 (14, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
-
- input.add8(14n);
+ it('test operator "xor" overload (euint16, euint64) => euint64 test 1 (47675, 18446725910384356169)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(47675n);
+ input.add64(18446725910384356169n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_uint8_euint8(14n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract4.xor_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(196n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(18446725910384382322n);
});
- it('test operator "mul" overload (uint8, euint8) => euint8 test 4 (14, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
-
- input.add8(14n);
+ it('test operator "xor" overload (euint16, euint64) => euint64 test 2 (47671, 47675)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(47671n);
+ input.add64(47675n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_uint8_euint8(14n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract4.xor_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(196n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(12n);
});
- it('test operator "div" overload (euint8, uint8) => euint8 test 1 (168, 148)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(168n);
-
+ it('test operator "xor" overload (euint16, euint64) => euint64 test 3 (47675, 47675)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(47675n);
+ input.add64(47675n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.div_euint8_uint8(encryptedAmount.handles[0], 148n, encryptedAmount.inputProof);
+ const tx = await this.contract4.xor_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(1n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(0n);
});
- it('test operator "div" overload (euint8, uint8) => euint8 test 2 (164, 168)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(164n);
-
+ it('test operator "xor" overload (euint16, euint64) => euint64 test 4 (47675, 47671)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(47675n);
+ input.add64(47671n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.div_euint8_uint8(encryptedAmount.handles[0], 168n, encryptedAmount.inputProof);
+ const tx = await this.contract4.xor_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(0n);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(12n);
});
- it('test operator "div" overload (euint8, uint8) => euint8 test 3 (168, 168)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(168n);
-
+ it('test operator "eq" overload (euint16, euint64) => ebool test 1 (29419, 18446062766310773765)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(29419n);
+ input.add64(18446062766310773765n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.div_euint8_uint8(encryptedAmount.handles[0], 168n, encryptedAmount.inputProof);
+ const tx = await this.contract4.eq_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(1n);
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
});
- it('test operator "div" overload (euint8, uint8) => euint8 test 4 (168, 164)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(168n);
-
+ it('test operator "eq" overload (euint16, euint64) => ebool test 2 (29415, 29419)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(29415n);
+ input.add64(29419n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.div_euint8_uint8(encryptedAmount.handles[0], 164n, encryptedAmount.inputProof);
+ const tx = await this.contract4.eq_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(1n);
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
});
- it('test operator "rem" overload (euint8, uint8) => euint8 test 1 (225, 242)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(225n);
-
+ it('test operator "eq" overload (euint16, euint64) => ebool test 3 (29419, 29419)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(29419n);
+ input.add64(29419n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.rem_euint8_uint8(encryptedAmount.handles[0], 242n, encryptedAmount.inputProof);
+ const tx = await this.contract4.eq_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(225n);
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
});
- it('test operator "rem" overload (euint8, uint8) => euint8 test 2 (183, 187)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(183n);
-
+ it('test operator "eq" overload (euint16, euint64) => ebool test 4 (29419, 29415)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(29419n);
+ input.add64(29415n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.rem_euint8_uint8(encryptedAmount.handles[0], 187n, encryptedAmount.inputProof);
+ const tx = await this.contract4.eq_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(183n);
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
});
- it('test operator "rem" overload (euint8, uint8) => euint8 test 3 (187, 187)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(187n);
+ it('test operator "ne" overload (euint16, euint64) => ebool test 1 (9855, 18438572273104866201)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(9855n);
+ input.add64(18438572273104866201n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.ne_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+ it('test operator "ne" overload (euint16, euint64) => ebool test 2 (9851, 9855)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(9851n);
+ input.add64(9855n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.rem_euint8_uint8(encryptedAmount.handles[0], 187n, encryptedAmount.inputProof);
+ const tx = await this.contract4.ne_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(0n);
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
});
- it('test operator "rem" overload (euint8, uint8) => euint8 test 4 (187, 183)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(187n);
+ it('test operator "ne" overload (euint16, euint64) => ebool test 3 (9855, 9855)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(9855n);
+ input.add64(9855n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.ne_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+ it('test operator "ne" overload (euint16, euint64) => ebool test 4 (9855, 9851)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(9855n);
+ input.add64(9851n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.rem_euint8_uint8(encryptedAmount.handles[0], 183n, encryptedAmount.inputProof);
+ const tx = await this.contract4.ne_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(4n);
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
});
});
diff --git a/test/tfheOperations/tfheOperations5.ts b/test/tfheOperations/tfheOperations5.ts
index 652b9c57..8bdaf504 100644
--- a/test/tfheOperations/tfheOperations5.ts
+++ b/test/tfheOperations/tfheOperations5.ts
@@ -7,7 +7,22 @@ import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'
import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance';
+import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
+import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
+import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
+import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
+import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
+import {
+ createInstances,
+ decrypt4,
+ decrypt8,
+ decrypt16,
+ decrypt32,
+ decrypt64,
+ decrypt128,
+ decrypt256,
+ decryptBool,
+} from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
@@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise {
return contract;
}
+async function deployTfheTestFixture7(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite7');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture8(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite8');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture9(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite9');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture10(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite10');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture11(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite11');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
describe('TFHE operations 5', function () {
before(async function () {
await initSigners(1);
@@ -105,2271 +175,4183 @@ describe('TFHE operations 5', function () {
this.contract6Address = await contract6.getAddress();
this.contract6 = contract6;
+ const contract7 = await deployTfheTestFixture7();
+ this.contract7Address = await contract7.getAddress();
+ this.contract7 = contract7;
+
+ const contract8 = await deployTfheTestFixture8();
+ this.contract8Address = await contract8.getAddress();
+ this.contract8 = contract8;
+
+ const contract9 = await deployTfheTestFixture9();
+ this.contract9Address = await contract9.getAddress();
+ this.contract9 = contract9;
+
+ const contract10 = await deployTfheTestFixture10();
+ this.contract10Address = await contract10.getAddress();
+ this.contract10 = contract10;
+
+ const contract11 = await deployTfheTestFixture11();
+ this.contract11Address = await contract11.getAddress();
+ this.contract11 = contract11;
+
const instances = await createInstances(this.signers);
this.instances = instances;
});
- it('test operator "eq" overload (euint8, uint8) => ebool test 1 (51, 215)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(51n);
-
+ it('test operator "ge" overload (euint16, euint64) => ebool test 1 (14081, 18444389415407077285)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(14081n);
+ input.add64(18444389415407077285n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_uint8(encryptedAmount.handles[0], 215n, encryptedAmount.inputProof);
+ const tx = await this.contract4.ge_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint8, uint8) => ebool test 2 (47, 51)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(47n);
-
+ it('test operator "ge" overload (euint16, euint64) => ebool test 2 (14077, 14081)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(14077n);
+ input.add64(14081n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_uint8(encryptedAmount.handles[0], 51n, encryptedAmount.inputProof);
+ const tx = await this.contract4.ge_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint8, uint8) => ebool test 3 (51, 51)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(51n);
-
+ it('test operator "ge" overload (euint16, euint64) => ebool test 3 (14081, 14081)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(14081n);
+ input.add64(14081n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_uint8(encryptedAmount.handles[0], 51n, encryptedAmount.inputProof);
+ const tx = await this.contract4.ge_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint8, uint8) => ebool test 4 (51, 47)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(51n);
+ it('test operator "ge" overload (euint16, euint64) => ebool test 4 (14081, 14077)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(14081n);
+ input.add64(14077n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.ge_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+ it('test operator "gt" overload (euint16, euint64) => ebool test 1 (45007, 18445308410216818905)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(45007n);
+ input.add64(18445308410216818905n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint8_uint8(encryptedAmount.handles[0], 47n, encryptedAmount.inputProof);
+ const tx = await this.contract4.gt_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (uint8, euint8) => ebool test 1 (31, 215)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "gt" overload (euint16, euint64) => ebool test 2 (45003, 45007)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(45003n);
+ input.add64(45007n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.gt_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
- input.add8(215n);
+ it('test operator "gt" overload (euint16, euint64) => ebool test 3 (45007, 45007)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(45007n);
+ input.add64(45007n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_uint8_euint8(31n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract4.gt_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (uint8, euint8) => ebool test 2 (47, 51)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "gt" overload (euint16, euint64) => ebool test 4 (45007, 45003)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(45007n);
+ input.add64(45003n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.gt_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint16, euint64) => ebool test 1 (33530, 18441393339688273439)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(33530n);
+ input.add64(18441393339688273439n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.le_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint16, euint64) => ebool test 2 (33526, 33530)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(33526n);
+ input.add64(33530n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.le_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint16, euint64) => ebool test 3 (33530, 33530)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(33530n);
+ input.add64(33530n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.le_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
- input.add8(51n);
+ it('test operator "le" overload (euint16, euint64) => ebool test 4 (33530, 33526)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(33530n);
+ input.add64(33526n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_uint8_euint8(47n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract4.le_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (uint8, euint8) => ebool test 3 (51, 51)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "lt" overload (euint16, euint64) => ebool test 1 (7192, 18440977990475901673)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(7192n);
+ input.add64(18440977990475901673n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.lt_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
- input.add8(51n);
+ it('test operator "lt" overload (euint16, euint64) => ebool test 2 (7188, 7192)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(7188n);
+ input.add64(7192n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_uint8_euint8(51n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract4.lt_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(true);
});
- it('test operator "eq" overload (uint8, euint8) => ebool test 4 (51, 47)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "lt" overload (euint16, euint64) => ebool test 3 (7192, 7192)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(7192n);
+ input.add64(7192n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.lt_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
- input.add8(47n);
+ it('test operator "lt" overload (euint16, euint64) => ebool test 4 (7192, 7188)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(7192n);
+ input.add64(7188n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_uint8_euint8(51n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract4.lt_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract4.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint8, uint8) => ebool test 1 (236, 213)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(236n);
+ it('test operator "min" overload (euint16, euint64) => euint64 test 1 (64768, 18439640713575288835)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(64768n);
+ input.add64(18439640713575288835n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.min_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(64768n);
+ });
+ it('test operator "min" overload (euint16, euint64) => euint64 test 2 (64764, 64768)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(64764n);
+ input.add64(64768n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_uint8(encryptedAmount.handles[0], 213n, encryptedAmount.inputProof);
+ const tx = await this.contract4.min_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(64764n);
});
- it('test operator "ne" overload (euint8, uint8) => ebool test 2 (22, 26)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(22n);
+ it('test operator "min" overload (euint16, euint64) => euint64 test 3 (64768, 64768)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(64768n);
+ input.add64(64768n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.min_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(64768n);
+ });
+ it('test operator "min" overload (euint16, euint64) => euint64 test 4 (64768, 64764)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(64768n);
+ input.add64(64764n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_uint8(encryptedAmount.handles[0], 26n, encryptedAmount.inputProof);
+ const tx = await this.contract4.min_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(64764n);
});
- it('test operator "ne" overload (euint8, uint8) => ebool test 3 (26, 26)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(26n);
+ it('test operator "max" overload (euint16, euint64) => euint64 test 1 (43725, 18443087667786395005)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(43725n);
+ input.add64(18443087667786395005n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.max_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(18443087667786395005n);
+ });
+ it('test operator "max" overload (euint16, euint64) => euint64 test 2 (43721, 43725)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(43721n);
+ input.add64(43725n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_uint8(encryptedAmount.handles[0], 26n, encryptedAmount.inputProof);
+ const tx = await this.contract4.max_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(43725n);
+ });
+
+ it('test operator "max" overload (euint16, euint64) => euint64 test 3 (43725, 43725)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(43725n);
+ input.add64(43725n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.max_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(43725n);
});
- it('test operator "ne" overload (euint8, uint8) => ebool test 4 (26, 22)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(26n);
+ it('test operator "max" overload (euint16, euint64) => euint64 test 4 (43725, 43721)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(43725n);
+ input.add64(43721n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.max_euint16_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract4.res64());
+ expect(res).to.equal(43725n);
+ });
+ it('test operator "add" overload (euint16, euint128) => euint128 test 1 (2, 32769)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(2n);
+ input.add128(32769n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint8_uint8(encryptedAmount.handles[0], 22n, encryptedAmount.inputProof);
+ const tx = await this.contract4.add_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(32771n);
});
- it('test operator "ne" overload (uint8, euint8) => ebool test 1 (66, 213)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "add" overload (euint16, euint128) => euint128 test 2 (25454, 25456)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(25454n);
+ input.add128(25456n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.add_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(50910n);
+ });
- input.add8(213n);
+ it('test operator "add" overload (euint16, euint128) => euint128 test 3 (25456, 25456)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(25456n);
+ input.add128(25456n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_uint8_euint8(66n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract4.add_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(50912n);
+ });
+
+ it('test operator "add" overload (euint16, euint128) => euint128 test 4 (25456, 25454)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(25456n);
+ input.add128(25454n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.add_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(50910n);
+ });
+
+ it('test operator "sub" overload (euint16, euint128) => euint128 test 1 (45485, 45485)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(45485n);
+ input.add128(45485n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.sub_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint16, euint128) => euint128 test 2 (45485, 45481)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(45485n);
+ input.add128(45481n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.sub_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint16, euint128) => euint128 test 1 (2, 16385)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(2n);
+ input.add128(16385n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.mul_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(32770n);
+ });
+
+ it('test operator "mul" overload (euint16, euint128) => euint128 test 2 (206, 206)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(206n);
+ input.add128(206n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.mul_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(42436n);
+ });
+
+ it('test operator "mul" overload (euint16, euint128) => euint128 test 3 (206, 206)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(206n);
+ input.add128(206n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.mul_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(42436n);
+ });
+
+ it('test operator "mul" overload (euint16, euint128) => euint128 test 4 (206, 206)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(206n);
+ input.add128(206n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.mul_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(42436n);
+ });
+
+ it('test operator "and" overload (euint16, euint128) => euint128 test 1 (10041, 340282366920938463463370138658990657653)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(10041n);
+ input.add128(340282366920938463463370138658990657653n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.and_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(49n);
+ });
+
+ it('test operator "and" overload (euint16, euint128) => euint128 test 2 (10037, 10041)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(10037n);
+ input.add128(10041n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.and_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(10033n);
+ });
+
+ it('test operator "and" overload (euint16, euint128) => euint128 test 3 (10041, 10041)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(10041n);
+ input.add128(10041n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.and_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(10041n);
+ });
+
+ it('test operator "and" overload (euint16, euint128) => euint128 test 4 (10041, 10037)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(10041n);
+ input.add128(10037n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.and_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(10033n);
+ });
+
+ it('test operator "or" overload (euint16, euint128) => euint128 test 1 (65101, 340282366920938463463368378388212688025)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(65101n);
+ input.add128(340282366920938463463368378388212688025n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.or_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(340282366920938463463368378388212743901n);
+ });
+
+ it('test operator "or" overload (euint16, euint128) => euint128 test 2 (65097, 65101)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(65097n);
+ input.add128(65101n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.or_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(65101n);
+ });
+
+ it('test operator "or" overload (euint16, euint128) => euint128 test 3 (65101, 65101)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(65101n);
+ input.add128(65101n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.or_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(65101n);
+ });
+
+ it('test operator "or" overload (euint16, euint128) => euint128 test 4 (65101, 65097)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(65101n);
+ input.add128(65097n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.or_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(65101n);
+ });
+
+ it('test operator "xor" overload (euint16, euint128) => euint128 test 1 (57137, 340282366920938463463372706296613530555)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(57137n);
+ input.add128(340282366920938463463372706296613530555n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.xor_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(340282366920938463463372706296613549194n);
+ });
+
+ it('test operator "xor" overload (euint16, euint128) => euint128 test 2 (57133, 57137)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(57133n);
+ input.add128(57137n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.xor_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(28n);
+ });
+
+ it('test operator "xor" overload (euint16, euint128) => euint128 test 3 (57137, 57137)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(57137n);
+ input.add128(57137n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.xor_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint16, euint128) => euint128 test 4 (57137, 57133)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(57137n);
+ input.add128(57133n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.xor_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(28n);
+ });
+
+ it('test operator "eq" overload (euint16, euint128) => ebool test 1 (47922, 340282366920938463463372663915711616945)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(47922n);
+ input.add128(340282366920938463463372663915711616945n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.eq_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint16, euint128) => ebool test 2 (47918, 47922)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(47918n);
+ input.add128(47922n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.eq_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint16, euint128) => ebool test 3 (47922, 47922)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(47922n);
+ input.add128(47922n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.eq_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint16, euint128) => ebool test 4 (47922, 47918)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(47922n);
+ input.add128(47918n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.eq_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint16, euint128) => ebool test 1 (58939, 340282366920938463463367826166753900405)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(58939n);
+ input.add128(340282366920938463463367826166753900405n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.ne_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint16, euint128) => ebool test 2 (58935, 58939)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(58935n);
+ input.add128(58939n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.ne_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint16, euint128) => ebool test 3 (58939, 58939)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(58939n);
+ input.add128(58939n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.ne_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint16, euint128) => ebool test 4 (58939, 58935)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(58939n);
+ input.add128(58935n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.ne_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint16, euint128) => ebool test 1 (25628, 340282366920938463463367234559875664879)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(25628n);
+ input.add128(340282366920938463463367234559875664879n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.ge_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint16, euint128) => ebool test 2 (25624, 25628)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(25624n);
+ input.add128(25628n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.ge_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint16, euint128) => ebool test 3 (25628, 25628)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(25628n);
+ input.add128(25628n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.ge_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint16, euint128) => ebool test 4 (25628, 25624)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(25628n);
+ input.add128(25624n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.ge_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint16, euint128) => ebool test 1 (29493, 340282366920938463463370329441548615949)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(29493n);
+ input.add128(340282366920938463463370329441548615949n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.gt_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint16, euint128) => ebool test 2 (29489, 29493)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(29489n);
+ input.add128(29493n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.gt_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint16, euint128) => ebool test 3 (29493, 29493)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(29493n);
+ input.add128(29493n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.gt_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint16, euint128) => ebool test 4 (29493, 29489)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(29493n);
+ input.add128(29489n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.gt_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint16, euint128) => ebool test 1 (63634, 340282366920938463463365626120025172451)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(63634n);
+ input.add128(340282366920938463463365626120025172451n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.le_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint16, euint128) => ebool test 2 (63630, 63634)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(63630n);
+ input.add128(63634n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.le_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint16, euint128) => ebool test 3 (63634, 63634)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(63634n);
+ input.add128(63634n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.le_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint16, euint128) => ebool test 4 (63634, 63630)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(63634n);
+ input.add128(63630n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.le_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint16, euint128) => ebool test 1 (16589, 340282366920938463463371297893972390287)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(16589n);
+ input.add128(340282366920938463463371297893972390287n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.lt_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint16, euint128) => ebool test 2 (16585, 16589)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(16585n);
+ input.add128(16589n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.lt_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint16, euint128) => ebool test 3 (16589, 16589)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(16589n);
+ input.add128(16589n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.lt_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint16, euint128) => ebool test 4 (16589, 16585)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(16589n);
+ input.add128(16585n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.lt_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint16, euint128) => euint128 test 1 (47213, 340282366920938463463367215507048923025)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(47213n);
+ input.add128(340282366920938463463367215507048923025n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.min_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(47213n);
+ });
+
+ it('test operator "min" overload (euint16, euint128) => euint128 test 2 (47209, 47213)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(47209n);
+ input.add128(47213n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.min_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(47209n);
+ });
+
+ it('test operator "min" overload (euint16, euint128) => euint128 test 3 (47213, 47213)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(47213n);
+ input.add128(47213n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.min_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(47213n);
+ });
+
+ it('test operator "min" overload (euint16, euint128) => euint128 test 4 (47213, 47209)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(47213n);
+ input.add128(47209n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.min_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(47209n);
+ });
+
+ it('test operator "max" overload (euint16, euint128) => euint128 test 1 (41694, 340282366920938463463370312817461607687)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(41694n);
+ input.add128(340282366920938463463370312817461607687n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.max_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(340282366920938463463370312817461607687n);
+ });
+
+ it('test operator "max" overload (euint16, euint128) => euint128 test 2 (41690, 41694)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(41690n);
+ input.add128(41694n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.max_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(41694n);
+ });
+
+ it('test operator "max" overload (euint16, euint128) => euint128 test 3 (41694, 41694)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(41694n);
+ input.add128(41694n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.max_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(41694n);
+ });
+
+ it('test operator "max" overload (euint16, euint128) => euint128 test 4 (41694, 41690)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(41694n);
+ input.add128(41690n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.max_euint16_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract4.res128());
+ expect(res).to.equal(41694n);
+ });
+
+ it('test operator "add" overload (euint16, euint256) => euint256 test 1 (2, 32769)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(2n);
+ input.add256(32769n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.add_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(32771n);
+ });
+
+ it('test operator "add" overload (euint16, euint256) => euint256 test 2 (20019, 20021)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(20019n);
+ input.add256(20021n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.add_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(40040n);
+ });
+
+ it('test operator "add" overload (euint16, euint256) => euint256 test 3 (20021, 20021)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(20021n);
+ input.add256(20021n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.add_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(40042n);
+ });
+
+ it('test operator "add" overload (euint16, euint256) => euint256 test 4 (20021, 20019)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(20021n);
+ input.add256(20019n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.add_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(40040n);
+ });
+
+ it('test operator "sub" overload (euint16, euint256) => euint256 test 1 (40273, 40273)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(40273n);
+ input.add256(40273n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.sub_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint16, euint256) => euint256 test 2 (40273, 40269)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(40273n);
+ input.add256(40269n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.sub_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint16, euint256) => euint256 test 1 (2, 16385)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(2n);
+ input.add256(16385n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.mul_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(32770n);
+ });
+
+ it('test operator "mul" overload (euint16, euint256) => euint256 test 2 (228, 228)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(228n);
+ input.add256(228n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.mul_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(51984n);
+ });
+
+ it('test operator "mul" overload (euint16, euint256) => euint256 test 3 (228, 228)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(228n);
+ input.add256(228n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.mul_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(51984n);
+ });
+
+ it('test operator "mul" overload (euint16, euint256) => euint256 test 4 (228, 228)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(228n);
+ input.add256(228n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.mul_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(51984n);
+ });
+
+ it('test operator "and" overload (euint16, euint256) => euint256 test 1 (12579, 115792089237316195423570985008687907853269984665640564039457582458858424079051)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(12579n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582458858424079051n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.and_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(4099n);
+ });
+
+ it('test operator "and" overload (euint16, euint256) => euint256 test 2 (12575, 12579)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(12575n);
+ input.add256(12579n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.and_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(12547n);
+ });
+
+ it('test operator "and" overload (euint16, euint256) => euint256 test 3 (12579, 12579)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(12579n);
+ input.add256(12579n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.and_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(12579n);
+ });
+
+ it('test operator "and" overload (euint16, euint256) => euint256 test 4 (12579, 12575)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(12579n);
+ input.add256(12575n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.and_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(12547n);
+ });
+
+ it('test operator "or" overload (euint16, euint256) => euint256 test 1 (31079, 115792089237316195423570985008687907853269984665640564039457575275996784888971)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(31079n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575275996784888971n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.or_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457575275996784917999n);
+ });
+
+ it('test operator "or" overload (euint16, euint256) => euint256 test 2 (31075, 31079)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(31075n);
+ input.add256(31079n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.or_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(31079n);
+ });
+
+ it('test operator "or" overload (euint16, euint256) => euint256 test 3 (31079, 31079)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(31079n);
+ input.add256(31079n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.or_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(31079n);
+ });
+
+ it('test operator "or" overload (euint16, euint256) => euint256 test 4 (31079, 31075)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(31079n);
+ input.add256(31075n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.or_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(31079n);
+ });
+
+ it('test operator "xor" overload (euint16, euint256) => euint256 test 1 (21805, 115792089237316195423570985008687907853269984665640564039457581252703610907733)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(21805n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581252703610907733n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.xor_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457581252703610927480n);
+ });
+
+ it('test operator "xor" overload (euint16, euint256) => euint256 test 2 (21801, 21805)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(21801n);
+ input.add256(21805n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.xor_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "xor" overload (euint16, euint256) => euint256 test 3 (21805, 21805)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(21805n);
+ input.add256(21805n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.xor_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint16, euint256) => euint256 test 4 (21805, 21801)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(21805n);
+ input.add256(21801n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.xor_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "eq" overload (euint16, euint256) => ebool test 1 (55138, 115792089237316195423570985008687907853269984665640564039457576200268434748919)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(55138n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457576200268434748919n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.eq_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint16, euint256) => ebool test 2 (55134, 55138)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(55134n);
+ input.add256(55138n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.eq_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint16, euint256) => ebool test 3 (55138, 55138)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(55138n);
+ input.add256(55138n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.eq_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint16, euint256) => ebool test 4 (55138, 55134)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(55138n);
+ input.add256(55134n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.eq_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint16, euint256) => ebool test 1 (41071, 115792089237316195423570985008687907853269984665640564039457577958679700892209)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(41071n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577958679700892209n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.ne_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint16, euint256) => ebool test 2 (41067, 41071)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(41067n);
+ input.add256(41071n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.ne_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint16, euint256) => ebool test 3 (41071, 41071)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(41071n);
+ input.add256(41071n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.ne_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint16, euint256) => ebool test 4 (41071, 41067)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(41071n);
+ input.add256(41067n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.ne_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint16, euint256) => ebool test 1 (50106, 115792089237316195423570985008687907853269984665640564039457582313908377810967)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(50106n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582313908377810967n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.ge_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint16, euint256) => ebool test 2 (50102, 50106)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(50102n);
+ input.add256(50106n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.ge_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint16, euint256) => ebool test 3 (50106, 50106)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(50106n);
+ input.add256(50106n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.ge_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint16, euint256) => ebool test 4 (50106, 50102)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(50106n);
+ input.add256(50102n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.ge_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint16, euint256) => ebool test 1 (30875, 115792089237316195423570985008687907853269984665640564039457575028224206757889)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(30875n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575028224206757889n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.gt_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint16, euint256) => ebool test 2 (30871, 30875)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(30871n);
+ input.add256(30875n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.gt_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint16, euint256) => ebool test 3 (30875, 30875)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(30875n);
+ input.add256(30875n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.gt_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint16, euint256) => ebool test 4 (30875, 30871)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(30875n);
+ input.add256(30871n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.gt_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint16, euint256) => ebool test 1 (10398, 115792089237316195423570985008687907853269984665640564039457582877023510899415)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(10398n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582877023510899415n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.le_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint16, euint256) => ebool test 2 (10394, 10398)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(10394n);
+ input.add256(10398n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.le_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint16, euint256) => ebool test 3 (10398, 10398)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(10398n);
+ input.add256(10398n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.le_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint16, euint256) => ebool test 4 (10398, 10394)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(10398n);
+ input.add256(10394n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.le_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint16, euint256) => ebool test 1 (58145, 115792089237316195423570985008687907853269984665640564039457578303118040864491)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(58145n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457578303118040864491n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.lt_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint16, euint256) => ebool test 2 (58141, 58145)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(58141n);
+ input.add256(58145n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.lt_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint16, euint256) => ebool test 3 (58145, 58145)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(58145n);
+ input.add256(58145n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.lt_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint16, euint256) => ebool test 4 (58145, 58141)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(58145n);
+ input.add256(58141n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.lt_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract4.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint16, euint256) => euint256 test 1 (56701, 115792089237316195423570985008687907853269984665640564039457576701213568693639)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(56701n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457576701213568693639n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.min_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(56701n);
+ });
+
+ it('test operator "min" overload (euint16, euint256) => euint256 test 2 (56697, 56701)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(56697n);
+ input.add256(56701n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.min_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(56697n);
+ });
+
+ it('test operator "min" overload (euint16, euint256) => euint256 test 3 (56701, 56701)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(56701n);
+ input.add256(56701n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.min_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(56701n);
+ });
+
+ it('test operator "min" overload (euint16, euint256) => euint256 test 4 (56701, 56697)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(56701n);
+ input.add256(56697n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.min_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(56697n);
+ });
+
+ it('test operator "max" overload (euint16, euint256) => euint256 test 1 (35663, 115792089237316195423570985008687907853269984665640564039457581066242393293579)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(35663n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581066242393293579n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.max_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457581066242393293579n);
+ });
+
+ it('test operator "max" overload (euint16, euint256) => euint256 test 2 (35659, 35663)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(35659n);
+ input.add256(35663n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.max_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(35663n);
+ });
+
+ it('test operator "max" overload (euint16, euint256) => euint256 test 3 (35663, 35663)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(35663n);
+ input.add256(35663n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.max_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(35663n);
+ });
+
+ it('test operator "max" overload (euint16, euint256) => euint256 test 4 (35663, 35659)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(35663n);
+ input.add256(35659n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.max_euint16_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract4.res256());
+ expect(res).to.equal(35663n);
+ });
+
+ it('test operator "add" overload (euint16, uint16) => euint16 test 1 (26028, 15417)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(26028n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.add_euint16_uint16(encryptedAmount.handles[0], 15417n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(41445n);
+ });
+
+ it('test operator "add" overload (euint16, uint16) => euint16 test 2 (26024, 26028)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(26024n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.add_euint16_uint16(encryptedAmount.handles[0], 26028n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(52052n);
+ });
+
+ it('test operator "add" overload (euint16, uint16) => euint16 test 3 (26028, 26028)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(26028n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.add_euint16_uint16(encryptedAmount.handles[0], 26028n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(52056n);
+ });
+
+ it('test operator "add" overload (euint16, uint16) => euint16 test 4 (26028, 26024)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(26028n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.add_euint16_uint16(encryptedAmount.handles[0], 26024n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(52052n);
+ });
+
+ it('test operator "add" overload (uint16, euint16) => euint16 test 1 (22897, 15417)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+
+ input.add16(15417n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.add_uint16_euint16(22897n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(38314n);
+ });
+
+ it('test operator "add" overload (uint16, euint16) => euint16 test 2 (26024, 26028)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+
+ input.add16(26028n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.add_uint16_euint16(26024n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(52052n);
+ });
+
+ it('test operator "add" overload (uint16, euint16) => euint16 test 3 (26028, 26028)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+
+ input.add16(26028n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.add_uint16_euint16(26028n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(52056n);
+ });
+
+ it('test operator "add" overload (uint16, euint16) => euint16 test 4 (26028, 26024)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+
+ input.add16(26024n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.add_uint16_euint16(26028n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(52052n);
+ });
+
+ it('test operator "sub" overload (euint16, uint16) => euint16 test 1 (14486, 14486)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(14486n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.sub_euint16_uint16(encryptedAmount.handles[0], 14486n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint16, uint16) => euint16 test 2 (14486, 14482)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(14486n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.sub_euint16_uint16(encryptedAmount.handles[0], 14482n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "sub" overload (uint16, euint16) => euint16 test 1 (14486, 14486)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+
+ input.add16(14486n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.sub_uint16_euint16(14486n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (uint16, euint16) => euint16 test 2 (14486, 14482)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+
+ input.add16(14482n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.sub_uint16_euint16(14486n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint16, uint16) => euint16 test 1 (233, 168)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(233n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.mul_euint16_uint16(encryptedAmount.handles[0], 168n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(39144n);
+ });
+
+ it('test operator "mul" overload (euint16, uint16) => euint16 test 2 (233, 233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(233n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.mul_euint16_uint16(encryptedAmount.handles[0], 233n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(54289n);
+ });
+
+ it('test operator "mul" overload (euint16, uint16) => euint16 test 3 (233, 233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(233n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.mul_euint16_uint16(encryptedAmount.handles[0], 233n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(54289n);
+ });
+
+ it('test operator "mul" overload (euint16, uint16) => euint16 test 4 (233, 233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ input.add16(233n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.mul_euint16_uint16(encryptedAmount.handles[0], 233n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(54289n);
+ });
+
+ it('test operator "mul" overload (uint16, euint16) => euint16 test 1 (140, 168)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+
+ input.add16(168n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.mul_uint16_euint16(140n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(23520n);
+ });
+
+ it('test operator "mul" overload (uint16, euint16) => euint16 test 2 (233, 233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+
+ input.add16(233n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.mul_uint16_euint16(233n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(54289n);
+ });
+
+ it('test operator "mul" overload (uint16, euint16) => euint16 test 3 (233, 233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+
+ input.add16(233n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.mul_uint16_euint16(233n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(54289n);
+ });
+
+ it('test operator "mul" overload (uint16, euint16) => euint16 test 4 (233, 233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+
+ input.add16(233n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract4.mul_uint16_euint16(233n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract4.res16());
+ expect(res).to.equal(54289n);
+ });
+
+ it('test operator "div" overload (euint16, uint16) => euint16 test 1 (20304, 59132)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(20304n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.div_euint16_uint16(encryptedAmount.handles[0], 59132n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "div" overload (euint16, uint16) => euint16 test 2 (20300, 20304)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(20300n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.div_euint16_uint16(encryptedAmount.handles[0], 20304n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "div" overload (euint16, uint16) => euint16 test 3 (20304, 20304)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(20304n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.div_euint16_uint16(encryptedAmount.handles[0], 20304n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(1n);
+ });
+
+ it('test operator "div" overload (euint16, uint16) => euint16 test 4 (20304, 20300)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(20304n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.div_euint16_uint16(encryptedAmount.handles[0], 20300n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(1n);
+ });
+
+ it('test operator "rem" overload (euint16, uint16) => euint16 test 1 (41581, 40239)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(41581n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.rem_euint16_uint16(encryptedAmount.handles[0], 40239n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(1342n);
+ });
+
+ it('test operator "rem" overload (euint16, uint16) => euint16 test 2 (40817, 40821)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(40817n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.rem_euint16_uint16(encryptedAmount.handles[0], 40821n, encryptedAmount.inputProof);
+ await tx.wait();
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(40817n);
});
- it('test operator "ne" overload (uint8, euint8) => ebool test 2 (22, 26)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "rem" overload (euint16, uint16) => euint16 test 3 (40821, 40821)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(40821n);
- input.add8(26n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_uint8_euint8(22n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.rem_euint16_uint16(encryptedAmount.handles[0], 40821n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(0n);
});
- it('test operator "ne" overload (uint8, euint8) => ebool test 3 (26, 26)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "rem" overload (euint16, uint16) => euint16 test 4 (40821, 40817)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(40821n);
- input.add8(26n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_uint8_euint8(26n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.rem_euint16_uint16(encryptedAmount.handles[0], 40817n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(4n);
});
- it('test operator "ne" overload (uint8, euint8) => ebool test 4 (26, 22)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "and" overload (euint16, uint16) => euint16 test 1 (25969, 39616)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(25969n);
- input.add8(22n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_uint8_euint8(26n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.and_euint16_uint16(encryptedAmount.handles[0], 39616n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(64n);
});
- it('test operator "ge" overload (euint8, uint8) => ebool test 1 (89, 157)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(89n);
+ it('test operator "and" overload (euint16, uint16) => euint16 test 2 (25965, 25969)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(25965n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_uint8(encryptedAmount.handles[0], 157n, encryptedAmount.inputProof);
+ const tx = await this.contract5.and_euint16_uint16(encryptedAmount.handles[0], 25969n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(25953n);
});
- it('test operator "ge" overload (euint8, uint8) => ebool test 2 (85, 89)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(85n);
+ it('test operator "and" overload (euint16, uint16) => euint16 test 3 (25969, 25969)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(25969n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_uint8(encryptedAmount.handles[0], 89n, encryptedAmount.inputProof);
+ const tx = await this.contract5.and_euint16_uint16(encryptedAmount.handles[0], 25969n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(25969n);
});
- it('test operator "ge" overload (euint8, uint8) => ebool test 3 (89, 89)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(89n);
+ it('test operator "and" overload (euint16, uint16) => euint16 test 4 (25969, 25965)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(25969n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_uint8(encryptedAmount.handles[0], 89n, encryptedAmount.inputProof);
+ const tx = await this.contract5.and_euint16_uint16(encryptedAmount.handles[0], 25965n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(25953n);
});
- it('test operator "ge" overload (euint8, uint8) => ebool test 4 (89, 85)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(89n);
+ it('test operator "and" overload (uint16, euint16) => euint16 test 1 (12551, 39616)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(39616n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint8_uint8(encryptedAmount.handles[0], 85n, encryptedAmount.inputProof);
+ const tx = await this.contract5.and_uint16_euint16(12551n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(4096n);
});
- it('test operator "ge" overload (uint8, euint8) => ebool test 1 (164, 157)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "and" overload (uint16, euint16) => euint16 test 2 (25965, 25969)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(157n);
+ input.add16(25969n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_uint8_euint8(164n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.and_uint16_euint16(25965n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(25953n);
});
- it('test operator "ge" overload (uint8, euint8) => ebool test 2 (85, 89)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "and" overload (uint16, euint16) => euint16 test 3 (25969, 25969)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(89n);
+ input.add16(25969n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_uint8_euint8(85n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.and_uint16_euint16(25969n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(25969n);
});
- it('test operator "ge" overload (uint8, euint8) => ebool test 3 (89, 89)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "and" overload (uint16, euint16) => euint16 test 4 (25969, 25965)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(89n);
+ input.add16(25965n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_uint8_euint8(89n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.and_uint16_euint16(25969n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(25953n);
});
- it('test operator "ge" overload (uint8, euint8) => ebool test 4 (89, 85)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "or" overload (euint16, uint16) => euint16 test 1 (41436, 27184)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(41436n);
- input.add8(85n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_uint8_euint8(89n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.or_euint16_uint16(encryptedAmount.handles[0], 27184n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(60412n);
});
- it('test operator "gt" overload (euint8, uint8) => ebool test 1 (247, 141)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(247n);
+ it('test operator "or" overload (euint16, uint16) => euint16 test 2 (37563, 37567)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(37563n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_uint8(encryptedAmount.handles[0], 141n, encryptedAmount.inputProof);
+ const tx = await this.contract5.or_euint16_uint16(encryptedAmount.handles[0], 37567n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(37567n);
});
- it('test operator "gt" overload (euint8, uint8) => ebool test 2 (52, 56)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(52n);
+ it('test operator "or" overload (euint16, uint16) => euint16 test 3 (37567, 37567)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(37567n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_uint8(encryptedAmount.handles[0], 56n, encryptedAmount.inputProof);
+ const tx = await this.contract5.or_euint16_uint16(encryptedAmount.handles[0], 37567n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(37567n);
});
- it('test operator "gt" overload (euint8, uint8) => ebool test 3 (56, 56)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(56n);
+ it('test operator "or" overload (euint16, uint16) => euint16 test 4 (37567, 37563)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(37567n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_uint8(encryptedAmount.handles[0], 56n, encryptedAmount.inputProof);
+ const tx = await this.contract5.or_euint16_uint16(encryptedAmount.handles[0], 37563n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(37567n);
});
- it('test operator "gt" overload (euint8, uint8) => ebool test 4 (56, 52)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(56n);
+ it('test operator "or" overload (uint16, euint16) => euint16 test 1 (65174, 27184)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(27184n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint8_uint8(encryptedAmount.handles[0], 52n, encryptedAmount.inputProof);
+ const tx = await this.contract5.or_uint16_euint16(65174n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(65206n);
});
- it('test operator "gt" overload (uint8, euint8) => ebool test 1 (186, 141)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "or" overload (uint16, euint16) => euint16 test 2 (37563, 37567)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(141n);
+ input.add16(37567n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_uint8_euint8(186n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.or_uint16_euint16(37563n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(37567n);
});
- it('test operator "gt" overload (uint8, euint8) => ebool test 2 (52, 56)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "or" overload (uint16, euint16) => euint16 test 3 (37567, 37567)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(56n);
+ input.add16(37567n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_uint8_euint8(52n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.or_uint16_euint16(37567n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(37567n);
});
- it('test operator "gt" overload (uint8, euint8) => ebool test 3 (56, 56)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "or" overload (uint16, euint16) => euint16 test 4 (37567, 37563)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(56n);
+ input.add16(37563n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_uint8_euint8(56n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.or_uint16_euint16(37567n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(37567n);
});
- it('test operator "gt" overload (uint8, euint8) => ebool test 4 (56, 52)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "xor" overload (euint16, uint16) => euint16 test 1 (65327, 31297)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(65327n);
- input.add8(52n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_uint8_euint8(56n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.xor_euint16_uint16(encryptedAmount.handles[0], 31297n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(34158n);
});
- it('test operator "le" overload (euint8, uint8) => ebool test 1 (182, 83)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(182n);
+ it('test operator "xor" overload (euint16, uint16) => euint16 test 2 (25542, 25546)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(25542n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_uint8(encryptedAmount.handles[0], 83n, encryptedAmount.inputProof);
+ const tx = await this.contract5.xor_euint16_uint16(encryptedAmount.handles[0], 25546n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(12n);
});
- it('test operator "le" overload (euint8, uint8) => ebool test 2 (178, 182)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(178n);
+ it('test operator "xor" overload (euint16, uint16) => euint16 test 3 (25546, 25546)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(25546n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_uint8(encryptedAmount.handles[0], 182n, encryptedAmount.inputProof);
+ const tx = await this.contract5.xor_euint16_uint16(encryptedAmount.handles[0], 25546n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(0n);
});
- it('test operator "le" overload (euint8, uint8) => ebool test 3 (182, 182)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(182n);
+ it('test operator "xor" overload (euint16, uint16) => euint16 test 4 (25546, 25542)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(25546n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_uint8(encryptedAmount.handles[0], 182n, encryptedAmount.inputProof);
+ const tx = await this.contract5.xor_euint16_uint16(encryptedAmount.handles[0], 25542n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(12n);
});
- it('test operator "le" overload (euint8, uint8) => ebool test 4 (182, 178)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(182n);
+ it('test operator "xor" overload (uint16, euint16) => euint16 test 1 (33651, 31297)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(31297n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint8_uint8(encryptedAmount.handles[0], 178n, encryptedAmount.inputProof);
+ const tx = await this.contract5.xor_uint16_euint16(33651n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(63794n);
});
- it('test operator "le" overload (uint8, euint8) => ebool test 1 (14, 83)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "xor" overload (uint16, euint16) => euint16 test 2 (25542, 25546)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(83n);
+ input.add16(25546n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_uint8_euint8(14n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.xor_uint16_euint16(25542n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(12n);
});
- it('test operator "le" overload (uint8, euint8) => ebool test 2 (178, 182)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "xor" overload (uint16, euint16) => euint16 test 3 (25546, 25546)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(182n);
+ input.add16(25546n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_uint8_euint8(178n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.xor_uint16_euint16(25546n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(0n);
});
- it('test operator "le" overload (uint8, euint8) => ebool test 3 (182, 182)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "xor" overload (uint16, euint16) => euint16 test 4 (25546, 25542)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(182n);
+ input.add16(25542n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_uint8_euint8(182n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.xor_uint16_euint16(25546n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(12n);
});
- it('test operator "le" overload (uint8, euint8) => ebool test 4 (182, 178)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "eq" overload (euint16, uint16) => ebool test 1 (45930, 25309)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(45930n);
- input.add8(178n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_uint8_euint8(182n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.eq_euint16_uint16(encryptedAmount.handles[0], 25309n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint8, uint8) => ebool test 1 (44, 12)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(44n);
+ it('test operator "eq" overload (euint16, uint16) => ebool test 2 (43841, 43845)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(43841n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_uint8(encryptedAmount.handles[0], 12n, encryptedAmount.inputProof);
+ const tx = await this.contract5.eq_euint16_uint16(encryptedAmount.handles[0], 43845n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint8, uint8) => ebool test 2 (40, 44)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(40n);
+ it('test operator "eq" overload (euint16, uint16) => ebool test 3 (43845, 43845)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(43845n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_uint8(encryptedAmount.handles[0], 44n, encryptedAmount.inputProof);
+ const tx = await this.contract5.eq_euint16_uint16(encryptedAmount.handles[0], 43845n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint8, uint8) => ebool test 3 (44, 44)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(44n);
+ it('test operator "eq" overload (euint16, uint16) => ebool test 4 (43845, 43841)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(43845n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_uint8(encryptedAmount.handles[0], 44n, encryptedAmount.inputProof);
+ const tx = await this.contract5.eq_euint16_uint16(encryptedAmount.handles[0], 43841n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint8, uint8) => ebool test 4 (44, 40)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(44n);
+ it('test operator "eq" overload (uint16, euint16) => ebool test 1 (50532, 25309)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(25309n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint8_uint8(encryptedAmount.handles[0], 40n, encryptedAmount.inputProof);
+ const tx = await this.contract5.eq_uint16_euint16(50532n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (uint8, euint8) => ebool test 1 (106, 12)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "eq" overload (uint16, euint16) => ebool test 2 (43841, 43845)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(12n);
+ input.add16(43845n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_uint8_euint8(106n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.eq_uint16_euint16(43841n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (uint8, euint8) => ebool test 2 (40, 44)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "eq" overload (uint16, euint16) => ebool test 3 (43845, 43845)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(44n);
+ input.add16(43845n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_uint8_euint8(40n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.eq_uint16_euint16(43845n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (uint8, euint8) => ebool test 3 (44, 44)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "eq" overload (uint16, euint16) => ebool test 4 (43845, 43841)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(44n);
+ input.add16(43841n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_uint8_euint8(44n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.eq_uint16_euint16(43845n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (uint8, euint8) => ebool test 4 (44, 40)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "ne" overload (euint16, uint16) => ebool test 1 (16378, 35706)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(16378n);
- input.add8(40n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_uint8_euint8(44n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.ne_euint16_uint16(encryptedAmount.handles[0], 35706n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (euint8, uint8) => euint8 test 1 (254, 134)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(254n);
+ it('test operator "ne" overload (euint16, uint16) => ebool test 2 (16374, 16378)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(16374n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_uint8(encryptedAmount.handles[0], 134n, encryptedAmount.inputProof);
+ const tx = await this.contract5.ne_euint16_uint16(encryptedAmount.handles[0], 16378n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(134n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (euint8, uint8) => euint8 test 2 (69, 73)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(69n);
+ it('test operator "ne" overload (euint16, uint16) => ebool test 3 (16378, 16378)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(16378n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_uint8(encryptedAmount.handles[0], 73n, encryptedAmount.inputProof);
+ const tx = await this.contract5.ne_euint16_uint16(encryptedAmount.handles[0], 16378n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(69n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "min" overload (euint8, uint8) => euint8 test 3 (73, 73)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(73n);
+ it('test operator "ne" overload (euint16, uint16) => ebool test 4 (16378, 16374)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(16378n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_uint8(encryptedAmount.handles[0], 73n, encryptedAmount.inputProof);
+ const tx = await this.contract5.ne_euint16_uint16(encryptedAmount.handles[0], 16374n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(73n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (euint8, uint8) => euint8 test 4 (73, 69)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(73n);
+ it('test operator "ne" overload (uint16, euint16) => ebool test 1 (43595, 35706)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(35706n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_euint8_uint8(encryptedAmount.handles[0], 69n, encryptedAmount.inputProof);
+ const tx = await this.contract5.ne_uint16_euint16(43595n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(69n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (uint8, euint8) => euint8 test 1 (48, 134)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "ne" overload (uint16, euint16) => ebool test 2 (16374, 16378)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(134n);
+ input.add16(16378n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_uint8_euint8(48n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.ne_uint16_euint16(16374n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(48n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (uint8, euint8) => euint8 test 2 (69, 73)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "ne" overload (uint16, euint16) => ebool test 3 (16378, 16378)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(73n);
+ input.add16(16378n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_uint8_euint8(69n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.ne_uint16_euint16(16378n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(69n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "min" overload (uint8, euint8) => euint8 test 3 (73, 73)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "ne" overload (uint16, euint16) => ebool test 4 (16378, 16374)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(73n);
+ input.add16(16374n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_uint8_euint8(73n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.ne_uint16_euint16(16378n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(73n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (uint8, euint8) => euint8 test 4 (73, 69)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "ge" overload (euint16, uint16) => ebool test 1 (51651, 48781)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(51651n);
- input.add8(69n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.min_uint8_euint8(73n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.ge_euint16_uint16(encryptedAmount.handles[0], 48781n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(69n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "max" overload (euint8, uint8) => euint8 test 1 (227, 27)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(227n);
+ it('test operator "ge" overload (euint16, uint16) => ebool test 2 (13064, 13068)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(13064n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_uint8(encryptedAmount.handles[0], 27n, encryptedAmount.inputProof);
+ const tx = await this.contract5.ge_euint16_uint16(encryptedAmount.handles[0], 13068n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(227n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "max" overload (euint8, uint8) => euint8 test 2 (25, 29)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(25n);
+ it('test operator "ge" overload (euint16, uint16) => ebool test 3 (13068, 13068)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(13068n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_uint8(encryptedAmount.handles[0], 29n, encryptedAmount.inputProof);
+ const tx = await this.contract5.ge_euint16_uint16(encryptedAmount.handles[0], 13068n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(29n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "max" overload (euint8, uint8) => euint8 test 3 (29, 29)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(29n);
+ it('test operator "ge" overload (euint16, uint16) => ebool test 4 (13068, 13064)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(13068n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_uint8(encryptedAmount.handles[0], 29n, encryptedAmount.inputProof);
+ const tx = await this.contract5.ge_euint16_uint16(encryptedAmount.handles[0], 13064n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(29n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "max" overload (euint8, uint8) => euint8 test 4 (29, 25)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add8(29n);
+ it('test operator "ge" overload (uint16, euint16) => ebool test 1 (60450, 48781)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(48781n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_euint8_uint8(encryptedAmount.handles[0], 25n, encryptedAmount.inputProof);
+ const tx = await this.contract5.ge_uint16_euint16(60450n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(29n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "max" overload (uint8, euint8) => euint8 test 1 (174, 27)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "ge" overload (uint16, euint16) => ebool test 2 (13064, 13068)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(27n);
+ input.add16(13068n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_uint8_euint8(174n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.ge_uint16_euint16(13064n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(174n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "max" overload (uint8, euint8) => euint8 test 2 (25, 29)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "ge" overload (uint16, euint16) => ebool test 3 (13068, 13068)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(29n);
+ input.add16(13068n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_uint8_euint8(25n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.ge_uint16_euint16(13068n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(29n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "max" overload (uint8, euint8) => euint8 test 3 (29, 29)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "ge" overload (uint16, euint16) => ebool test 4 (13068, 13064)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- input.add8(29n);
+ input.add16(13064n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_uint8_euint8(29n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.ge_uint16_euint16(13068n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(29n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "max" overload (uint8, euint8) => euint8 test 4 (29, 25)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
+ it('test operator "gt" overload (euint16, uint16) => ebool test 1 (49523, 10749)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(49523n);
- input.add8(25n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.max_uint8_euint8(29n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract5.gt_euint16_uint16(encryptedAmount.handles[0], 10749n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt8(await this.contract2.res8());
- expect(res).to.equal(29n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "add" overload (euint16, euint4) => euint16 test 1 (8, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(8n);
- input.add4(2n);
- const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
- await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(10n);
- });
+ it('test operator "gt" overload (euint16, uint16) => ebool test 2 (49519, 49523)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(49519n);
- it('test operator "add" overload (euint16, euint4) => euint16 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(4n);
- input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.gt_euint16_uint16(encryptedAmount.handles[0], 49523n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(12n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "add" overload (euint16, euint4) => euint16 test 3 (5, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(5n);
- input.add4(5n);
- const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
- await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(10n);
- });
+ it('test operator "gt" overload (euint16, uint16) => ebool test 3 (49523, 49523)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(49523n);
- it('test operator "add" overload (euint16, euint4) => euint16 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(8n);
- input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.add_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.gt_euint16_uint16(encryptedAmount.handles[0], 49523n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(12n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "sub" overload (euint16, euint4) => euint16 test 1 (14, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(14n);
- input.add4(14n);
- const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.sub_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
- await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(0n);
- });
+ it('test operator "gt" overload (euint16, uint16) => ebool test 4 (49523, 49519)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(49523n);
- it('test operator "sub" overload (euint16, euint4) => euint16 test 2 (14, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(14n);
- input.add4(10n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.sub_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.gt_euint16_uint16(encryptedAmount.handles[0], 49519n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(4n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "mul" overload (euint16, euint4) => euint16 test 1 (5, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(5n);
- input.add4(2n);
- const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
- await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(10n);
- });
+ it('test operator "gt" overload (uint16, euint16) => ebool test 1 (38042, 10749)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- it('test operator "mul" overload (euint16, euint4) => euint16 test 2 (3, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(3n);
- input.add4(4n);
+ input.add16(10749n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.gt_uint16_euint16(38042n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(12n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "mul" overload (euint16, euint4) => euint16 test 3 (3, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(3n);
- input.add4(3n);
- const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
- await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(9n);
- });
+ it('test operator "gt" overload (uint16, euint16) => ebool test 2 (49519, 49523)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
- it('test operator "mul" overload (euint16, euint4) => euint16 test 4 (4, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(4n);
- input.add4(3n);
+ input.add16(49523n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.mul_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.gt_uint16_euint16(49519n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(12n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "and" overload (euint16, euint4) => euint16 test 1 (62185, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(62185n);
- input.add4(11n);
+ it('test operator "gt" overload (uint16, euint16) => ebool test 3 (49523, 49523)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+
+ input.add16(49523n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.and_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.gt_uint16_euint16(49523n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(9n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "and" overload (euint16, euint4) => euint16 test 2 (7, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(7n);
- input.add4(11n);
+ it('test operator "gt" overload (uint16, euint16) => ebool test 4 (49523, 49519)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+
+ input.add16(49519n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.and_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.gt_uint16_euint16(49523n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(3n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "and" overload (euint16, euint4) => euint16 test 3 (11, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(11n);
- input.add4(11n);
+ it('test operator "le" overload (euint16, uint16) => ebool test 1 (20803, 27442)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(20803n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.and_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.le_euint16_uint16(encryptedAmount.handles[0], 27442n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(11n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "and" overload (euint16, euint4) => euint16 test 4 (11, 7)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(11n);
- input.add4(7n);
+ it('test operator "le" overload (euint16, uint16) => ebool test 2 (869, 873)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(869n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.and_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.le_euint16_uint16(encryptedAmount.handles[0], 873n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(3n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "or" overload (euint16, euint4) => euint16 test 1 (40123, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(40123n);
- input.add4(11n);
+ it('test operator "le" overload (euint16, uint16) => ebool test 3 (873, 873)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(873n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.or_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.le_euint16_uint16(encryptedAmount.handles[0], 873n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(40123n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "or" overload (euint16, euint4) => euint16 test 2 (7, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(7n);
- input.add4(11n);
+ it('test operator "le" overload (euint16, uint16) => ebool test 4 (873, 869)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(873n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.or_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.le_euint16_uint16(encryptedAmount.handles[0], 869n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(15n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "or" overload (euint16, euint4) => euint16 test 3 (11, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(11n);
- input.add4(11n);
+ it('test operator "le" overload (uint16, euint16) => ebool test 1 (36363, 27442)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+
+ input.add16(27442n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.or_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.le_uint16_euint16(36363n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(11n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "or" overload (euint16, euint4) => euint16 test 4 (11, 7)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(11n);
- input.add4(7n);
+ it('test operator "le" overload (uint16, euint16) => ebool test 2 (869, 873)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+
+ input.add16(873n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.or_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.le_uint16_euint16(869n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(15n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "xor" overload (euint16, euint4) => euint16 test 1 (34235, 7)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(34235n);
- input.add4(7n);
+ it('test operator "le" overload (uint16, euint16) => ebool test 3 (873, 873)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+
+ input.add16(873n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.xor_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.le_uint16_euint16(873n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(34236n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "xor" overload (euint16, euint4) => euint16 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(4n);
- input.add4(8n);
+ it('test operator "le" overload (uint16, euint16) => ebool test 4 (873, 869)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+
+ input.add16(869n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.xor_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.le_uint16_euint16(873n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(12n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "xor" overload (euint16, euint4) => euint16 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(8n);
- input.add4(8n);
+ it('test operator "lt" overload (euint16, uint16) => ebool test 1 (34482, 38499)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(34482n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.xor_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.lt_euint16_uint16(encryptedAmount.handles[0], 38499n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(0n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "xor" overload (euint16, euint4) => euint16 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(8n);
- input.add4(4n);
+ it('test operator "lt" overload (euint16, uint16) => ebool test 2 (5142, 5146)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(5142n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.xor_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.lt_euint16_uint16(encryptedAmount.handles[0], 5146n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract2.res16());
- expect(res).to.equal(12n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint16, euint4) => ebool test 1 (57152, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(57152n);
- input.add4(3n);
+ it('test operator "lt" overload (euint16, uint16) => ebool test 3 (5146, 5146)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(5146n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.lt_euint16_uint16(encryptedAmount.handles[0], 5146n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint16, euint4) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(4n);
- input.add4(8n);
+ it('test operator "lt" overload (euint16, uint16) => ebool test 4 (5146, 5142)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(5146n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.lt_euint16_uint16(encryptedAmount.handles[0], 5142n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint16, euint4) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(8n);
- input.add4(8n);
+ it('test operator "lt" overload (uint16, euint16) => ebool test 1 (21462, 38499)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+
+ input.add16(38499n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.lt_uint16_euint16(21462n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint16, euint4) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(8n);
- input.add4(4n);
+ it('test operator "lt" overload (uint16, euint16) => ebool test 2 (5142, 5146)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+
+ input.add16(5146n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.eq_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.lt_uint16_euint16(5142n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint16, euint4) => ebool test 1 (24920, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(24920n);
- input.add4(3n);
+ it('test operator "lt" overload (uint16, euint16) => ebool test 3 (5146, 5146)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+
+ input.add16(5146n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.lt_uint16_euint16(5146n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint16, euint4) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(4n);
- input.add4(8n);
+ it('test operator "lt" overload (uint16, euint16) => ebool test 4 (5146, 5142)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+
+ input.add16(5142n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.lt_uint16_euint16(5146n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint16, euint4) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(8n);
- input.add4(8n);
+ it('test operator "min" overload (euint16, uint16) => euint16 test 1 (32718, 54097)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(32718n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.min_euint16_uint16(encryptedAmount.handles[0], 54097n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(32718n);
});
- it('test operator "ne" overload (euint16, euint4) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(8n);
- input.add4(4n);
+ it('test operator "min" overload (euint16, uint16) => euint16 test 2 (8265, 8269)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(8265n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ne_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.min_euint16_uint16(encryptedAmount.handles[0], 8269n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(8265n);
});
- it('test operator "ge" overload (euint16, euint4) => ebool test 1 (27268, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(27268n);
- input.add4(4n);
+ it('test operator "min" overload (euint16, uint16) => euint16 test 3 (8269, 8269)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(8269n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.min_euint16_uint16(encryptedAmount.handles[0], 8269n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(8269n);
});
- it('test operator "ge" overload (euint16, euint4) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(4n);
- input.add4(8n);
+ it('test operator "min" overload (euint16, uint16) => euint16 test 4 (8269, 8265)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(8269n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.min_euint16_uint16(encryptedAmount.handles[0], 8265n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(8265n);
});
- it('test operator "ge" overload (euint16, euint4) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(8n);
- input.add4(8n);
+ it('test operator "min" overload (uint16, euint16) => euint16 test 1 (24240, 54097)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+
+ input.add16(54097n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.min_uint16_euint16(24240n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(24240n);
});
- it('test operator "ge" overload (euint16, euint4) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(8n);
- input.add4(4n);
+ it('test operator "min" overload (uint16, euint16) => euint16 test 2 (8265, 8269)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+
+ input.add16(8269n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.ge_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.min_uint16_euint16(8265n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(8265n);
});
- it('test operator "gt" overload (euint16, euint4) => ebool test 1 (6870, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(6870n);
- input.add4(8n);
+ it('test operator "min" overload (uint16, euint16) => euint16 test 3 (8269, 8269)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+
+ input.add16(8269n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.min_uint16_euint16(8269n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(8269n);
});
- it('test operator "gt" overload (euint16, euint4) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(4n);
- input.add4(8n);
+ it('test operator "min" overload (uint16, euint16) => euint16 test 4 (8269, 8265)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+
+ input.add16(8265n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.min_uint16_euint16(8269n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(8265n);
});
- it('test operator "gt" overload (euint16, euint4) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(8n);
- input.add4(8n);
+ it('test operator "max" overload (euint16, uint16) => euint16 test 1 (37775, 25405)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(37775n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.max_euint16_uint16(encryptedAmount.handles[0], 25405n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(37775n);
});
- it('test operator "gt" overload (euint16, euint4) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(8n);
- input.add4(4n);
+ it('test operator "max" overload (euint16, uint16) => euint16 test 2 (22428, 22432)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(22428n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.gt_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.max_euint16_uint16(encryptedAmount.handles[0], 22432n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(22432n);
});
- it('test operator "le" overload (euint16, euint4) => ebool test 1 (39104, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(39104n);
- input.add4(8n);
+ it('test operator "max" overload (euint16, uint16) => euint16 test 3 (22432, 22432)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(22432n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.max_euint16_uint16(encryptedAmount.handles[0], 22432n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(22432n);
});
- it('test operator "le" overload (euint16, euint4) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(4n);
- input.add4(8n);
+ it('test operator "max" overload (euint16, uint16) => euint16 test 4 (22432, 22428)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add16(22432n);
+
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.max_euint16_uint16(encryptedAmount.handles[0], 22428n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(22432n);
});
- it('test operator "le" overload (euint16, euint4) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(8n);
- input.add4(8n);
+ it('test operator "max" overload (uint16, euint16) => euint16 test 1 (1122, 25405)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+
+ input.add16(25405n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.max_uint16_euint16(1122n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(25405n);
});
- it('test operator "le" overload (euint16, euint4) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(8n);
- input.add4(4n);
+ it('test operator "max" overload (uint16, euint16) => euint16 test 2 (22428, 22432)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+
+ input.add16(22432n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.le_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.max_uint16_euint16(22428n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(22432n);
});
- it('test operator "lt" overload (euint16, euint4) => ebool test 1 (57762, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(57762n);
- input.add4(4n);
+ it('test operator "max" overload (uint16, euint16) => euint16 test 3 (22432, 22432)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+
+ input.add16(22432n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.max_uint16_euint16(22432n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(22432n);
});
- it('test operator "lt" overload (euint16, euint4) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(4n);
- input.add4(8n);
+ it('test operator "max" overload (uint16, euint16) => euint16 test 4 (22432, 22428)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+
+ input.add16(22428n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint16_euint4(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
+ const tx = await this.contract5.max_uint16_euint16(22432n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(true);
+ const res = await decrypt16(await this.contract5.res16());
+ expect(res).to.equal(22432n);
});
- it('test operator "lt" overload (euint16, euint4) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(8n);
- input.add4(8n);
+ it('test operator "add" overload (euint32, euint4) => euint32 test 1 (10, 1)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(10n);
+ input.add4(1n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint16_euint4(
+ const tx = await this.contract5.add_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(11n);
});
- it('test operator "lt" overload (euint16, euint4) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address);
- input.add16(8n);
- input.add4(4n);
+ it('test operator "add" overload (euint32, euint4) => euint32 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(4n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract2.lt_euint16_euint4(
+ const tx = await this.contract5.add_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract2.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(12n);
});
- it('test operator "min" overload (euint16, euint4) => euint16 test 1 (10884, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(10884n);
- input.add4(9n);
+ it('test operator "add" overload (euint32, euint4) => euint32 test 3 (5, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(5n);
+ input.add4(5n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_euint4(
+ const tx = await this.contract5.add_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(9n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(10n);
});
- it('test operator "min" overload (euint16, euint4) => euint16 test 2 (5, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(5n);
- input.add4(9n);
+ it('test operator "add" overload (euint32, euint4) => euint32 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_euint4(
+ const tx = await this.contract5.add_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(5n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(12n);
});
- it('test operator "min" overload (euint16, euint4) => euint16 test 3 (9, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(9n);
- input.add4(9n);
+ it('test operator "sub" overload (euint32, euint4) => euint32 test 1 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_euint4(
+ const tx = await this.contract5.sub_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(9n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "min" overload (euint16, euint4) => euint16 test 4 (9, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(9n);
- input.add4(5n);
+ it('test operator "sub" overload (euint32, euint4) => euint32 test 2 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_euint4(
+ const tx = await this.contract5.sub_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(5n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(4n);
});
- it('test operator "max" overload (euint16, euint4) => euint16 test 1 (58569, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(58569n);
- input.add4(10n);
+ it('test operator "mul" overload (euint32, euint4) => euint32 test 1 (6, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(6n);
+ input.add4(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_euint4(
+ const tx = await this.contract5.mul_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(58569n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(12n);
});
- it('test operator "max" overload (euint16, euint4) => euint16 test 2 (6, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(6n);
- input.add4(10n);
+ it('test operator "mul" overload (euint32, euint4) => euint32 test 2 (3, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3n);
+ input.add4(5n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_euint4(
+ const tx = await this.contract5.mul_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(10n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(15n);
});
- it('test operator "max" overload (euint16, euint4) => euint16 test 3 (10, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(10n);
- input.add4(10n);
+ it('test operator "mul" overload (euint32, euint4) => euint32 test 3 (3, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3n);
+ input.add4(3n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_euint4(
+ const tx = await this.contract5.mul_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(10n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(9n);
});
- it('test operator "max" overload (euint16, euint4) => euint16 test 4 (10, 6)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(10n);
- input.add4(6n);
+ it('test operator "mul" overload (euint32, euint4) => euint32 test 4 (5, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(5n);
+ input.add4(3n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_euint4(
+ const tx = await this.contract5.mul_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(10n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(15n);
});
- it('test operator "add" overload (euint16, euint8) => euint16 test 1 (147, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(147n);
- input.add8(3n);
+ it('test operator "and" overload (euint32, euint4) => euint32 test 1 (3337809992, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3337809992n);
+ input.add4(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint16_euint8(
+ const tx = await this.contract5.and_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(150n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "add" overload (euint16, euint8) => euint16 test 2 (116, 118)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(116n);
- input.add8(118n);
+ it('test operator "and" overload (euint32, euint4) => euint32 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(4n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint16_euint8(
+ const tx = await this.contract5.and_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(234n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "add" overload (euint16, euint8) => euint16 test 3 (118, 118)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(118n);
- input.add8(118n);
+ it('test operator "and" overload (euint32, euint4) => euint32 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint16_euint8(
+ const tx = await this.contract5.and_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(236n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(8n);
});
- it('test operator "add" overload (euint16, euint8) => euint16 test 4 (118, 116)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(118n);
- input.add8(116n);
+ it('test operator "and" overload (euint32, euint4) => euint32 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint16_euint8(
+ const tx = await this.contract5.and_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(234n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "sub" overload (euint16, euint8) => euint16 test 1 (143, 143)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(143n);
- input.add8(143n);
+ it('test operator "or" overload (euint32, euint4) => euint32 test 1 (1671920698, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1671920698n);
+ input.add4(3n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.sub_euint16_euint8(
+ const tx = await this.contract5.or_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(0n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(1671920699n);
});
- it('test operator "sub" overload (euint16, euint8) => euint16 test 2 (143, 139)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(143n);
- input.add8(139n);
+ it('test operator "or" overload (euint32, euint4) => euint32 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(4n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.sub_euint16_euint8(
+ const tx = await this.contract5.or_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(4n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(12n);
});
- it('test operator "mul" overload (euint16, euint8) => euint16 test 1 (127, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(127n);
- input.add8(2n);
+ it('test operator "or" overload (euint32, euint4) => euint32 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint16_euint8(
+ const tx = await this.contract5.or_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(254n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(8n);
});
- it('test operator "mul" overload (euint16, euint8) => euint16 test 2 (10, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(10n);
- input.add8(10n);
+ it('test operator "or" overload (euint32, euint4) => euint32 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint16_euint8(
+ const tx = await this.contract5.or_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(100n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(12n);
});
- it('test operator "mul" overload (euint16, euint8) => euint16 test 3 (10, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(10n);
- input.add8(10n);
+ it('test operator "xor" overload (euint32, euint4) => euint32 test 1 (4009369108, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(4009369108n);
+ input.add4(6n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint16_euint8(
+ const tx = await this.contract5.xor_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(100n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(4009369106n);
});
- it('test operator "mul" overload (euint16, euint8) => euint16 test 4 (10, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(10n);
- input.add8(10n);
+ it('test operator "xor" overload (euint32, euint4) => euint32 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(4n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint16_euint8(
+ const tx = await this.contract5.xor_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(100n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(12n);
});
- it('test operator "and" overload (euint16, euint8) => euint16 test 1 (19261, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(19261n);
- input.add8(5n);
+ it('test operator "xor" overload (euint32, euint4) => euint32 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint16_euint8(
+ const tx = await this.contract5.xor_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(5n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "and" overload (euint16, euint8) => euint16 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(4n);
- input.add8(8n);
+ it('test operator "xor" overload (euint32, euint4) => euint32 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint16_euint8(
+ const tx = await this.contract5.xor_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(0n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(12n);
});
- it('test operator "and" overload (euint16, euint8) => euint16 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(8n);
- input.add8(8n);
+ it('test operator "eq" overload (euint32, euint4) => ebool test 1 (1592167767, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1592167767n);
+ input.add4(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint16_euint8(
+ const tx = await this.contract5.eq_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(8n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "and" overload (euint16, euint8) => euint16 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(8n);
- input.add8(4n);
+ it('test operator "eq" overload (euint32, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(4n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint16_euint8(
+ const tx = await this.contract5.eq_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(0n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "or" overload (euint16, euint8) => euint16 test 1 (37227, 88)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(37227n);
- input.add8(88n);
+ it('test operator "eq" overload (euint32, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.or_euint16_euint8(
+ const tx = await this.contract5.eq_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(37243n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "or" overload (euint16, euint8) => euint16 test 2 (84, 88)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(84n);
- input.add8(88n);
+ it('test operator "eq" overload (euint32, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.or_euint16_euint8(
+ const tx = await this.contract5.eq_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(92n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "or" overload (euint16, euint8) => euint16 test 3 (88, 88)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(88n);
- input.add8(88n);
+ it('test operator "ne" overload (euint32, euint4) => ebool test 1 (2761853602, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(2761853602n);
+ input.add4(13n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.or_euint16_euint8(
+ const tx = await this.contract5.ne_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(88n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "or" overload (euint16, euint8) => euint16 test 4 (88, 84)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(88n);
- input.add8(84n);
+ it('test operator "ne" overload (euint32, euint4) => ebool test 2 (9, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(9n);
+ input.add4(13n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.or_euint16_euint8(
+ const tx = await this.contract5.ne_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(92n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "xor" overload (euint16, euint8) => euint16 test 1 (43168, 233)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(43168n);
- input.add8(233n);
+ it('test operator "ne" overload (euint32, euint4) => ebool test 3 (13, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(13n);
+ input.add4(13n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.xor_euint16_euint8(
+ const tx = await this.contract5.ne_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(43081n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "xor" overload (euint16, euint8) => euint16 test 2 (229, 233)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(229n);
- input.add8(233n);
+ it('test operator "ne" overload (euint32, euint4) => ebool test 4 (13, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(13n);
+ input.add4(9n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.xor_euint16_euint8(
+ const tx = await this.contract5.ne_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(12n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "xor" overload (euint16, euint8) => euint16 test 3 (233, 233)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(233n);
- input.add8(233n);
+ it('test operator "ge" overload (euint32, euint4) => ebool test 1 (417230890, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(417230890n);
+ input.add4(6n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.xor_euint16_euint8(
+ const tx = await this.contract5.ge_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(0n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "xor" overload (euint16, euint8) => euint16 test 4 (233, 229)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(233n);
- input.add8(229n);
+ it('test operator "ge" overload (euint32, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(4n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.xor_euint16_euint8(
+ const tx = await this.contract5.ge_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(12n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint16, euint8) => ebool test 1 (64589, 145)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(64589n);
- input.add8(145n);
+ it('test operator "ge" overload (euint32, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint16_euint8(
+ const tx = await this.contract5.ge_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint16, euint8) => ebool test 2 (141, 145)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(141n);
- input.add8(145n);
+ it('test operator "ge" overload (euint32, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint16_euint8(
+ const tx = await this.contract5.ge_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint16, euint8) => ebool test 3 (145, 145)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(145n);
- input.add8(145n);
+ it('test operator "gt" overload (euint32, euint4) => ebool test 1 (3015562136, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3015562136n);
+ input.add4(7n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint16_euint8(
+ const tx = await this.contract5.gt_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint16, euint8) => ebool test 4 (145, 141)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(145n);
- input.add8(141n);
+ it('test operator "gt" overload (euint32, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(4n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint16_euint8(
+ const tx = await this.contract5.gt_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint16, euint8) => ebool test 1 (59614, 149)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(59614n);
- input.add8(149n);
+ it('test operator "gt" overload (euint32, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint16_euint8(
+ const tx = await this.contract5.gt_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint16, euint8) => ebool test 2 (145, 149)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(145n);
- input.add8(149n);
+ it('test operator "gt" overload (euint32, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint16_euint8(
+ const tx = await this.contract5.gt_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint16, euint8) => ebool test 3 (149, 149)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(149n);
- input.add8(149n);
+ it('test operator "le" overload (euint32, euint4) => ebool test 1 (1297036148, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1297036148n);
+ input.add4(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint16_euint8(
+ const tx = await this.contract5.le_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint16, euint8) => ebool test 4 (149, 145)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(149n);
- input.add8(145n);
+ it('test operator "le" overload (euint32, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(4n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint16_euint8(
+ const tx = await this.contract5.le_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint16, euint8) => ebool test 1 (24994, 118)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(24994n);
- input.add8(118n);
+ it('test operator "le" overload (euint32, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint16_euint8(
+ const tx = await this.contract5.le_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint16, euint8) => ebool test 2 (114, 118)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(114n);
- input.add8(118n);
+ it('test operator "le" overload (euint32, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint16_euint8(
+ const tx = await this.contract5.le_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint16, euint8) => ebool test 3 (118, 118)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(118n);
- input.add8(118n);
+ it('test operator "lt" overload (euint32, euint4) => ebool test 1 (2282621038, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(2282621038n);
+ input.add4(7n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint16_euint8(
+ const tx = await this.contract5.lt_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint16, euint8) => ebool test 4 (118, 114)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(118n);
- input.add8(114n);
+ it('test operator "lt" overload (euint32, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(4n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint16_euint8(
+ const tx = await this.contract5.lt_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint16, euint8) => ebool test 1 (15548, 171)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(15548n);
- input.add8(171n);
+ it('test operator "lt" overload (euint32, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint16_euint8(
+ const tx = await this.contract5.lt_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint16, euint8) => ebool test 2 (167, 171)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(167n);
- input.add8(171n);
+ it('test operator "lt" overload (euint32, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint16_euint8(
+ const tx = await this.contract5.lt_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint16, euint8) => ebool test 3 (171, 171)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(171n);
- input.add8(171n);
+ it('test operator "min" overload (euint32, euint4) => euint32 test 1 (52471261, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(52471261n);
+ input.add4(11n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint16_euint8(
+ const tx = await this.contract5.min_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(11n);
});
- it('test operator "gt" overload (euint16, euint8) => ebool test 4 (171, 167)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(171n);
- input.add8(167n);
+ it('test operator "min" overload (euint32, euint4) => euint32 test 2 (7, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(7n);
+ input.add4(11n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint16_euint8(
+ const tx = await this.contract5.min_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(7n);
});
- it('test operator "le" overload (euint16, euint8) => ebool test 1 (53893, 183)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(53893n);
- input.add8(183n);
+ it('test operator "min" overload (euint32, euint4) => euint32 test 3 (11, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(11n);
+ input.add4(11n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint16_euint8(
+ const tx = await this.contract5.min_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(11n);
});
- it('test operator "le" overload (euint16, euint8) => ebool test 2 (179, 183)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(179n);
- input.add8(183n);
+ it('test operator "min" overload (euint32, euint4) => euint32 test 4 (11, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(11n);
+ input.add4(7n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint16_euint8(
+ const tx = await this.contract5.min_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(7n);
});
- it('test operator "le" overload (euint16, euint8) => ebool test 3 (183, 183)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(183n);
- input.add8(183n);
+ it('test operator "max" overload (euint32, euint4) => euint32 test 1 (1089745104, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1089745104n);
+ input.add4(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint16_euint8(
+ const tx = await this.contract5.max_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(1089745104n);
});
- it('test operator "le" overload (euint16, euint8) => ebool test 4 (183, 179)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(183n);
- input.add8(179n);
+ it('test operator "max" overload (euint32, euint4) => euint32 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(4n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint16_euint8(
+ const tx = await this.contract5.max_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(8n);
});
- it('test operator "lt" overload (euint16, euint8) => ebool test 1 (14349, 199)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(14349n);
- input.add8(199n);
+ it('test operator "max" overload (euint32, euint4) => euint32 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(8n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint16_euint8(
+ const tx = await this.contract5.max_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(8n);
});
- it('test operator "lt" overload (euint16, euint8) => ebool test 2 (195, 199)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(195n);
- input.add8(199n);
+ it('test operator "max" overload (euint32, euint4) => euint32 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(8n);
+ input.add4(4n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint16_euint8(
+ const tx = await this.contract5.max_euint32_euint4(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(8n);
});
- it('test operator "lt" overload (euint16, euint8) => ebool test 3 (199, 199)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(199n);
- input.add8(199n);
+ it('test operator "add" overload (euint32, euint8) => euint32 test 1 (129, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(129n);
+ input.add8(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint16_euint8(
+ const tx = await this.contract5.add_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(131n);
});
- it('test operator "lt" overload (euint16, euint8) => ebool test 4 (199, 195)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(199n);
- input.add8(195n);
+ it('test operator "add" overload (euint32, euint8) => euint32 test 2 (79, 81)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(79n);
+ input.add8(81n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint16_euint8(
+ const tx = await this.contract5.add_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(160n);
});
- it('test operator "min" overload (euint16, euint8) => euint16 test 1 (29386, 59)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(29386n);
- input.add8(59n);
+ it('test operator "add" overload (euint32, euint8) => euint32 test 3 (81, 81)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(81n);
+ input.add8(81n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_euint8(
+ const tx = await this.contract5.add_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(59n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(162n);
});
- it('test operator "min" overload (euint16, euint8) => euint16 test 2 (55, 59)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(55n);
- input.add8(59n);
+ it('test operator "add" overload (euint32, euint8) => euint32 test 4 (81, 79)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(81n);
+ input.add8(79n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_euint8(
+ const tx = await this.contract5.add_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(55n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(160n);
});
- it('test operator "min" overload (euint16, euint8) => euint16 test 3 (59, 59)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(59n);
- input.add8(59n);
+ it('test operator "sub" overload (euint32, euint8) => euint32 test 1 (69, 69)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(69n);
+ input.add8(69n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_euint8(
+ const tx = await this.contract5.sub_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(59n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "min" overload (euint16, euint8) => euint16 test 4 (59, 55)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(59n);
- input.add8(55n);
+ it('test operator "sub" overload (euint32, euint8) => euint32 test 2 (69, 65)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(69n);
+ input.add8(65n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_euint8(
+ const tx = await this.contract5.sub_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(55n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(4n);
});
});
diff --git a/test/tfheOperations/tfheOperations6.ts b/test/tfheOperations/tfheOperations6.ts
index 5f4ec0a2..08d806b1 100644
--- a/test/tfheOperations/tfheOperations6.ts
+++ b/test/tfheOperations/tfheOperations6.ts
@@ -7,7 +7,22 @@ import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'
import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance';
+import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
+import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
+import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
+import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
+import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
+import {
+ createInstances,
+ decrypt4,
+ decrypt8,
+ decrypt16,
+ decrypt32,
+ decrypt64,
+ decrypt128,
+ decrypt256,
+ decryptBool,
+} from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
@@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise {
return contract;
}
+async function deployTfheTestFixture7(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite7');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture8(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite8');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture9(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite9');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture10(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite10');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture11(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite11');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
describe('TFHE operations 6', function () {
before(async function () {
await initSigners(1);
@@ -105,2497 +175,4677 @@ describe('TFHE operations 6', function () {
this.contract6Address = await contract6.getAddress();
this.contract6 = contract6;
+ const contract7 = await deployTfheTestFixture7();
+ this.contract7Address = await contract7.getAddress();
+ this.contract7 = contract7;
+
+ const contract8 = await deployTfheTestFixture8();
+ this.contract8Address = await contract8.getAddress();
+ this.contract8 = contract8;
+
+ const contract9 = await deployTfheTestFixture9();
+ this.contract9Address = await contract9.getAddress();
+ this.contract9 = contract9;
+
+ const contract10 = await deployTfheTestFixture10();
+ this.contract10Address = await contract10.getAddress();
+ this.contract10 = contract10;
+
+ const contract11 = await deployTfheTestFixture11();
+ this.contract11Address = await contract11.getAddress();
+ this.contract11 = contract11;
+
const instances = await createInstances(this.signers);
this.instances = instances;
});
- it('test operator "max" overload (euint16, euint8) => euint16 test 1 (46663, 31)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(46663n);
- input.add8(31n);
+ it('test operator "mul" overload (euint32, euint8) => euint32 test 1 (114, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(114n);
+ input.add8(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_euint8(
+ const tx = await this.contract5.mul_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(46663n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(228n);
});
- it('test operator "max" overload (euint16, euint8) => euint16 test 2 (27, 31)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(27n);
- input.add8(31n);
+ it('test operator "mul" overload (euint32, euint8) => euint32 test 2 (15, 16)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(15n);
+ input.add8(16n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_euint8(
+ const tx = await this.contract5.mul_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(31n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(240n);
});
- it('test operator "max" overload (euint16, euint8) => euint16 test 3 (31, 31)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(31n);
- input.add8(31n);
+ it('test operator "mul" overload (euint32, euint8) => euint32 test 3 (9, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(9n);
+ input.add8(9n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_euint8(
+ const tx = await this.contract5.mul_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(31n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(81n);
});
- it('test operator "max" overload (euint16, euint8) => euint16 test 4 (31, 27)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(31n);
- input.add8(27n);
+ it('test operator "mul" overload (euint32, euint8) => euint32 test 4 (16, 15)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(16n);
+ input.add8(15n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_euint8(
+ const tx = await this.contract5.mul_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(31n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(240n);
});
- it('test operator "add" overload (euint16, euint16) => euint16 test 1 (12135, 15379)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12135n);
- input.add16(15379n);
+ it('test operator "and" overload (euint32, euint8) => euint32 test 1 (2846739700, 34)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(2846739700n);
+ input.add8(34n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint16_euint16(
+ const tx = await this.contract5.and_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(27514n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(32n);
});
- it('test operator "add" overload (euint16, euint16) => euint16 test 2 (12131, 12135)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12131n);
- input.add16(12135n);
+ it('test operator "and" overload (euint32, euint8) => euint32 test 2 (30, 34)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(30n);
+ input.add8(34n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint16_euint16(
+ const tx = await this.contract5.and_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(24266n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(2n);
});
- it('test operator "add" overload (euint16, euint16) => euint16 test 3 (12135, 12135)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12135n);
- input.add16(12135n);
+ it('test operator "and" overload (euint32, euint8) => euint32 test 3 (34, 34)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(34n);
+ input.add8(34n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint16_euint16(
+ const tx = await this.contract5.and_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(24270n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(34n);
});
- it('test operator "add" overload (euint16, euint16) => euint16 test 4 (12135, 12131)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12135n);
- input.add16(12131n);
+ it('test operator "and" overload (euint32, euint8) => euint32 test 4 (34, 30)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(34n);
+ input.add8(30n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint16_euint16(
+ const tx = await this.contract5.and_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(24266n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(2n);
});
- it('test operator "sub" overload (euint16, euint16) => euint16 test 1 (3171, 3171)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(3171n);
- input.add16(3171n);
+ it('test operator "or" overload (euint32, euint8) => euint32 test 1 (143668880, 184)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(143668880n);
+ input.add8(184n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.sub_euint16_euint16(
+ const tx = await this.contract5.or_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(0n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(143668920n);
});
- it('test operator "sub" overload (euint16, euint16) => euint16 test 2 (3171, 3167)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(3171n);
- input.add16(3167n);
+ it('test operator "or" overload (euint32, euint8) => euint32 test 2 (180, 184)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(180n);
+ input.add8(184n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.sub_euint16_euint16(
+ const tx = await this.contract5.or_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(4n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(188n);
});
- it('test operator "mul" overload (euint16, euint16) => euint16 test 1 (78, 381)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(78n);
- input.add16(381n);
+ it('test operator "or" overload (euint32, euint8) => euint32 test 3 (184, 184)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(184n);
+ input.add8(184n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint16_euint16(
+ const tx = await this.contract5.or_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(29718n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(184n);
});
- it('test operator "mul" overload (euint16, euint16) => euint16 test 2 (155, 155)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(155n);
- input.add16(155n);
+ it('test operator "or" overload (euint32, euint8) => euint32 test 4 (184, 180)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(184n);
+ input.add8(180n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint16_euint16(
+ const tx = await this.contract5.or_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(24025n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(188n);
});
- it('test operator "mul" overload (euint16, euint16) => euint16 test 3 (155, 155)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(155n);
- input.add16(155n);
+ it('test operator "xor" overload (euint32, euint8) => euint32 test 1 (1756250914, 211)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1756250914n);
+ input.add8(211n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint16_euint16(
+ const tx = await this.contract5.xor_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(24025n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(1756251121n);
});
- it('test operator "mul" overload (euint16, euint16) => euint16 test 4 (155, 155)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(155n);
- input.add16(155n);
+ it('test operator "xor" overload (euint32, euint8) => euint32 test 2 (207, 211)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(207n);
+ input.add8(211n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint16_euint16(
+ const tx = await this.contract5.xor_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(24025n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(28n);
});
- it('test operator "and" overload (euint16, euint16) => euint16 test 1 (3535, 5032)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(3535n);
- input.add16(5032n);
+ it('test operator "xor" overload (euint32, euint8) => euint32 test 3 (211, 211)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(211n);
+ input.add8(211n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint16_euint16(
+ const tx = await this.contract5.xor_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(392n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "and" overload (euint16, euint16) => euint16 test 2 (3531, 3535)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(3531n);
- input.add16(3535n);
+ it('test operator "xor" overload (euint32, euint8) => euint32 test 4 (211, 207)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(211n);
+ input.add8(207n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint16_euint16(
+ const tx = await this.contract5.xor_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(3531n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(28n);
});
- it('test operator "and" overload (euint16, euint16) => euint16 test 3 (3535, 3535)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(3535n);
- input.add16(3535n);
+ it('test operator "eq" overload (euint32, euint8) => ebool test 1 (2371399582, 166)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(2371399582n);
+ input.add8(166n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint16_euint16(
+ const tx = await this.contract5.eq_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(3535n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "and" overload (euint16, euint16) => euint16 test 4 (3535, 3531)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(3535n);
- input.add16(3531n);
+ it('test operator "eq" overload (euint32, euint8) => ebool test 2 (162, 166)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(162n);
+ input.add8(166n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint16_euint16(
+ const tx = await this.contract5.eq_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(3531n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "or" overload (euint16, euint16) => euint16 test 1 (33634, 27003)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(33634n);
- input.add16(27003n);
+ it('test operator "eq" overload (euint32, euint8) => ebool test 3 (166, 166)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(166n);
+ input.add8(166n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.or_euint16_euint16(
+ const tx = await this.contract5.eq_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(60283n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "or" overload (euint16, euint16) => euint16 test 2 (26999, 27003)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(26999n);
- input.add16(27003n);
+ it('test operator "eq" overload (euint32, euint8) => ebool test 4 (166, 162)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(166n);
+ input.add8(162n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.or_euint16_euint16(
+ const tx = await this.contract5.eq_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(27007n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "or" overload (euint16, euint16) => euint16 test 3 (27003, 27003)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(27003n);
- input.add16(27003n);
+ it('test operator "ne" overload (euint32, euint8) => ebool test 1 (1535914080, 80)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1535914080n);
+ input.add8(80n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.or_euint16_euint16(
+ const tx = await this.contract5.ne_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(27003n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "or" overload (euint16, euint16) => euint16 test 4 (27003, 26999)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(27003n);
- input.add16(26999n);
+ it('test operator "ne" overload (euint32, euint8) => ebool test 2 (76, 80)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(76n);
+ input.add8(80n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.or_euint16_euint16(
+ const tx = await this.contract5.ne_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(27007n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "xor" overload (euint16, euint16) => euint16 test 1 (64619, 2520)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(64619n);
- input.add16(2520n);
+ it('test operator "ne" overload (euint32, euint8) => ebool test 3 (80, 80)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(80n);
+ input.add8(80n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.xor_euint16_euint16(
+ const tx = await this.contract5.ne_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(62899n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "xor" overload (euint16, euint16) => euint16 test 2 (2516, 2520)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(2516n);
- input.add16(2520n);
+ it('test operator "ne" overload (euint32, euint8) => ebool test 4 (80, 76)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(80n);
+ input.add8(76n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.xor_euint16_euint16(
+ const tx = await this.contract5.ne_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(12n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "xor" overload (euint16, euint16) => euint16 test 3 (2520, 2520)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(2520n);
- input.add16(2520n);
+ it('test operator "ge" overload (euint32, euint8) => ebool test 1 (1009223821, 187)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1009223821n);
+ input.add8(187n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.xor_euint16_euint16(
+ const tx = await this.contract5.ge_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(0n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "xor" overload (euint16, euint16) => euint16 test 4 (2520, 2516)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(2520n);
- input.add16(2516n);
+ it('test operator "ge" overload (euint32, euint8) => ebool test 2 (183, 187)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(183n);
+ input.add8(187n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.xor_euint16_euint16(
+ const tx = await this.contract5.ge_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(12n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint16, euint16) => ebool test 1 (63705, 3249)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(63705n);
- input.add16(3249n);
+ it('test operator "ge" overload (euint32, euint8) => ebool test 3 (187, 187)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(187n);
+ input.add8(187n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint16_euint16(
+ const tx = await this.contract5.ge_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint16, euint16) => ebool test 2 (3245, 3249)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(3245n);
- input.add16(3249n);
+ it('test operator "ge" overload (euint32, euint8) => ebool test 4 (187, 183)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(187n);
+ input.add8(183n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint16_euint16(
+ const tx = await this.contract5.ge_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint16, euint16) => ebool test 3 (3249, 3249)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(3249n);
- input.add16(3249n);
+ it('test operator "gt" overload (euint32, euint8) => ebool test 1 (1381529874, 57)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1381529874n);
+ input.add8(57n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint16_euint16(
+ const tx = await this.contract5.gt_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint16, euint16) => ebool test 4 (3249, 3245)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(3249n);
- input.add16(3245n);
+ it('test operator "gt" overload (euint32, euint8) => ebool test 2 (53, 57)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(53n);
+ input.add8(57n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint16_euint16(
+ const tx = await this.contract5.gt_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint16, euint16) => ebool test 1 (27750, 23851)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(27750n);
- input.add16(23851n);
+ it('test operator "gt" overload (euint32, euint8) => ebool test 3 (57, 57)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(57n);
+ input.add8(57n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint16_euint16(
+ const tx = await this.contract5.gt_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint16, euint16) => ebool test 2 (23847, 23851)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(23847n);
- input.add16(23851n);
+ it('test operator "gt" overload (euint32, euint8) => ebool test 4 (57, 53)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(57n);
+ input.add8(53n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint16_euint16(
+ const tx = await this.contract5.gt_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint16, euint16) => ebool test 3 (23851, 23851)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(23851n);
- input.add16(23851n);
+ it('test operator "le" overload (euint32, euint8) => ebool test 1 (884339915, 183)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(884339915n);
+ input.add8(183n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint16_euint16(
+ const tx = await this.contract5.le_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint16, euint16) => ebool test 4 (23851, 23847)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(23851n);
- input.add16(23847n);
+ it('test operator "le" overload (euint32, euint8) => ebool test 2 (179, 183)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(179n);
+ input.add8(183n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint16_euint16(
+ const tx = await this.contract5.le_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint16, euint16) => ebool test 1 (8825, 39131)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(8825n);
- input.add16(39131n);
+ it('test operator "le" overload (euint32, euint8) => ebool test 3 (183, 183)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(183n);
+ input.add8(183n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint16_euint16(
+ const tx = await this.contract5.le_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint16, euint16) => ebool test 2 (8821, 8825)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(8821n);
- input.add16(8825n);
+ it('test operator "le" overload (euint32, euint8) => ebool test 4 (183, 179)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(183n);
+ input.add8(179n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint16_euint16(
+ const tx = await this.contract5.le_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint16, euint16) => ebool test 3 (8825, 8825)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(8825n);
- input.add16(8825n);
+ it('test operator "lt" overload (euint32, euint8) => ebool test 1 (1459989337, 220)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1459989337n);
+ input.add8(220n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint16_euint16(
+ const tx = await this.contract5.lt_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint16, euint16) => ebool test 4 (8825, 8821)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(8825n);
- input.add16(8821n);
+ it('test operator "lt" overload (euint32, euint8) => ebool test 2 (216, 220)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(216n);
+ input.add8(220n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint16_euint16(
+ const tx = await this.contract5.lt_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint16, euint16) => ebool test 1 (33735, 54333)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(33735n);
- input.add16(54333n);
+ it('test operator "lt" overload (euint32, euint8) => ebool test 3 (220, 220)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(220n);
+ input.add8(220n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint16_euint16(
+ const tx = await this.contract5.lt_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint16, euint16) => ebool test 2 (33731, 33735)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(33731n);
- input.add16(33735n);
+ it('test operator "lt" overload (euint32, euint8) => ebool test 4 (220, 216)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(220n);
+ input.add8(216n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint16_euint16(
+ const tx = await this.contract5.lt_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint16, euint16) => ebool test 3 (33735, 33735)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(33735n);
- input.add16(33735n);
+ it('test operator "min" overload (euint32, euint8) => euint32 test 1 (2070023085, 28)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(2070023085n);
+ input.add8(28n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint16_euint16(
+ const tx = await this.contract5.min_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(28n);
});
- it('test operator "gt" overload (euint16, euint16) => ebool test 4 (33735, 33731)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(33735n);
- input.add16(33731n);
+ it('test operator "min" overload (euint32, euint8) => euint32 test 2 (24, 28)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(24n);
+ input.add8(28n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint16_euint16(
+ const tx = await this.contract5.min_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(24n);
});
- it('test operator "le" overload (euint16, euint16) => ebool test 1 (38605, 53936)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(38605n);
- input.add16(53936n);
+ it('test operator "min" overload (euint32, euint8) => euint32 test 3 (28, 28)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(28n);
+ input.add8(28n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint16_euint16(
+ const tx = await this.contract5.min_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(28n);
});
- it('test operator "le" overload (euint16, euint16) => ebool test 2 (38601, 38605)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(38601n);
- input.add16(38605n);
+ it('test operator "min" overload (euint32, euint8) => euint32 test 4 (28, 24)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(28n);
+ input.add8(24n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint16_euint16(
+ const tx = await this.contract5.min_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(24n);
});
- it('test operator "le" overload (euint16, euint16) => ebool test 3 (38605, 38605)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(38605n);
- input.add16(38605n);
+ it('test operator "max" overload (euint32, euint8) => euint32 test 1 (2231185000, 65)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(2231185000n);
+ input.add8(65n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint16_euint16(
+ const tx = await this.contract5.max_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(2231185000n);
});
- it('test operator "le" overload (euint16, euint16) => ebool test 4 (38605, 38601)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(38605n);
- input.add16(38601n);
+ it('test operator "max" overload (euint32, euint8) => euint32 test 2 (61, 65)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(61n);
+ input.add8(65n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint16_euint16(
+ const tx = await this.contract5.max_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(65n);
});
- it('test operator "lt" overload (euint16, euint16) => ebool test 1 (59332, 12427)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(59332n);
- input.add16(12427n);
+ it('test operator "max" overload (euint32, euint8) => euint32 test 3 (65, 65)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(65n);
+ input.add8(65n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint16_euint16(
+ const tx = await this.contract5.max_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(65n);
});
- it('test operator "lt" overload (euint16, euint16) => ebool test 2 (12423, 12427)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12423n);
- input.add16(12427n);
+ it('test operator "max" overload (euint32, euint8) => euint32 test 4 (65, 61)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(65n);
+ input.add8(61n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint16_euint16(
+ const tx = await this.contract5.max_euint32_euint8(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(65n);
});
- it('test operator "lt" overload (euint16, euint16) => ebool test 3 (12427, 12427)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12427n);
- input.add16(12427n);
+ it('test operator "add" overload (euint32, euint16) => euint32 test 1 (35595, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(35595n);
+ input.add16(11n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint16_euint16(
+ const tx = await this.contract5.add_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(35606n);
});
- it('test operator "lt" overload (euint16, euint16) => ebool test 4 (12427, 12423)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12427n);
- input.add16(12423n);
+ it('test operator "add" overload (euint32, euint16) => euint32 test 2 (18477, 18479)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(18477n);
+ input.add16(18479n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint16_euint16(
+ const tx = await this.contract5.add_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(36956n);
});
- it('test operator "min" overload (euint16, euint16) => euint16 test 1 (18209, 14696)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(18209n);
- input.add16(14696n);
+ it('test operator "add" overload (euint32, euint16) => euint32 test 3 (18479, 18479)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(18479n);
+ input.add16(18479n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_euint16(
+ const tx = await this.contract5.add_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(14696n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(36958n);
});
- it('test operator "min" overload (euint16, euint16) => euint16 test 2 (14692, 14696)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(14692n);
- input.add16(14696n);
+ it('test operator "add" overload (euint32, euint16) => euint32 test 4 (18479, 18477)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(18479n);
+ input.add16(18477n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_euint16(
+ const tx = await this.contract5.add_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(14692n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(36956n);
});
- it('test operator "min" overload (euint16, euint16) => euint16 test 3 (14696, 14696)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(14696n);
- input.add16(14696n);
+ it('test operator "sub" overload (euint32, euint16) => euint32 test 1 (18922, 18922)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(18922n);
+ input.add16(18922n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_euint16(
+ const tx = await this.contract5.sub_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(14696n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "min" overload (euint16, euint16) => euint16 test 4 (14696, 14692)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(14696n);
- input.add16(14692n);
+ it('test operator "sub" overload (euint32, euint16) => euint32 test 2 (18922, 18918)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(18922n);
+ input.add16(18918n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_euint16(
+ const tx = await this.contract5.sub_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(14692n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(4n);
});
- it('test operator "max" overload (euint16, euint16) => euint16 test 1 (35722, 7688)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(35722n);
- input.add16(7688n);
+ it('test operator "mul" overload (euint32, euint16) => euint32 test 1 (30224, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(30224n);
+ input.add16(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_euint16(
+ const tx = await this.contract5.mul_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(35722n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(60448n);
});
- it('test operator "max" overload (euint16, euint16) => euint16 test 2 (7684, 7688)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(7684n);
- input.add16(7688n);
+ it('test operator "mul" overload (euint32, euint16) => euint32 test 2 (160, 160)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(160n);
+ input.add16(160n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_euint16(
+ const tx = await this.contract5.mul_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(7688n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(25600n);
});
- it('test operator "max" overload (euint16, euint16) => euint16 test 3 (7688, 7688)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(7688n);
- input.add16(7688n);
+ it('test operator "mul" overload (euint32, euint16) => euint32 test 3 (160, 160)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(160n);
+ input.add16(160n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_euint16(
+ const tx = await this.contract5.mul_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(7688n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(25600n);
});
- it('test operator "max" overload (euint16, euint16) => euint16 test 4 (7688, 7684)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(7688n);
- input.add16(7684n);
+ it('test operator "mul" overload (euint32, euint16) => euint32 test 4 (160, 160)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(160n);
+ input.add16(160n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_euint16(
+ const tx = await this.contract5.mul_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(7688n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(25600n);
});
- it('test operator "add" overload (euint16, euint32) => euint32 test 1 (2, 40496)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(2n);
- input.add32(40496n);
+ it('test operator "and" overload (euint32, euint16) => euint32 test 1 (1681139161, 6880)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1681139161n);
+ input.add16(6880n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint16_euint32(
+ const tx = await this.contract5.and_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(40498n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(192n);
});
- it('test operator "add" overload (euint16, euint32) => euint32 test 2 (18317, 18319)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(18317n);
- input.add32(18319n);
+ it('test operator "and" overload (euint32, euint16) => euint32 test 2 (6876, 6880)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(6876n);
+ input.add16(6880n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint16_euint32(
+ const tx = await this.contract5.and_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(36636n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(6848n);
});
- it('test operator "add" overload (euint16, euint32) => euint32 test 3 (18319, 18319)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(18319n);
- input.add32(18319n);
+ it('test operator "and" overload (euint32, euint16) => euint32 test 3 (6880, 6880)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(6880n);
+ input.add16(6880n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint16_euint32(
+ const tx = await this.contract5.and_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(36638n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(6880n);
});
- it('test operator "add" overload (euint16, euint32) => euint32 test 4 (18319, 18317)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(18319n);
- input.add32(18317n);
+ it('test operator "and" overload (euint32, euint16) => euint32 test 4 (6880, 6876)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(6880n);
+ input.add16(6876n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint16_euint32(
+ const tx = await this.contract5.and_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(36636n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(6848n);
});
- it('test operator "sub" overload (euint16, euint32) => euint32 test 1 (17812, 17812)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(17812n);
- input.add32(17812n);
+ it('test operator "or" overload (euint32, euint16) => euint32 test 1 (68701034, 41103)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(68701034n);
+ input.add16(41103n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.sub_euint16_euint32(
+ const tx = await this.contract5.or_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(0n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(68742127n);
});
- it('test operator "sub" overload (euint16, euint32) => euint32 test 2 (17812, 17808)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(17812n);
- input.add32(17808n);
+ it('test operator "or" overload (euint32, euint16) => euint32 test 2 (41099, 41103)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(41099n);
+ input.add16(41103n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.sub_euint16_euint32(
+ const tx = await this.contract5.or_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(4n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(41103n);
});
- it('test operator "mul" overload (euint16, euint32) => euint32 test 1 (2, 18411)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(2n);
- input.add32(18411n);
+ it('test operator "or" overload (euint32, euint16) => euint32 test 3 (41103, 41103)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(41103n);
+ input.add16(41103n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint16_euint32(
+ const tx = await this.contract5.or_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(36822n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(41103n);
});
- it('test operator "mul" overload (euint16, euint32) => euint32 test 2 (139, 139)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(139n);
- input.add32(139n);
+ it('test operator "or" overload (euint32, euint16) => euint32 test 4 (41103, 41099)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(41103n);
+ input.add16(41099n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint16_euint32(
+ const tx = await this.contract5.or_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(19321n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(41103n);
});
- it('test operator "mul" overload (euint16, euint32) => euint32 test 3 (139, 139)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(139n);
- input.add32(139n);
+ it('test operator "xor" overload (euint32, euint16) => euint32 test 1 (3818112177, 23871)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3818112177n);
+ input.add16(23871n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint16_euint32(
+ const tx = await this.contract5.xor_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(19321n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(3818101134n);
});
- it('test operator "mul" overload (euint16, euint32) => euint32 test 4 (139, 139)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(139n);
- input.add32(139n);
+ it('test operator "xor" overload (euint32, euint16) => euint32 test 2 (23867, 23871)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(23867n);
+ input.add16(23871n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint16_euint32(
+ const tx = await this.contract5.xor_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(19321n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(4n);
});
- it('test operator "and" overload (euint16, euint32) => euint32 test 1 (27862, 1736690738)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(27862n);
- input.add32(1736690738n);
+ it('test operator "xor" overload (euint32, euint16) => euint32 test 3 (23871, 23871)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(23871n);
+ input.add16(23871n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint16_euint32(
+ const tx = await this.contract5.xor_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(19474n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "and" overload (euint16, euint32) => euint32 test 2 (27858, 27862)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(27858n);
- input.add32(27862n);
+ it('test operator "xor" overload (euint32, euint16) => euint32 test 4 (23871, 23867)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(23871n);
+ input.add16(23867n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint16_euint32(
+ const tx = await this.contract5.xor_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(27858n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(4n);
});
- it('test operator "and" overload (euint16, euint32) => euint32 test 3 (27862, 27862)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(27862n);
- input.add32(27862n);
+ it('test operator "eq" overload (euint32, euint16) => ebool test 1 (843782707, 34473)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(843782707n);
+ input.add16(34473n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint16_euint32(
+ const tx = await this.contract5.eq_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(27862n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "and" overload (euint16, euint32) => euint32 test 4 (27862, 27858)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(27862n);
- input.add32(27858n);
+ it('test operator "eq" overload (euint32, euint16) => ebool test 2 (34469, 34473)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(34469n);
+ input.add16(34473n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint16_euint32(
+ const tx = await this.contract5.eq_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(27858n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "or" overload (euint16, euint32) => euint32 test 1 (440, 1863142416)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(440n);
- input.add32(1863142416n);
+ it('test operator "eq" overload (euint32, euint16) => ebool test 3 (34473, 34473)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(34473n);
+ input.add16(34473n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.or_euint16_euint32(
+ const tx = await this.contract5.eq_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(1863142840n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "or" overload (euint16, euint32) => euint32 test 2 (436, 440)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(436n);
- input.add32(440n);
+ it('test operator "eq" overload (euint32, euint16) => ebool test 4 (34473, 34469)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(34473n);
+ input.add16(34469n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.or_euint16_euint32(
+ const tx = await this.contract5.eq_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(444n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "or" overload (euint16, euint32) => euint32 test 3 (440, 440)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(440n);
- input.add32(440n);
+ it('test operator "ne" overload (euint32, euint16) => ebool test 1 (3735850389, 7960)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3735850389n);
+ input.add16(7960n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.or_euint16_euint32(
+ const tx = await this.contract5.ne_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(440n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "or" overload (euint16, euint32) => euint32 test 4 (440, 436)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(440n);
- input.add32(436n);
+ it('test operator "ne" overload (euint32, euint16) => ebool test 2 (7956, 7960)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(7956n);
+ input.add16(7960n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.or_euint16_euint32(
+ const tx = await this.contract5.ne_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(444n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "xor" overload (euint16, euint32) => euint32 test 1 (51717, 501889469)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(51717n);
- input.add32(501889469n);
+ it('test operator "ne" overload (euint32, euint16) => ebool test 3 (7960, 7960)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(7960n);
+ input.add16(7960n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.xor_euint16_euint32(
+ const tx = await this.contract5.ne_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(501937080n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "xor" overload (euint16, euint32) => euint32 test 2 (51713, 51717)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(51713n);
- input.add32(51717n);
+ it('test operator "ne" overload (euint32, euint16) => ebool test 4 (7960, 7956)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(7960n);
+ input.add16(7956n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.xor_euint16_euint32(
+ const tx = await this.contract5.ne_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(4n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "xor" overload (euint16, euint32) => euint32 test 3 (51717, 51717)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(51717n);
- input.add32(51717n);
+ it('test operator "ge" overload (euint32, euint16) => ebool test 1 (3233856655, 54626)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3233856655n);
+ input.add16(54626n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.xor_euint16_euint32(
+ const tx = await this.contract5.ge_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(0n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "xor" overload (euint16, euint32) => euint32 test 4 (51717, 51713)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(51717n);
- input.add32(51713n);
+ it('test operator "ge" overload (euint32, euint16) => ebool test 2 (54622, 54626)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(54622n);
+ input.add16(54626n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.xor_euint16_euint32(
+ const tx = await this.contract5.ge_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(4n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint16, euint32) => ebool test 1 (19428, 3260350416)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(19428n);
- input.add32(3260350416n);
+ it('test operator "ge" overload (euint32, euint16) => ebool test 3 (54626, 54626)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(54626n);
+ input.add16(54626n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint16_euint32(
+ const tx = await this.contract5.ge_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint16, euint32) => ebool test 2 (19424, 19428)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(19424n);
- input.add32(19428n);
+ it('test operator "ge" overload (euint32, euint16) => ebool test 4 (54626, 54622)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(54626n);
+ input.add16(54622n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint16_euint32(
+ const tx = await this.contract5.ge_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint16, euint32) => ebool test 3 (19428, 19428)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(19428n);
- input.add32(19428n);
+ it('test operator "gt" overload (euint32, euint16) => ebool test 1 (1059995818, 54018)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1059995818n);
+ input.add16(54018n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint16_euint32(
+ const tx = await this.contract5.gt_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint16, euint32) => ebool test 4 (19428, 19424)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(19428n);
- input.add32(19424n);
+ it('test operator "gt" overload (euint32, euint16) => ebool test 2 (54014, 54018)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(54014n);
+ input.add16(54018n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint16_euint32(
+ const tx = await this.contract5.gt_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint16, euint32) => ebool test 1 (4461, 3322499889)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(4461n);
- input.add32(3322499889n);
+ it('test operator "gt" overload (euint32, euint16) => ebool test 3 (54018, 54018)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(54018n);
+ input.add16(54018n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint16_euint32(
+ const tx = await this.contract5.gt_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint16, euint32) => ebool test 2 (4457, 4461)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(4457n);
- input.add32(4461n);
+ it('test operator "gt" overload (euint32, euint16) => ebool test 4 (54018, 54014)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(54018n);
+ input.add16(54014n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint16_euint32(
+ const tx = await this.contract5.gt_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint16, euint32) => ebool test 3 (4461, 4461)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(4461n);
- input.add32(4461n);
+ it('test operator "le" overload (euint32, euint16) => ebool test 1 (787386715, 25220)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(787386715n);
+ input.add16(25220n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint16_euint32(
+ const tx = await this.contract5.le_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint16, euint32) => ebool test 4 (4461, 4457)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(4461n);
- input.add32(4457n);
+ it('test operator "le" overload (euint32, euint16) => ebool test 2 (25216, 25220)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(25216n);
+ input.add16(25220n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint16_euint32(
+ const tx = await this.contract5.le_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint16, euint32) => ebool test 1 (23826, 3191695510)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(23826n);
- input.add32(3191695510n);
+ it('test operator "le" overload (euint32, euint16) => ebool test 3 (25220, 25220)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(25220n);
+ input.add16(25220n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint16_euint32(
+ const tx = await this.contract5.le_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint16, euint32) => ebool test 2 (23822, 23826)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(23822n);
- input.add32(23826n);
+ it('test operator "le" overload (euint32, euint16) => ebool test 4 (25220, 25216)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(25220n);
+ input.add16(25216n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint16_euint32(
+ const tx = await this.contract5.le_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint16, euint32) => ebool test 3 (23826, 23826)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(23826n);
- input.add32(23826n);
+ it('test operator "lt" overload (euint32, euint16) => ebool test 1 (2091084769, 25571)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(2091084769n);
+ input.add16(25571n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint16_euint32(
+ const tx = await this.contract5.lt_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint16, euint32) => ebool test 4 (23826, 23822)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(23826n);
- input.add32(23822n);
+ it('test operator "lt" overload (euint32, euint16) => ebool test 2 (25567, 25571)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(25567n);
+ input.add16(25571n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint16_euint32(
+ const tx = await this.contract5.lt_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint16, euint32) => ebool test 1 (20452, 2742403767)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(20452n);
- input.add32(2742403767n);
+ it('test operator "lt" overload (euint32, euint16) => ebool test 3 (25571, 25571)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(25571n);
+ input.add16(25571n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint16_euint32(
+ const tx = await this.contract5.lt_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint16, euint32) => ebool test 2 (20448, 20452)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(20448n);
- input.add32(20452n);
+ it('test operator "lt" overload (euint32, euint16) => ebool test 4 (25571, 25567)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(25571n);
+ input.add16(25567n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint16_euint32(
+ const tx = await this.contract5.lt_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint16, euint32) => ebool test 3 (20452, 20452)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(20452n);
- input.add32(20452n);
+ it('test operator "min" overload (euint32, euint16) => euint32 test 1 (3265803083, 25661)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3265803083n);
+ input.add16(25661n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint16_euint32(
+ const tx = await this.contract5.min_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(25661n);
});
- it('test operator "gt" overload (euint16, euint32) => ebool test 4 (20452, 20448)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(20452n);
- input.add32(20448n);
+ it('test operator "min" overload (euint32, euint16) => euint32 test 2 (25657, 25661)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(25657n);
+ input.add16(25661n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint16_euint32(
+ const tx = await this.contract5.min_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(25657n);
});
- it('test operator "le" overload (euint16, euint32) => ebool test 1 (32489, 2097840840)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(32489n);
- input.add32(2097840840n);
+ it('test operator "min" overload (euint32, euint16) => euint32 test 3 (25661, 25661)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(25661n);
+ input.add16(25661n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint16_euint32(
+ const tx = await this.contract5.min_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(25661n);
});
- it('test operator "le" overload (euint16, euint32) => ebool test 2 (32485, 32489)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(32485n);
- input.add32(32489n);
+ it('test operator "min" overload (euint32, euint16) => euint32 test 4 (25661, 25657)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(25661n);
+ input.add16(25657n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint16_euint32(
+ const tx = await this.contract5.min_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(25657n);
});
- it('test operator "le" overload (euint16, euint32) => ebool test 3 (32489, 32489)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(32489n);
- input.add32(32489n);
+ it('test operator "max" overload (euint32, euint16) => euint32 test 1 (1606859063, 42684)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1606859063n);
+ input.add16(42684n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint16_euint32(
+ const tx = await this.contract5.max_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(1606859063n);
});
- it('test operator "le" overload (euint16, euint32) => ebool test 4 (32489, 32485)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(32489n);
- input.add32(32485n);
+ it('test operator "max" overload (euint32, euint16) => euint32 test 2 (42680, 42684)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(42680n);
+ input.add16(42684n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint16_euint32(
+ const tx = await this.contract5.max_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(42684n);
});
- it('test operator "lt" overload (euint16, euint32) => ebool test 1 (46117, 3066026054)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(46117n);
- input.add32(3066026054n);
+ it('test operator "max" overload (euint32, euint16) => euint32 test 3 (42684, 42684)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(42684n);
+ input.add16(42684n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint16_euint32(
+ const tx = await this.contract5.max_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(42684n);
});
- it('test operator "lt" overload (euint16, euint32) => ebool test 2 (46113, 46117)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(46113n);
- input.add32(46117n);
+ it('test operator "max" overload (euint32, euint16) => euint32 test 4 (42684, 42680)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(42684n);
+ input.add16(42680n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint16_euint32(
+ const tx = await this.contract5.max_euint32_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(42684n);
});
- it('test operator "lt" overload (euint16, euint32) => ebool test 3 (46117, 46117)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(46117n);
- input.add32(46117n);
+ it('test operator "add" overload (euint32, euint32) => euint32 test 1 (1855544902, 1743021443)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1855544902n);
+ input.add32(1743021443n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint16_euint32(
+ const tx = await this.contract5.add_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(3598566345n);
});
- it('test operator "lt" overload (euint16, euint32) => ebool test 4 (46117, 46113)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(46117n);
- input.add32(46113n);
+ it('test operator "add" overload (euint32, euint32) => euint32 test 2 (1743021441, 1743021443)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1743021441n);
+ input.add32(1743021443n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint16_euint32(
+ const tx = await this.contract5.add_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(3486042884n);
+ });
+
+ it('test operator "add" overload (euint32, euint32) => euint32 test 3 (1743021443, 1743021443)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1743021443n);
+ input.add32(1743021443n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.add_euint32_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(3486042886n);
});
- it('test operator "min" overload (euint16, euint32) => euint32 test 1 (5231, 2030449754)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(5231n);
- input.add32(2030449754n);
+ it('test operator "add" overload (euint32, euint32) => euint32 test 4 (1743021443, 1743021441)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1743021443n);
+ input.add32(1743021441n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_euint32(
+ const tx = await this.contract5.add_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(5231n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(3486042884n);
});
- it('test operator "min" overload (euint16, euint32) => euint32 test 2 (5227, 5231)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(5227n);
- input.add32(5231n);
+ it('test operator "sub" overload (euint32, euint32) => euint32 test 1 (1818111464, 1818111464)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1818111464n);
+ input.add32(1818111464n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_euint32(
+ const tx = await this.contract5.sub_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(5227n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "min" overload (euint16, euint32) => euint32 test 3 (5231, 5231)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(5231n);
- input.add32(5231n);
+ it('test operator "sub" overload (euint32, euint32) => euint32 test 2 (1818111464, 1818111460)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1818111464n);
+ input.add32(1818111460n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_euint32(
+ const tx = await this.contract5.sub_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(5231n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(4n);
});
- it('test operator "min" overload (euint16, euint32) => euint32 test 4 (5231, 5227)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(5231n);
- input.add32(5227n);
+ it('test operator "mul" overload (euint32, euint32) => euint32 test 1 (96111, 23856)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(96111n);
+ input.add32(23856n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_euint32(
+ const tx = await this.contract5.mul_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(5227n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(2292824016n);
});
- it('test operator "max" overload (euint16, euint32) => euint32 test 1 (34046, 3126513605)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(34046n);
- input.add32(3126513605n);
+ it('test operator "mul" overload (euint32, euint32) => euint32 test 2 (47710, 47710)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(47710n);
+ input.add32(47710n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_euint32(
+ const tx = await this.contract5.mul_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(3126513605n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(2276244100n);
});
- it('test operator "max" overload (euint16, euint32) => euint32 test 2 (34042, 34046)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(34042n);
- input.add32(34046n);
+ it('test operator "mul" overload (euint32, euint32) => euint32 test 3 (47710, 47710)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(47710n);
+ input.add32(47710n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_euint32(
+ const tx = await this.contract5.mul_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(34046n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(2276244100n);
});
- it('test operator "max" overload (euint16, euint32) => euint32 test 3 (34046, 34046)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(34046n);
- input.add32(34046n);
+ it('test operator "mul" overload (euint32, euint32) => euint32 test 4 (47710, 47710)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(47710n);
+ input.add32(47710n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_euint32(
+ const tx = await this.contract5.mul_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(34046n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(2276244100n);
});
- it('test operator "max" overload (euint16, euint32) => euint32 test 4 (34046, 34042)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(34046n);
- input.add32(34042n);
+ it('test operator "and" overload (euint32, euint32) => euint32 test 1 (3317288822, 1342588191)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3317288822n);
+ input.add32(1342588191n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_euint32(
+ const tx = await this.contract5.and_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(34046n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(1073759510n);
});
- it('test operator "add" overload (euint16, euint64) => euint64 test 1 (2, 65506)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(2n);
- input.add64(65506n);
+ it('test operator "and" overload (euint32, euint32) => euint32 test 2 (1342588187, 1342588191)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1342588187n);
+ input.add32(1342588191n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint16_euint64(
+ const tx = await this.contract5.and_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(65508n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(1342588187n);
});
- it('test operator "add" overload (euint16, euint64) => euint64 test 2 (12725, 12729)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12725n);
- input.add64(12729n);
+ it('test operator "and" overload (euint32, euint32) => euint32 test 3 (1342588191, 1342588191)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1342588191n);
+ input.add32(1342588191n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint16_euint64(
+ const tx = await this.contract5.and_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(25454n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(1342588191n);
});
- it('test operator "add" overload (euint16, euint64) => euint64 test 3 (12729, 12729)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12729n);
- input.add64(12729n);
+ it('test operator "and" overload (euint32, euint32) => euint32 test 4 (1342588191, 1342588187)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1342588191n);
+ input.add32(1342588187n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint16_euint64(
+ const tx = await this.contract5.and_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(25458n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(1342588187n);
});
- it('test operator "add" overload (euint16, euint64) => euint64 test 4 (12729, 12725)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12729n);
- input.add64(12725n);
+ it('test operator "or" overload (euint32, euint32) => euint32 test 1 (1707541891, 1244554527)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1707541891n);
+ input.add32(1244554527n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint16_euint64(
+ const tx = await this.contract5.or_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(25454n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(1877960095n);
});
- it('test operator "sub" overload (euint16, euint64) => euint64 test 1 (45021, 45021)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(45021n);
- input.add64(45021n);
+ it('test operator "or" overload (euint32, euint32) => euint32 test 2 (1244554523, 1244554527)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1244554523n);
+ input.add32(1244554527n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.sub_euint16_euint64(
+ const tx = await this.contract5.or_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(0n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(1244554527n);
});
- it('test operator "sub" overload (euint16, euint64) => euint64 test 2 (45021, 45017)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(45021n);
- input.add64(45017n);
+ it('test operator "or" overload (euint32, euint32) => euint32 test 3 (1244554527, 1244554527)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1244554527n);
+ input.add32(1244554527n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.sub_euint16_euint64(
+ const tx = await this.contract5.or_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(4n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(1244554527n);
});
- it('test operator "mul" overload (euint16, euint64) => euint64 test 1 (2, 32761)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(2n);
- input.add64(32761n);
+ it('test operator "or" overload (euint32, euint32) => euint32 test 4 (1244554527, 1244554523)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1244554527n);
+ input.add32(1244554523n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint16_euint64(
+ const tx = await this.contract5.or_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(65522n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(1244554527n);
});
- it('test operator "mul" overload (euint16, euint64) => euint64 test 2 (221, 221)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(221n);
- input.add64(221n);
+ it('test operator "xor" overload (euint32, euint32) => euint32 test 1 (3766539452, 3557659859)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3766539452n);
+ input.add32(3557659859n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint16_euint64(
+ const tx = await this.contract5.xor_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(48841n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(881672303n);
});
- it('test operator "mul" overload (euint16, euint64) => euint64 test 3 (221, 221)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(221n);
- input.add64(221n);
+ it('test operator "xor" overload (euint32, euint32) => euint32 test 2 (3557659855, 3557659859)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3557659855n);
+ input.add32(3557659859n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint16_euint64(
+ const tx = await this.contract5.xor_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(48841n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(28n);
});
- it('test operator "mul" overload (euint16, euint64) => euint64 test 4 (221, 221)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(221n);
- input.add64(221n);
+ it('test operator "xor" overload (euint32, euint32) => euint32 test 3 (3557659859, 3557659859)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3557659859n);
+ input.add32(3557659859n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint16_euint64(
+ const tx = await this.contract5.xor_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(48841n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "and" overload (euint16, euint64) => euint64 test 1 (17953, 18443736631892089939)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(17953n);
- input.add64(18443736631892089939n);
+ it('test operator "xor" overload (euint32, euint32) => euint32 test 4 (3557659859, 3557659855)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3557659859n);
+ input.add32(3557659855n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint16_euint64(
+ const tx = await this.contract5.xor_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(1025n);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(28n);
});
- it('test operator "and" overload (euint16, euint64) => euint64 test 2 (17949, 17953)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(17949n);
- input.add64(17953n);
+ it('test operator "eq" overload (euint32, euint32) => ebool test 1 (3899668665, 3823635226)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3899668665n);
+ input.add32(3823635226n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint16_euint64(
+ const tx = await this.contract5.eq_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(17921n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "and" overload (euint16, euint64) => euint64 test 3 (17953, 17953)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(17953n);
- input.add64(17953n);
+ it('test operator "eq" overload (euint32, euint32) => ebool test 2 (3823635222, 3823635226)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3823635222n);
+ input.add32(3823635226n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint16_euint64(
+ const tx = await this.contract5.eq_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(17953n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "and" overload (euint16, euint64) => euint64 test 4 (17953, 17949)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(17953n);
- input.add64(17949n);
+ it('test operator "eq" overload (euint32, euint32) => ebool test 3 (3823635226, 3823635226)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3823635226n);
+ input.add32(3823635226n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint16_euint64(
+ const tx = await this.contract5.eq_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(17921n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "or" overload (euint16, euint64) => euint64 test 1 (12837, 18444850378165005521)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12837n);
- input.add64(18444850378165005521n);
+ it('test operator "eq" overload (euint32, euint32) => ebool test 4 (3823635226, 3823635222)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3823635226n);
+ input.add32(3823635222n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.or_euint16_euint64(
+ const tx = await this.contract5.eq_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(18444850378165010165n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "or" overload (euint16, euint64) => euint64 test 2 (12833, 12837)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12833n);
- input.add64(12837n);
+ it('test operator "ne" overload (euint32, euint32) => ebool test 1 (440396727, 1222940316)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(440396727n);
+ input.add32(1222940316n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.or_euint16_euint64(
+ const tx = await this.contract5.ne_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(12837n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "or" overload (euint16, euint64) => euint64 test 3 (12837, 12837)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12837n);
- input.add64(12837n);
+ it('test operator "ne" overload (euint32, euint32) => ebool test 2 (440396723, 440396727)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(440396723n);
+ input.add32(440396727n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.or_euint16_euint64(
+ const tx = await this.contract5.ne_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(12837n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "or" overload (euint16, euint64) => euint64 test 4 (12837, 12833)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12837n);
- input.add64(12833n);
+ it('test operator "ne" overload (euint32, euint32) => ebool test 3 (440396727, 440396727)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(440396727n);
+ input.add32(440396727n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.or_euint16_euint64(
+ const tx = await this.contract5.ne_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(12837n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
});
- it('test operator "xor" overload (euint16, euint64) => euint64 test 1 (12673, 18438027026491597713)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12673n);
- input.add64(18438027026491597713n);
+ it('test operator "ne" overload (euint32, euint32) => ebool test 4 (440396727, 440396723)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(440396727n);
+ input.add32(440396723n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.xor_euint16_euint64(
+ const tx = await this.contract5.ne_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(18438027026491593232n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "xor" overload (euint16, euint64) => euint64 test 2 (12669, 12673)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12669n);
- input.add64(12673n);
+ it('test operator "ge" overload (euint32, euint32) => ebool test 1 (929694790, 907768232)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(929694790n);
+ input.add32(907768232n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.xor_euint16_euint64(
+ const tx = await this.contract5.ge_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(252n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "xor" overload (euint16, euint64) => euint64 test 3 (12673, 12673)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12673n);
- input.add64(12673n);
+ it('test operator "ge" overload (euint32, euint32) => ebool test 2 (907768228, 907768232)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(907768228n);
+ input.add32(907768232n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.xor_euint16_euint64(
+ const tx = await this.contract5.ge_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(0n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint32, euint32) => ebool test 3 (907768232, 907768232)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(907768232n);
+ input.add32(907768232n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.ge_euint32_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint32, euint32) => ebool test 4 (907768232, 907768228)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(907768232n);
+ input.add32(907768228n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.ge_euint32_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "xor" overload (euint16, euint64) => euint64 test 4 (12673, 12669)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12673n);
- input.add64(12669n);
+ it('test operator "gt" overload (euint32, euint32) => ebool test 1 (3794643996, 619151916)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3794643996n);
+ input.add32(619151916n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.xor_euint16_euint64(
+ const tx = await this.contract5.gt_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(252n);
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint16, euint64) => ebool test 1 (15185, 18442214214141554887)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(15185n);
- input.add64(18442214214141554887n);
+ it('test operator "gt" overload (euint32, euint32) => ebool test 2 (619151912, 619151916)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(619151912n);
+ input.add32(619151916n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint16_euint64(
+ const tx = await this.contract5.gt_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint16, euint64) => ebool test 2 (15181, 15185)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(15181n);
- input.add64(15185n);
+ it('test operator "gt" overload (euint32, euint32) => ebool test 3 (619151916, 619151916)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(619151916n);
+ input.add32(619151916n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint16_euint64(
+ const tx = await this.contract5.gt_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint16, euint64) => ebool test 3 (15185, 15185)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(15185n);
- input.add64(15185n);
+ it('test operator "gt" overload (euint32, euint32) => ebool test 4 (619151916, 619151912)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(619151916n);
+ input.add32(619151912n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint16_euint64(
+ const tx = await this.contract5.gt_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint16, euint64) => ebool test 4 (15185, 15181)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(15185n);
- input.add64(15181n);
+ it('test operator "le" overload (euint32, euint32) => ebool test 1 (1814515265, 1215301262)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1814515265n);
+ input.add32(1215301262n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint16_euint64(
+ const tx = await this.contract5.le_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint16, euint64) => ebool test 1 (6072, 18442627728041568827)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(6072n);
- input.add64(18442627728041568827n);
+ it('test operator "le" overload (euint32, euint32) => ebool test 2 (1215301258, 1215301262)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1215301258n);
+ input.add32(1215301262n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint16_euint64(
+ const tx = await this.contract5.le_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint16, euint64) => ebool test 2 (6068, 6072)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(6068n);
- input.add64(6072n);
+ it('test operator "le" overload (euint32, euint32) => ebool test 3 (1215301262, 1215301262)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1215301262n);
+ input.add32(1215301262n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint16_euint64(
+ const tx = await this.contract5.le_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint16, euint64) => ebool test 3 (6072, 6072)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(6072n);
- input.add64(6072n);
+ it('test operator "le" overload (euint32, euint32) => ebool test 4 (1215301262, 1215301258)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1215301262n);
+ input.add32(1215301258n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint16_euint64(
+ const tx = await this.contract5.le_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint16, euint64) => ebool test 4 (6072, 6068)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(6072n);
- input.add64(6068n);
+ it('test operator "lt" overload (euint32, euint32) => ebool test 1 (597865082, 2797648845)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(597865082n);
+ input.add32(2797648845n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.lt_euint32_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint32, euint32) => ebool test 2 (597865078, 597865082)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(597865078n);
+ input.add32(597865082n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint16_euint64(
+ const tx = await this.contract5.lt_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint16, euint64) => ebool test 1 (63199, 18444428591303537867)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(63199n);
- input.add64(18444428591303537867n);
+ it('test operator "lt" overload (euint32, euint32) => ebool test 3 (597865082, 597865082)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(597865082n);
+ input.add32(597865082n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint16_euint64(
+ const tx = await this.contract5.lt_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint16, euint64) => ebool test 2 (63195, 63199)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(63195n);
- input.add64(63199n);
+ it('test operator "lt" overload (euint32, euint32) => ebool test 4 (597865082, 597865078)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(597865082n);
+ input.add32(597865078n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint16_euint64(
+ const tx = await this.contract5.lt_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract5.resb());
expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint16, euint64) => ebool test 3 (63199, 63199)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(63199n);
- input.add64(63199n);
+ it('test operator "min" overload (euint32, euint32) => euint32 test 1 (3167993396, 3198148813)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3167993396n);
+ input.add32(3198148813n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint16_euint64(
+ const tx = await this.contract5.min_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(3167993396n);
});
- it('test operator "ge" overload (euint16, euint64) => ebool test 4 (63199, 63195)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(63199n);
- input.add64(63195n);
+ it('test operator "min" overload (euint32, euint32) => euint32 test 2 (3167993392, 3167993396)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3167993392n);
+ input.add32(3167993396n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint16_euint64(
+ const tx = await this.contract5.min_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(3167993392n);
});
- it('test operator "gt" overload (euint16, euint64) => ebool test 1 (63105, 18440430414982980885)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(63105n);
- input.add64(18440430414982980885n);
+ it('test operator "min" overload (euint32, euint32) => euint32 test 3 (3167993396, 3167993396)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3167993396n);
+ input.add32(3167993396n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint16_euint64(
+ const tx = await this.contract5.min_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(3167993396n);
});
- it('test operator "gt" overload (euint16, euint64) => ebool test 2 (63101, 63105)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(63101n);
- input.add64(63105n);
+ it('test operator "min" overload (euint32, euint32) => euint32 test 4 (3167993396, 3167993392)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3167993396n);
+ input.add32(3167993392n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint16_euint64(
+ const tx = await this.contract5.min_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(3167993392n);
});
- it('test operator "gt" overload (euint16, euint64) => ebool test 3 (63105, 63105)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(63105n);
- input.add64(63105n);
+ it('test operator "max" overload (euint32, euint32) => euint32 test 1 (1310408559, 1943659319)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1310408559n);
+ input.add32(1943659319n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint16_euint64(
+ const tx = await this.contract5.max_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(1943659319n);
});
- it('test operator "gt" overload (euint16, euint64) => ebool test 4 (63105, 63101)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(63105n);
- input.add64(63101n);
+ it('test operator "max" overload (euint32, euint32) => euint32 test 2 (1310408555, 1310408559)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1310408555n);
+ input.add32(1310408559n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint16_euint64(
+ const tx = await this.contract5.max_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(1310408559n);
});
- it('test operator "le" overload (euint16, euint64) => ebool test 1 (46492, 18439416152876310159)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(46492n);
- input.add64(18439416152876310159n);
+ it('test operator "max" overload (euint32, euint32) => euint32 test 3 (1310408559, 1310408559)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1310408559n);
+ input.add32(1310408559n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint16_euint64(
+ const tx = await this.contract5.max_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(1310408559n);
});
- it('test operator "le" overload (euint16, euint64) => ebool test 2 (46488, 46492)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(46488n);
- input.add64(46492n);
+ it('test operator "max" overload (euint32, euint32) => euint32 test 4 (1310408559, 1310408555)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1310408559n);
+ input.add32(1310408555n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint16_euint64(
+ const tx = await this.contract5.max_euint32_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract5.res32());
+ expect(res).to.equal(1310408559n);
});
- it('test operator "le" overload (euint16, euint64) => ebool test 3 (46492, 46492)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(46492n);
- input.add64(46492n);
+ it('test operator "add" overload (euint32, euint64) => euint64 test 1 (2, 4294187631)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(2n);
+ input.add64(4294187631n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint16_euint64(
+ const tx = await this.contract5.add_euint32_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(4294187633n);
});
- it('test operator "le" overload (euint16, euint64) => ebool test 4 (46492, 46488)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(46492n);
- input.add64(46488n);
+ it('test operator "add" overload (euint32, euint64) => euint64 test 2 (1977492101, 1977492105)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1977492101n);
+ input.add64(1977492105n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint16_euint64(
+ const tx = await this.contract5.add_euint32_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(3954984206n);
});
- it('test operator "lt" overload (euint16, euint64) => ebool test 1 (20266, 18439286572290779257)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(20266n);
- input.add64(18439286572290779257n);
+ it('test operator "add" overload (euint32, euint64) => euint64 test 3 (1977492105, 1977492105)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1977492105n);
+ input.add64(1977492105n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint16_euint64(
+ const tx = await this.contract5.add_euint32_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(3954984210n);
});
- it('test operator "lt" overload (euint16, euint64) => ebool test 2 (20262, 20266)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(20262n);
- input.add64(20266n);
+ it('test operator "add" overload (euint32, euint64) => euint64 test 4 (1977492105, 1977492101)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1977492105n);
+ input.add64(1977492101n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint16_euint64(
+ const tx = await this.contract5.add_euint32_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(3954984206n);
});
- it('test operator "lt" overload (euint16, euint64) => ebool test 3 (20266, 20266)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(20266n);
- input.add64(20266n);
+ it('test operator "sub" overload (euint32, euint64) => euint64 test 1 (2880371585, 2880371585)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(2880371585n);
+ input.add64(2880371585n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint16_euint64(
+ const tx = await this.contract5.sub_euint32_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(0n);
});
- it('test operator "lt" overload (euint16, euint64) => ebool test 4 (20266, 20262)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(20266n);
- input.add64(20262n);
+ it('test operator "sub" overload (euint32, euint64) => euint64 test 2 (2880371585, 2880371581)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(2880371585n);
+ input.add64(2880371581n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint16_euint64(
+ const tx = await this.contract5.sub_euint32_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint32, euint64) => euint64 test 1 (2, 2146877501)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(2n);
+ input.add64(2146877501n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.mul_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(4293755002n);
+ });
+
+ it('test operator "mul" overload (euint32, euint64) => euint64 test 2 (43587, 43587)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(43587n);
+ input.add64(43587n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.mul_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(1899826569n);
+ });
+
+ it('test operator "mul" overload (euint32, euint64) => euint64 test 3 (43587, 43587)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(43587n);
+ input.add64(43587n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.mul_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(1899826569n);
+ });
+
+ it('test operator "mul" overload (euint32, euint64) => euint64 test 4 (43587, 43587)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(43587n);
+ input.add64(43587n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.mul_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(1899826569n);
+ });
+
+ it('test operator "and" overload (euint32, euint64) => euint64 test 1 (1745478480, 18442616126135451977)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1745478480n);
+ input.add64(18442616126135451977n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.and_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(1208074560n);
+ });
+
+ it('test operator "and" overload (euint32, euint64) => euint64 test 2 (1745478476, 1745478480)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1745478476n);
+ input.add64(1745478480n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.and_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(1745478464n);
+ });
+
+ it('test operator "and" overload (euint32, euint64) => euint64 test 3 (1745478480, 1745478480)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1745478480n);
+ input.add64(1745478480n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.and_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(1745478480n);
});
- it('test operator "min" overload (euint16, euint64) => euint64 test 1 (44251, 18443711845572494969)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(44251n);
- input.add64(18443711845572494969n);
+ it('test operator "and" overload (euint32, euint64) => euint64 test 4 (1745478480, 1745478476)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1745478480n);
+ input.add64(1745478476n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_euint64(
+ const tx = await this.contract5.and_euint32_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(44251n);
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(1745478464n);
});
- it('test operator "min" overload (euint16, euint64) => euint64 test 2 (44247, 44251)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(44247n);
- input.add64(44251n);
+ it('test operator "or" overload (euint32, euint64) => euint64 test 1 (1546853992, 18445417582546475671)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1546853992n);
+ input.add64(18445417582546475671n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_euint64(
+ const tx = await this.contract5.or_euint32_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(44247n);
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(18445417583755615999n);
});
- it('test operator "min" overload (euint16, euint64) => euint64 test 3 (44251, 44251)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(44251n);
- input.add64(44251n);
+ it('test operator "or" overload (euint32, euint64) => euint64 test 2 (1546853988, 1546853992)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1546853988n);
+ input.add64(1546853992n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_euint64(
+ const tx = await this.contract5.or_euint32_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(44251n);
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(1546853996n);
});
- it('test operator "min" overload (euint16, euint64) => euint64 test 4 (44251, 44247)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(44251n);
- input.add64(44247n);
+ it('test operator "or" overload (euint32, euint64) => euint64 test 3 (1546853992, 1546853992)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1546853992n);
+ input.add64(1546853992n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_euint64(
+ const tx = await this.contract5.or_euint32_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(44247n);
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(1546853992n);
});
- it('test operator "max" overload (euint16, euint64) => euint64 test 1 (28367, 18440532375906129937)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(28367n);
- input.add64(18440532375906129937n);
+ it('test operator "or" overload (euint32, euint64) => euint64 test 4 (1546853992, 1546853988)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1546853992n);
+ input.add64(1546853988n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_euint64(
+ const tx = await this.contract5.or_euint32_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(18440532375906129937n);
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(1546853996n);
});
- it('test operator "max" overload (euint16, euint64) => euint64 test 2 (28363, 28367)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(28363n);
- input.add64(28367n);
+ it('test operator "xor" overload (euint32, euint64) => euint64 test 1 (390302983, 18441970713749353087)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(390302983n);
+ input.add64(18441970713749353087n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_euint64(
+ const tx = await this.contract5.xor_euint32_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(28367n);
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(18441970713904316280n);
});
- it('test operator "max" overload (euint16, euint64) => euint64 test 3 (28367, 28367)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(28367n);
- input.add64(28367n);
+ it('test operator "xor" overload (euint32, euint64) => euint64 test 2 (390302979, 390302983)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(390302979n);
+ input.add64(390302983n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_euint64(
+ const tx = await this.contract5.xor_euint32_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(28367n);
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(4n);
});
- it('test operator "max" overload (euint16, euint64) => euint64 test 4 (28367, 28363)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(28367n);
- input.add64(28363n);
+ it('test operator "xor" overload (euint32, euint64) => euint64 test 3 (390302983, 390302983)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(390302983n);
+ input.add64(390302983n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_euint64(
+ const tx = await this.contract5.xor_euint32_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract3.res64());
- expect(res).to.equal(28367n);
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint32, euint64) => euint64 test 4 (390302983, 390302979)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(390302983n);
+ input.add64(390302979n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.xor_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract5.res64());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "eq" overload (euint32, euint64) => ebool test 1 (3575591686, 18441139457541916589)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3575591686n);
+ input.add64(18441139457541916589n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.eq_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint32, euint64) => ebool test 2 (3575591682, 3575591686)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3575591682n);
+ input.add64(3575591686n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.eq_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint32, euint64) => ebool test 3 (3575591686, 3575591686)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3575591686n);
+ input.add64(3575591686n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.eq_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint32, euint64) => ebool test 4 (3575591686, 3575591682)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(3575591686n);
+ input.add64(3575591682n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.eq_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint32, euint64) => ebool test 1 (1132249413, 18438312419950369711)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1132249413n);
+ input.add64(18438312419950369711n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.ne_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint32, euint64) => ebool test 2 (1132249409, 1132249413)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1132249409n);
+ input.add64(1132249413n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.ne_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint32, euint64) => ebool test 3 (1132249413, 1132249413)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1132249413n);
+ input.add64(1132249413n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.ne_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint32, euint64) => ebool test 4 (1132249413, 1132249409)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1132249413n);
+ input.add64(1132249409n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.ne_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint32, euint64) => ebool test 1 (2716663813, 18446666024340671893)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(2716663813n);
+ input.add64(18446666024340671893n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.ge_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint32, euint64) => ebool test 2 (2716663809, 2716663813)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(2716663809n);
+ input.add64(2716663813n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.ge_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint32, euint64) => ebool test 3 (2716663813, 2716663813)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(2716663813n);
+ input.add64(2716663813n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.ge_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint32, euint64) => ebool test 4 (2716663813, 2716663809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(2716663813n);
+ input.add64(2716663809n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.ge_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint32, euint64) => ebool test 1 (1898220780, 18441112726231908571)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1898220780n);
+ input.add64(18441112726231908571n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.gt_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint32, euint64) => ebool test 2 (1898220776, 1898220780)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1898220776n);
+ input.add64(1898220780n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.gt_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint32, euint64) => ebool test 3 (1898220780, 1898220780)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1898220780n);
+ input.add64(1898220780n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.gt_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint32, euint64) => ebool test 4 (1898220780, 1898220776)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address);
+ input.add32(1898220780n);
+ input.add64(1898220776n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract5.gt_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract5.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint32, euint64) => ebool test 1 (1718048813, 18439987431102861375)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1718048813n);
+ input.add64(18439987431102861375n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint32, euint64) => ebool test 2 (1718048809, 1718048813)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1718048809n);
+ input.add64(1718048813n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint32, euint64) => ebool test 3 (1718048813, 1718048813)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1718048813n);
+ input.add64(1718048813n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint32, euint64) => ebool test 4 (1718048813, 1718048809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1718048813n);
+ input.add64(1718048809n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint32, euint64) => ebool test 1 (3259927115, 18445091130782070813)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3259927115n);
+ input.add64(18445091130782070813n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint32, euint64) => ebool test 2 (3259927111, 3259927115)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3259927111n);
+ input.add64(3259927115n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint32, euint64) => ebool test 3 (3259927115, 3259927115)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3259927115n);
+ input.add64(3259927115n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint32, euint64) => ebool test 4 (3259927115, 3259927111)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3259927115n);
+ input.add64(3259927111n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint32, euint64) => euint64 test 1 (1841925700, 18442933982305840083)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1841925700n);
+ input.add64(18442933982305840083n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.min_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(1841925700n);
+ });
+
+ it('test operator "min" overload (euint32, euint64) => euint64 test 2 (1841925696, 1841925700)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1841925696n);
+ input.add64(1841925700n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.min_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(1841925696n);
+ });
+
+ it('test operator "min" overload (euint32, euint64) => euint64 test 3 (1841925700, 1841925700)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1841925700n);
+ input.add64(1841925700n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.min_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(1841925700n);
+ });
+
+ it('test operator "min" overload (euint32, euint64) => euint64 test 4 (1841925700, 1841925696)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1841925700n);
+ input.add64(1841925696n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.min_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(1841925696n);
+ });
+
+ it('test operator "max" overload (euint32, euint64) => euint64 test 1 (1980815436, 18446246159979986155)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1980815436n);
+ input.add64(18446246159979986155n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.max_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(18446246159979986155n);
+ });
+
+ it('test operator "max" overload (euint32, euint64) => euint64 test 2 (1980815432, 1980815436)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1980815432n);
+ input.add64(1980815436n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.max_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(1980815436n);
+ });
+
+ it('test operator "max" overload (euint32, euint64) => euint64 test 3 (1980815436, 1980815436)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1980815436n);
+ input.add64(1980815436n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.max_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(1980815436n);
+ });
+
+ it('test operator "max" overload (euint32, euint64) => euint64 test 4 (1980815436, 1980815432)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1980815436n);
+ input.add64(1980815432n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.max_euint32_euint64(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(1980815436n);
+ });
+
+ it('test operator "add" overload (euint32, euint128) => euint128 test 1 (2, 2147483649)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2n);
+ input.add128(2147483649n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.add_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(2147483651n);
+ });
+
+ it('test operator "add" overload (euint32, euint128) => euint128 test 2 (788156404, 788156408)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(788156404n);
+ input.add128(788156408n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.add_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(1576312812n);
+ });
+
+ it('test operator "add" overload (euint32, euint128) => euint128 test 3 (788156408, 788156408)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(788156408n);
+ input.add128(788156408n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.add_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(1576312816n);
+ });
+
+ it('test operator "add" overload (euint32, euint128) => euint128 test 4 (788156408, 788156404)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(788156408n);
+ input.add128(788156404n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.add_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(1576312812n);
+ });
+
+ it('test operator "sub" overload (euint32, euint128) => euint128 test 1 (3561141951, 3561141951)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3561141951n);
+ input.add128(3561141951n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.sub_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint32, euint128) => euint128 test 2 (3561141951, 3561141947)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3561141951n);
+ input.add128(3561141947n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.sub_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint32, euint128) => euint128 test 1 (2, 1073741825)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2n);
+ input.add128(1073741825n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.mul_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(2147483650n);
+ });
+
+ it('test operator "mul" overload (euint32, euint128) => euint128 test 2 (63676, 63676)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(63676n);
+ input.add128(63676n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.mul_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(4054632976n);
+ });
+
+ it('test operator "mul" overload (euint32, euint128) => euint128 test 3 (63676, 63676)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(63676n);
+ input.add128(63676n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.mul_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(4054632976n);
+ });
+
+ it('test operator "mul" overload (euint32, euint128) => euint128 test 4 (63676, 63676)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(63676n);
+ input.add128(63676n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.mul_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(4054632976n);
+ });
+
+ it('test operator "and" overload (euint32, euint128) => euint128 test 1 (2659354872, 340282366920938463463373182215335994821)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2659354872n);
+ input.add128(340282366920938463463373182215335994821n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.and_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(2424307904n);
+ });
+
+ it('test operator "and" overload (euint32, euint128) => euint128 test 2 (2659354868, 2659354872)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2659354868n);
+ input.add128(2659354872n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.and_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(2659354864n);
+ });
+
+ it('test operator "and" overload (euint32, euint128) => euint128 test 3 (2659354872, 2659354872)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2659354872n);
+ input.add128(2659354872n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.and_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(2659354872n);
+ });
+
+ it('test operator "and" overload (euint32, euint128) => euint128 test 4 (2659354872, 2659354868)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2659354872n);
+ input.add128(2659354868n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.and_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(2659354864n);
+ });
+
+ it('test operator "or" overload (euint32, euint128) => euint128 test 1 (1775515615, 340282366920938463463365726409727391809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1775515615n);
+ input.add128(340282366920938463463365726409727391809n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.or_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(340282366920938463463365726409758064607n);
+ });
+
+ it('test operator "or" overload (euint32, euint128) => euint128 test 2 (1775515611, 1775515615)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1775515611n);
+ input.add128(1775515615n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.or_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(1775515615n);
+ });
+
+ it('test operator "or" overload (euint32, euint128) => euint128 test 3 (1775515615, 1775515615)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1775515615n);
+ input.add128(1775515615n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.or_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(1775515615n);
+ });
+
+ it('test operator "or" overload (euint32, euint128) => euint128 test 4 (1775515615, 1775515611)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1775515615n);
+ input.add128(1775515611n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.or_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(1775515615n);
+ });
+
+ it('test operator "xor" overload (euint32, euint128) => euint128 test 1 (3049009589, 340282366920938463463368216078619273371)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3049009589n);
+ input.add128(340282366920938463463368216078619273371n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.xor_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(340282366920938463463368216080538425646n);
+ });
+
+ it('test operator "xor" overload (euint32, euint128) => euint128 test 2 (3049009585, 3049009589)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3049009585n);
+ input.add128(3049009589n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.xor_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "xor" overload (euint32, euint128) => euint128 test 3 (3049009589, 3049009589)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3049009589n);
+ input.add128(3049009589n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.xor_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint32, euint128) => euint128 test 4 (3049009589, 3049009585)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3049009589n);
+ input.add128(3049009585n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.xor_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "eq" overload (euint32, euint128) => ebool test 1 (764411697, 340282366920938463463368167171281881439)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(764411697n);
+ input.add128(340282366920938463463368167171281881439n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint32, euint128) => ebool test 2 (764411693, 764411697)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(764411693n);
+ input.add128(764411697n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint32, euint128) => ebool test 3 (764411697, 764411697)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(764411697n);
+ input.add128(764411697n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint32, euint128) => ebool test 4 (764411697, 764411693)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(764411697n);
+ input.add128(764411693n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint32, euint128) => ebool test 1 (3303815983, 340282366920938463463373693800095408137)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3303815983n);
+ input.add128(340282366920938463463373693800095408137n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint32, euint128) => ebool test 2 (3303815979, 3303815983)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3303815979n);
+ input.add128(3303815983n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint32, euint128) => ebool test 3 (3303815983, 3303815983)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3303815983n);
+ input.add128(3303815983n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint32, euint128) => ebool test 4 (3303815983, 3303815979)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3303815983n);
+ input.add128(3303815979n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint32, euint128) => ebool test 1 (3786584955, 340282366920938463463367364294961686443)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3786584955n);
+ input.add128(340282366920938463463367364294961686443n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ge_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint32, euint128) => ebool test 2 (3786584951, 3786584955)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3786584951n);
+ input.add128(3786584955n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ge_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint32, euint128) => ebool test 3 (3786584955, 3786584955)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3786584955n);
+ input.add128(3786584955n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ge_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint32, euint128) => ebool test 4 (3786584955, 3786584951)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3786584955n);
+ input.add128(3786584951n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ge_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint32, euint128) => ebool test 1 (4277077408, 340282366920938463463374604764991737889)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(4277077408n);
+ input.add128(340282366920938463463374604764991737889n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.gt_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint32, euint128) => ebool test 2 (4277077404, 4277077408)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(4277077404n);
+ input.add128(4277077408n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.gt_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint32, euint128) => ebool test 3 (4277077408, 4277077408)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(4277077408n);
+ input.add128(4277077408n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.gt_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint32, euint128) => ebool test 4 (4277077408, 4277077404)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(4277077408n);
+ input.add128(4277077404n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.gt_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint32, euint128) => ebool test 1 (867198677, 340282366920938463463369757600308236313)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(867198677n);
+ input.add128(340282366920938463463369757600308236313n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint32, euint128) => ebool test 2 (867198673, 867198677)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(867198673n);
+ input.add128(867198677n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint32, euint128) => ebool test 3 (867198677, 867198677)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(867198677n);
+ input.add128(867198677n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint32, euint128) => ebool test 4 (867198677, 867198673)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(867198677n);
+ input.add128(867198673n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint32, euint128) => ebool test 1 (2093199071, 340282366920938463463370622002914075235)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2093199071n);
+ input.add128(340282366920938463463370622002914075235n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint32, euint128) => ebool test 2 (2093199067, 2093199071)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2093199067n);
+ input.add128(2093199071n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint32, euint128) => ebool test 3 (2093199071, 2093199071)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2093199071n);
+ input.add128(2093199071n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint32, euint128) => ebool test 4 (2093199071, 2093199067)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2093199071n);
+ input.add128(2093199067n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint32, euint128) => euint128 test 1 (4003399201, 340282366920938463463365902462339741051)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(4003399201n);
+ input.add128(340282366920938463463365902462339741051n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.min_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(4003399201n);
+ });
+
+ it('test operator "min" overload (euint32, euint128) => euint128 test 2 (4003399197, 4003399201)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(4003399197n);
+ input.add128(4003399201n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.min_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(4003399197n);
+ });
+
+ it('test operator "min" overload (euint32, euint128) => euint128 test 3 (4003399201, 4003399201)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(4003399201n);
+ input.add128(4003399201n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.min_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(4003399201n);
+ });
+
+ it('test operator "min" overload (euint32, euint128) => euint128 test 4 (4003399201, 4003399197)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(4003399201n);
+ input.add128(4003399197n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.min_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(4003399197n);
+ });
+
+ it('test operator "max" overload (euint32, euint128) => euint128 test 1 (731106649, 340282366920938463463370948491424745963)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(731106649n);
+ input.add128(340282366920938463463370948491424745963n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.max_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(340282366920938463463370948491424745963n);
+ });
+
+ it('test operator "max" overload (euint32, euint128) => euint128 test 2 (731106645, 731106649)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(731106645n);
+ input.add128(731106649n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.max_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(731106649n);
+ });
+
+ it('test operator "max" overload (euint32, euint128) => euint128 test 3 (731106649, 731106649)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(731106649n);
+ input.add128(731106649n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.max_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(731106649n);
+ });
+
+ it('test operator "max" overload (euint32, euint128) => euint128 test 4 (731106649, 731106645)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(731106649n);
+ input.add128(731106645n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.max_euint32_euint128(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract6.res128());
+ expect(res).to.equal(731106649n);
+ });
+
+ it('test operator "add" overload (euint32, euint256) => euint256 test 1 (2, 2147483649)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2n);
+ input.add256(2147483649n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.add_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(2147483651n);
+ });
+
+ it('test operator "add" overload (euint32, euint256) => euint256 test 2 (1370548128, 1370548130)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1370548128n);
+ input.add256(1370548130n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.add_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(2741096258n);
+ });
+
+ it('test operator "add" overload (euint32, euint256) => euint256 test 3 (1370548130, 1370548130)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1370548130n);
+ input.add256(1370548130n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.add_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(2741096260n);
+ });
+
+ it('test operator "add" overload (euint32, euint256) => euint256 test 4 (1370548130, 1370548128)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1370548130n);
+ input.add256(1370548128n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.add_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(2741096258n);
+ });
+
+ it('test operator "sub" overload (euint32, euint256) => euint256 test 1 (3022897647, 3022897647)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3022897647n);
+ input.add256(3022897647n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.sub_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint32, euint256) => euint256 test 2 (3022897647, 3022897643)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3022897647n);
+ input.add256(3022897643n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.sub_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint32, euint256) => euint256 test 1 (2, 1073741825)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2n);
+ input.add256(1073741825n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.mul_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(2147483650n);
+ });
+
+ it('test operator "mul" overload (euint32, euint256) => euint256 test 2 (59596, 59596)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(59596n);
+ input.add256(59596n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.mul_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(3551683216n);
+ });
+
+ it('test operator "mul" overload (euint32, euint256) => euint256 test 3 (59596, 59596)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(59596n);
+ input.add256(59596n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.mul_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(3551683216n);
+ });
+
+ it('test operator "mul" overload (euint32, euint256) => euint256 test 4 (59596, 59596)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(59596n);
+ input.add256(59596n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.mul_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(3551683216n);
+ });
+
+ it('test operator "and" overload (euint32, euint256) => euint256 test 1 (3994882895, 115792089237316195423570985008687907853269984665640564039457577397354470817443)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3994882895n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577397354470817443n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.and_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(1310528003n);
+ });
+
+ it('test operator "and" overload (euint32, euint256) => euint256 test 2 (3994882891, 3994882895)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3994882891n);
+ input.add256(3994882895n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.and_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(3994882891n);
+ });
+
+ it('test operator "and" overload (euint32, euint256) => euint256 test 3 (3994882895, 3994882895)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3994882895n);
+ input.add256(3994882895n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.and_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(3994882895n);
+ });
+
+ it('test operator "and" overload (euint32, euint256) => euint256 test 4 (3994882895, 3994882891)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3994882895n);
+ input.add256(3994882891n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.and_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(3994882891n);
+ });
+
+ it('test operator "or" overload (euint32, euint256) => euint256 test 1 (2321952704, 115792089237316195423570985008687907853269984665640564039457581516412469896587)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2321952704n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581516412469896587n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.or_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457581516414655131595n);
+ });
+
+ it('test operator "or" overload (euint32, euint256) => euint256 test 2 (2321952700, 2321952704)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2321952700n);
+ input.add256(2321952704n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.or_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(2321952764n);
+ });
+
+ it('test operator "or" overload (euint32, euint256) => euint256 test 3 (2321952704, 2321952704)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2321952704n);
+ input.add256(2321952704n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.or_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(2321952704n);
+ });
+
+ it('test operator "or" overload (euint32, euint256) => euint256 test 4 (2321952704, 2321952700)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2321952704n);
+ input.add256(2321952700n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.or_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(2321952764n);
+ });
+
+ it('test operator "xor" overload (euint32, euint256) => euint256 test 1 (3706671686, 115792089237316195423570985008687907853269984665640564039457578090382088595177)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3706671686n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457578090382088595177n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.xor_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457578090383101310127n);
+ });
+
+ it('test operator "xor" overload (euint32, euint256) => euint256 test 2 (3706671682, 3706671686)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3706671682n);
+ input.add256(3706671686n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.xor_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "xor" overload (euint32, euint256) => euint256 test 3 (3706671686, 3706671686)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3706671686n);
+ input.add256(3706671686n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.xor_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint32, euint256) => euint256 test 4 (3706671686, 3706671682)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3706671686n);
+ input.add256(3706671682n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.xor_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "eq" overload (euint32, euint256) => ebool test 1 (1808856605, 115792089237316195423570985008687907853269984665640564039457582106419349698079)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1808856605n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582106419349698079n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint32, euint256) => ebool test 2 (1808856601, 1808856605)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1808856601n);
+ input.add256(1808856605n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint32, euint256) => ebool test 3 (1808856605, 1808856605)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1808856605n);
+ input.add256(1808856605n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint32, euint256) => ebool test 4 (1808856605, 1808856601)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1808856605n);
+ input.add256(1808856601n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint32, euint256) => ebool test 1 (3268569536, 115792089237316195423570985008687907853269984665640564039457577368549107012293)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3268569536n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457577368549107012293n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint32, euint256) => ebool test 2 (3268569532, 3268569536)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3268569532n);
+ input.add256(3268569536n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint32, euint256) => ebool test 3 (3268569536, 3268569536)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3268569536n);
+ input.add256(3268569536n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint32, euint256) => ebool test 4 (3268569536, 3268569532)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3268569536n);
+ input.add256(3268569532n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint32, euint256) => ebool test 1 (3646475026, 115792089237316195423570985008687907853269984665640564039457583473653753763859)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3646475026n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457583473653753763859n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ge_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint32, euint256) => ebool test 2 (3646475022, 3646475026)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3646475022n);
+ input.add256(3646475026n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ge_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint32, euint256) => ebool test 3 (3646475026, 3646475026)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3646475026n);
+ input.add256(3646475026n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ge_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint32, euint256) => ebool test 4 (3646475026, 3646475022)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3646475026n);
+ input.add256(3646475022n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ge_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint32, euint256) => ebool test 1 (27376130, 115792089237316195423570985008687907853269984665640564039457582301524979306099)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(27376130n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582301524979306099n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.gt_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint32, euint256) => ebool test 2 (27376126, 27376130)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(27376126n);
+ input.add256(27376130n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.gt_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint32, euint256) => ebool test 3 (27376130, 27376130)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(27376130n);
+ input.add256(27376130n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.gt_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint32, euint256) => ebool test 4 (27376130, 27376126)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(27376130n);
+ input.add256(27376126n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.gt_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint32, euint256) => ebool test 1 (2709381066, 115792089237316195423570985008687907853269984665640564039457582000267248354603)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2709381066n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582000267248354603n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint32, euint256) => ebool test 2 (2709381062, 2709381066)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2709381062n);
+ input.add256(2709381066n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint32, euint256) => ebool test 3 (2709381066, 2709381066)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2709381066n);
+ input.add256(2709381066n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint32, euint256) => ebool test 4 (2709381066, 2709381062)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2709381066n);
+ input.add256(2709381062n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint32, euint256) => ebool test 1 (3016190595, 115792089237316195423570985008687907853269984665640564039457583853908247743739)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3016190595n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457583853908247743739n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint32, euint256) => ebool test 2 (3016190591, 3016190595)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3016190591n);
+ input.add256(3016190595n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint32, euint256) => ebool test 3 (3016190595, 3016190595)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3016190595n);
+ input.add256(3016190595n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint32, euint256) => ebool test 4 (3016190595, 3016190591)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3016190595n);
+ input.add256(3016190591n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
});
});
diff --git a/test/tfheOperations/tfheOperations7.ts b/test/tfheOperations/tfheOperations7.ts
index 90f485ee..078e9d2d 100644
--- a/test/tfheOperations/tfheOperations7.ts
+++ b/test/tfheOperations/tfheOperations7.ts
@@ -7,7 +7,22 @@ import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'
import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance';
+import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
+import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
+import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
+import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
+import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
+import {
+ createInstances,
+ decrypt4,
+ decrypt8,
+ decrypt16,
+ decrypt32,
+ decrypt64,
+ decrypt128,
+ decrypt256,
+ decryptBool,
+} from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
@@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise {
return contract;
}
+async function deployTfheTestFixture7(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite7');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture8(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite8');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture9(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite9');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture10(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite10');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture11(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite11');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
describe('TFHE operations 7', function () {
before(async function () {
await initSigners(1);
@@ -105,2099 +175,4615 @@ describe('TFHE operations 7', function () {
this.contract6Address = await contract6.getAddress();
this.contract6 = contract6;
+ const contract7 = await deployTfheTestFixture7();
+ this.contract7Address = await contract7.getAddress();
+ this.contract7 = contract7;
+
+ const contract8 = await deployTfheTestFixture8();
+ this.contract8Address = await contract8.getAddress();
+ this.contract8 = contract8;
+
+ const contract9 = await deployTfheTestFixture9();
+ this.contract9Address = await contract9.getAddress();
+ this.contract9 = contract9;
+
+ const contract10 = await deployTfheTestFixture10();
+ this.contract10Address = await contract10.getAddress();
+ this.contract10 = contract10;
+
+ const contract11 = await deployTfheTestFixture11();
+ this.contract11Address = await contract11.getAddress();
+ this.contract11 = contract11;
+
const instances = await createInstances(this.signers);
this.instances = instances;
});
- it('test operator "add" overload (euint16, uint16) => euint16 test 1 (12135, 52126)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12135n);
-
+ it('test operator "min" overload (euint32, euint256) => euint256 test 1 (3608929890, 115792089237316195423570985008687907853269984665640564039457579751481725336191)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3608929890n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579751481725336191n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint16_uint16(encryptedAmount.handles[0], 52126n, encryptedAmount.inputProof);
+ const tx = await this.contract6.min_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(64261n);
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(3608929890n);
});
- it('test operator "add" overload (euint16, uint16) => euint16 test 2 (12131, 12135)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12131n);
-
+ it('test operator "min" overload (euint32, euint256) => euint256 test 2 (3608929886, 3608929890)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3608929886n);
+ input.add256(3608929890n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint16_uint16(encryptedAmount.handles[0], 12135n, encryptedAmount.inputProof);
+ const tx = await this.contract6.min_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(24266n);
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(3608929886n);
});
- it('test operator "add" overload (euint16, uint16) => euint16 test 3 (12135, 12135)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12135n);
-
+ it('test operator "min" overload (euint32, euint256) => euint256 test 3 (3608929890, 3608929890)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3608929890n);
+ input.add256(3608929890n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint16_uint16(encryptedAmount.handles[0], 12135n, encryptedAmount.inputProof);
+ const tx = await this.contract6.min_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(24270n);
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(3608929890n);
});
- it('test operator "add" overload (euint16, uint16) => euint16 test 4 (12135, 12131)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12135n);
-
+ it('test operator "min" overload (euint32, euint256) => euint256 test 4 (3608929890, 3608929886)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3608929890n);
+ input.add256(3608929886n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint16_uint16(encryptedAmount.handles[0], 12131n, encryptedAmount.inputProof);
+ const tx = await this.contract6.min_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(24266n);
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(3608929886n);
});
- it('test operator "add" overload (uint16, euint16) => euint16 test 1 (12140, 26064)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
-
- input.add16(26064n);
+ it('test operator "max" overload (euint32, euint256) => euint256 test 1 (2079496081, 115792089237316195423570985008687907853269984665640564039457579470316273335423)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2079496081n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457579470316273335423n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_uint16_euint16(12140n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.max_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(38204n);
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579470316273335423n);
});
- it('test operator "add" overload (uint16, euint16) => euint16 test 2 (12131, 12135)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
-
- input.add16(12135n);
+ it('test operator "max" overload (euint32, euint256) => euint256 test 2 (2079496077, 2079496081)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2079496077n);
+ input.add256(2079496081n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_uint16_euint16(12131n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.max_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(24266n);
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(2079496081n);
});
- it('test operator "add" overload (uint16, euint16) => euint16 test 3 (12135, 12135)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
-
- input.add16(12135n);
+ it('test operator "max" overload (euint32, euint256) => euint256 test 3 (2079496081, 2079496081)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2079496081n);
+ input.add256(2079496081n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_uint16_euint16(12135n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.max_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(24270n);
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(2079496081n);
});
- it('test operator "add" overload (uint16, euint16) => euint16 test 4 (12135, 12131)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
-
- input.add16(12131n);
+ it('test operator "max" overload (euint32, euint256) => euint256 test 4 (2079496081, 2079496077)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(2079496081n);
+ input.add256(2079496077n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_uint16_euint16(12135n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.max_euint32_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(24266n);
+ const res = await decrypt256(await this.contract6.res256());
+ expect(res).to.equal(2079496081n);
});
- it('test operator "sub" overload (euint16, uint16) => euint16 test 1 (3171, 3171)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(3171n);
+ it('test operator "add" overload (euint32, uint32) => euint32 test 1 (1855544902, 749023821)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1855544902n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.sub_euint16_uint16(encryptedAmount.handles[0], 3171n, encryptedAmount.inputProof);
+ const tx = await this.contract6.add_euint32_uint32(
+ encryptedAmount.handles[0],
+ 749023821n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(0n);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(2604568723n);
});
- it('test operator "sub" overload (euint16, uint16) => euint16 test 2 (3171, 3167)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(3171n);
+ it('test operator "add" overload (euint32, uint32) => euint32 test 2 (1743021441, 1743021443)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1743021441n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.sub_euint16_uint16(encryptedAmount.handles[0], 3167n, encryptedAmount.inputProof);
+ const tx = await this.contract6.add_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1743021443n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(4n);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(3486042884n);
});
- it('test operator "sub" overload (uint16, euint16) => euint16 test 1 (3171, 3171)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "add" overload (euint32, uint32) => euint32 test 3 (1743021443, 1743021443)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1743021443n);
- input.add16(3171n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.sub_uint16_euint16(3171n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.add_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1743021443n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(0n);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(3486042886n);
});
- it('test operator "sub" overload (uint16, euint16) => euint16 test 2 (3171, 3167)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "add" overload (euint32, uint32) => euint32 test 4 (1743021443, 1743021441)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1743021443n);
- input.add16(3167n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.sub_uint16_euint16(3171n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.add_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1743021441n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(4n);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(3486042884n);
});
- it('test operator "mul" overload (euint16, uint16) => euint16 test 1 (78, 344)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(78n);
+ it('test operator "add" overload (uint32, euint32) => euint32 test 1 (1745146365, 1498047640)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1498047640n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint16_uint16(encryptedAmount.handles[0], 344n, encryptedAmount.inputProof);
+ const tx = await this.contract6.add_uint32_euint32(
+ 1745146365n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(26832n);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(3243194005n);
});
- it('test operator "mul" overload (euint16, uint16) => euint16 test 2 (155, 155)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(155n);
+ it('test operator "add" overload (uint32, euint32) => euint32 test 2 (1743021441, 1743021443)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1743021443n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint16_uint16(encryptedAmount.handles[0], 155n, encryptedAmount.inputProof);
+ const tx = await this.contract6.add_uint32_euint32(
+ 1743021441n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(24025n);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(3486042884n);
});
- it('test operator "mul" overload (euint16, uint16) => euint16 test 3 (155, 155)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(155n);
+ it('test operator "add" overload (uint32, euint32) => euint32 test 3 (1743021443, 1743021443)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1743021443n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint16_uint16(encryptedAmount.handles[0], 155n, encryptedAmount.inputProof);
+ const tx = await this.contract6.add_uint32_euint32(
+ 1743021443n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(24025n);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(3486042886n);
});
- it('test operator "mul" overload (euint16, uint16) => euint16 test 4 (155, 155)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(155n);
+ it('test operator "add" overload (uint32, euint32) => euint32 test 4 (1743021443, 1743021441)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1743021441n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint16_uint16(encryptedAmount.handles[0], 155n, encryptedAmount.inputProof);
+ const tx = await this.contract6.add_uint32_euint32(
+ 1743021443n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(24025n);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(3486042884n);
});
- it('test operator "mul" overload (uint16, euint16) => euint16 test 1 (256, 173)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "sub" overload (euint32, uint32) => euint32 test 1 (1818111464, 1818111464)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1818111464n);
- input.add16(173n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_uint16_euint16(256n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.sub_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1818111464n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(44288n);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "mul" overload (uint16, euint16) => euint16 test 2 (155, 155)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "sub" overload (euint32, uint32) => euint32 test 2 (1818111464, 1818111460)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1818111464n);
- input.add16(155n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_uint16_euint16(155n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.sub_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1818111460n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(24025n);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(4n);
});
- it('test operator "mul" overload (uint16, euint16) => euint16 test 3 (155, 155)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "sub" overload (uint32, euint32) => euint32 test 1 (1818111464, 1818111464)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add16(155n);
+ input.add32(1818111464n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_uint16_euint16(155n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.sub_uint32_euint32(
+ 1818111464n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(24025n);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "mul" overload (uint16, euint16) => euint16 test 4 (155, 155)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "sub" overload (uint32, euint32) => euint32 test 2 (1818111464, 1818111460)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add16(155n);
+ input.add32(1818111460n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_uint16_euint16(155n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.sub_uint32_euint32(
+ 1818111464n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(24025n);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(4n);
});
- it('test operator "div" overload (euint16, uint16) => euint16 test 1 (8852, 38586)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(8852n);
+ it('test operator "mul" overload (euint32, uint32) => euint32 test 1 (48056, 45037)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(48056n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.div_euint16_uint16(encryptedAmount.handles[0], 38586n, encryptedAmount.inputProof);
+ const tx = await this.contract6.mul_euint32_uint32(encryptedAmount.handles[0], 45037n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(0n);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(2164298072n);
});
- it('test operator "div" overload (euint16, uint16) => euint16 test 2 (8848, 8852)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(8848n);
+ it('test operator "mul" overload (euint32, uint32) => euint32 test 2 (47710, 47710)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(47710n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.div_euint16_uint16(encryptedAmount.handles[0], 8852n, encryptedAmount.inputProof);
+ const tx = await this.contract6.mul_euint32_uint32(encryptedAmount.handles[0], 47710n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(0n);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(2276244100n);
});
- it('test operator "div" overload (euint16, uint16) => euint16 test 3 (8852, 8852)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(8852n);
+ it('test operator "mul" overload (euint32, uint32) => euint32 test 3 (47710, 47710)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(47710n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.div_euint16_uint16(encryptedAmount.handles[0], 8852n, encryptedAmount.inputProof);
+ const tx = await this.contract6.mul_euint32_uint32(encryptedAmount.handles[0], 47710n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(1n);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(2276244100n);
});
- it('test operator "div" overload (euint16, uint16) => euint16 test 4 (8852, 8848)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(8852n);
+ it('test operator "mul" overload (euint32, uint32) => euint32 test 4 (47710, 47710)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(47710n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.div_euint16_uint16(encryptedAmount.handles[0], 8848n, encryptedAmount.inputProof);
+ const tx = await this.contract6.mul_euint32_uint32(encryptedAmount.handles[0], 47710n, encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(1n);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(2276244100n);
});
- it('test operator "rem" overload (euint16, uint16) => euint16 test 1 (53463, 2321)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(53463n);
+ it('test operator "mul" overload (uint32, euint32) => euint32 test 1 (25623, 45037)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(45037n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.rem_euint16_uint16(encryptedAmount.handles[0], 2321n, encryptedAmount.inputProof);
+ const tx = await this.contract6.mul_uint32_euint32(25623n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(80n);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1153983051n);
});
- it('test operator "rem" overload (euint16, uint16) => euint16 test 2 (20898, 20902)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(20898n);
+ it('test operator "mul" overload (uint32, euint32) => euint32 test 2 (47710, 47710)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(47710n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.rem_euint16_uint16(encryptedAmount.handles[0], 20902n, encryptedAmount.inputProof);
+ const tx = await this.contract6.mul_uint32_euint32(47710n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(20898n);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(2276244100n);
});
- it('test operator "rem" overload (euint16, uint16) => euint16 test 3 (20902, 20902)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(20902n);
+ it('test operator "mul" overload (uint32, euint32) => euint32 test 3 (47710, 47710)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(47710n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.rem_euint16_uint16(encryptedAmount.handles[0], 20902n, encryptedAmount.inputProof);
+ const tx = await this.contract6.mul_uint32_euint32(47710n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(0n);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(2276244100n);
});
- it('test operator "rem" overload (euint16, uint16) => euint16 test 4 (20902, 20898)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(20902n);
+ it('test operator "mul" overload (uint32, euint32) => euint32 test 4 (47710, 47710)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(47710n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.rem_euint16_uint16(encryptedAmount.handles[0], 20898n, encryptedAmount.inputProof);
+ const tx = await this.contract6.mul_uint32_euint32(47710n, encryptedAmount.handles[0], encryptedAmount.inputProof);
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(4n);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(2276244100n);
});
- it('test operator "eq" overload (euint16, uint16) => ebool test 1 (63705, 39705)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(63705n);
+ it('test operator "div" overload (euint32, uint32) => euint32 test 1 (1492630984, 1624831749)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1492630984n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint16_uint16(encryptedAmount.handles[0], 39705n, encryptedAmount.inputProof);
+ const tx = await this.contract6.div_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1624831749n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "eq" overload (euint16, uint16) => ebool test 2 (3245, 3249)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(3245n);
+ it('test operator "div" overload (euint32, uint32) => euint32 test 2 (1492630980, 1492630984)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1492630980n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint16_uint16(encryptedAmount.handles[0], 3249n, encryptedAmount.inputProof);
+ const tx = await this.contract6.div_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1492630984n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "eq" overload (euint16, uint16) => ebool test 3 (3249, 3249)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(3249n);
+ it('test operator "div" overload (euint32, uint32) => euint32 test 3 (1492630984, 1492630984)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1492630984n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint16_uint16(encryptedAmount.handles[0], 3249n, encryptedAmount.inputProof);
+ const tx = await this.contract6.div_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1492630984n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1n);
});
- it('test operator "eq" overload (euint16, uint16) => ebool test 4 (3249, 3245)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(3249n);
+ it('test operator "div" overload (euint32, uint32) => euint32 test 4 (1492630984, 1492630980)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1492630984n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint16_uint16(encryptedAmount.handles[0], 3245n, encryptedAmount.inputProof);
+ const tx = await this.contract6.div_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1492630980n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1n);
});
- it('test operator "eq" overload (uint16, euint16) => ebool test 1 (28254, 39705)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "rem" overload (euint32, uint32) => euint32 test 1 (631407091, 2150413493)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(631407091n);
- input.add16(39705n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_uint16_euint16(28254n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.rem_euint32_uint32(
+ encryptedAmount.handles[0],
+ 2150413493n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(631407091n);
});
- it('test operator "eq" overload (uint16, euint16) => ebool test 2 (3245, 3249)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "rem" overload (euint32, uint32) => euint32 test 2 (631407087, 631407091)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(631407087n);
- input.add16(3249n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_uint16_euint16(3245n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.rem_euint32_uint32(
+ encryptedAmount.handles[0],
+ 631407091n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(631407087n);
});
- it('test operator "eq" overload (uint16, euint16) => ebool test 3 (3249, 3249)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "rem" overload (euint32, uint32) => euint32 test 3 (631407091, 631407091)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(631407091n);
- input.add16(3249n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_uint16_euint16(3249n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.rem_euint32_uint32(
+ encryptedAmount.handles[0],
+ 631407091n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "eq" overload (uint16, euint16) => ebool test 4 (3249, 3245)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "rem" overload (euint32, uint32) => euint32 test 4 (631407091, 631407087)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(631407091n);
- input.add16(3245n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_uint16_euint16(3249n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.rem_euint32_uint32(
+ encryptedAmount.handles[0],
+ 631407087n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(4n);
});
- it('test operator "ne" overload (euint16, uint16) => ebool test 1 (27750, 3479)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(27750n);
+ it('test operator "and" overload (euint32, uint32) => euint32 test 1 (3317288822, 510484248)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3317288822n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint16_uint16(encryptedAmount.handles[0], 3479n, encryptedAmount.inputProof);
+ const tx = await this.contract6.and_euint32_uint32(
+ encryptedAmount.handles[0],
+ 510484248n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(69816080n);
});
- it('test operator "ne" overload (euint16, uint16) => ebool test 2 (23847, 23851)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(23847n);
+ it('test operator "and" overload (euint32, uint32) => euint32 test 2 (1342588187, 1342588191)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1342588187n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint16_uint16(encryptedAmount.handles[0], 23851n, encryptedAmount.inputProof);
+ const tx = await this.contract6.and_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1342588191n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1342588187n);
});
- it('test operator "ne" overload (euint16, uint16) => ebool test 3 (23851, 23851)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(23851n);
+ it('test operator "and" overload (euint32, uint32) => euint32 test 3 (1342588191, 1342588191)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1342588191n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint16_uint16(encryptedAmount.handles[0], 23851n, encryptedAmount.inputProof);
+ const tx = await this.contract6.and_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1342588191n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1342588191n);
});
- it('test operator "ne" overload (euint16, uint16) => ebool test 4 (23851, 23847)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(23851n);
+ it('test operator "and" overload (euint32, uint32) => euint32 test 4 (1342588191, 1342588187)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1342588191n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint16_uint16(encryptedAmount.handles[0], 23847n, encryptedAmount.inputProof);
+ const tx = await this.contract6.and_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1342588187n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1342588187n);
});
- it('test operator "ne" overload (uint16, euint16) => ebool test 1 (20385, 3479)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "and" overload (uint32, euint32) => euint32 test 1 (3731064608, 510484248)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add16(3479n);
+ input.add32(510484248n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_uint16_euint16(20385n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.and_uint32_euint32(
+ 3731064608n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(509675264n);
});
- it('test operator "ne" overload (uint16, euint16) => ebool test 2 (23847, 23851)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "and" overload (uint32, euint32) => euint32 test 2 (1342588187, 1342588191)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add16(23851n);
+ input.add32(1342588191n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_uint16_euint16(23847n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.and_uint32_euint32(
+ 1342588187n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1342588187n);
});
- it('test operator "ne" overload (uint16, euint16) => ebool test 3 (23851, 23851)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "and" overload (uint32, euint32) => euint32 test 3 (1342588191, 1342588191)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add16(23851n);
+ input.add32(1342588191n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_uint16_euint16(23851n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.and_uint32_euint32(
+ 1342588191n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1342588191n);
});
- it('test operator "ne" overload (uint16, euint16) => ebool test 4 (23851, 23847)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "and" overload (uint32, euint32) => euint32 test 4 (1342588191, 1342588187)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add16(23847n);
+ input.add32(1342588187n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_uint16_euint16(23851n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.and_uint32_euint32(
+ 1342588191n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1342588187n);
});
- it('test operator "ge" overload (euint16, uint16) => ebool test 1 (8825, 23737)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(8825n);
+ it('test operator "or" overload (euint32, uint32) => euint32 test 1 (1707541891, 1007760424)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1707541891n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint16_uint16(encryptedAmount.handles[0], 23737n, encryptedAmount.inputProof);
+ const tx = await this.contract6.or_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1007760424n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(2111255979n);
});
- it('test operator "ge" overload (euint16, uint16) => ebool test 2 (8821, 8825)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(8821n);
+ it('test operator "or" overload (euint32, uint32) => euint32 test 2 (1244554523, 1244554527)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1244554523n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint16_uint16(encryptedAmount.handles[0], 8825n, encryptedAmount.inputProof);
+ const tx = await this.contract6.or_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1244554527n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1244554527n);
});
- it('test operator "ge" overload (euint16, uint16) => ebool test 3 (8825, 8825)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(8825n);
+ it('test operator "or" overload (euint32, uint32) => euint32 test 3 (1244554527, 1244554527)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1244554527n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint16_uint16(encryptedAmount.handles[0], 8825n, encryptedAmount.inputProof);
+ const tx = await this.contract6.or_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1244554527n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1244554527n);
});
- it('test operator "ge" overload (euint16, uint16) => ebool test 4 (8825, 8821)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(8825n);
+ it('test operator "or" overload (euint32, uint32) => euint32 test 4 (1244554527, 1244554523)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1244554527n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint16_uint16(encryptedAmount.handles[0], 8821n, encryptedAmount.inputProof);
+ const tx = await this.contract6.or_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1244554523n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1244554527n);
});
- it('test operator "ge" overload (uint16, euint16) => ebool test 1 (43508, 23737)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "or" overload (uint32, euint32) => euint32 test 1 (1405809228, 1007760424)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add16(23737n);
+ input.add32(1007760424n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_uint16_euint16(43508n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.or_uint32_euint32(
+ 1405809228n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(2145121900n);
});
- it('test operator "ge" overload (uint16, euint16) => ebool test 2 (8821, 8825)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "or" overload (uint32, euint32) => euint32 test 2 (1244554523, 1244554527)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add16(8825n);
+ input.add32(1244554527n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_uint16_euint16(8821n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.or_uint32_euint32(
+ 1244554523n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1244554527n);
});
- it('test operator "ge" overload (uint16, euint16) => ebool test 3 (8825, 8825)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "or" overload (uint32, euint32) => euint32 test 3 (1244554527, 1244554527)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add16(8825n);
+ input.add32(1244554527n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_uint16_euint16(8825n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.or_uint32_euint32(
+ 1244554527n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1244554527n);
});
- it('test operator "ge" overload (uint16, euint16) => ebool test 4 (8825, 8821)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "or" overload (uint32, euint32) => euint32 test 4 (1244554527, 1244554523)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add16(8821n);
+ input.add32(1244554523n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_uint16_euint16(8825n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.or_uint32_euint32(
+ 1244554527n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(true);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1244554527n);
});
- it('test operator "gt" overload (euint16, uint16) => ebool test 1 (33735, 40439)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(33735n);
+ it('test operator "xor" overload (euint32, uint32) => euint32 test 1 (3766539452, 3890491814)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3766539452n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint16_uint16(encryptedAmount.handles[0], 40439n, encryptedAmount.inputProof);
+ const tx = await this.contract6.xor_euint32_uint32(
+ encryptedAmount.handles[0],
+ 3890491814n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(124052762n);
});
- it('test operator "gt" overload (euint16, uint16) => ebool test 2 (33731, 33735)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(33731n);
+ it('test operator "xor" overload (euint32, uint32) => euint32 test 2 (3557659855, 3557659859)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3557659855n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint16_uint16(encryptedAmount.handles[0], 33735n, encryptedAmount.inputProof);
+ const tx = await this.contract6.xor_euint32_uint32(
+ encryptedAmount.handles[0],
+ 3557659859n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(28n);
});
- it('test operator "gt" overload (euint16, uint16) => ebool test 3 (33735, 33735)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(33735n);
+ it('test operator "xor" overload (euint32, uint32) => euint32 test 3 (3557659859, 3557659859)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3557659859n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint16_uint16(encryptedAmount.handles[0], 33735n, encryptedAmount.inputProof);
+ const tx = await this.contract6.xor_euint32_uint32(
+ encryptedAmount.handles[0],
+ 3557659859n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(0n);
});
- it('test operator "gt" overload (euint16, uint16) => ebool test 4 (33735, 33731)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(33735n);
+ it('test operator "xor" overload (euint32, uint32) => euint32 test 4 (3557659859, 3557659855)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3557659859n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint16_uint16(encryptedAmount.handles[0], 33731n, encryptedAmount.inputProof);
- await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const tx = await this.contract6.xor_euint32_uint32(
+ encryptedAmount.handles[0],
+ 3557659855n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(28n);
+ });
+
+ it('test operator "xor" overload (uint32, euint32) => euint32 test 1 (1940474497, 3890491814)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(3890491814n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.xor_uint32_euint32(
+ 1940474497n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(2488105767n);
+ });
+
+ it('test operator "xor" overload (uint32, euint32) => euint32 test 2 (3557659855, 3557659859)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(3557659859n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.xor_uint32_euint32(
+ 3557659855n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(28n);
+ });
+
+ it('test operator "xor" overload (uint32, euint32) => euint32 test 3 (3557659859, 3557659859)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(3557659859n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.xor_uint32_euint32(
+ 3557659859n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (uint32, euint32) => euint32 test 4 (3557659859, 3557659855)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(3557659855n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.xor_uint32_euint32(
+ 3557659859n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(28n);
+ });
+
+ it('test operator "eq" overload (euint32, uint32) => ebool test 1 (3899668665, 2460864818)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3899668665n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_euint32_uint32(
+ encryptedAmount.handles[0],
+ 2460864818n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint32, uint32) => ebool test 2 (3823635222, 3823635226)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3823635222n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_euint32_uint32(
+ encryptedAmount.handles[0],
+ 3823635226n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint32, uint32) => ebool test 3 (3823635226, 3823635226)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3823635226n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_euint32_uint32(
+ encryptedAmount.handles[0],
+ 3823635226n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint32, uint32) => ebool test 4 (3823635226, 3823635222)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3823635226n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_euint32_uint32(
+ encryptedAmount.handles[0],
+ 3823635222n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (uint32, euint32) => ebool test 1 (3310168424, 2460864818)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(2460864818n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_uint32_euint32(
+ 3310168424n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (uint32, euint32) => ebool test 2 (3823635222, 3823635226)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(3823635226n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_uint32_euint32(
+ 3823635222n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (uint32, euint32) => ebool test 3 (3823635226, 3823635226)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(3823635226n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_uint32_euint32(
+ 3823635226n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (uint32, euint32) => ebool test 4 (3823635226, 3823635222)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(3823635222n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_uint32_euint32(
+ 3823635226n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint32, uint32) => ebool test 1 (440396727, 826320072)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(440396727n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_euint32_uint32(
+ encryptedAmount.handles[0],
+ 826320072n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint32, uint32) => ebool test 2 (440396723, 440396727)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(440396723n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_euint32_uint32(
+ encryptedAmount.handles[0],
+ 440396727n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint32, uint32) => ebool test 3 (440396727, 440396727)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(440396727n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_euint32_uint32(
+ encryptedAmount.handles[0],
+ 440396727n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint32, uint32) => ebool test 4 (440396727, 440396723)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(440396727n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_euint32_uint32(
+ encryptedAmount.handles[0],
+ 440396723n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (uint16, euint16) => ebool test 1 (47103, 40439)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "ne" overload (uint32, euint32) => ebool test 1 (3496297299, 826320072)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add16(40439n);
+ input.add32(826320072n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_uint16_euint16(47103n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.ne_uint32_euint32(
+ 3496297299n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (uint32, euint32) => ebool test 2 (440396723, 440396727)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(440396727n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_uint32_euint32(
+ 440396723n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract6.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (uint16, euint16) => ebool test 2 (33731, 33735)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "ne" overload (uint32, euint32) => ebool test 3 (440396727, 440396727)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add16(33735n);
+ input.add32(440396727n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_uint16_euint16(33731n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.ne_uint32_euint32(
+ 440396727n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract6.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (uint16, euint16) => ebool test 3 (33735, 33735)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "ne" overload (uint32, euint32) => ebool test 4 (440396727, 440396723)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(440396723n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_uint32_euint32(
+ 440396727n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint32, uint32) => ebool test 1 (929694790, 603878469)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(929694790n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ge_euint32_uint32(
+ encryptedAmount.handles[0],
+ 603878469n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint32, uint32) => ebool test 2 (907768228, 907768232)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(907768228n);
- input.add16(33735n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_uint16_euint16(33735n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.ge_euint32_uint32(
+ encryptedAmount.handles[0],
+ 907768232n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract6.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (uint16, euint16) => ebool test 4 (33735, 33731)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "ge" overload (euint32, uint32) => ebool test 3 (907768232, 907768232)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(907768232n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ge_euint32_uint32(
+ encryptedAmount.handles[0],
+ 907768232n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint32, uint32) => ebool test 4 (907768232, 907768228)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(907768232n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ge_euint32_uint32(
+ encryptedAmount.handles[0],
+ 907768228n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (uint32, euint32) => ebool test 1 (2155494187, 603878469)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add16(33731n);
+ input.add32(603878469n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_uint16_euint16(33735n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.ge_uint32_euint32(
+ 2155494187n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract6.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint16, uint16) => ebool test 1 (38605, 15668)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(38605n);
+ it('test operator "ge" overload (uint32, euint32) => ebool test 2 (907768228, 907768232)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(907768232n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint16_uint16(encryptedAmount.handles[0], 15668n, encryptedAmount.inputProof);
+ const tx = await this.contract6.ge_uint32_euint32(
+ 907768228n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract6.resb());
expect(res).to.equal(false);
});
- it('test operator "le" overload (euint16, uint16) => ebool test 2 (38601, 38605)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(38601n);
+ it('test operator "ge" overload (uint32, euint32) => ebool test 3 (907768232, 907768232)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(907768232n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ge_uint32_euint32(
+ 907768232n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (uint32, euint32) => ebool test 4 (907768232, 907768228)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(907768228n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ge_uint32_euint32(
+ 907768232n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint32, uint32) => ebool test 1 (3794643996, 3726690353)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3794643996n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint16_uint16(encryptedAmount.handles[0], 38605n, encryptedAmount.inputProof);
+ const tx = await this.contract6.gt_euint32_uint32(
+ encryptedAmount.handles[0],
+ 3726690353n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract6.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint16, uint16) => ebool test 3 (38605, 38605)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(38605n);
+ it('test operator "gt" overload (euint32, uint32) => ebool test 2 (619151912, 619151916)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(619151912n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.gt_euint32_uint32(
+ encryptedAmount.handles[0],
+ 619151916n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint32, uint32) => ebool test 3 (619151916, 619151916)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(619151916n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.gt_euint32_uint32(
+ encryptedAmount.handles[0],
+ 619151916n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint32, uint32) => ebool test 4 (619151916, 619151912)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(619151916n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint16_uint16(encryptedAmount.handles[0], 38605n, encryptedAmount.inputProof);
+ const tx = await this.contract6.gt_euint32_uint32(
+ encryptedAmount.handles[0],
+ 619151912n,
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract6.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint16, uint16) => ebool test 4 (38605, 38601)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(38605n);
+ it('test operator "gt" overload (uint32, euint32) => ebool test 1 (3642906183, 3726690353)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3726690353n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint16_uint16(encryptedAmount.handles[0], 38601n, encryptedAmount.inputProof);
+ const tx = await this.contract6.gt_uint32_euint32(
+ 3642906183n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract6.resb());
expect(res).to.equal(false);
});
- it('test operator "le" overload (uint16, euint16) => ebool test 1 (26564, 15668)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "gt" overload (uint32, euint32) => ebool test 2 (619151912, 619151916)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add16(15668n);
+ input.add32(619151916n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_uint16_euint16(26564n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.gt_uint32_euint32(
+ 619151912n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract6.resb());
expect(res).to.equal(false);
});
- it('test operator "le" overload (uint16, euint16) => ebool test 2 (38601, 38605)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
+ it('test operator "gt" overload (uint32, euint32) => ebool test 3 (619151916, 619151916)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
- input.add16(38605n);
+ input.add32(619151916n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_uint16_euint16(38601n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.gt_uint32_euint32(
+ 619151916n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (uint32, euint32) => ebool test 4 (619151916, 619151912)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(619151912n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.gt_uint32_euint32(
+ 619151916n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint32, uint32) => ebool test 1 (1814515265, 524803703)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1814515265n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_euint32_uint32(
+ encryptedAmount.handles[0],
+ 524803703n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "le" overload (euint32, uint32) => ebool test 2 (1215301258, 1215301262)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1215301258n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1215301262n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint32, uint32) => ebool test 3 (1215301262, 1215301262)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1215301262n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1215301262n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint32, uint32) => ebool test 4 (1215301262, 1215301258)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1215301262n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1215301258n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "le" overload (uint32, euint32) => ebool test 1 (1873209457, 524803703)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(524803703n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_uint32_euint32(
+ 1873209457n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "le" overload (uint32, euint32) => ebool test 2 (1215301258, 1215301262)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(1215301262n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_uint32_euint32(
+ 1215301258n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (uint32, euint32) => ebool test 3 (1215301262, 1215301262)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(1215301262n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_uint32_euint32(
+ 1215301262n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (uint32, euint32) => ebool test 4 (1215301262, 1215301258)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(1215301258n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_uint32_euint32(
+ 1215301262n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint32, uint32) => ebool test 1 (597865082, 459499324)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(597865082n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_euint32_uint32(
+ encryptedAmount.handles[0],
+ 459499324n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint32, uint32) => ebool test 2 (597865078, 597865082)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(597865078n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_euint32_uint32(
+ encryptedAmount.handles[0],
+ 597865082n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint32, uint32) => ebool test 3 (597865082, 597865082)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(597865082n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_euint32_uint32(
+ encryptedAmount.handles[0],
+ 597865082n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint32, uint32) => ebool test 4 (597865082, 597865078)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(597865082n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_euint32_uint32(
+ encryptedAmount.handles[0],
+ 597865078n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (uint32, euint32) => ebool test 1 (4239340674, 459499324)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(459499324n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_uint32_euint32(
+ 4239340674n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (uint32, euint32) => ebool test 2 (597865078, 597865082)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(597865082n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_uint32_euint32(
+ 597865078n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (uint32, euint32) => ebool test 3 (597865082, 597865082)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(597865082n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_uint32_euint32(
+ 597865082n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (uint32, euint32) => ebool test 4 (597865082, 597865078)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(597865078n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_uint32_euint32(
+ 597865082n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint32, uint32) => euint32 test 1 (3167993396, 1826176221)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3167993396n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.min_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1826176221n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1826176221n);
+ });
+
+ it('test operator "min" overload (euint32, uint32) => euint32 test 2 (3167993392, 3167993396)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3167993392n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.min_euint32_uint32(
+ encryptedAmount.handles[0],
+ 3167993396n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(3167993392n);
+ });
+
+ it('test operator "min" overload (euint32, uint32) => euint32 test 3 (3167993396, 3167993396)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3167993396n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.min_euint32_uint32(
+ encryptedAmount.handles[0],
+ 3167993396n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(3167993396n);
+ });
+
+ it('test operator "min" overload (euint32, uint32) => euint32 test 4 (3167993396, 3167993392)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(3167993396n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.min_euint32_uint32(
+ encryptedAmount.handles[0],
+ 3167993392n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(3167993392n);
+ });
+
+ it('test operator "min" overload (uint32, euint32) => euint32 test 1 (591129059, 1826176221)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(1826176221n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.min_uint32_euint32(
+ 591129059n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(591129059n);
+ });
+
+ it('test operator "min" overload (uint32, euint32) => euint32 test 2 (3167993392, 3167993396)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(3167993396n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.min_uint32_euint32(
+ 3167993392n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(3167993392n);
+ });
+
+ it('test operator "min" overload (uint32, euint32) => euint32 test 3 (3167993396, 3167993396)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(3167993396n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.min_uint32_euint32(
+ 3167993396n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(3167993396n);
+ });
+
+ it('test operator "min" overload (uint32, euint32) => euint32 test 4 (3167993396, 3167993392)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(3167993392n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.min_uint32_euint32(
+ 3167993396n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(3167993392n);
+ });
+
+ it('test operator "max" overload (euint32, uint32) => euint32 test 1 (1310408559, 1676413628)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1310408559n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.max_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1676413628n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1676413628n);
+ });
+
+ it('test operator "max" overload (euint32, uint32) => euint32 test 2 (1310408555, 1310408559)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1310408555n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.max_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1310408559n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1310408559n);
+ });
+
+ it('test operator "max" overload (euint32, uint32) => euint32 test 3 (1310408559, 1310408559)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1310408559n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.max_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1310408559n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1310408559n);
+ });
+
+ it('test operator "max" overload (euint32, uint32) => euint32 test 4 (1310408559, 1310408555)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add32(1310408559n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.max_euint32_uint32(
+ encryptedAmount.handles[0],
+ 1310408555n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1310408559n);
+ });
+
+ it('test operator "max" overload (uint32, euint32) => euint32 test 1 (870136392, 1676413628)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(1676413628n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.max_uint32_euint32(
+ 870136392n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1676413628n);
+ });
+
+ it('test operator "max" overload (uint32, euint32) => euint32 test 2 (1310408555, 1310408559)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(1310408559n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.max_uint32_euint32(
+ 1310408555n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1310408559n);
+ });
+
+ it('test operator "max" overload (uint32, euint32) => euint32 test 3 (1310408559, 1310408559)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(1310408559n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.max_uint32_euint32(
+ 1310408559n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1310408559n);
+ });
+
+ it('test operator "max" overload (uint32, euint32) => euint32 test 4 (1310408559, 1310408555)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+
+ input.add32(1310408555n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.max_uint32_euint32(
+ 1310408559n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt32(await this.contract6.res32());
+ expect(res).to.equal(1310408559n);
+ });
+
+ it('test operator "add" overload (euint64, euint4) => euint64 test 1 (9, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(9n);
+ input.add4(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.add_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(11n);
+ });
+
+ it('test operator "add" overload (euint64, euint4) => euint64 test 2 (5, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(5n);
+ input.add4(7n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.add_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "add" overload (euint64, euint4) => euint64 test 3 (7, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(7n);
+ input.add4(7n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.add_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(14n);
+ });
+
+ it('test operator "add" overload (euint64, euint4) => euint64 test 4 (7, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(7n);
+ input.add4(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.add_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "sub" overload (euint64, euint4) => euint64 test 1 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.sub_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint64, euint4) => euint64 test 2 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.sub_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint64, euint4) => euint64 test 1 (5, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(5n);
+ input.add4(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.mul_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "mul" overload (euint64, euint4) => euint64 test 2 (3, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(3n);
+ input.add4(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.mul_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(15n);
+ });
+
+ it('test operator "mul" overload (euint64, euint4) => euint64 test 3 (3, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(3n);
+ input.add4(3n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.mul_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(9n);
+ });
+
+ it('test operator "mul" overload (euint64, euint4) => euint64 test 4 (5, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(5n);
+ input.add4(3n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.mul_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(15n);
+ });
+
+ it('test operator "and" overload (euint64, euint4) => euint64 test 1 (18438614995227733505, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18438614995227733505n);
+ input.add4(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.and_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "and" overload (euint64, euint4) => euint64 test 2 (10, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(10n);
+ input.add4(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.and_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "and" overload (euint64, euint4) => euint64 test 3 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(14n);
+ input.add4(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.and_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(14n);
+ });
+
+ it('test operator "and" overload (euint64, euint4) => euint64 test 4 (14, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(14n);
+ input.add4(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.and_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "or" overload (euint64, euint4) => euint64 test 1 (18443718017569117131, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18443718017569117131n);
+ input.add4(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.or_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(18443718017569117131n);
+ });
+
+ it('test operator "or" overload (euint64, euint4) => euint64 test 2 (5, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(5n);
+ input.add4(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.or_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(13n);
+ });
+
+ it('test operator "or" overload (euint64, euint4) => euint64 test 3 (9, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(9n);
+ input.add4(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.or_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(9n);
+ });
+
+ it('test operator "or" overload (euint64, euint4) => euint64 test 4 (9, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(9n);
+ input.add4(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.or_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(13n);
+ });
+
+ it('test operator "xor" overload (euint64, euint4) => euint64 test 1 (18442021950386427623, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18442021950386427623n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.xor_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(18442021950386427631n);
+ });
+
+ it('test operator "xor" overload (euint64, euint4) => euint64 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.xor_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "xor" overload (euint64, euint4) => euint64 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.xor_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint64, euint4) => euint64 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.xor_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "eq" overload (euint64, euint4) => ebool test 1 (18439903646396993533, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18439903646396993533n);
+ input.add4(7n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint64, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint64, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint64, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint64, euint4) => ebool test 1 (18443746789087798257, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18443746789087798257n);
+ input.add4(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint64, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint64, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint64, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint64, euint4) => ebool test 1 (18438015014584183031, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18438015014584183031n);
+ input.add4(11n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ge_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint64, euint4) => ebool test 2 (7, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(7n);
+ input.add4(11n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ge_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint64, euint4) => ebool test 3 (11, 11)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(11n);
+ input.add4(11n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ge_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint64, euint4) => ebool test 4 (11, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(11n);
+ input.add4(7n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ge_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint64, euint4) => ebool test 1 (18445379539074122583, 7)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18445379539074122583n);
+ input.add4(7n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.gt_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint64, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.gt_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint64, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.gt_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint64, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.gt_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint64, euint4) => ebool test 1 (18443622047758317419, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18443622047758317419n);
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "le" overload (euint64, euint4) => ebool test 2 (9, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(9n);
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint64, euint4) => ebool test 3 (13, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(13n);
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint64, euint4) => ebool test 4 (13, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(13n);
+ input.add4(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.le_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint64, euint4) => ebool test 1 (18444247959988442675, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18444247959988442675n);
+ input.add4(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint64, euint4) => ebool test 2 (6, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(6n);
+ input.add4(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint64, euint4) => ebool test 3 (10, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(10n);
+ input.add4(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint64, euint4) => ebool test 4 (10, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(10n);
+ input.add4(6n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.lt_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint64, euint4) => euint64 test 1 (18440660497360576819, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18440660497360576819n);
+ input.add4(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.min_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(14n);
+ });
+
+ it('test operator "min" overload (euint64, euint4) => euint64 test 2 (10, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(10n);
+ input.add4(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.min_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "min" overload (euint64, euint4) => euint64 test 3 (14, 14)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(14n);
+ input.add4(14n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.min_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(14n);
+ });
+
+ it('test operator "min" overload (euint64, euint4) => euint64 test 4 (14, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(14n);
+ input.add4(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.min_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "max" overload (euint64, euint4) => euint64 test 1 (18446600326518934469, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18446600326518934469n);
+ input.add4(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.max_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(18446600326518934469n);
+ });
+
+ it('test operator "max" overload (euint64, euint4) => euint64 test 2 (8, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(8n);
+ input.add4(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.max_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "max" overload (euint64, euint4) => euint64 test 3 (12, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(12n);
+ input.add4(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.max_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "max" overload (euint64, euint4) => euint64 test 4 (12, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(12n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.max_euint64_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "add" overload (euint64, euint8) => euint64 test 1 (129, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(129n);
+ input.add8(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.add_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(131n);
+ });
+
+ it('test operator "add" overload (euint64, euint8) => euint64 test 2 (66, 70)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(66n);
+ input.add8(70n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.add_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(136n);
+ });
+
+ it('test operator "add" overload (euint64, euint8) => euint64 test 3 (70, 70)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(70n);
+ input.add8(70n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.add_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(140n);
+ });
+
+ it('test operator "add" overload (euint64, euint8) => euint64 test 4 (70, 66)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(70n);
+ input.add8(66n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.add_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(136n);
+ });
+
+ it('test operator "sub" overload (euint64, euint8) => euint64 test 1 (117, 117)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(117n);
+ input.add8(117n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.sub_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint64, euint8) => euint64 test 2 (117, 113)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(117n);
+ input.add8(113n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.sub_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint64, euint8) => euint64 test 1 (65, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(65n);
+ input.add8(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.mul_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(130n);
+ });
+
+ it('test operator "mul" overload (euint64, euint8) => euint64 test 2 (12, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(12n);
+ input.add8(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.mul_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(156n);
+ });
+
+ it('test operator "mul" overload (euint64, euint8) => euint64 test 3 (13, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(13n);
+ input.add8(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.mul_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(169n);
+ });
+
+ it('test operator "mul" overload (euint64, euint8) => euint64 test 4 (13, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(13n);
+ input.add8(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.mul_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(156n);
+ });
+
+ it('test operator "and" overload (euint64, euint8) => euint64 test 1 (18443952274371967793, 221)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18443952274371967793n);
+ input.add8(221n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.and_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(17n);
+ });
+
+ it('test operator "and" overload (euint64, euint8) => euint64 test 2 (217, 221)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(217n);
+ input.add8(221n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.and_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(217n);
+ });
+
+ it('test operator "and" overload (euint64, euint8) => euint64 test 3 (221, 221)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(221n);
+ input.add8(221n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.and_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(221n);
+ });
+
+ it('test operator "and" overload (euint64, euint8) => euint64 test 4 (221, 217)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(221n);
+ input.add8(217n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.and_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(217n);
+ });
+
+ it('test operator "or" overload (euint64, euint8) => euint64 test 1 (18442034297780989323, 254)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18442034297780989323n);
+ input.add8(254n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.or_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(18442034297780989439n);
+ });
+
+ it('test operator "or" overload (euint64, euint8) => euint64 test 2 (250, 254)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(250n);
+ input.add8(254n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.or_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(254n);
+ });
+
+ it('test operator "or" overload (euint64, euint8) => euint64 test 3 (254, 254)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(254n);
+ input.add8(254n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.or_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(254n);
+ });
+
+ it('test operator "or" overload (euint64, euint8) => euint64 test 4 (254, 250)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(254n);
+ input.add8(250n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.or_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(254n);
+ });
+
+ it('test operator "xor" overload (euint64, euint8) => euint64 test 1 (18439050232368801565, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18439050232368801565n);
+ input.add8(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.xor_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(18439050232368801553n);
+ });
+
+ it('test operator "xor" overload (euint64, euint8) => euint64 test 2 (8, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(8n);
+ input.add8(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.xor_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "xor" overload (euint64, euint8) => euint64 test 3 (12, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(12n);
+ input.add8(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.xor_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint64, euint8) => euint64 test 4 (12, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(12n);
+ input.add8(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.xor_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "eq" overload (euint64, euint8) => ebool test 1 (18439031766765231937, 63)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18439031766765231937n);
+ input.add8(63n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint64, euint8) => ebool test 2 (59, 63)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(59n);
+ input.add8(63n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint64, euint8) => ebool test 3 (63, 63)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(63n);
+ input.add8(63n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint64, euint8) => ebool test 4 (63, 59)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(63n);
+ input.add8(59n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.eq_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint64, euint8) => ebool test 1 (18443274666908974803, 120)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18443274666908974803n);
+ input.add8(120n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint64, euint8) => ebool test 2 (116, 120)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(116n);
+ input.add8(120n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint64, euint8) => ebool test 3 (120, 120)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(120n);
+ input.add8(120n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint64, euint8) => ebool test 4 (120, 116)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(120n);
+ input.add8(116n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract6.ne_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract6.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (uint16, euint16) => ebool test 3 (38605, 38605)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
-
- input.add16(38605n);
+ it('test operator "ge" overload (euint64, euint8) => ebool test 1 (18444176095713623219, 248)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18444176095713623219n);
+ input.add8(248n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_uint16_euint16(38605n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.ge_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract6.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (uint16, euint16) => ebool test 4 (38605, 38601)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
-
- input.add16(38601n);
+ it('test operator "ge" overload (euint64, euint8) => ebool test 2 (244, 248)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(244n);
+ input.add8(248n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_uint16_euint16(38605n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.ge_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract6.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint16, uint16) => ebool test 1 (59332, 5218)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(59332n);
-
+ it('test operator "ge" overload (euint64, euint8) => ebool test 3 (248, 248)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(248n);
+ input.add8(248n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint16_uint16(encryptedAmount.handles[0], 5218n, encryptedAmount.inputProof);
+ const tx = await this.contract6.ge_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint16, uint16) => ebool test 2 (12423, 12427)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12423n);
-
+ it('test operator "ge" overload (euint64, euint8) => ebool test 4 (248, 244)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(248n);
+ input.add8(244n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint16_uint16(encryptedAmount.handles[0], 12427n, encryptedAmount.inputProof);
+ const tx = await this.contract6.ge_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract6.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint16, uint16) => ebool test 3 (12427, 12427)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12427n);
-
+ it('test operator "gt" overload (euint64, euint8) => ebool test 1 (18445625176027562117, 124)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18445625176027562117n);
+ input.add8(124n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint16_uint16(encryptedAmount.handles[0], 12427n, encryptedAmount.inputProof);
+ const tx = await this.contract6.gt_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint16, uint16) => ebool test 4 (12427, 12423)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(12427n);
-
+ it('test operator "gt" overload (euint64, euint8) => ebool test 2 (120, 124)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(120n);
+ input.add8(124n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint16_uint16(encryptedAmount.handles[0], 12423n, encryptedAmount.inputProof);
+ const tx = await this.contract6.gt_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract6.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (uint16, euint16) => ebool test 1 (8638, 5218)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
-
- input.add16(5218n);
+ it('test operator "gt" overload (euint64, euint8) => ebool test 3 (124, 124)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(124n);
+ input.add8(124n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_uint16_euint16(8638n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.gt_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract6.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (uint16, euint16) => ebool test 2 (12423, 12427)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
-
- input.add16(12427n);
+ it('test operator "gt" overload (euint64, euint8) => ebool test 4 (124, 120)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(124n);
+ input.add8(120n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_uint16_euint16(12423n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.gt_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract6.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (uint16, euint16) => ebool test 3 (12427, 12427)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
-
- input.add16(12427n);
- const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_uint16_euint16(12427n, encryptedAmount.handles[0], encryptedAmount.inputProof);
- await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
- expect(res).to.equal(false);
- });
-
- it('test operator "lt" overload (uint16, euint16) => ebool test 4 (12427, 12423)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
-
- input.add16(12423n);
+ it('test operator "le" overload (euint64, euint8) => ebool test 1 (18443904556846943161, 36)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18443904556846943161n);
+ input.add8(36n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_uint16_euint16(12427n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.le_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract6.resb());
expect(res).to.equal(false);
});
- it('test operator "min" overload (euint16, uint16) => euint16 test 1 (18209, 9598)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(18209n);
-
- const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_uint16(encryptedAmount.handles[0], 9598n, encryptedAmount.inputProof);
- await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(9598n);
- });
-
- it('test operator "min" overload (euint16, uint16) => euint16 test 2 (14692, 14696)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(14692n);
-
+ it('test operator "le" overload (euint64, euint8) => ebool test 2 (32, 36)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(32n);
+ input.add8(36n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_uint16(encryptedAmount.handles[0], 14696n, encryptedAmount.inputProof);
+ const tx = await this.contract6.le_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(14692n);
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (euint16, uint16) => euint16 test 3 (14696, 14696)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(14696n);
-
+ it('test operator "le" overload (euint64, euint8) => ebool test 3 (36, 36)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(36n);
+ input.add8(36n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_uint16(encryptedAmount.handles[0], 14696n, encryptedAmount.inputProof);
+ const tx = await this.contract6.le_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(14696n);
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (euint16, uint16) => euint16 test 4 (14696, 14692)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(14696n);
-
+ it('test operator "le" overload (euint64, euint8) => ebool test 4 (36, 32)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(36n);
+ input.add8(32n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint16_uint16(encryptedAmount.handles[0], 14692n, encryptedAmount.inputProof);
+ const tx = await this.contract6.le_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(14692n);
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
});
- it('test operator "min" overload (uint16, euint16) => euint16 test 1 (16454, 9598)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
-
- input.add16(9598n);
+ it('test operator "lt" overload (euint64, euint8) => ebool test 1 (18444886637718481993, 57)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18444886637718481993n);
+ input.add8(57n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_uint16_euint16(16454n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.lt_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(9598n);
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
});
- it('test operator "min" overload (uint16, euint16) => euint16 test 2 (14692, 14696)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
-
- input.add16(14696n);
+ it('test operator "lt" overload (euint64, euint8) => ebool test 2 (53, 57)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(53n);
+ input.add8(57n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_uint16_euint16(14692n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.lt_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(14692n);
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (uint16, euint16) => euint16 test 3 (14696, 14696)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
-
- input.add16(14696n);
+ it('test operator "lt" overload (euint64, euint8) => ebool test 3 (57, 57)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(57n);
+ input.add8(57n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_uint16_euint16(14696n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.lt_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(14696n);
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
});
- it('test operator "min" overload (uint16, euint16) => euint16 test 4 (14696, 14692)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
-
- input.add16(14692n);
+ it('test operator "lt" overload (euint64, euint8) => ebool test 4 (57, 53)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(57n);
+ input.add8(53n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_uint16_euint16(14696n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.lt_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(14692n);
+ const res = await decryptBool(await this.contract6.resb());
+ expect(res).to.equal(false);
});
- it('test operator "max" overload (euint16, uint16) => euint16 test 1 (35722, 5145)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(35722n);
-
+ it('test operator "min" overload (euint64, euint8) => euint64 test 1 (18442702391560231447, 64)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18442702391560231447n);
+ input.add8(64n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_uint16(encryptedAmount.handles[0], 5145n, encryptedAmount.inputProof);
+ const tx = await this.contract6.min_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(35722n);
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(64n);
});
- it('test operator "max" overload (euint16, uint16) => euint16 test 2 (7684, 7688)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(7684n);
-
+ it('test operator "min" overload (euint64, euint8) => euint64 test 2 (60, 64)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(60n);
+ input.add8(64n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_uint16(encryptedAmount.handles[0], 7688n, encryptedAmount.inputProof);
+ const tx = await this.contract6.min_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(7688n);
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(60n);
});
- it('test operator "max" overload (euint16, uint16) => euint16 test 3 (7688, 7688)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(7688n);
-
+ it('test operator "min" overload (euint64, euint8) => euint64 test 3 (64, 64)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(64n);
+ input.add8(64n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_uint16(encryptedAmount.handles[0], 7688n, encryptedAmount.inputProof);
+ const tx = await this.contract6.min_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(7688n);
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(64n);
});
- it('test operator "max" overload (euint16, uint16) => euint16 test 4 (7688, 7684)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add16(7688n);
-
+ it('test operator "min" overload (euint64, euint8) => euint64 test 4 (64, 60)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(64n);
+ input.add8(60n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint16_uint16(encryptedAmount.handles[0], 7684n, encryptedAmount.inputProof);
+ const tx = await this.contract6.min_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(7688n);
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(60n);
});
- it('test operator "max" overload (uint16, euint16) => euint16 test 1 (56359, 5145)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
-
- input.add16(5145n);
+ it('test operator "max" overload (euint64, euint8) => euint64 test 1 (18437818308322976495, 86)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(18437818308322976495n);
+ input.add8(86n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_uint16_euint16(56359n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.max_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(56359n);
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(18437818308322976495n);
});
- it('test operator "max" overload (uint16, euint16) => euint16 test 2 (7684, 7688)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
-
- input.add16(7688n);
+ it('test operator "max" overload (euint64, euint8) => euint64 test 2 (82, 86)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(82n);
+ input.add8(86n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_uint16_euint16(7684n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.max_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(7688n);
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(86n);
});
- it('test operator "max" overload (uint16, euint16) => euint16 test 3 (7688, 7688)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
-
- input.add16(7688n);
+ it('test operator "max" overload (euint64, euint8) => euint64 test 3 (86, 86)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(86n);
+ input.add8(86n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_uint16_euint16(7688n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.max_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(7688n);
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(86n);
});
- it('test operator "max" overload (uint16, euint16) => euint16 test 4 (7688, 7684)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
-
- input.add16(7684n);
+ it('test operator "max" overload (euint64, euint8) => euint64 test 4 (86, 82)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address);
+ input.add64(86n);
+ input.add8(82n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_uint16_euint16(7688n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract6.max_euint64_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt16(await this.contract3.res16());
- expect(res).to.equal(7688n);
+ const res = await decrypt64(await this.contract6.res64());
+ expect(res).to.equal(86n);
});
- it('test operator "add" overload (euint32, euint4) => euint32 test 1 (12, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(12n);
- input.add4(2n);
+ it('test operator "add" overload (euint64, euint16) => euint64 test 1 (65532, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(65532n);
+ input.add16(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint32_euint4(
+ const tx = await this.contract7.add_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(14n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(65534n);
});
- it('test operator "add" overload (euint32, euint4) => euint32 test 2 (4, 6)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(4n);
- input.add4(6n);
+ it('test operator "add" overload (euint64, euint16) => euint64 test 2 (23004, 23006)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(23004n);
+ input.add16(23006n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint32_euint4(
+ const tx = await this.contract7.add_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(10n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(46010n);
});
- it('test operator "add" overload (euint32, euint4) => euint32 test 3 (6, 6)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(6n);
- input.add4(6n);
+ it('test operator "add" overload (euint64, euint16) => euint64 test 3 (23006, 23006)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(23006n);
+ input.add16(23006n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint32_euint4(
+ const tx = await this.contract7.add_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(12n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(46012n);
});
- it('test operator "add" overload (euint32, euint4) => euint32 test 4 (6, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(6n);
- input.add4(4n);
+ it('test operator "add" overload (euint64, euint16) => euint64 test 4 (23006, 23004)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(23006n);
+ input.add16(23004n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint32_euint4(
+ const tx = await this.contract7.add_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(10n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(46010n);
});
- it('test operator "sub" overload (euint32, euint4) => euint32 test 1 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(8n);
- input.add4(8n);
+ it('test operator "sub" overload (euint64, euint16) => euint64 test 1 (54317, 54317)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(54317n);
+ input.add16(54317n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.sub_euint32_euint4(
+ const tx = await this.contract7.sub_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
+ const res = await decrypt64(await this.contract7.res64());
expect(res).to.equal(0n);
});
- it('test operator "sub" overload (euint32, euint4) => euint32 test 2 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(8n);
- input.add4(4n);
+ it('test operator "sub" overload (euint64, euint16) => euint64 test 2 (54317, 54313)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(54317n);
+ input.add16(54313n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.sub_euint32_euint4(
+ const tx = await this.contract7.sub_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
+ const res = await decrypt64(await this.contract7.res64());
expect(res).to.equal(4n);
});
- it('test operator "mul" overload (euint32, euint4) => euint32 test 1 (5, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(5n);
- input.add4(2n);
+ it('test operator "mul" overload (euint64, euint16) => euint64 test 1 (32754, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(32754n);
+ input.add16(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint32_euint4(
+ const tx = await this.contract7.mul_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(10n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(65508n);
});
- it('test operator "mul" overload (euint32, euint4) => euint32 test 2 (3, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(3n);
- input.add4(3n);
+ it('test operator "mul" overload (euint64, euint16) => euint64 test 2 (191, 191)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(191n);
+ input.add16(191n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint32_euint4(
+ const tx = await this.contract7.mul_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(9n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(36481n);
});
- it('test operator "mul" overload (euint32, euint4) => euint32 test 3 (3, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(3n);
- input.add4(3n);
+ it('test operator "mul" overload (euint64, euint16) => euint64 test 3 (191, 191)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(191n);
+ input.add16(191n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint32_euint4(
+ const tx = await this.contract7.mul_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(9n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(36481n);
});
- it('test operator "mul" overload (euint32, euint4) => euint32 test 4 (3, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(3n);
- input.add4(3n);
+ it('test operator "mul" overload (euint64, euint16) => euint64 test 4 (191, 191)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(191n);
+ input.add16(191n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint32_euint4(
+ const tx = await this.contract7.mul_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(9n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(36481n);
});
- it('test operator "and" overload (euint32, euint4) => euint32 test 1 (2599330540, 1)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(2599330540n);
- input.add4(1n);
+ it('test operator "and" overload (euint64, euint16) => euint64 test 1 (18443322659758757933, 48184)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443322659758757933n);
+ input.add16(48184n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint32_euint4(
+ const tx = await this.contract7.and_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(0n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(6184n);
});
- it('test operator "and" overload (euint32, euint4) => euint32 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(4n);
- input.add4(8n);
+ it('test operator "and" overload (euint64, euint16) => euint64 test 2 (48180, 48184)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(48180n);
+ input.add16(48184n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint32_euint4(
+ const tx = await this.contract7.and_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(0n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(48176n);
});
- it('test operator "and" overload (euint32, euint4) => euint32 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(8n);
- input.add4(8n);
+ it('test operator "and" overload (euint64, euint16) => euint64 test 3 (48184, 48184)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(48184n);
+ input.add16(48184n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint32_euint4(
+ const tx = await this.contract7.and_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(8n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(48184n);
});
- it('test operator "and" overload (euint32, euint4) => euint32 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(8n);
- input.add4(4n);
+ it('test operator "and" overload (euint64, euint16) => euint64 test 4 (48184, 48180)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(48184n);
+ input.add16(48180n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint32_euint4(
+ const tx = await this.contract7.and_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(0n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(48176n);
});
- it('test operator "or" overload (euint32, euint4) => euint32 test 1 (2761097401, 13)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(2761097401n);
- input.add4(13n);
+ it('test operator "or" overload (euint64, euint16) => euint64 test 1 (18445256696814040973, 63476)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18445256696814040973n);
+ input.add16(63476n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.or_euint32_euint4(
+ const tx = await this.contract7.or_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(2761097405n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18445256696814041085n);
});
- it('test operator "or" overload (euint32, euint4) => euint32 test 2 (9, 13)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(9n);
- input.add4(13n);
+ it('test operator "or" overload (euint64, euint16) => euint64 test 2 (63472, 63476)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(63472n);
+ input.add16(63476n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.or_euint32_euint4(
+ const tx = await this.contract7.or_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(13n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(63476n);
});
- it('test operator "or" overload (euint32, euint4) => euint32 test 3 (13, 13)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(13n);
- input.add4(13n);
+ it('test operator "or" overload (euint64, euint16) => euint64 test 3 (63476, 63476)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(63476n);
+ input.add16(63476n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.or_euint32_euint4(
+ const tx = await this.contract7.or_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(13n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(63476n);
});
- it('test operator "or" overload (euint32, euint4) => euint32 test 4 (13, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(13n);
- input.add4(9n);
+ it('test operator "or" overload (euint64, euint16) => euint64 test 4 (63476, 63472)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(63476n);
+ input.add16(63472n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.or_euint32_euint4(
+ const tx = await this.contract7.or_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(13n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(63476n);
});
- it('test operator "xor" overload (euint32, euint4) => euint32 test 1 (2588014920, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(2588014920n);
- input.add4(3n);
+ it('test operator "xor" overload (euint64, euint16) => euint64 test 1 (18446196219353056271, 45319)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18446196219353056271n);
+ input.add16(45319n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.xor_euint32_euint4(
+ const tx = await this.contract7.xor_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(2588014923n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18446196219353101576n);
});
- it('test operator "xor" overload (euint32, euint4) => euint32 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(4n);
- input.add4(8n);
+ it('test operator "xor" overload (euint64, euint16) => euint64 test 2 (45315, 45319)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(45315n);
+ input.add16(45319n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.xor_euint32_euint4(
+ const tx = await this.contract7.xor_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(12n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(4n);
});
- it('test operator "xor" overload (euint32, euint4) => euint32 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(8n);
- input.add4(8n);
+ it('test operator "xor" overload (euint64, euint16) => euint64 test 3 (45319, 45319)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(45319n);
+ input.add16(45319n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.xor_euint32_euint4(
+ const tx = await this.contract7.xor_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
+ const res = await decrypt64(await this.contract7.res64());
expect(res).to.equal(0n);
});
- it('test operator "xor" overload (euint32, euint4) => euint32 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(8n);
- input.add4(4n);
+ it('test operator "xor" overload (euint64, euint16) => euint64 test 4 (45319, 45315)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(45319n);
+ input.add16(45315n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.xor_euint32_euint4(
+ const tx = await this.contract7.xor_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(12n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(4n);
});
- it('test operator "eq" overload (euint32, euint4) => ebool test 1 (3027950561, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(3027950561n);
- input.add4(14n);
+ it('test operator "eq" overload (euint64, euint16) => ebool test 1 (18445593277781135549, 65299)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18445593277781135549n);
+ input.add16(65299n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint32_euint4(
+ const tx = await this.contract7.eq_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint32, euint4) => ebool test 2 (10, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(10n);
- input.add4(14n);
+ it('test operator "eq" overload (euint64, euint16) => ebool test 2 (65295, 65299)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(65295n);
+ input.add16(65299n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint32_euint4(
+ const tx = await this.contract7.eq_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint32, euint4) => ebool test 3 (14, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(14n);
- input.add4(14n);
+ it('test operator "eq" overload (euint64, euint16) => ebool test 3 (65299, 65299)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(65299n);
+ input.add16(65299n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint32_euint4(
+ const tx = await this.contract7.eq_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint32, euint4) => ebool test 4 (14, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(14n);
- input.add4(10n);
+ it('test operator "eq" overload (euint64, euint16) => ebool test 4 (65299, 65295)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(65299n);
+ input.add16(65295n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.eq_euint32_euint4(
+ const tx = await this.contract7.eq_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint32, euint4) => ebool test 1 (2599901708, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(2599901708n);
- input.add4(3n);
+ it('test operator "ne" overload (euint64, euint16) => ebool test 1 (18446683880931020495, 9122)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18446683880931020495n);
+ input.add16(9122n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint32_euint4(
+ const tx = await this.contract7.ne_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint32, euint4) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(4n);
- input.add4(8n);
+ it('test operator "ne" overload (euint64, euint16) => ebool test 2 (9118, 9122)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(9118n);
+ input.add16(9122n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint32_euint4(
+ const tx = await this.contract7.ne_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint32, euint4) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(8n);
- input.add4(8n);
+ it('test operator "ne" overload (euint64, euint16) => ebool test 3 (9122, 9122)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(9122n);
+ input.add16(9122n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint32_euint4(
+ const tx = await this.contract7.ne_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint32, euint4) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(8n);
- input.add4(4n);
+ it('test operator "ne" overload (euint64, euint16) => ebool test 4 (9122, 9118)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(9122n);
+ input.add16(9118n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ne_euint32_euint4(
+ const tx = await this.contract7.ne_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint32, euint4) => ebool test 1 (1601227311, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(1601227311n);
- input.add4(14n);
+ it('test operator "ge" overload (euint64, euint16) => ebool test 1 (18445173411231141809, 29055)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18445173411231141809n);
+ input.add16(29055n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint32_euint4(
+ const tx = await this.contract7.ge_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint32, euint4) => ebool test 2 (10, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(10n);
- input.add4(14n);
+ it('test operator "ge" overload (euint64, euint16) => ebool test 2 (29051, 29055)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(29051n);
+ input.add16(29055n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint32_euint4(
+ const tx = await this.contract7.ge_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint32, euint4) => ebool test 3 (14, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(14n);
- input.add4(14n);
+ it('test operator "ge" overload (euint64, euint16) => ebool test 3 (29055, 29055)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(29055n);
+ input.add16(29055n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint32_euint4(
+ const tx = await this.contract7.ge_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint32, euint4) => ebool test 4 (14, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(14n);
- input.add4(10n);
+ it('test operator "ge" overload (euint64, euint16) => ebool test 4 (29055, 29051)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(29055n);
+ input.add16(29051n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.ge_euint32_euint4(
+ const tx = await this.contract7.ge_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint32, euint4) => ebool test 1 (3548820179, 1)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(3548820179n);
- input.add4(1n);
+ it('test operator "gt" overload (euint64, euint16) => ebool test 1 (18444002964571998281, 52124)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444002964571998281n);
+ input.add16(52124n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint32_euint4(
+ const tx = await this.contract7.gt_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint32, euint4) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(4n);
- input.add4(8n);
+ it('test operator "gt" overload (euint64, euint16) => ebool test 2 (52120, 52124)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(52120n);
+ input.add16(52124n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint32_euint4(
+ const tx = await this.contract7.gt_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint32, euint4) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(8n);
- input.add4(8n);
+ it('test operator "gt" overload (euint64, euint16) => ebool test 3 (52124, 52124)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(52124n);
+ input.add16(52124n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint32_euint4(
+ const tx = await this.contract7.gt_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint32, euint4) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(8n);
- input.add4(4n);
+ it('test operator "gt" overload (euint64, euint16) => ebool test 4 (52124, 52120)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(52124n);
+ input.add16(52120n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.gt_euint32_euint4(
+ const tx = await this.contract7.gt_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint32, euint4) => ebool test 1 (681177958, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(681177958n);
- input.add4(4n);
+ it('test operator "le" overload (euint64, euint16) => ebool test 1 (18437883313011515679, 51774)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18437883313011515679n);
+ input.add16(51774n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint32_euint4(
+ const tx = await this.contract7.le_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "le" overload (euint32, euint4) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(4n);
- input.add4(8n);
+ it('test operator "le" overload (euint64, euint16) => ebool test 2 (51770, 51774)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(51770n);
+ input.add16(51774n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint32_euint4(
+ const tx = await this.contract7.le_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint32, euint4) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(8n);
- input.add4(8n);
+ it('test operator "le" overload (euint64, euint16) => ebool test 3 (51774, 51774)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(51774n);
+ input.add16(51774n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint32_euint4(
+ const tx = await this.contract7.le_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint32, euint4) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(8n);
- input.add4(4n);
+ it('test operator "le" overload (euint64, euint16) => ebool test 4 (51774, 51770)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(51774n);
+ input.add16(51770n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.le_euint32_euint4(
+ const tx = await this.contract7.le_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint32, euint4) => ebool test 1 (928445097, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(928445097n);
- input.add4(2n);
+ it('test operator "lt" overload (euint64, euint16) => ebool test 1 (18440546263819960189, 42672)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440546263819960189n);
+ input.add16(42672n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint32_euint4(
+ const tx = await this.contract7.lt_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint32, euint4) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(4n);
- input.add4(8n);
+ it('test operator "lt" overload (euint64, euint16) => ebool test 2 (42668, 42672)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(42668n);
+ input.add16(42672n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint32_euint4(
+ const tx = await this.contract7.lt_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint32, euint4) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(8n);
- input.add4(8n);
+ it('test operator "lt" overload (euint64, euint16) => ebool test 3 (42672, 42672)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(42672n);
+ input.add16(42672n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint32_euint4(
+ const tx = await this.contract7.lt_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint32, euint4) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(8n);
- input.add4(4n);
+ it('test operator "lt" overload (euint64, euint16) => ebool test 4 (42672, 42668)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(42672n);
+ input.add16(42668n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.lt_euint32_euint4(
+ const tx = await this.contract7.lt_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract3.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "min" overload (euint32, euint4) => euint32 test 1 (2403125524, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(2403125524n);
- input.add4(11n);
+ it('test operator "min" overload (euint64, euint16) => euint64 test 1 (18440389921895932333, 42816)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440389921895932333n);
+ input.add16(42816n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint32_euint4(
+ const tx = await this.contract7.min_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(11n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(42816n);
});
- it('test operator "min" overload (euint32, euint4) => euint32 test 2 (7, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(7n);
- input.add4(11n);
+ it('test operator "min" overload (euint64, euint16) => euint64 test 2 (42812, 42816)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(42812n);
+ input.add16(42816n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint32_euint4(
+ const tx = await this.contract7.min_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(7n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(42812n);
});
- it('test operator "min" overload (euint32, euint4) => euint32 test 3 (11, 11)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(11n);
- input.add4(11n);
+ it('test operator "min" overload (euint64, euint16) => euint64 test 3 (42816, 42816)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(42816n);
+ input.add16(42816n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint32_euint4(
+ const tx = await this.contract7.min_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(11n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(42816n);
});
- it('test operator "min" overload (euint32, euint4) => euint32 test 4 (11, 7)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(11n);
- input.add4(7n);
+ it('test operator "min" overload (euint64, euint16) => euint64 test 4 (42816, 42812)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(42816n);
+ input.add16(42812n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.min_euint32_euint4(
+ const tx = await this.contract7.min_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(7n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(42812n);
});
- it('test operator "max" overload (euint32, euint4) => euint32 test 1 (1272584917, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(1272584917n);
- input.add4(14n);
+ it('test operator "max" overload (euint64, euint16) => euint64 test 1 (18446109140882718991, 19434)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18446109140882718991n);
+ input.add16(19434n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint32_euint4(
+ const tx = await this.contract7.max_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(1272584917n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18446109140882718991n);
});
- it('test operator "max" overload (euint32, euint4) => euint32 test 2 (10, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(10n);
- input.add4(14n);
+ it('test operator "max" overload (euint64, euint16) => euint64 test 2 (19430, 19434)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(19430n);
+ input.add16(19434n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint32_euint4(
+ const tx = await this.contract7.max_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(14n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(19434n);
});
- it('test operator "max" overload (euint32, euint4) => euint32 test 3 (14, 14)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(14n);
- input.add4(14n);
+ it('test operator "max" overload (euint64, euint16) => euint64 test 3 (19434, 19434)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(19434n);
+ input.add16(19434n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint32_euint4(
+ const tx = await this.contract7.max_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(14n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(19434n);
});
- it('test operator "max" overload (euint32, euint4) => euint32 test 4 (14, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(14n);
- input.add4(10n);
+ it('test operator "max" overload (euint64, euint16) => euint64 test 4 (19434, 19430)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(19434n);
+ input.add16(19430n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.max_euint32_euint4(
+ const tx = await this.contract7.max_euint64_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(14n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(19434n);
});
- it('test operator "add" overload (euint32, euint8) => euint32 test 1 (153, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(153n);
- input.add8(2n);
+ it('test operator "add" overload (euint64, euint32) => euint64 test 1 (4294529095, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(4294529095n);
+ input.add32(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint32_euint8(
+ const tx = await this.contract7.add_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(155n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(4294529097n);
});
- it('test operator "add" overload (euint32, euint8) => euint32 test 2 (123, 125)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(123n);
- input.add8(125n);
+ it('test operator "add" overload (euint64, euint32) => euint64 test 2 (1772669097, 1772669099)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1772669097n);
+ input.add32(1772669099n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint32_euint8(
+ const tx = await this.contract7.add_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(248n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(3545338196n);
});
- it('test operator "add" overload (euint32, euint8) => euint32 test 3 (125, 125)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(125n);
- input.add8(125n);
+ it('test operator "add" overload (euint64, euint32) => euint64 test 3 (1772669099, 1772669099)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1772669099n);
+ input.add32(1772669099n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint32_euint8(
+ const tx = await this.contract7.add_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(250n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(3545338198n);
});
- it('test operator "add" overload (euint32, euint8) => euint32 test 4 (125, 123)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(125n);
- input.add8(123n);
+ it('test operator "add" overload (euint64, euint32) => euint64 test 4 (1772669099, 1772669097)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1772669099n);
+ input.add32(1772669097n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.add_euint32_euint8(
+ const tx = await this.contract7.add_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(248n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(3545338196n);
});
- it('test operator "sub" overload (euint32, euint8) => euint32 test 1 (52, 52)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(52n);
- input.add8(52n);
+ it('test operator "sub" overload (euint64, euint32) => euint64 test 1 (148706478, 148706478)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(148706478n);
+ input.add32(148706478n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.sub_euint32_euint8(
+ const tx = await this.contract7.sub_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
+ const res = await decrypt64(await this.contract7.res64());
expect(res).to.equal(0n);
});
- it('test operator "sub" overload (euint32, euint8) => euint32 test 2 (52, 48)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(52n);
- input.add8(48n);
+ it('test operator "sub" overload (euint64, euint32) => euint64 test 2 (148706478, 148706474)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(148706478n);
+ input.add32(148706474n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.sub_euint32_euint8(
+ const tx = await this.contract7.sub_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
+ const res = await decrypt64(await this.contract7.res64());
expect(res).to.equal(4n);
});
- it('test operator "mul" overload (euint32, euint8) => euint32 test 1 (102, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(102n);
- input.add8(2n);
+ it('test operator "mul" overload (euint64, euint32) => euint64 test 1 (2147463302, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(2147463302n);
+ input.add32(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint32_euint8(
+ const tx = await this.contract7.mul_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(204n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(4294926604n);
});
- it('test operator "mul" overload (euint32, euint8) => euint32 test 2 (10, 12)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(10n);
- input.add8(12n);
+ it('test operator "mul" overload (euint64, euint32) => euint64 test 2 (62313, 62313)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(62313n);
+ input.add32(62313n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint32_euint8(
+ const tx = await this.contract7.mul_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(120n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(3882909969n);
});
- it('test operator "mul" overload (euint32, euint8) => euint32 test 3 (12, 12)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(12n);
- input.add8(12n);
+ it('test operator "mul" overload (euint64, euint32) => euint64 test 3 (62313, 62313)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(62313n);
+ input.add32(62313n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint32_euint8(
+ const tx = await this.contract7.mul_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(144n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(3882909969n);
});
- it('test operator "mul" overload (euint32, euint8) => euint32 test 4 (12, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(12n);
- input.add8(10n);
+ it('test operator "mul" overload (euint64, euint32) => euint64 test 4 (62313, 62313)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(62313n);
+ input.add32(62313n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.mul_euint32_euint8(
+ const tx = await this.contract7.mul_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(120n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(3882909969n);
});
- it('test operator "and" overload (euint32, euint8) => euint32 test 1 (2756559333, 33)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(2756559333n);
- input.add8(33n);
+ it('test operator "and" overload (euint64, euint32) => euint64 test 1 (18439406521573141853, 840706883)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18439406521573141853n);
+ input.add32(840706883n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint32_euint8(
+ const tx = await this.contract7.and_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(33n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(33564993n);
});
- it('test operator "and" overload (euint32, euint8) => euint32 test 2 (29, 33)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(29n);
- input.add8(33n);
+ it('test operator "and" overload (euint64, euint32) => euint64 test 2 (840706879, 840706883)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(840706879n);
+ input.add32(840706883n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint32_euint8(
+ const tx = await this.contract7.and_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(1n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(840706819n);
});
- it('test operator "and" overload (euint32, euint8) => euint32 test 3 (33, 33)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(33n);
- input.add8(33n);
+ it('test operator "and" overload (euint64, euint32) => euint64 test 3 (840706883, 840706883)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(840706883n);
+ input.add32(840706883n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint32_euint8(
+ const tx = await this.contract7.and_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(33n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(840706883n);
});
- it('test operator "and" overload (euint32, euint8) => euint32 test 4 (33, 29)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address);
- input.add32(33n);
- input.add8(29n);
+ it('test operator "and" overload (euint64, euint32) => euint64 test 4 (840706883, 840706879)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(840706883n);
+ input.add32(840706879n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract3.and_euint32_euint8(
+ const tx = await this.contract7.and_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract3.res32());
- expect(res).to.equal(1n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(840706819n);
+ });
+
+ it('test operator "or" overload (euint64, euint32) => euint64 test 1 (18441305633946386479, 1651927522)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18441305633946386479n);
+ input.add32(1651927522n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.or_euint64_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18441305635594103279n);
+ });
+
+ it('test operator "or" overload (euint64, euint32) => euint64 test 2 (1651927518, 1651927522)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1651927518n);
+ input.add32(1651927522n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.or_euint64_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(1651927550n);
+ });
+
+ it('test operator "or" overload (euint64, euint32) => euint64 test 3 (1651927522, 1651927522)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1651927522n);
+ input.add32(1651927522n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.or_euint64_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(1651927522n);
+ });
+
+ it('test operator "or" overload (euint64, euint32) => euint64 test 4 (1651927522, 1651927518)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1651927522n);
+ input.add32(1651927518n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.or_euint64_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(1651927550n);
});
- it('test operator "or" overload (euint32, euint8) => euint32 test 1 (1062322837, 212)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1062322837n);
- input.add8(212n);
+ it('test operator "xor" overload (euint64, euint32) => euint64 test 1 (18440012895744339301, 1085979490)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440012895744339301n);
+ input.add32(1085979490n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint32_euint8(
+ const tx = await this.contract7.xor_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1062322901n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18440012896823678471n);
});
- it('test operator "or" overload (euint32, euint8) => euint32 test 2 (208, 212)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(208n);
- input.add8(212n);
+ it('test operator "xor" overload (euint64, euint32) => euint64 test 2 (1085979486, 1085979490)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1085979486n);
+ input.add32(1085979490n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint32_euint8(
+ const tx = await this.contract7.xor_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(212n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(60n);
});
- it('test operator "or" overload (euint32, euint8) => euint32 test 3 (212, 212)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(212n);
- input.add8(212n);
+ it('test operator "xor" overload (euint64, euint32) => euint64 test 3 (1085979490, 1085979490)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1085979490n);
+ input.add32(1085979490n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint32_euint8(
+ const tx = await this.contract7.xor_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(212n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(0n);
});
- it('test operator "or" overload (euint32, euint8) => euint32 test 4 (212, 208)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(212n);
- input.add8(208n);
+ it('test operator "xor" overload (euint64, euint32) => euint64 test 4 (1085979490, 1085979486)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1085979490n);
+ input.add32(1085979486n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint32_euint8(
+ const tx = await this.contract7.xor_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(212n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(60n);
});
});
diff --git a/test/tfheOperations/tfheOperations8.ts b/test/tfheOperations/tfheOperations8.ts
index 261e7412..4b38a2ec 100644
--- a/test/tfheOperations/tfheOperations8.ts
+++ b/test/tfheOperations/tfheOperations8.ts
@@ -7,7 +7,22 @@ import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'
import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance';
+import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
+import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
+import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
+import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
+import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
+import {
+ createInstances,
+ decrypt4,
+ decrypt8,
+ decrypt16,
+ decrypt32,
+ decrypt64,
+ decrypt128,
+ decrypt256,
+ decryptBool,
+} from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
@@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise {
return contract;
}
+async function deployTfheTestFixture7(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite7');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture8(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite8');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture9(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite9');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture10(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite10');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture11(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite11');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
describe('TFHE operations 8', function () {
before(async function () {
await initSigners(1);
@@ -105,2497 +175,4677 @@ describe('TFHE operations 8', function () {
this.contract6Address = await contract6.getAddress();
this.contract6 = contract6;
- const instances = await createInstances(this.signers);
- this.instances = instances;
- });
+ const contract7 = await deployTfheTestFixture7();
+ this.contract7Address = await contract7.getAddress();
+ this.contract7 = contract7;
- it('test operator "xor" overload (euint32, euint8) => euint32 test 1 (2442028658, 23)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2442028658n);
- input.add8(23n);
- const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint32_euint8(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
- await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2442028645n);
- });
+ const contract8 = await deployTfheTestFixture8();
+ this.contract8Address = await contract8.getAddress();
+ this.contract8 = contract8;
- it('test operator "xor" overload (euint32, euint8) => euint32 test 2 (19, 23)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(19n);
- input.add8(23n);
- const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint32_euint8(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
- await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(4n);
- });
+ const contract9 = await deployTfheTestFixture9();
+ this.contract9Address = await contract9.getAddress();
+ this.contract9 = contract9;
- it('test operator "xor" overload (euint32, euint8) => euint32 test 3 (23, 23)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(23n);
- input.add8(23n);
- const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint32_euint8(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
- await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(0n);
- });
+ const contract10 = await deployTfheTestFixture10();
+ this.contract10Address = await contract10.getAddress();
+ this.contract10 = contract10;
- it('test operator "xor" overload (euint32, euint8) => euint32 test 4 (23, 19)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(23n);
- input.add8(19n);
- const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint32_euint8(
- encryptedAmount.handles[0],
- encryptedAmount.handles[1],
- encryptedAmount.inputProof,
- );
- await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(4n);
+ const contract11 = await deployTfheTestFixture11();
+ this.contract11Address = await contract11.getAddress();
+ this.contract11 = contract11;
+
+ const instances = await createInstances(this.signers);
+ this.instances = instances;
});
- it('test operator "eq" overload (euint32, euint8) => ebool test 1 (1831274090, 104)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1831274090n);
- input.add8(104n);
+ it('test operator "eq" overload (euint64, euint32) => ebool test 1 (18443073273307378367, 1540281447)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443073273307378367n);
+ input.add32(1540281447n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint32_euint8(
+ const tx = await this.contract7.eq_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint32, euint8) => ebool test 2 (100, 104)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(100n);
- input.add8(104n);
+ it('test operator "eq" overload (euint64, euint32) => ebool test 2 (1540281443, 1540281447)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1540281443n);
+ input.add32(1540281447n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint32_euint8(
+ const tx = await this.contract7.eq_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint32, euint8) => ebool test 3 (104, 104)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(104n);
- input.add8(104n);
+ it('test operator "eq" overload (euint64, euint32) => ebool test 3 (1540281447, 1540281447)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1540281447n);
+ input.add32(1540281447n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint32_euint8(
+ const tx = await this.contract7.eq_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint32, euint8) => ebool test 4 (104, 100)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(104n);
- input.add8(100n);
+ it('test operator "eq" overload (euint64, euint32) => ebool test 4 (1540281447, 1540281443)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1540281447n);
+ input.add32(1540281443n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint32_euint8(
+ const tx = await this.contract7.eq_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint32, euint8) => ebool test 1 (3821365412, 152)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(3821365412n);
- input.add8(152n);
+ it('test operator "ne" overload (euint64, euint32) => ebool test 1 (18443424543399945811, 2475089443)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443424543399945811n);
+ input.add32(2475089443n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint32_euint8(
+ const tx = await this.contract7.ne_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint32, euint8) => ebool test 2 (148, 152)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(148n);
- input.add8(152n);
+ it('test operator "ne" overload (euint64, euint32) => ebool test 2 (2475089439, 2475089443)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(2475089439n);
+ input.add32(2475089443n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint32_euint8(
+ const tx = await this.contract7.ne_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint32, euint8) => ebool test 3 (152, 152)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(152n);
- input.add8(152n);
+ it('test operator "ne" overload (euint64, euint32) => ebool test 3 (2475089443, 2475089443)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(2475089443n);
+ input.add32(2475089443n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint32_euint8(
+ const tx = await this.contract7.ne_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint32, euint8) => ebool test 4 (152, 148)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(152n);
- input.add8(148n);
+ it('test operator "ne" overload (euint64, euint32) => ebool test 4 (2475089443, 2475089439)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(2475089443n);
+ input.add32(2475089439n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint32_euint8(
+ const tx = await this.contract7.ne_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint32, euint8) => ebool test 1 (1799963609, 233)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1799963609n);
- input.add8(233n);
+ it('test operator "ge" overload (euint64, euint32) => ebool test 1 (18439654895803536359, 1948462184)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18439654895803536359n);
+ input.add32(1948462184n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint32_euint8(
+ const tx = await this.contract7.ge_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint32, euint8) => ebool test 2 (229, 233)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(229n);
- input.add8(233n);
+ it('test operator "ge" overload (euint64, euint32) => ebool test 2 (1948462180, 1948462184)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1948462180n);
+ input.add32(1948462184n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint32_euint8(
+ const tx = await this.contract7.ge_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint32, euint8) => ebool test 3 (233, 233)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(233n);
- input.add8(233n);
+ it('test operator "ge" overload (euint64, euint32) => ebool test 3 (1948462184, 1948462184)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1948462184n);
+ input.add32(1948462184n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint32_euint8(
+ const tx = await this.contract7.ge_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint32, euint8) => ebool test 4 (233, 229)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(233n);
- input.add8(229n);
+ it('test operator "ge" overload (euint64, euint32) => ebool test 4 (1948462184, 1948462180)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1948462184n);
+ input.add32(1948462180n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint32_euint8(
+ const tx = await this.contract7.ge_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint32, euint8) => ebool test 1 (3893344872, 37)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(3893344872n);
- input.add8(37n);
+ it('test operator "gt" overload (euint64, euint32) => ebool test 1 (18445739090666652013, 2575338339)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18445739090666652013n);
+ input.add32(2575338339n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint32_euint8(
+ const tx = await this.contract7.gt_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint32, euint8) => ebool test 2 (33, 37)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(33n);
- input.add8(37n);
+ it('test operator "gt" overload (euint64, euint32) => ebool test 2 (2575338335, 2575338339)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(2575338335n);
+ input.add32(2575338339n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint32_euint8(
+ const tx = await this.contract7.gt_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint32, euint8) => ebool test 3 (37, 37)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(37n);
- input.add8(37n);
+ it('test operator "gt" overload (euint64, euint32) => ebool test 3 (2575338339, 2575338339)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(2575338339n);
+ input.add32(2575338339n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint32_euint8(
+ const tx = await this.contract7.gt_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint32, euint8) => ebool test 4 (37, 33)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(37n);
- input.add8(33n);
+ it('test operator "gt" overload (euint64, euint32) => ebool test 4 (2575338339, 2575338335)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(2575338339n);
+ input.add32(2575338335n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint32_euint8(
+ const tx = await this.contract7.gt_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint32, euint8) => ebool test 1 (804391035, 133)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(804391035n);
- input.add8(133n);
+ it('test operator "le" overload (euint64, euint32) => ebool test 1 (18442023388952183851, 1762835382)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18442023388952183851n);
+ input.add32(1762835382n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint32_euint8(
+ const tx = await this.contract7.le_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "le" overload (euint32, euint8) => ebool test 2 (129, 133)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(129n);
- input.add8(133n);
+ it('test operator "le" overload (euint64, euint32) => ebool test 2 (1762835378, 1762835382)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1762835378n);
+ input.add32(1762835382n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint32_euint8(
+ const tx = await this.contract7.le_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint32, euint8) => ebool test 3 (133, 133)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(133n);
- input.add8(133n);
+ it('test operator "le" overload (euint64, euint32) => ebool test 3 (1762835382, 1762835382)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1762835382n);
+ input.add32(1762835382n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint32_euint8(
+ const tx = await this.contract7.le_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint32, euint8) => ebool test 4 (133, 129)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(133n);
- input.add8(129n);
+ it('test operator "le" overload (euint64, euint32) => ebool test 4 (1762835382, 1762835378)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1762835382n);
+ input.add32(1762835378n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint32_euint8(
+ const tx = await this.contract7.le_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint32, euint8) => ebool test 1 (3782116241, 158)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(3782116241n);
- input.add8(158n);
+ it('test operator "lt" overload (euint64, euint32) => ebool test 1 (18441377707016357467, 2876988629)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18441377707016357467n);
+ input.add32(2876988629n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint32_euint8(
+ const tx = await this.contract7.lt_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint32, euint8) => ebool test 2 (154, 158)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(154n);
- input.add8(158n);
+ it('test operator "lt" overload (euint64, euint32) => ebool test 2 (2876988625, 2876988629)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(2876988625n);
+ input.add32(2876988629n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint32_euint8(
+ const tx = await this.contract7.lt_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint32, euint8) => ebool test 3 (158, 158)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(158n);
- input.add8(158n);
+ it('test operator "lt" overload (euint64, euint32) => ebool test 3 (2876988629, 2876988629)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(2876988629n);
+ input.add32(2876988629n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint32_euint8(
+ const tx = await this.contract7.lt_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint32, euint8) => ebool test 4 (158, 154)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(158n);
- input.add8(154n);
+ it('test operator "lt" overload (euint64, euint32) => ebool test 4 (2876988629, 2876988625)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(2876988629n);
+ input.add32(2876988625n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint32_euint8(
+ const tx = await this.contract7.lt_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "min" overload (euint32, euint8) => euint32 test 1 (2689679661, 114)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2689679661n);
- input.add8(114n);
+ it('test operator "min" overload (euint64, euint32) => euint64 test 1 (18439611592084278651, 1078993829)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18439611592084278651n);
+ input.add32(1078993829n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint32_euint8(
+ const tx = await this.contract7.min_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(114n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(1078993829n);
});
- it('test operator "min" overload (euint32, euint8) => euint32 test 2 (110, 114)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(110n);
- input.add8(114n);
+ it('test operator "min" overload (euint64, euint32) => euint64 test 2 (1078993825, 1078993829)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1078993825n);
+ input.add32(1078993829n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint32_euint8(
+ const tx = await this.contract7.min_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(110n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(1078993825n);
});
- it('test operator "min" overload (euint32, euint8) => euint32 test 3 (114, 114)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(114n);
- input.add8(114n);
+ it('test operator "min" overload (euint64, euint32) => euint64 test 3 (1078993829, 1078993829)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1078993829n);
+ input.add32(1078993829n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint32_euint8(
+ const tx = await this.contract7.min_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(114n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(1078993829n);
});
- it('test operator "min" overload (euint32, euint8) => euint32 test 4 (114, 110)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(114n);
- input.add8(110n);
+ it('test operator "min" overload (euint64, euint32) => euint64 test 4 (1078993829, 1078993825)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(1078993829n);
+ input.add32(1078993825n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint32_euint8(
+ const tx = await this.contract7.min_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(110n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(1078993825n);
});
- it('test operator "max" overload (euint32, euint8) => euint32 test 1 (2001471362, 68)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2001471362n);
- input.add8(68n);
+ it('test operator "max" overload (euint64, euint32) => euint64 test 1 (18438142521959169981, 4265760124)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18438142521959169981n);
+ input.add32(4265760124n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint32_euint8(
+ const tx = await this.contract7.max_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2001471362n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18438142521959169981n);
});
- it('test operator "max" overload (euint32, euint8) => euint32 test 2 (64, 68)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(64n);
- input.add8(68n);
+ it('test operator "max" overload (euint64, euint32) => euint64 test 2 (4265760120, 4265760124)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(4265760120n);
+ input.add32(4265760124n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint32_euint8(
+ const tx = await this.contract7.max_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(68n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(4265760124n);
});
- it('test operator "max" overload (euint32, euint8) => euint32 test 3 (68, 68)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(68n);
- input.add8(68n);
+ it('test operator "max" overload (euint64, euint32) => euint64 test 3 (4265760124, 4265760124)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(4265760124n);
+ input.add32(4265760124n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint32_euint8(
+ const tx = await this.contract7.max_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(68n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(4265760124n);
});
- it('test operator "max" overload (euint32, euint8) => euint32 test 4 (68, 64)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(68n);
- input.add8(64n);
+ it('test operator "max" overload (euint64, euint32) => euint64 test 4 (4265760124, 4265760120)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(4265760124n);
+ input.add32(4265760120n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint32_euint8(
+ const tx = await this.contract7.max_euint64_euint32(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(68n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(4265760124n);
});
- it('test operator "add" overload (euint32, euint16) => euint32 test 1 (62662, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(62662n);
- input.add16(2n);
+ it('test operator "add" overload (euint64, euint64) => euint64 test 1 (9222005500490563257, 9222323180954998973)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(9222005500490563257n);
+ input.add64(9222323180954998973n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint32_euint16(
+ const tx = await this.contract7.add_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(62664n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18444328681445562230n);
});
- it('test operator "add" overload (euint32, euint16) => euint32 test 2 (19188, 19190)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(19188n);
- input.add16(19190n);
+ it('test operator "add" overload (euint64, euint64) => euint64 test 2 (9222005500490563255, 9222005500490563257)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(9222005500490563255n);
+ input.add64(9222005500490563257n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint32_euint16(
+ const tx = await this.contract7.add_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(38378n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18444011000981126512n);
});
- it('test operator "add" overload (euint32, euint16) => euint32 test 3 (19190, 19190)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(19190n);
- input.add16(19190n);
+ it('test operator "add" overload (euint64, euint64) => euint64 test 3 (9222005500490563257, 9222005500490563257)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(9222005500490563257n);
+ input.add64(9222005500490563257n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint32_euint16(
+ const tx = await this.contract7.add_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(38380n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18444011000981126514n);
});
- it('test operator "add" overload (euint32, euint16) => euint32 test 4 (19190, 19188)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(19190n);
- input.add16(19188n);
+ it('test operator "add" overload (euint64, euint64) => euint64 test 4 (9222005500490563257, 9222005500490563255)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(9222005500490563257n);
+ input.add64(9222005500490563255n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint32_euint16(
+ const tx = await this.contract7.add_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(38378n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18444011000981126512n);
});
- it('test operator "sub" overload (euint32, euint16) => euint32 test 1 (35686, 35686)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(35686n);
- input.add16(35686n);
+ it('test operator "sub" overload (euint64, euint64) => euint64 test 1 (18440691834306324731, 18440691834306324731)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440691834306324731n);
+ input.add64(18440691834306324731n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.sub_euint32_euint16(
+ const tx = await this.contract7.sub_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
+ const res = await decrypt64(await this.contract7.res64());
expect(res).to.equal(0n);
});
- it('test operator "sub" overload (euint32, euint16) => euint32 test 2 (35686, 35682)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(35686n);
- input.add16(35682n);
+ it('test operator "sub" overload (euint64, euint64) => euint64 test 2 (18440691834306324731, 18440691834306324727)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440691834306324731n);
+ input.add64(18440691834306324727n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.sub_euint32_euint16(
+ const tx = await this.contract7.sub_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
+ const res = await decrypt64(await this.contract7.res64());
expect(res).to.equal(4n);
});
- it('test operator "mul" overload (euint32, euint16) => euint32 test 1 (22131, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(22131n);
- input.add16(2n);
+ it('test operator "mul" overload (euint64, euint64) => euint64 test 1 (4294482875, 4294789499)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(4294482875n);
+ input.add64(4294789499n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint32_euint16(
+ const tx = await this.contract7.mul_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(44262n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18443899955185329625n);
});
- it('test operator "mul" overload (euint32, euint16) => euint32 test 2 (158, 158)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(158n);
- input.add16(158n);
+ it('test operator "mul" overload (euint64, euint64) => euint64 test 2 (4294482875, 4294482875)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(4294482875n);
+ input.add64(4294482875n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint32_euint16(
+ const tx = await this.contract7.mul_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(24964n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18442583163668265625n);
});
- it('test operator "mul" overload (euint32, euint16) => euint32 test 3 (158, 158)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(158n);
- input.add16(158n);
+ it('test operator "mul" overload (euint64, euint64) => euint64 test 3 (4294482875, 4294482875)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(4294482875n);
+ input.add64(4294482875n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint32_euint16(
+ const tx = await this.contract7.mul_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(24964n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18442583163668265625n);
});
- it('test operator "mul" overload (euint32, euint16) => euint32 test 4 (158, 158)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(158n);
- input.add16(158n);
+ it('test operator "mul" overload (euint64, euint64) => euint64 test 4 (4294482875, 4294482875)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(4294482875n);
+ input.add64(4294482875n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint32_euint16(
+ const tx = await this.contract7.mul_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(24964n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18442583163668265625n);
});
- it('test operator "and" overload (euint32, euint16) => euint32 test 1 (46593294, 4785)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(46593294n);
- input.add16(4785n);
+ it('test operator "and" overload (euint64, euint64) => euint64 test 1 (18444124970074897317, 18442657213736743287)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444124970074897317n);
+ input.add64(18442657213736743287n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.and_euint32_euint16(
+ const tx = await this.contract7.and_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(4096n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18442294351260348709n);
});
- it('test operator "and" overload (euint32, euint16) => euint32 test 2 (4781, 4785)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(4781n);
- input.add16(4785n);
+ it('test operator "and" overload (euint64, euint64) => euint64 test 2 (18442657213736743283, 18442657213736743287)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18442657213736743283n);
+ input.add64(18442657213736743287n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.and_euint32_euint16(
+ const tx = await this.contract7.and_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(4769n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18442657213736743283n);
});
- it('test operator "and" overload (euint32, euint16) => euint32 test 3 (4785, 4785)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(4785n);
- input.add16(4785n);
+ it('test operator "and" overload (euint64, euint64) => euint64 test 3 (18442657213736743287, 18442657213736743287)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18442657213736743287n);
+ input.add64(18442657213736743287n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.and_euint32_euint16(
+ const tx = await this.contract7.and_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(4785n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18442657213736743287n);
});
- it('test operator "and" overload (euint32, euint16) => euint32 test 4 (4785, 4781)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(4785n);
- input.add16(4781n);
+ it('test operator "and" overload (euint64, euint64) => euint64 test 4 (18442657213736743287, 18442657213736743283)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18442657213736743287n);
+ input.add64(18442657213736743283n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.and_euint32_euint16(
+ const tx = await this.contract7.and_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(4769n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18442657213736743283n);
});
- it('test operator "or" overload (euint32, euint16) => euint32 test 1 (1914437939, 49825)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1914437939n);
- input.add16(49825n);
+ it('test operator "or" overload (euint64, euint64) => euint64 test 1 (18445851190683093315, 18440297605680046453)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18445851190683093315n);
+ input.add64(18440297605680046453n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint32_euint16(
+ const tx = await this.contract7.or_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1914487731n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18446141532670781815n);
});
- it('test operator "or" overload (euint32, euint16) => euint32 test 2 (49821, 49825)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(49821n);
- input.add16(49825n);
+ it('test operator "or" overload (euint64, euint64) => euint64 test 2 (18440297605680046449, 18440297605680046453)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440297605680046449n);
+ input.add64(18440297605680046453n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint32_euint16(
+ const tx = await this.contract7.or_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(49853n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18440297605680046453n);
});
- it('test operator "or" overload (euint32, euint16) => euint32 test 3 (49825, 49825)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(49825n);
- input.add16(49825n);
+ it('test operator "or" overload (euint64, euint64) => euint64 test 3 (18440297605680046453, 18440297605680046453)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440297605680046453n);
+ input.add64(18440297605680046453n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint32_euint16(
+ const tx = await this.contract7.or_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(49825n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18440297605680046453n);
});
- it('test operator "or" overload (euint32, euint16) => euint32 test 4 (49825, 49821)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(49825n);
- input.add16(49821n);
+ it('test operator "or" overload (euint64, euint64) => euint64 test 4 (18440297605680046453, 18440297605680046449)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440297605680046453n);
+ input.add64(18440297605680046449n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint32_euint16(
+ const tx = await this.contract7.or_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(49853n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18440297605680046453n);
});
- it('test operator "xor" overload (euint32, euint16) => euint32 test 1 (4035221230, 58371)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(4035221230n);
- input.add16(58371n);
+ it('test operator "xor" overload (euint64, euint64) => euint64 test 1 (18439520894560746701, 18440669858368892063)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18439520894560746701n);
+ input.add64(18440669858368892063n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint32_euint16(
+ const tx = await this.contract7.xor_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(4035212013n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(3444795783188562n);
});
- it('test operator "xor" overload (euint32, euint16) => euint32 test 2 (58367, 58371)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(58367n);
- input.add16(58371n);
+ it('test operator "xor" overload (euint64, euint64) => euint64 test 2 (18439520894560746697, 18439520894560746701)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18439520894560746697n);
+ input.add64(18439520894560746701n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint32_euint16(
+ const tx = await this.contract7.xor_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2044n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(4n);
});
- it('test operator "xor" overload (euint32, euint16) => euint32 test 3 (58371, 58371)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(58371n);
- input.add16(58371n);
+ it('test operator "xor" overload (euint64, euint64) => euint64 test 3 (18439520894560746701, 18439520894560746701)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18439520894560746701n);
+ input.add64(18439520894560746701n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint32_euint16(
+ const tx = await this.contract7.xor_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
+ const res = await decrypt64(await this.contract7.res64());
expect(res).to.equal(0n);
});
- it('test operator "xor" overload (euint32, euint16) => euint32 test 4 (58371, 58367)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(58371n);
- input.add16(58367n);
+ it('test operator "xor" overload (euint64, euint64) => euint64 test 4 (18439520894560746701, 18439520894560746697)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18439520894560746701n);
+ input.add64(18439520894560746697n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint32_euint16(
+ const tx = await this.contract7.xor_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2044n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(4n);
});
- it('test operator "eq" overload (euint32, euint16) => ebool test 1 (3944731587, 33929)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(3944731587n);
- input.add16(33929n);
+ it('test operator "eq" overload (euint64, euint64) => ebool test 1 (18443282870504090991, 18446028700927461615)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443282870504090991n);
+ input.add64(18446028700927461615n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint32_euint16(
+ const tx = await this.contract7.eq_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint32, euint16) => ebool test 2 (33925, 33929)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(33925n);
- input.add16(33929n);
+ it('test operator "eq" overload (euint64, euint64) => ebool test 2 (18443282870504090987, 18443282870504090991)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443282870504090987n);
+ input.add64(18443282870504090991n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint32_euint16(
+ const tx = await this.contract7.eq_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint32, euint16) => ebool test 3 (33929, 33929)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(33929n);
- input.add16(33929n);
+ it('test operator "eq" overload (euint64, euint64) => ebool test 3 (18443282870504090991, 18443282870504090991)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443282870504090991n);
+ input.add64(18443282870504090991n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint32_euint16(
+ const tx = await this.contract7.eq_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint32, euint16) => ebool test 4 (33929, 33925)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(33929n);
- input.add16(33925n);
+ it('test operator "eq" overload (euint64, euint64) => ebool test 4 (18443282870504090991, 18443282870504090987)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443282870504090991n);
+ input.add64(18443282870504090987n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint32_euint16(
+ const tx = await this.contract7.eq_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint32, euint16) => ebool test 1 (3302913406, 10832)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(3302913406n);
- input.add16(10832n);
+ it('test operator "ne" overload (euint64, euint64) => ebool test 1 (18445289136242885897, 18441860560804132295)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18445289136242885897n);
+ input.add64(18441860560804132295n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint32_euint16(
+ const tx = await this.contract7.ne_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint32, euint16) => ebool test 2 (10828, 10832)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(10828n);
- input.add16(10832n);
+ it('test operator "ne" overload (euint64, euint64) => ebool test 2 (18441860560804132291, 18441860560804132295)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18441860560804132291n);
+ input.add64(18441860560804132295n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint32_euint16(
+ const tx = await this.contract7.ne_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint32, euint16) => ebool test 3 (10832, 10832)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(10832n);
- input.add16(10832n);
+ it('test operator "ne" overload (euint64, euint64) => ebool test 3 (18441860560804132295, 18441860560804132295)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18441860560804132295n);
+ input.add64(18441860560804132295n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint32_euint16(
+ const tx = await this.contract7.ne_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint32, euint16) => ebool test 4 (10832, 10828)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(10832n);
- input.add16(10828n);
+ it('test operator "ne" overload (euint64, euint64) => ebool test 4 (18441860560804132295, 18441860560804132291)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18441860560804132295n);
+ input.add64(18441860560804132291n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint32_euint16(
+ const tx = await this.contract7.ne_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint32, euint16) => ebool test 1 (1742405068, 56059)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1742405068n);
- input.add16(56059n);
+ it('test operator "ge" overload (euint64, euint64) => ebool test 1 (18444613618003912273, 18441817383047397973)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444613618003912273n);
+ input.add64(18441817383047397973n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint32_euint16(
+ const tx = await this.contract7.ge_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint32, euint16) => ebool test 2 (56055, 56059)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(56055n);
- input.add16(56059n);
+ it('test operator "ge" overload (euint64, euint64) => ebool test 2 (18441817383047397969, 18441817383047397973)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18441817383047397969n);
+ input.add64(18441817383047397973n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint32_euint16(
+ const tx = await this.contract7.ge_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint32, euint16) => ebool test 3 (56059, 56059)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(56059n);
- input.add16(56059n);
+ it('test operator "ge" overload (euint64, euint64) => ebool test 3 (18441817383047397973, 18441817383047397973)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18441817383047397973n);
+ input.add64(18441817383047397973n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint32_euint16(
+ const tx = await this.contract7.ge_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint32, euint16) => ebool test 4 (56059, 56055)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(56059n);
- input.add16(56055n);
+ it('test operator "ge" overload (euint64, euint64) => ebool test 4 (18441817383047397973, 18441817383047397969)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18441817383047397973n);
+ input.add64(18441817383047397969n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint32_euint16(
+ const tx = await this.contract7.ge_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint32, euint16) => ebool test 1 (4017313863, 63284)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(4017313863n);
- input.add16(63284n);
+ it('test operator "gt" overload (euint64, euint64) => ebool test 1 (18444129545450155179, 18438304556640407461)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444129545450155179n);
+ input.add64(18438304556640407461n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint32_euint16(
+ const tx = await this.contract7.gt_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint32, euint16) => ebool test 2 (63280, 63284)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(63280n);
- input.add16(63284n);
+ it('test operator "gt" overload (euint64, euint64) => ebool test 2 (18438304556640407457, 18438304556640407461)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18438304556640407457n);
+ input.add64(18438304556640407461n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint32_euint16(
+ const tx = await this.contract7.gt_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint32, euint16) => ebool test 3 (63284, 63284)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(63284n);
- input.add16(63284n);
+ it('test operator "gt" overload (euint64, euint64) => ebool test 3 (18438304556640407461, 18438304556640407461)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18438304556640407461n);
+ input.add64(18438304556640407461n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint32_euint16(
+ const tx = await this.contract7.gt_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint32, euint16) => ebool test 4 (63284, 63280)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(63284n);
- input.add16(63280n);
+ it('test operator "gt" overload (euint64, euint64) => ebool test 4 (18438304556640407461, 18438304556640407457)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18438304556640407461n);
+ input.add64(18438304556640407457n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint32_euint16(
+ const tx = await this.contract7.gt_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint32, euint16) => ebool test 1 (1660443539, 63916)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1660443539n);
- input.add16(63916n);
+ it('test operator "le" overload (euint64, euint64) => ebool test 1 (18440402951089431437, 18444684457474043493)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440402951089431437n);
+ input.add64(18444684457474043493n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint32_euint16(
+ const tx = await this.contract7.le_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
});
- it('test operator "le" overload (euint32, euint16) => ebool test 2 (63912, 63916)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(63912n);
- input.add16(63916n);
+ it('test operator "le" overload (euint64, euint64) => ebool test 2 (18440402951089431433, 18440402951089431437)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440402951089431433n);
+ input.add64(18440402951089431437n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint32_euint16(
+ const tx = await this.contract7.le_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint32, euint16) => ebool test 3 (63916, 63916)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(63916n);
- input.add16(63916n);
+ it('test operator "le" overload (euint64, euint64) => ebool test 3 (18440402951089431437, 18440402951089431437)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440402951089431437n);
+ input.add64(18440402951089431437n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint32_euint16(
+ const tx = await this.contract7.le_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint32, euint16) => ebool test 4 (63916, 63912)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(63916n);
- input.add16(63912n);
+ it('test operator "le" overload (euint64, euint64) => ebool test 4 (18440402951089431437, 18440402951089431433)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440402951089431437n);
+ input.add64(18440402951089431433n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint32_euint16(
+ const tx = await this.contract7.le_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint32, euint16) => ebool test 1 (1150183024, 6871)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1150183024n);
- input.add16(6871n);
+ it('test operator "lt" overload (euint64, euint64) => ebool test 1 (18443308354694945505, 18438494040818835505)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443308354694945505n);
+ input.add64(18438494040818835505n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint32_euint16(
+ const tx = await this.contract7.lt_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint32, euint16) => ebool test 2 (6867, 6871)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(6867n);
- input.add16(6871n);
+ it('test operator "lt" overload (euint64, euint64) => ebool test 2 (18438494040818835501, 18438494040818835505)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18438494040818835501n);
+ input.add64(18438494040818835505n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint32_euint16(
+ const tx = await this.contract7.lt_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint32, euint16) => ebool test 3 (6871, 6871)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(6871n);
- input.add16(6871n);
+ it('test operator "lt" overload (euint64, euint64) => ebool test 3 (18438494040818835505, 18438494040818835505)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18438494040818835505n);
+ input.add64(18438494040818835505n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint32_euint16(
+ const tx = await this.contract7.lt_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint32, euint16) => ebool test 4 (6871, 6867)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(6871n);
- input.add16(6867n);
+ it('test operator "lt" overload (euint64, euint64) => ebool test 4 (18438494040818835505, 18438494040818835501)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18438494040818835505n);
+ input.add64(18438494040818835501n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint32_euint16(
+ const tx = await this.contract7.lt_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "min" overload (euint32, euint16) => euint32 test 1 (2355937467, 15361)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2355937467n);
- input.add16(15361n);
+ it('test operator "min" overload (euint64, euint64) => euint64 test 1 (18438422972288340001, 18441615262395055283)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18438422972288340001n);
+ input.add64(18441615262395055283n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint32_euint16(
+ const tx = await this.contract7.min_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(15361n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18438422972288340001n);
});
- it('test operator "min" overload (euint32, euint16) => euint32 test 2 (15357, 15361)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(15357n);
- input.add16(15361n);
+ it('test operator "min" overload (euint64, euint64) => euint64 test 2 (18438422972288339997, 18438422972288340001)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18438422972288339997n);
+ input.add64(18438422972288340001n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint32_euint16(
+ const tx = await this.contract7.min_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(15357n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18438422972288339997n);
});
- it('test operator "min" overload (euint32, euint16) => euint32 test 3 (15361, 15361)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(15361n);
- input.add16(15361n);
+ it('test operator "min" overload (euint64, euint64) => euint64 test 3 (18438422972288340001, 18438422972288340001)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18438422972288340001n);
+ input.add64(18438422972288340001n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint32_euint16(
+ const tx = await this.contract7.min_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(15361n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18438422972288340001n);
});
- it('test operator "min" overload (euint32, euint16) => euint32 test 4 (15361, 15357)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(15361n);
- input.add16(15357n);
+ it('test operator "min" overload (euint64, euint64) => euint64 test 4 (18438422972288340001, 18438422972288339997)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18438422972288340001n);
+ input.add64(18438422972288339997n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint32_euint16(
+ const tx = await this.contract7.min_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(15357n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18438422972288339997n);
});
- it('test operator "max" overload (euint32, euint16) => euint32 test 1 (4156714889, 5440)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(4156714889n);
- input.add16(5440n);
+ it('test operator "max" overload (euint64, euint64) => euint64 test 1 (18445852065991763771, 18440937538047974893)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18445852065991763771n);
+ input.add64(18440937538047974893n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint32_euint16(
+ const tx = await this.contract7.max_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(4156714889n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18445852065991763771n);
});
- it('test operator "max" overload (euint32, euint16) => euint32 test 2 (5436, 5440)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(5436n);
- input.add16(5440n);
+ it('test operator "max" overload (euint64, euint64) => euint64 test 2 (18440937538047974889, 18440937538047974893)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440937538047974889n);
+ input.add64(18440937538047974893n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint32_euint16(
+ const tx = await this.contract7.max_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(5440n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18440937538047974893n);
});
- it('test operator "max" overload (euint32, euint16) => euint32 test 3 (5440, 5440)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(5440n);
- input.add16(5440n);
+ it('test operator "max" overload (euint64, euint64) => euint64 test 3 (18440937538047974893, 18440937538047974893)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440937538047974893n);
+ input.add64(18440937538047974893n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint32_euint16(
+ const tx = await this.contract7.max_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(5440n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18440937538047974893n);
});
- it('test operator "max" overload (euint32, euint16) => euint32 test 4 (5440, 5436)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(5440n);
- input.add16(5436n);
+ it('test operator "max" overload (euint64, euint64) => euint64 test 4 (18440937538047974893, 18440937538047974889)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440937538047974893n);
+ input.add64(18440937538047974889n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint32_euint16(
+ const tx = await this.contract7.max_euint64_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(5440n);
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18440937538047974893n);
});
- it('test operator "add" overload (euint32, euint32) => euint32 test 1 (451501910, 1802073207)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(451501910n);
- input.add32(1802073207n);
+ it('test operator "add" overload (euint64, euint128) => euint128 test 1 (2, 9223372036854775809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(2n);
+ input.add128(9223372036854775809n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint32_euint32(
+ const tx = await this.contract7.add_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2253575117n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(9223372036854775811n);
});
- it('test operator "add" overload (euint32, euint32) => euint32 test 2 (903003814, 903003818)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(903003814n);
- input.add32(903003818n);
+ it('test operator "add" overload (euint64, euint128) => euint128 test 2 (9220019285142748118, 9220019285142748120)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(9220019285142748118n);
+ input.add128(9220019285142748120n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint32_euint32(
+ const tx = await this.contract7.add_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1806007632n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(18440038570285496238n);
});
- it('test operator "add" overload (euint32, euint32) => euint32 test 3 (903003818, 903003818)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(903003818n);
- input.add32(903003818n);
+ it('test operator "add" overload (euint64, euint128) => euint128 test 3 (9220019285142748120, 9220019285142748120)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(9220019285142748120n);
+ input.add128(9220019285142748120n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint32_euint32(
+ const tx = await this.contract7.add_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1806007636n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(18440038570285496240n);
});
- it('test operator "add" overload (euint32, euint32) => euint32 test 4 (903003818, 903003814)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(903003818n);
- input.add32(903003814n);
+ it('test operator "add" overload (euint64, euint128) => euint128 test 4 (9220019285142748120, 9220019285142748118)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(9220019285142748120n);
+ input.add128(9220019285142748118n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint32_euint32(
+ const tx = await this.contract7.add_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1806007632n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(18440038570285496238n);
});
- it('test operator "sub" overload (euint32, euint32) => euint32 test 1 (296156690, 296156690)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(296156690n);
- input.add32(296156690n);
+ it('test operator "sub" overload (euint64, euint128) => euint128 test 1 (18445847707614326699, 18445847707614326699)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18445847707614326699n);
+ input.add128(18445847707614326699n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.sub_euint32_euint32(
+ const tx = await this.contract7.sub_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
+ const res = await decrypt128(await this.contract7.res128());
expect(res).to.equal(0n);
});
- it('test operator "sub" overload (euint32, euint32) => euint32 test 2 (296156690, 296156686)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(296156690n);
- input.add32(296156686n);
+ it('test operator "sub" overload (euint64, euint128) => euint128 test 2 (18445847707614326699, 18445847707614326695)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18445847707614326699n);
+ input.add128(18445847707614326695n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.sub_euint32_euint32(
+ const tx = await this.contract7.sub_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
+ const res = await decrypt128(await this.contract7.res128());
expect(res).to.equal(4n);
});
- it('test operator "mul" overload (euint32, euint32) => euint32 test 1 (54583, 21224)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(54583n);
- input.add32(21224n);
+ it('test operator "mul" overload (euint64, euint128) => euint128 test 1 (2, 4611686018427387905)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(2n);
+ input.add128(4611686018427387905n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint32_euint32(
+ const tx = await this.contract7.mul_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1158469592n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(9223372036854775810n);
});
- it('test operator "mul" overload (euint32, euint32) => euint32 test 2 (42446, 42446)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(42446n);
- input.add32(42446n);
+ it('test operator "mul" overload (euint64, euint128) => euint128 test 2 (4293652736, 4293652736)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(4293652736n);
+ input.add128(4293652736n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint32_euint32(
+ const tx = await this.contract7.mul_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1801662916n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(18435453817360285696n);
});
- it('test operator "mul" overload (euint32, euint32) => euint32 test 3 (42446, 42446)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(42446n);
- input.add32(42446n);
+ it('test operator "mul" overload (euint64, euint128) => euint128 test 3 (4293652736, 4293652736)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(4293652736n);
+ input.add128(4293652736n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint32_euint32(
+ const tx = await this.contract7.mul_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1801662916n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(18435453817360285696n);
});
- it('test operator "mul" overload (euint32, euint32) => euint32 test 4 (42446, 42446)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(42446n);
- input.add32(42446n);
+ it('test operator "mul" overload (euint64, euint128) => euint128 test 4 (4293652736, 4293652736)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(4293652736n);
+ input.add128(4293652736n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint32_euint32(
+ const tx = await this.contract7.mul_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1801662916n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(18435453817360285696n);
});
- it('test operator "and" overload (euint32, euint32) => euint32 test 1 (2522719500, 2344855070)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2522719500n);
- input.add32(2344855070n);
+ it('test operator "and" overload (euint64, euint128) => euint128 test 1 (18438964653643998977, 340282366920938463463371580179294281733)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18438964653643998977n);
+ input.add128(340282366920938463463371580179294281733n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.and_euint32_euint32(
+ const tx = await this.contract7.and_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2185339916n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(18438894284827860993n);
});
- it('test operator "and" overload (euint32, euint32) => euint32 test 2 (2344855066, 2344855070)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2344855066n);
- input.add32(2344855070n);
+ it('test operator "and" overload (euint64, euint128) => euint128 test 2 (18438964653643998973, 18438964653643998977)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18438964653643998973n);
+ input.add128(18438964653643998977n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.and_euint32_euint32(
+ const tx = await this.contract7.and_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2344855066n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(18438964653643998721n);
});
- it('test operator "and" overload (euint32, euint32) => euint32 test 3 (2344855070, 2344855070)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2344855070n);
- input.add32(2344855070n);
+ it('test operator "and" overload (euint64, euint128) => euint128 test 3 (18438964653643998977, 18438964653643998977)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18438964653643998977n);
+ input.add128(18438964653643998977n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.and_euint32_euint32(
+ const tx = await this.contract7.and_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2344855070n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(18438964653643998977n);
});
- it('test operator "and" overload (euint32, euint32) => euint32 test 4 (2344855070, 2344855066)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2344855070n);
- input.add32(2344855066n);
+ it('test operator "and" overload (euint64, euint128) => euint128 test 4 (18438964653643998977, 18438964653643998973)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18438964653643998977n);
+ input.add128(18438964653643998973n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.and_euint32_euint32(
+ const tx = await this.contract7.and_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2344855066n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(18438964653643998721n);
});
- it('test operator "or" overload (euint32, euint32) => euint32 test 1 (1757798833, 311935858)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1757798833n);
- input.add32(311935858n);
+ it('test operator "or" overload (euint64, euint128) => euint128 test 1 (18444253937643069461, 340282366920938463463369573351070308735)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444253937643069461n);
+ input.add128(340282366920938463463369573351070308735n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint32_euint32(
+ const tx = await this.contract7.or_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2060968947n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(340282366920938463463374396049659246975n);
});
- it('test operator "or" overload (euint32, euint32) => euint32 test 2 (311935854, 311935858)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(311935854n);
- input.add32(311935858n);
+ it('test operator "or" overload (euint64, euint128) => euint128 test 2 (18444253937643069457, 18444253937643069461)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444253937643069457n);
+ input.add128(18444253937643069461n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint32_euint32(
+ const tx = await this.contract7.or_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(311935870n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(18444253937643069461n);
});
- it('test operator "or" overload (euint32, euint32) => euint32 test 3 (311935858, 311935858)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(311935858n);
- input.add32(311935858n);
+ it('test operator "or" overload (euint64, euint128) => euint128 test 3 (18444253937643069461, 18444253937643069461)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444253937643069461n);
+ input.add128(18444253937643069461n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint32_euint32(
+ const tx = await this.contract7.or_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(311935858n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(18444253937643069461n);
});
- it('test operator "or" overload (euint32, euint32) => euint32 test 4 (311935858, 311935854)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(311935858n);
- input.add32(311935854n);
+ it('test operator "or" overload (euint64, euint128) => euint128 test 4 (18444253937643069461, 18444253937643069457)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444253937643069461n);
+ input.add128(18444253937643069457n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint32_euint32(
+ const tx = await this.contract7.or_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(311935870n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(18444253937643069461n);
});
- it('test operator "xor" overload (euint32, euint32) => euint32 test 1 (3321450403, 449148535)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(3321450403n);
- input.add32(449148535n);
+ it('test operator "xor" overload (euint64, euint128) => euint128 test 1 (18445744178466976977, 340282366920938463463371486789808692655)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18445744178466976977n);
+ input.add128(340282366920938463463371486789808692655n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint32_euint32(
+ const tx = await this.contract7.xor_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(3745266132n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(340282366920938463444930285940062611838n);
});
- it('test operator "xor" overload (euint32, euint32) => euint32 test 2 (449148531, 449148535)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(449148531n);
- input.add32(449148535n);
+ it('test operator "xor" overload (euint64, euint128) => euint128 test 2 (18445744178466976973, 18445744178466976977)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18445744178466976973n);
+ input.add128(18445744178466976977n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint32_euint32(
+ const tx = await this.contract7.xor_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(4n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(28n);
});
- it('test operator "xor" overload (euint32, euint32) => euint32 test 3 (449148535, 449148535)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(449148535n);
- input.add32(449148535n);
+ it('test operator "xor" overload (euint64, euint128) => euint128 test 3 (18445744178466976977, 18445744178466976977)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18445744178466976977n);
+ input.add128(18445744178466976977n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint32_euint32(
+ const tx = await this.contract7.xor_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
+ const res = await decrypt128(await this.contract7.res128());
expect(res).to.equal(0n);
});
- it('test operator "xor" overload (euint32, euint32) => euint32 test 4 (449148535, 449148531)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(449148535n);
- input.add32(449148531n);
+ it('test operator "xor" overload (euint64, euint128) => euint128 test 4 (18445744178466976977, 18445744178466976973)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18445744178466976977n);
+ input.add128(18445744178466976973n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint32_euint32(
+ const tx = await this.contract7.xor_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(4n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(28n);
});
- it('test operator "eq" overload (euint32, euint32) => ebool test 1 (287391998, 2464993294)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(287391998n);
- input.add32(2464993294n);
+ it('test operator "eq" overload (euint64, euint128) => ebool test 1 (18440180042915486669, 340282366920938463463371210059252201113)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440180042915486669n);
+ input.add128(340282366920938463463371210059252201113n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint32_euint32(
+ const tx = await this.contract7.eq_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint32, euint32) => ebool test 2 (287391994, 287391998)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(287391994n);
- input.add32(287391998n);
+ it('test operator "eq" overload (euint64, euint128) => ebool test 2 (18440180042915486665, 18440180042915486669)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440180042915486665n);
+ input.add128(18440180042915486669n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint32_euint32(
+ const tx = await this.contract7.eq_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint32, euint32) => ebool test 3 (287391998, 287391998)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(287391998n);
- input.add32(287391998n);
+ it('test operator "eq" overload (euint64, euint128) => ebool test 3 (18440180042915486669, 18440180042915486669)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440180042915486669n);
+ input.add128(18440180042915486669n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint32_euint32(
+ const tx = await this.contract7.eq_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint32, euint32) => ebool test 4 (287391998, 287391994)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(287391998n);
- input.add32(287391994n);
+ it('test operator "eq" overload (euint64, euint128) => ebool test 4 (18440180042915486669, 18440180042915486665)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440180042915486669n);
+ input.add128(18440180042915486665n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint32_euint32(
+ const tx = await this.contract7.eq_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint32, euint32) => ebool test 1 (221510600, 3939036059)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(221510600n);
- input.add32(3939036059n);
+ it('test operator "ne" overload (euint64, euint128) => ebool test 1 (18439484097328106945, 340282366920938463463374251414120336649)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18439484097328106945n);
+ input.add128(340282366920938463463374251414120336649n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint32_euint32(
+ const tx = await this.contract7.ne_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint32, euint32) => ebool test 2 (221510596, 221510600)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(221510596n);
- input.add32(221510600n);
+ it('test operator "ne" overload (euint64, euint128) => ebool test 2 (18439484097328106941, 18439484097328106945)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18439484097328106941n);
+ input.add128(18439484097328106945n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint32_euint32(
+ const tx = await this.contract7.ne_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint32, euint32) => ebool test 3 (221510600, 221510600)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(221510600n);
- input.add32(221510600n);
+ it('test operator "ne" overload (euint64, euint128) => ebool test 3 (18439484097328106945, 18439484097328106945)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18439484097328106945n);
+ input.add128(18439484097328106945n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint32_euint32(
+ const tx = await this.contract7.ne_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint32, euint32) => ebool test 4 (221510600, 221510596)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(221510600n);
- input.add32(221510596n);
+ it('test operator "ne" overload (euint64, euint128) => ebool test 4 (18439484097328106945, 18439484097328106941)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18439484097328106945n);
+ input.add128(18439484097328106941n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint32_euint32(
+ const tx = await this.contract7.ne_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint32, euint32) => ebool test 1 (1736787381, 970577162)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1736787381n);
- input.add32(970577162n);
+ it('test operator "ge" overload (euint64, euint128) => ebool test 1 (18442500358670120549, 340282366920938463463373603431929658391)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18442500358670120549n);
+ input.add128(340282366920938463463373603431929658391n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint32_euint32(
+ const tx = await this.contract7.ge_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint32, euint32) => ebool test 2 (970577158, 970577162)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(970577158n);
- input.add32(970577162n);
+ it('test operator "ge" overload (euint64, euint128) => ebool test 2 (18442500358670120545, 18442500358670120549)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18442500358670120545n);
+ input.add128(18442500358670120549n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint32_euint32(
+ const tx = await this.contract7.ge_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint32, euint32) => ebool test 3 (970577162, 970577162)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(970577162n);
- input.add32(970577162n);
+ it('test operator "ge" overload (euint64, euint128) => ebool test 3 (18442500358670120549, 18442500358670120549)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18442500358670120549n);
+ input.add128(18442500358670120549n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint32_euint32(
+ const tx = await this.contract7.ge_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint32, euint32) => ebool test 4 (970577162, 970577158)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(970577162n);
- input.add32(970577158n);
+ it('test operator "ge" overload (euint64, euint128) => ebool test 4 (18442500358670120549, 18442500358670120545)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18442500358670120549n);
+ input.add128(18442500358670120545n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint32_euint32(
+ const tx = await this.contract7.ge_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint32, euint32) => ebool test 1 (212629196, 2875731526)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(212629196n);
- input.add32(2875731526n);
+ it('test operator "gt" overload (euint64, euint128) => ebool test 1 (18440808032965074109, 340282366920938463463365853534758019559)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440808032965074109n);
+ input.add128(340282366920938463463365853534758019559n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint32_euint32(
+ const tx = await this.contract7.gt_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint32, euint32) => ebool test 2 (212629192, 212629196)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(212629192n);
- input.add32(212629196n);
+ it('test operator "gt" overload (euint64, euint128) => ebool test 2 (18440808032965074105, 18440808032965074109)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440808032965074105n);
+ input.add128(18440808032965074109n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint32_euint32(
+ const tx = await this.contract7.gt_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint32, euint32) => ebool test 3 (212629196, 212629196)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(212629196n);
- input.add32(212629196n);
+ it('test operator "gt" overload (euint64, euint128) => ebool test 3 (18440808032965074109, 18440808032965074109)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440808032965074109n);
+ input.add128(18440808032965074109n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint32_euint32(
+ const tx = await this.contract7.gt_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint32, euint32) => ebool test 4 (212629196, 212629192)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(212629196n);
- input.add32(212629192n);
+ it('test operator "gt" overload (euint64, euint128) => ebool test 4 (18440808032965074109, 18440808032965074105)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440808032965074109n);
+ input.add128(18440808032965074105n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint32_euint32(
+ const tx = await this.contract7.gt_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint32, euint32) => ebool test 1 (2708913268, 1446383134)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2708913268n);
- input.add32(1446383134n);
+ it('test operator "le" overload (euint64, euint128) => ebool test 1 (18443662339869468477, 340282366920938463463371042076884293495)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443662339869468477n);
+ input.add128(340282366920938463463371042076884293495n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint32_euint32(
+ const tx = await this.contract7.le_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
});
- it('test operator "le" overload (euint32, euint32) => ebool test 2 (1446383130, 1446383134)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1446383130n);
- input.add32(1446383134n);
+ it('test operator "le" overload (euint64, euint128) => ebool test 2 (18443662339869468473, 18443662339869468477)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443662339869468473n);
+ input.add128(18443662339869468477n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint32_euint32(
+ const tx = await this.contract7.le_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint32, euint32) => ebool test 3 (1446383134, 1446383134)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1446383134n);
- input.add32(1446383134n);
+ it('test operator "le" overload (euint64, euint128) => ebool test 3 (18443662339869468477, 18443662339869468477)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443662339869468477n);
+ input.add128(18443662339869468477n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint32_euint32(
+ const tx = await this.contract7.le_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint32, euint32) => ebool test 4 (1446383134, 1446383130)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1446383134n);
- input.add32(1446383130n);
+ it('test operator "le" overload (euint64, euint128) => ebool test 4 (18443662339869468477, 18443662339869468473)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443662339869468477n);
+ input.add128(18443662339869468473n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint32_euint32(
+ const tx = await this.contract7.le_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint32, euint32) => ebool test 1 (1837089382, 4089682184)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1837089382n);
- input.add32(4089682184n);
+ it('test operator "lt" overload (euint64, euint128) => ebool test 1 (18444814117403628673, 340282366920938463463365637360413874149)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444814117403628673n);
+ input.add128(340282366920938463463365637360413874149n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint32_euint32(
+ const tx = await this.contract7.lt_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint32, euint32) => ebool test 2 (1837089378, 1837089382)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1837089378n);
- input.add32(1837089382n);
+ it('test operator "lt" overload (euint64, euint128) => ebool test 2 (18444814117403628669, 18444814117403628673)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444814117403628669n);
+ input.add128(18444814117403628673n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint32_euint32(
+ const tx = await this.contract7.lt_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint32, euint32) => ebool test 3 (1837089382, 1837089382)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1837089382n);
- input.add32(1837089382n);
+ it('test operator "lt" overload (euint64, euint128) => ebool test 3 (18444814117403628673, 18444814117403628673)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444814117403628673n);
+ input.add128(18444814117403628673n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint32_euint32(
+ const tx = await this.contract7.lt_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint32, euint32) => ebool test 4 (1837089382, 1837089378)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1837089382n);
- input.add32(1837089378n);
+ it('test operator "lt" overload (euint64, euint128) => ebool test 4 (18444814117403628673, 18444814117403628669)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444814117403628673n);
+ input.add128(18444814117403628669n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint32_euint32(
+ const tx = await this.contract7.lt_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract7.resb());
expect(res).to.equal(false);
});
- it('test operator "min" overload (euint32, euint32) => euint32 test 1 (4226618007, 2940808913)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(4226618007n);
- input.add32(2940808913n);
+ it('test operator "min" overload (euint64, euint128) => euint128 test 1 (18444900314492723695, 340282366920938463463367540489775579127)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444900314492723695n);
+ input.add128(340282366920938463463367540489775579127n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint32_euint32(
+ const tx = await this.contract7.min_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2940808913n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(18444900314492723695n);
});
- it('test operator "min" overload (euint32, euint32) => euint32 test 2 (2940808909, 2940808913)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2940808909n);
- input.add32(2940808913n);
+ it('test operator "min" overload (euint64, euint128) => euint128 test 2 (18444900314492723691, 18444900314492723695)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444900314492723691n);
+ input.add128(18444900314492723695n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint32_euint32(
+ const tx = await this.contract7.min_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2940808909n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(18444900314492723691n);
});
- it('test operator "min" overload (euint32, euint32) => euint32 test 3 (2940808913, 2940808913)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2940808913n);
- input.add32(2940808913n);
+ it('test operator "min" overload (euint64, euint128) => euint128 test 3 (18444900314492723695, 18444900314492723695)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444900314492723695n);
+ input.add128(18444900314492723695n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint32_euint32(
+ const tx = await this.contract7.min_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2940808913n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(18444900314492723695n);
});
- it('test operator "min" overload (euint32, euint32) => euint32 test 4 (2940808913, 2940808909)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2940808913n);
- input.add32(2940808909n);
+ it('test operator "min" overload (euint64, euint128) => euint128 test 4 (18444900314492723695, 18444900314492723691)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444900314492723695n);
+ input.add128(18444900314492723691n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint32_euint32(
+ const tx = await this.contract7.min_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2940808909n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(18444900314492723691n);
});
- it('test operator "max" overload (euint32, euint32) => euint32 test 1 (3535438432, 2851290845)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(3535438432n);
- input.add32(2851290845n);
+ it('test operator "max" overload (euint64, euint128) => euint128 test 1 (18444589551829336117, 340282366920938463463371310064926977589)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444589551829336117n);
+ input.add128(340282366920938463463371310064926977589n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint32_euint32(
+ const tx = await this.contract7.max_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(3535438432n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(340282366920938463463371310064926977589n);
});
- it('test operator "max" overload (euint32, euint32) => euint32 test 2 (2851290841, 2851290845)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2851290841n);
- input.add32(2851290845n);
+ it('test operator "max" overload (euint64, euint128) => euint128 test 2 (18444589551829336113, 18444589551829336117)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444589551829336113n);
+ input.add128(18444589551829336117n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint32_euint32(
+ const tx = await this.contract7.max_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2851290845n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(18444589551829336117n);
});
- it('test operator "max" overload (euint32, euint32) => euint32 test 3 (2851290845, 2851290845)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2851290845n);
- input.add32(2851290845n);
+ it('test operator "max" overload (euint64, euint128) => euint128 test 3 (18444589551829336117, 18444589551829336117)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444589551829336117n);
+ input.add128(18444589551829336117n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint32_euint32(
+ const tx = await this.contract7.max_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2851290845n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(18444589551829336117n);
});
- it('test operator "max" overload (euint32, euint32) => euint32 test 4 (2851290845, 2851290841)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2851290845n);
- input.add32(2851290841n);
+ it('test operator "max" overload (euint64, euint128) => euint128 test 4 (18444589551829336117, 18444589551829336113)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444589551829336117n);
+ input.add128(18444589551829336113n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint32_euint32(
+ const tx = await this.contract7.max_euint64_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2851290845n);
+ const res = await decrypt128(await this.contract7.res128());
+ expect(res).to.equal(18444589551829336117n);
});
- it('test operator "add" overload (euint32, euint64) => euint64 test 1 (2, 4294200415)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2n);
- input.add64(4294200415n);
+ it('test operator "add" overload (euint64, euint256) => euint256 test 1 (2, 9223372036854775809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(2n);
+ input.add256(9223372036854775809n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint32_euint64(
+ const tx = await this.contract7.add_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(4294200417n);
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(9223372036854775811n);
});
- it('test operator "add" overload (euint32, euint64) => euint64 test 2 (184177949, 184177953)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(184177949n);
- input.add64(184177953n);
+ it('test operator "add" overload (euint64, euint256) => euint256 test 2 (9223002406300982591, 9223002406300982593)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(9223002406300982591n);
+ input.add256(9223002406300982593n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint32_euint64(
+ const tx = await this.contract7.add_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(368355902n);
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(18446004812601965184n);
});
- it('test operator "add" overload (euint32, euint64) => euint64 test 3 (184177953, 184177953)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(184177953n);
- input.add64(184177953n);
+ it('test operator "add" overload (euint64, euint256) => euint256 test 3 (9223002406300982593, 9223002406300982593)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(9223002406300982593n);
+ input.add256(9223002406300982593n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint32_euint64(
+ const tx = await this.contract7.add_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(368355906n);
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(18446004812601965186n);
});
- it('test operator "add" overload (euint32, euint64) => euint64 test 4 (184177953, 184177949)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(184177953n);
- input.add64(184177949n);
+ it('test operator "add" overload (euint64, euint256) => euint256 test 4 (9223002406300982593, 9223002406300982591)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(9223002406300982593n);
+ input.add256(9223002406300982591n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint32_euint64(
+ const tx = await this.contract7.add_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(368355902n);
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(18446004812601965184n);
});
- it('test operator "sub" overload (euint32, euint64) => euint64 test 1 (2163998221, 2163998221)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2163998221n);
- input.add64(2163998221n);
+ it('test operator "sub" overload (euint64, euint256) => euint256 test 1 (18445224051732608013, 18445224051732608013)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18445224051732608013n);
+ input.add256(18445224051732608013n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.sub_euint32_euint64(
+ const tx = await this.contract7.sub_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
+ const res = await decrypt256(await this.contract7.res256());
expect(res).to.equal(0n);
});
- it('test operator "sub" overload (euint32, euint64) => euint64 test 2 (2163998221, 2163998217)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2163998221n);
- input.add64(2163998217n);
+ it('test operator "sub" overload (euint64, euint256) => euint256 test 2 (18445224051732608013, 18445224051732608009)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18445224051732608013n);
+ input.add256(18445224051732608009n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.sub_euint32_euint64(
+ const tx = await this.contract7.sub_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
+ const res = await decrypt256(await this.contract7.res256());
expect(res).to.equal(4n);
});
- it('test operator "mul" overload (euint32, euint64) => euint64 test 1 (2, 2146443814)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2n);
- input.add64(2146443814n);
+ it('test operator "mul" overload (euint64, euint256) => euint256 test 1 (2, 4611686018427387905)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(2n);
+ input.add256(4611686018427387905n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint32_euint64(
+ const tx = await this.contract7.mul_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(4292887628n);
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(9223372036854775810n);
});
- it('test operator "mul" overload (euint32, euint64) => euint64 test 2 (61456, 61456)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(61456n);
- input.add64(61456n);
+ it('test operator "mul" overload (euint64, euint256) => euint256 test 2 (4292932541, 4292932541)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(4292932541n);
+ input.add256(4292932541n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint32_euint64(
+ const tx = await this.contract7.mul_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(3776839936n);
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(18429269801576716681n);
});
- it('test operator "mul" overload (euint32, euint64) => euint64 test 3 (61456, 61456)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(61456n);
- input.add64(61456n);
+ it('test operator "mul" overload (euint64, euint256) => euint256 test 3 (4292932541, 4292932541)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(4292932541n);
+ input.add256(4292932541n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint32_euint64(
+ const tx = await this.contract7.mul_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(3776839936n);
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(18429269801576716681n);
});
- it('test operator "mul" overload (euint32, euint64) => euint64 test 4 (61456, 61456)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(61456n);
- input.add64(61456n);
+ it('test operator "mul" overload (euint64, euint256) => euint256 test 4 (4292932541, 4292932541)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(4292932541n);
+ input.add256(4292932541n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint32_euint64(
+ const tx = await this.contract7.mul_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(3776839936n);
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(18429269801576716681n);
});
- it('test operator "and" overload (euint32, euint64) => euint64 test 1 (595906685, 18438632387690440007)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(595906685n);
- input.add64(18438632387690440007n);
+ it('test operator "and" overload (euint64, euint256) => euint256 test 1 (18443960605514453875, 115792089237316195423570985008687907853269984665640564039457575145704576396421)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443960605514453875n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575145704576396421n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.and_euint32_euint64(
+ const tx = await this.contract7.and_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(537133125n);
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(18437737227820728321n);
});
- it('test operator "and" overload (euint32, euint64) => euint64 test 2 (595906681, 595906685)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(595906681n);
- input.add64(595906685n);
+ it('test operator "and" overload (euint64, euint256) => euint256 test 2 (18443960605514453871, 18443960605514453875)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443960605514453871n);
+ input.add256(18443960605514453875n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.and_euint32_euint64(
+ const tx = await this.contract7.and_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(595906681n);
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(18443960605514453859n);
});
- it('test operator "and" overload (euint32, euint64) => euint64 test 3 (595906685, 595906685)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(595906685n);
- input.add64(595906685n);
+ it('test operator "and" overload (euint64, euint256) => euint256 test 3 (18443960605514453875, 18443960605514453875)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443960605514453875n);
+ input.add256(18443960605514453875n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.and_euint32_euint64(
+ const tx = await this.contract7.and_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(595906685n);
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(18443960605514453875n);
});
- it('test operator "and" overload (euint32, euint64) => euint64 test 4 (595906685, 595906681)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(595906685n);
- input.add64(595906681n);
+ it('test operator "and" overload (euint64, euint256) => euint256 test 4 (18443960605514453875, 18443960605514453871)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443960605514453875n);
+ input.add256(18443960605514453871n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.and_euint32_euint64(
+ const tx = await this.contract7.and_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(595906681n);
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(18443960605514453859n);
});
- it('test operator "or" overload (euint32, euint64) => euint64 test 1 (1312726121, 18440203558036734807)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1312726121n);
- input.add64(18440203558036734807n);
+ it('test operator "or" overload (euint64, euint256) => euint256 test 1 (18444891827197945405, 115792089237316195423570985008687907853269984665640564039457581376324451236725)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444891827197945405n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581376324451236725n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint32_euint64(
+ const tx = await this.contract7.or_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(18440203559245881215n);
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457583990276981260157n);
});
- it('test operator "or" overload (euint32, euint64) => euint64 test 2 (1312726117, 1312726121)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1312726117n);
- input.add64(1312726121n);
+ it('test operator "or" overload (euint64, euint256) => euint256 test 2 (18444891827197945401, 18444891827197945405)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444891827197945401n);
+ input.add256(18444891827197945405n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint32_euint64(
+ const tx = await this.contract7.or_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(1312726125n);
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(18444891827197945405n);
});
- it('test operator "or" overload (euint32, euint64) => euint64 test 3 (1312726121, 1312726121)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1312726121n);
- input.add64(1312726121n);
+ it('test operator "or" overload (euint64, euint256) => euint256 test 3 (18444891827197945405, 18444891827197945405)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444891827197945405n);
+ input.add256(18444891827197945405n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint32_euint64(
+ const tx = await this.contract7.or_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(1312726121n);
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(18444891827197945405n);
});
- it('test operator "or" overload (euint32, euint64) => euint64 test 4 (1312726121, 1312726117)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1312726121n);
- input.add64(1312726117n);
+ it('test operator "or" overload (euint64, euint256) => euint256 test 4 (18444891827197945405, 18444891827197945401)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444891827197945405n);
+ input.add256(18444891827197945401n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint32_euint64(
+ const tx = await this.contract7.or_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(1312726125n);
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(18444891827197945405n);
});
- it('test operator "xor" overload (euint32, euint64) => euint64 test 1 (3933920874, 18441384818446198365)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(3933920874n);
- input.add64(18441384818446198365n);
+ it('test operator "xor" overload (euint64, euint256) => euint256 test 1 (18438921176678700429, 115792089237316195423570985008687907853269984665640564039457575984328616481271)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18438921176678700429n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575984328616481271n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint32_euint64(
+ const tx = await this.contract7.xor_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(18441384821297952823n);
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039439139317222450136186n);
});
- it('test operator "xor" overload (euint32, euint64) => euint64 test 2 (3933920870, 3933920874)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(3933920870n);
- input.add64(3933920874n);
+ it('test operator "xor" overload (euint64, euint256) => euint256 test 2 (18438921176678700425, 18438921176678700429)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18438921176678700425n);
+ input.add256(18438921176678700429n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint32_euint64(
+ const tx = await this.contract7.xor_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(12n);
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(4n);
});
- it('test operator "xor" overload (euint32, euint64) => euint64 test 3 (3933920874, 3933920874)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(3933920874n);
- input.add64(3933920874n);
+ it('test operator "xor" overload (euint64, euint256) => euint256 test 3 (18438921176678700429, 18438921176678700429)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18438921176678700429n);
+ input.add256(18438921176678700429n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint32_euint64(
+ const tx = await this.contract7.xor_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
+ const res = await decrypt256(await this.contract7.res256());
expect(res).to.equal(0n);
});
- it('test operator "xor" overload (euint32, euint64) => euint64 test 4 (3933920874, 3933920870)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(3933920874n);
- input.add64(3933920870n);
+ it('test operator "xor" overload (euint64, euint256) => euint256 test 4 (18438921176678700429, 18438921176678700425)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18438921176678700429n);
+ input.add256(18438921176678700425n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.xor_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "eq" overload (euint64, euint256) => ebool test 1 (18443851863635995939, 115792089237316195423570985008687907853269984665640564039457575030888379042775)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443851863635995939n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457575030888379042775n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.eq_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint64, euint256) => ebool test 2 (18443851863635995935, 18443851863635995939)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443851863635995935n);
+ input.add256(18443851863635995939n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.eq_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint64, euint256) => ebool test 3 (18443851863635995939, 18443851863635995939)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443851863635995939n);
+ input.add256(18443851863635995939n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.eq_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint64, euint256) => ebool test 4 (18443851863635995939, 18443851863635995935)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443851863635995939n);
+ input.add256(18443851863635995935n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint32_euint64(
+ const tx = await this.contract7.eq_euint64_euint256(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(12n);
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint64, euint256) => ebool test 1 (18446211817960475589, 115792089237316195423570985008687907853269984665640564039457576433191959532665)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18446211817960475589n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457576433191959532665n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ne_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint64, euint256) => ebool test 2 (18446211817960475585, 18446211817960475589)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18446211817960475585n);
+ input.add256(18446211817960475589n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ne_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint64, euint256) => ebool test 3 (18446211817960475589, 18446211817960475589)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18446211817960475589n);
+ input.add256(18446211817960475589n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ne_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint64, euint256) => ebool test 4 (18446211817960475589, 18446211817960475585)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18446211817960475589n);
+ input.add256(18446211817960475585n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ne_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint64, euint256) => ebool test 1 (18444770112796649545, 115792089237316195423570985008687907853269984665640564039457581281801379635505)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444770112796649545n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581281801379635505n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ge_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint64, euint256) => ebool test 2 (18444770112796649541, 18444770112796649545)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444770112796649541n);
+ input.add256(18444770112796649545n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ge_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint64, euint256) => ebool test 3 (18444770112796649545, 18444770112796649545)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444770112796649545n);
+ input.add256(18444770112796649545n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ge_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint64, euint256) => ebool test 4 (18444770112796649545, 18444770112796649541)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444770112796649545n);
+ input.add256(18444770112796649541n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ge_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint64, euint256) => ebool test 1 (18443327594956328675, 115792089237316195423570985008687907853269984665640564039457581268418001741927)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443327594956328675n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581268418001741927n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.gt_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint64, euint256) => ebool test 2 (18443327594956328671, 18443327594956328675)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443327594956328671n);
+ input.add256(18443327594956328675n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.gt_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint64, euint256) => ebool test 3 (18443327594956328675, 18443327594956328675)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443327594956328675n);
+ input.add256(18443327594956328675n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.gt_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint64, euint256) => ebool test 4 (18443327594956328675, 18443327594956328671)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443327594956328675n);
+ input.add256(18443327594956328671n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.gt_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint64, euint256) => ebool test 1 (18443803742985479181, 115792089237316195423570985008687907853269984665640564039457581800529684723115)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443803742985479181n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457581800529684723115n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.le_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint64, euint256) => ebool test 2 (18443803742985479177, 18443803742985479181)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443803742985479177n);
+ input.add256(18443803742985479181n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.le_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint64, euint256) => ebool test 3 (18443803742985479181, 18443803742985479181)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443803742985479181n);
+ input.add256(18443803742985479181n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.le_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint64, euint256) => ebool test 4 (18443803742985479181, 18443803742985479177)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443803742985479181n);
+ input.add256(18443803742985479177n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.le_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint64, euint256) => ebool test 1 (18440844601726997069, 115792089237316195423570985008687907853269984665640564039457578884493044868087)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440844601726997069n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457578884493044868087n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.lt_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint64, euint256) => ebool test 2 (18440844601726997065, 18440844601726997069)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440844601726997065n);
+ input.add256(18440844601726997069n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.lt_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint64, euint256) => ebool test 3 (18440844601726997069, 18440844601726997069)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440844601726997069n);
+ input.add256(18440844601726997069n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.lt_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint64, euint256) => ebool test 4 (18440844601726997069, 18440844601726997065)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440844601726997069n);
+ input.add256(18440844601726997065n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.lt_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint64, euint256) => euint256 test 1 (18446426094775234589, 115792089237316195423570985008687907853269984665640564039457578688132986416989)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18446426094775234589n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457578688132986416989n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.min_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(18446426094775234589n);
+ });
+
+ it('test operator "min" overload (euint64, euint256) => euint256 test 2 (18446426094775234585, 18446426094775234589)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18446426094775234585n);
+ input.add256(18446426094775234589n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.min_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(18446426094775234585n);
+ });
+
+ it('test operator "min" overload (euint64, euint256) => euint256 test 3 (18446426094775234589, 18446426094775234589)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18446426094775234589n);
+ input.add256(18446426094775234589n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.min_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(18446426094775234589n);
+ });
+
+ it('test operator "min" overload (euint64, euint256) => euint256 test 4 (18446426094775234589, 18446426094775234585)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18446426094775234589n);
+ input.add256(18446426094775234585n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.min_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(18446426094775234585n);
+ });
+
+ it('test operator "max" overload (euint64, euint256) => euint256 test 1 (18437962634473522913, 115792089237316195423570985008687907853269984665640564039457582464243297466475)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18437962634473522913n);
+ input.add256(115792089237316195423570985008687907853269984665640564039457582464243297466475n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.max_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457582464243297466475n);
+ });
+
+ it('test operator "max" overload (euint64, euint256) => euint256 test 2 (18437962634473522909, 18437962634473522913)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18437962634473522909n);
+ input.add256(18437962634473522913n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.max_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(18437962634473522913n);
+ });
+
+ it('test operator "max" overload (euint64, euint256) => euint256 test 3 (18437962634473522913, 18437962634473522913)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18437962634473522913n);
+ input.add256(18437962634473522913n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.max_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(18437962634473522913n);
+ });
+
+ it('test operator "max" overload (euint64, euint256) => euint256 test 4 (18437962634473522913, 18437962634473522909)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18437962634473522913n);
+ input.add256(18437962634473522909n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.max_euint64_euint256(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt256(await this.contract7.res256());
+ expect(res).to.equal(18437962634473522913n);
+ });
+
+ it('test operator "add" overload (euint64, uint64) => euint64 test 1 (9222005500490563257, 9221821229831123671)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(9222005500490563257n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.add_euint64_uint64(
+ encryptedAmount.handles[0],
+ 9221821229831123671n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18443826730321686928n);
+ });
+
+ it('test operator "add" overload (euint64, uint64) => euint64 test 2 (9222005500490563255, 9222005500490563257)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(9222005500490563255n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.add_euint64_uint64(
+ encryptedAmount.handles[0],
+ 9222005500490563257n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18444011000981126512n);
+ });
+
+ it('test operator "add" overload (euint64, uint64) => euint64 test 3 (9222005500490563257, 9222005500490563257)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(9222005500490563257n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.add_euint64_uint64(
+ encryptedAmount.handles[0],
+ 9222005500490563257n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18444011000981126514n);
+ });
+
+ it('test operator "add" overload (euint64, uint64) => euint64 test 4 (9222005500490563257, 9222005500490563255)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(9222005500490563257n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.add_euint64_uint64(
+ encryptedAmount.handles[0],
+ 9222005500490563255n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18444011000981126512n);
+ });
+
+ it('test operator "add" overload (uint64, euint64) => euint64 test 1 (9221960957990697049, 9221821229831123671)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(9221821229831123671n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.add_uint64_euint64(
+ 9221960957990697049n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18443782187821820720n);
+ });
+
+ it('test operator "add" overload (uint64, euint64) => euint64 test 2 (9222005500490563255, 9222005500490563257)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(9222005500490563257n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.add_uint64_euint64(
+ 9222005500490563255n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18444011000981126512n);
+ });
+
+ it('test operator "add" overload (uint64, euint64) => euint64 test 3 (9222005500490563257, 9222005500490563257)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(9222005500490563257n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.add_uint64_euint64(
+ 9222005500490563257n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18444011000981126514n);
+ });
+
+ it('test operator "add" overload (uint64, euint64) => euint64 test 4 (9222005500490563257, 9222005500490563255)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(9222005500490563255n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.add_uint64_euint64(
+ 9222005500490563257n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18444011000981126512n);
+ });
+
+ it('test operator "sub" overload (euint64, uint64) => euint64 test 1 (18440691834306324731, 18440691834306324731)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440691834306324731n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.sub_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18440691834306324731n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint64, uint64) => euint64 test 2 (18440691834306324731, 18440691834306324727)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440691834306324731n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.sub_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18440691834306324727n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "sub" overload (uint64, euint64) => euint64 test 1 (18440691834306324731, 18440691834306324731)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18440691834306324731n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.sub_uint64_euint64(
+ 18440691834306324731n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (uint64, euint64) => euint64 test 2 (18440691834306324731, 18440691834306324727)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18440691834306324727n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.sub_uint64_euint64(
+ 18440691834306324731n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint64, uint64) => euint64 test 1 (4294482875, 4294108167)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(4294482875n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.mul_euint64_uint64(
+ encryptedAmount.handles[0],
+ 4294108167n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18440973986579140125n);
+ });
+
+ it('test operator "mul" overload (euint64, uint64) => euint64 test 2 (4294482875, 4294482875)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(4294482875n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.mul_euint64_uint64(
+ encryptedAmount.handles[0],
+ 4294482875n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18442583163668265625n);
+ });
+
+ it('test operator "mul" overload (euint64, uint64) => euint64 test 3 (4294482875, 4294482875)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(4294482875n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.mul_euint64_uint64(
+ encryptedAmount.handles[0],
+ 4294482875n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18442583163668265625n);
+ });
+
+ it('test operator "mul" overload (euint64, uint64) => euint64 test 4 (4294482875, 4294482875)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(4294482875n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.mul_euint64_uint64(
+ encryptedAmount.handles[0],
+ 4294482875n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18442583163668265625n);
+ });
+
+ it('test operator "mul" overload (uint64, euint64) => euint64 test 1 (4293014414, 4294108167)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(4294108167n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.mul_uint64_euint64(
+ 4293014414n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18434668256206119138n);
+ });
+
+ it('test operator "mul" overload (uint64, euint64) => euint64 test 2 (4294482875, 4294482875)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(4294482875n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.mul_uint64_euint64(
+ 4294482875n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18442583163668265625n);
+ });
+
+ it('test operator "mul" overload (uint64, euint64) => euint64 test 3 (4294482875, 4294482875)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(4294482875n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.mul_uint64_euint64(
+ 4294482875n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18442583163668265625n);
+ });
+
+ it('test operator "mul" overload (uint64, euint64) => euint64 test 4 (4294482875, 4294482875)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(4294482875n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.mul_uint64_euint64(
+ 4294482875n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18442583163668265625n);
+ });
+
+ it('test operator "div" overload (euint64, uint64) => euint64 test 1 (18444804438871636581, 18440669978814863107)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444804438871636581n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.div_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18440669978814863107n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(1n);
+ });
+
+ it('test operator "div" overload (euint64, uint64) => euint64 test 2 (18444804438871636577, 18444804438871636581)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444804438871636577n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.div_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18444804438871636581n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "div" overload (euint64, uint64) => euint64 test 3 (18444804438871636581, 18444804438871636581)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444804438871636581n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.div_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18444804438871636581n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(1n);
+ });
+
+ it('test operator "div" overload (euint64, uint64) => euint64 test 4 (18444804438871636581, 18444804438871636577)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444804438871636581n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.div_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18444804438871636577n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(1n);
+ });
+
+ it('test operator "rem" overload (euint64, uint64) => euint64 test 1 (18446008186519174615, 18445049964172995155)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18446008186519174615n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.rem_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18445049964172995155n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(958222346179460n);
+ });
+
+ it('test operator "rem" overload (euint64, uint64) => euint64 test 2 (18443920463081385689, 18443920463081385693)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443920463081385689n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.rem_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18443920463081385693n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18443920463081385689n);
+ });
+
+ it('test operator "rem" overload (euint64, uint64) => euint64 test 3 (18443920463081385693, 18443920463081385693)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443920463081385693n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.rem_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18443920463081385693n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "rem" overload (euint64, uint64) => euint64 test 4 (18443920463081385693, 18443920463081385689)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443920463081385693n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.rem_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18443920463081385689n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "and" overload (euint64, uint64) => euint64 test 1 (18444124970074897317, 18444452212053822561)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444124970074897317n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.and_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18444452212053822561n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18444089373216524321n);
+ });
+
+ it('test operator "and" overload (euint64, uint64) => euint64 test 2 (18442657213736743283, 18442657213736743287)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18442657213736743283n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.and_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18442657213736743287n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18442657213736743283n);
+ });
+
+ it('test operator "and" overload (euint64, uint64) => euint64 test 3 (18442657213736743287, 18442657213736743287)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18442657213736743287n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.and_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18442657213736743287n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18442657213736743287n);
+ });
+
+ it('test operator "and" overload (euint64, uint64) => euint64 test 4 (18442657213736743287, 18442657213736743283)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18442657213736743287n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.and_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18442657213736743283n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18442657213736743283n);
+ });
+
+ it('test operator "and" overload (uint64, euint64) => euint64 test 1 (18445812436048048525, 18444452212053822561)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18444452212053822561n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.and_uint64_euint64(
+ 18445812436048048525n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18443525253958221825n);
+ });
+
+ it('test operator "and" overload (uint64, euint64) => euint64 test 2 (18442657213736743283, 18442657213736743287)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18442657213736743287n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.and_uint64_euint64(
+ 18442657213736743283n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18442657213736743283n);
+ });
+
+ it('test operator "and" overload (uint64, euint64) => euint64 test 3 (18442657213736743287, 18442657213736743287)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18442657213736743287n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.and_uint64_euint64(
+ 18442657213736743287n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18442657213736743287n);
+ });
+
+ it('test operator "and" overload (uint64, euint64) => euint64 test 4 (18442657213736743287, 18442657213736743283)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18442657213736743283n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.and_uint64_euint64(
+ 18442657213736743287n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18442657213736743283n);
+ });
+
+ it('test operator "or" overload (euint64, uint64) => euint64 test 1 (18445851190683093315, 18441158928097514419)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18445851190683093315n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.or_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18441158928097514419n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18445895250664217587n);
+ });
+
+ it('test operator "or" overload (euint64, uint64) => euint64 test 2 (18440297605680046449, 18440297605680046453)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440297605680046449n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.or_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18440297605680046453n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18440297605680046453n);
+ });
+
+ it('test operator "or" overload (euint64, uint64) => euint64 test 3 (18440297605680046453, 18440297605680046453)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440297605680046453n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.or_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18440297605680046453n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18440297605680046453n);
+ });
+
+ it('test operator "or" overload (euint64, uint64) => euint64 test 4 (18440297605680046453, 18440297605680046449)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18440297605680046453n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.or_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18440297605680046449n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18440297605680046453n);
+ });
+
+ it('test operator "or" overload (uint64, euint64) => euint64 test 1 (18444816838000851275, 18441158928097514419)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18441158928097514419n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.or_uint64_euint64(
+ 18444816838000851275n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18445951836858858491n);
+ });
+
+ it('test operator "or" overload (uint64, euint64) => euint64 test 2 (18440297605680046449, 18440297605680046453)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18440297605680046453n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.or_uint64_euint64(
+ 18440297605680046449n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18440297605680046453n);
+ });
+
+ it('test operator "or" overload (uint64, euint64) => euint64 test 3 (18440297605680046453, 18440297605680046453)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18440297605680046453n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.or_uint64_euint64(
+ 18440297605680046453n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18440297605680046453n);
+ });
+
+ it('test operator "or" overload (uint64, euint64) => euint64 test 4 (18440297605680046453, 18440297605680046449)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18440297605680046449n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.or_uint64_euint64(
+ 18440297605680046453n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(18440297605680046453n);
+ });
+
+ it('test operator "xor" overload (euint64, uint64) => euint64 test 1 (18439520894560746701, 18445914762272407037)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18439520894560746701n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.xor_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18445914762272407037n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(7700087946789168n);
+ });
+
+ it('test operator "xor" overload (euint64, uint64) => euint64 test 2 (18439520894560746697, 18439520894560746701)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18439520894560746697n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.xor_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18439520894560746701n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "xor" overload (euint64, uint64) => euint64 test 3 (18439520894560746701, 18439520894560746701)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18439520894560746701n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.xor_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18439520894560746701n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint64, uint64) => euint64 test 4 (18439520894560746701, 18439520894560746697)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18439520894560746701n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.xor_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18439520894560746697n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "xor" overload (uint64, euint64) => euint64 test 1 (18446426713533628951, 18445914762272407037)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18445914762272407037n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.xor_uint64_euint64(
+ 18446426713533628951n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(1076293857951722n);
+ });
+
+ it('test operator "xor" overload (uint64, euint64) => euint64 test 2 (18439520894560746697, 18439520894560746701)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18439520894560746701n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.xor_uint64_euint64(
+ 18439520894560746697n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "xor" overload (uint64, euint64) => euint64 test 3 (18439520894560746701, 18439520894560746701)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18439520894560746701n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.xor_uint64_euint64(
+ 18439520894560746701n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (uint64, euint64) => euint64 test 4 (18439520894560746701, 18439520894560746697)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18439520894560746697n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.xor_uint64_euint64(
+ 18439520894560746701n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract7.res64());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "eq" overload (euint64, uint64) => ebool test 1 (18443282870504090991, 18439130415590833625)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443282870504090991n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.eq_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18439130415590833625n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint64, uint64) => ebool test 2 (18443282870504090987, 18443282870504090991)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443282870504090987n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.eq_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18443282870504090991n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint64, uint64) => ebool test 3 (18443282870504090991, 18443282870504090991)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443282870504090991n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.eq_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18443282870504090991n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint64, uint64) => ebool test 4 (18443282870504090991, 18443282870504090987)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18443282870504090991n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.eq_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18443282870504090987n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (uint64, euint64) => ebool test 1 (18442875587397628573, 18439130415590833625)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18439130415590833625n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.eq_uint64_euint64(
+ 18442875587397628573n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (uint64, euint64) => ebool test 2 (18443282870504090987, 18443282870504090991)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18443282870504090991n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.eq_uint64_euint64(
+ 18443282870504090987n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (uint64, euint64) => ebool test 3 (18443282870504090991, 18443282870504090991)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18443282870504090991n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.eq_uint64_euint64(
+ 18443282870504090991n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (uint64, euint64) => ebool test 4 (18443282870504090991, 18443282870504090987)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18443282870504090987n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.eq_uint64_euint64(
+ 18443282870504090991n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint64, uint64) => ebool test 1 (18445289136242885897, 18440743017590143725)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18445289136242885897n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ne_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18440743017590143725n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint64, uint64) => ebool test 2 (18441860560804132291, 18441860560804132295)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18441860560804132291n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ne_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18441860560804132295n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint64, uint64) => ebool test 3 (18441860560804132295, 18441860560804132295)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18441860560804132295n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ne_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18441860560804132295n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint64, uint64) => ebool test 4 (18441860560804132295, 18441860560804132291)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18441860560804132295n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ne_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18441860560804132291n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (uint64, euint64) => ebool test 1 (18442171622930650065, 18440743017590143725)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18440743017590143725n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ne_uint64_euint64(
+ 18442171622930650065n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (uint64, euint64) => ebool test 2 (18441860560804132291, 18441860560804132295)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18441860560804132295n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ne_uint64_euint64(
+ 18441860560804132291n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (uint64, euint64) => ebool test 3 (18441860560804132295, 18441860560804132295)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18441860560804132295n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ne_uint64_euint64(
+ 18441860560804132295n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (uint64, euint64) => ebool test 4 (18441860560804132295, 18441860560804132291)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18441860560804132291n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ne_uint64_euint64(
+ 18441860560804132295n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint64, uint64) => ebool test 1 (18444613618003912273, 18444784193665775113)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18444613618003912273n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ge_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18444784193665775113n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint64, uint64) => ebool test 2 (18441817383047397969, 18441817383047397973)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18441817383047397969n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ge_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18441817383047397973n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint64, uint64) => ebool test 3 (18441817383047397973, 18441817383047397973)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18441817383047397973n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ge_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18441817383047397973n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint64, uint64) => ebool test 4 (18441817383047397973, 18441817383047397969)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+ input.add64(18441817383047397973n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ge_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18441817383047397969n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (uint64, euint64) => ebool test 1 (18439321097396363619, 18444784193665775113)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18444784193665775113n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ge_uint64_euint64(
+ 18439321097396363619n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (uint64, euint64) => ebool test 2 (18441817383047397969, 18441817383047397973)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18441817383047397973n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ge_uint64_euint64(
+ 18441817383047397969n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (uint64, euint64) => ebool test 3 (18441817383047397973, 18441817383047397973)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18441817383047397973n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ge_uint64_euint64(
+ 18441817383047397973n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (uint64, euint64) => ebool test 4 (18441817383047397973, 18441817383047397969)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address);
+
+ input.add64(18441817383047397969n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract7.ge_uint64_euint64(
+ 18441817383047397973n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract7.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint64, uint64) => ebool test 1 (18444129545450155179, 18441052996137337147)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add64(18444129545450155179n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.gt_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18441052996137337147n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint64, uint64) => ebool test 2 (18438304556640407457, 18438304556640407461)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add64(18438304556640407457n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.gt_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18438304556640407461n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint64, uint64) => ebool test 3 (18438304556640407461, 18438304556640407461)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add64(18438304556640407461n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.gt_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18438304556640407461n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint64, uint64) => ebool test 4 (18438304556640407461, 18438304556640407457)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add64(18438304556640407461n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.gt_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18438304556640407457n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (uint64, euint64) => ebool test 1 (18440314139404889003, 18441052996137337147)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+
+ input.add64(18441052996137337147n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.gt_uint64_euint64(
+ 18440314139404889003n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (uint64, euint64) => ebool test 2 (18438304556640407457, 18438304556640407461)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+
+ input.add64(18438304556640407461n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.gt_uint64_euint64(
+ 18438304556640407457n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (uint64, euint64) => ebool test 3 (18438304556640407461, 18438304556640407461)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+
+ input.add64(18438304556640407461n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.gt_uint64_euint64(
+ 18438304556640407461n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (uint64, euint64) => ebool test 4 (18438304556640407461, 18438304556640407457)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+
+ input.add64(18438304556640407457n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.gt_uint64_euint64(
+ 18438304556640407461n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint64, uint64) => ebool test 1 (18440402951089431437, 18443808705297812893)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add64(18440402951089431437n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.le_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18443808705297812893n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint64, uint64) => ebool test 2 (18440402951089431433, 18440402951089431437)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add64(18440402951089431433n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.le_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18440402951089431437n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint64, uint64) => ebool test 3 (18440402951089431437, 18440402951089431437)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add64(18440402951089431437n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.le_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18440402951089431437n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint64, uint64) => ebool test 4 (18440402951089431437, 18440402951089431433)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add64(18440402951089431437n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.le_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18440402951089431433n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "le" overload (uint64, euint64) => ebool test 1 (18443941229431137849, 18443808705297812893)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+
+ input.add64(18443808705297812893n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.le_uint64_euint64(
+ 18443941229431137849n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "le" overload (uint64, euint64) => ebool test 2 (18440402951089431433, 18440402951089431437)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+
+ input.add64(18440402951089431437n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.le_uint64_euint64(
+ 18440402951089431433n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (uint64, euint64) => ebool test 3 (18440402951089431437, 18440402951089431437)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+
+ input.add64(18440402951089431437n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.le_uint64_euint64(
+ 18440402951089431437n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (uint64, euint64) => ebool test 4 (18440402951089431437, 18440402951089431433)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+
+ input.add64(18440402951089431433n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.le_uint64_euint64(
+ 18440402951089431437n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint64, uint64) => ebool test 1 (18443308354694945505, 18438426856220799235)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add64(18443308354694945505n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.lt_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18438426856220799235n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint64, uint64) => ebool test 2 (18438494040818835501, 18438494040818835505)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add64(18438494040818835501n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.lt_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18438494040818835505n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint64, uint64) => ebool test 3 (18438494040818835505, 18438494040818835505)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add64(18438494040818835505n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.lt_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18438494040818835505n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint64, uint64) => ebool test 4 (18438494040818835505, 18438494040818835501)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add64(18438494040818835505n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.lt_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18438494040818835501n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (uint64, euint64) => ebool test 1 (18444682732892858227, 18438426856220799235)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+
+ input.add64(18438426856220799235n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.lt_uint64_euint64(
+ 18444682732892858227n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (uint64, euint64) => ebool test 2 (18438494040818835501, 18438494040818835505)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+
+ input.add64(18438494040818835505n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.lt_uint64_euint64(
+ 18438494040818835501n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (uint64, euint64) => ebool test 3 (18438494040818835505, 18438494040818835505)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+
+ input.add64(18438494040818835505n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.lt_uint64_euint64(
+ 18438494040818835505n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (uint64, euint64) => ebool test 4 (18438494040818835505, 18438494040818835501)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+
+ input.add64(18438494040818835501n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.lt_uint64_euint64(
+ 18438494040818835505n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint64, uint64) => euint64 test 1 (18438422972288340001, 18439986643027034037)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add64(18438422972288340001n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.min_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18439986643027034037n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract8.res64());
+ expect(res).to.equal(18438422972288340001n);
+ });
+
+ it('test operator "min" overload (euint64, uint64) => euint64 test 2 (18438422972288339997, 18438422972288340001)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add64(18438422972288339997n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.min_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18438422972288340001n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract8.res64());
+ expect(res).to.equal(18438422972288339997n);
+ });
+
+ it('test operator "min" overload (euint64, uint64) => euint64 test 3 (18438422972288340001, 18438422972288340001)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add64(18438422972288340001n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.min_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18438422972288340001n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract8.res64());
+ expect(res).to.equal(18438422972288340001n);
+ });
+
+ it('test operator "min" overload (euint64, uint64) => euint64 test 4 (18438422972288340001, 18438422972288339997)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add64(18438422972288340001n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.min_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18438422972288339997n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract8.res64());
+ expect(res).to.equal(18438422972288339997n);
+ });
+
+ it('test operator "min" overload (uint64, euint64) => euint64 test 1 (18443338893508802671, 18439986643027034037)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+
+ input.add64(18439986643027034037n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.min_uint64_euint64(
+ 18443338893508802671n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract8.res64());
+ expect(res).to.equal(18439986643027034037n);
+ });
+
+ it('test operator "min" overload (uint64, euint64) => euint64 test 2 (18438422972288339997, 18438422972288340001)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+
+ input.add64(18438422972288340001n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.min_uint64_euint64(
+ 18438422972288339997n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract8.res64());
+ expect(res).to.equal(18438422972288339997n);
+ });
+
+ it('test operator "min" overload (uint64, euint64) => euint64 test 3 (18438422972288340001, 18438422972288340001)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+
+ input.add64(18438422972288340001n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.min_uint64_euint64(
+ 18438422972288340001n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract8.res64());
+ expect(res).to.equal(18438422972288340001n);
+ });
+
+ it('test operator "min" overload (uint64, euint64) => euint64 test 4 (18438422972288340001, 18438422972288339997)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+
+ input.add64(18438422972288339997n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.min_uint64_euint64(
+ 18438422972288340001n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract8.res64());
+ expect(res).to.equal(18438422972288339997n);
+ });
+
+ it('test operator "max" overload (euint64, uint64) => euint64 test 1 (18445852065991763771, 18440623444591001569)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add64(18445852065991763771n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.max_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18440623444591001569n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract8.res64());
+ expect(res).to.equal(18445852065991763771n);
+ });
+
+ it('test operator "max" overload (euint64, uint64) => euint64 test 2 (18440937538047974889, 18440937538047974893)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add64(18440937538047974889n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.max_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18440937538047974893n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract8.res64());
+ expect(res).to.equal(18440937538047974893n);
+ });
+
+ it('test operator "max" overload (euint64, uint64) => euint64 test 3 (18440937538047974893, 18440937538047974893)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add64(18440937538047974893n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.max_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18440937538047974893n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract8.res64());
+ expect(res).to.equal(18440937538047974893n);
+ });
+
+ it('test operator "max" overload (euint64, uint64) => euint64 test 4 (18440937538047974893, 18440937538047974889)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add64(18440937538047974893n);
+
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.max_euint64_uint64(
+ encryptedAmount.handles[0],
+ 18440937538047974889n,
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract8.res64());
+ expect(res).to.equal(18440937538047974893n);
+ });
+
+ it('test operator "max" overload (uint64, euint64) => euint64 test 1 (18444013465281910433, 18440623444591001569)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+
+ input.add64(18440623444591001569n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.max_uint64_euint64(
+ 18444013465281910433n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract8.res64());
+ expect(res).to.equal(18444013465281910433n);
+ });
+
+ it('test operator "max" overload (uint64, euint64) => euint64 test 2 (18440937538047974889, 18440937538047974893)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+
+ input.add64(18440937538047974893n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.max_uint64_euint64(
+ 18440937538047974889n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract8.res64());
+ expect(res).to.equal(18440937538047974893n);
+ });
+
+ it('test operator "max" overload (uint64, euint64) => euint64 test 3 (18440937538047974893, 18440937538047974893)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+
+ input.add64(18440937538047974893n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.max_uint64_euint64(
+ 18440937538047974893n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract8.res64());
+ expect(res).to.equal(18440937538047974893n);
+ });
+
+ it('test operator "max" overload (uint64, euint64) => euint64 test 4 (18440937538047974893, 18440937538047974889)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+
+ input.add64(18440937538047974889n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.max_uint64_euint64(
+ 18440937538047974893n,
+ encryptedAmount.handles[0],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt64(await this.contract8.res64());
+ expect(res).to.equal(18440937538047974893n);
});
});
diff --git a/test/tfheOperations/tfheOperations9.ts b/test/tfheOperations/tfheOperations9.ts
index 4c9a30bc..4ab60160 100644
--- a/test/tfheOperations/tfheOperations9.ts
+++ b/test/tfheOperations/tfheOperations9.ts
@@ -7,7 +7,22 @@ import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'
import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decryptBool } from '../instance';
+import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
+import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
+import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
+import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
+import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
+import {
+ createInstances,
+ decrypt4,
+ decrypt8,
+ decrypt16,
+ decrypt32,
+ decrypt64,
+ decrypt128,
+ decrypt256,
+ decryptBool,
+} from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
@@ -76,6 +91,61 @@ async function deployTfheTestFixture6(): Promise {
return contract;
}
+async function deployTfheTestFixture7(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite7');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture8(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite8');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture9(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite9');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture10(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite10');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
+async function deployTfheTestFixture11(): Promise {
+ const signers = await getSigners();
+ const admin = signers.alice;
+
+ const contractFactory = await ethers.getContractFactory('TFHETestSuite11');
+ const contract = await contractFactory.connect(admin).deploy();
+ await contract.waitForDeployment();
+
+ return contract;
+}
+
describe('TFHE operations 9', function () {
before(async function () {
await initSigners(1);
@@ -93,2477 +163,4659 @@ describe('TFHE operations 9', function () {
this.contract3Address = await contract3.getAddress();
this.contract3 = contract3;
- const contract4 = await deployTfheTestFixture4();
- this.contract4Address = await contract4.getAddress();
- this.contract4 = contract4;
+ const contract4 = await deployTfheTestFixture4();
+ this.contract4Address = await contract4.getAddress();
+ this.contract4 = contract4;
+
+ const contract5 = await deployTfheTestFixture5();
+ this.contract5Address = await contract5.getAddress();
+ this.contract5 = contract5;
+
+ const contract6 = await deployTfheTestFixture6();
+ this.contract6Address = await contract6.getAddress();
+ this.contract6 = contract6;
+
+ const contract7 = await deployTfheTestFixture7();
+ this.contract7Address = await contract7.getAddress();
+ this.contract7 = contract7;
+
+ const contract8 = await deployTfheTestFixture8();
+ this.contract8Address = await contract8.getAddress();
+ this.contract8 = contract8;
+
+ const contract9 = await deployTfheTestFixture9();
+ this.contract9Address = await contract9.getAddress();
+ this.contract9 = contract9;
+
+ const contract10 = await deployTfheTestFixture10();
+ this.contract10Address = await contract10.getAddress();
+ this.contract10 = contract10;
+
+ const contract11 = await deployTfheTestFixture11();
+ this.contract11Address = await contract11.getAddress();
+ this.contract11 = contract11;
+
+ const instances = await createInstances(this.signers);
+ this.instances = instances;
+ });
+
+ it('test operator "add" overload (euint128, euint4) => euint128 test 1 (9, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(9n);
+ input.add4(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.add_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(11n);
+ });
+
+ it('test operator "add" overload (euint128, euint4) => euint128 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.add_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "add" overload (euint128, euint4) => euint128 test 3 (5, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(5n);
+ input.add4(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.add_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "add" overload (euint128, euint4) => euint128 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.add_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "sub" overload (euint128, euint4) => euint128 test 1 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.sub_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint128, euint4) => euint128 test 2 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.sub_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint128, euint4) => euint128 test 1 (5, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(5n);
+ input.add4(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.mul_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "mul" overload (euint128, euint4) => euint128 test 2 (3, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(3n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.mul_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "mul" overload (euint128, euint4) => euint128 test 3 (3, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(3n);
+ input.add4(3n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.mul_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(9n);
+ });
+
+ it('test operator "mul" overload (euint128, euint4) => euint128 test 4 (4, 3)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(4n);
+ input.add4(3n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.mul_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "and" overload (euint128, euint4) => euint128 test 1 (340282366920938463463372547368360839357, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463372547368360839357n);
+ input.add4(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.and_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "and" overload (euint128, euint4) => euint128 test 2 (6, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(6n);
+ input.add4(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.and_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(2n);
+ });
+
+ it('test operator "and" overload (euint128, euint4) => euint128 test 3 (10, 10)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(10n);
+ input.add4(10n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.and_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(10n);
+ });
+
+ it('test operator "and" overload (euint128, euint4) => euint128 test 4 (10, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(10n);
+ input.add4(6n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.and_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(2n);
+ });
+
+ it('test operator "or" overload (euint128, euint4) => euint128 test 1 (340282366920938463463366694641055128577, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463366694641055128577n);
+ input.add4(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.or_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463366694641055128589n);
+ });
+
+ it('test operator "or" overload (euint128, euint4) => euint128 test 2 (8, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(8n);
+ input.add4(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.or_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "or" overload (euint128, euint4) => euint128 test 3 (12, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(12n);
+ input.add4(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.or_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "or" overload (euint128, euint4) => euint128 test 4 (12, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(12n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.or_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(12n);
+ });
+
+ it('test operator "xor" overload (euint128, euint4) => euint128 test 1 (340282366920938463463370996799476031467, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463370996799476031467n);
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.xor_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463370996799476031462n);
+ });
+
+ it('test operator "xor" overload (euint128, euint4) => euint128 test 2 (9, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(9n);
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.xor_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "xor" overload (euint128, euint4) => euint128 test 3 (13, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(13n);
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.xor_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint128, euint4) => euint128 test 4 (13, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(13n);
+ input.add4(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.xor_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "eq" overload (euint128, euint4) => ebool test 1 (340282366920938463463369794780094019941, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463369794780094019941n);
+ input.add4(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.eq_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint128, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.eq_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint128, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.eq_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint128, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.eq_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint128, euint4) => ebool test 1 (340282366920938463463371595006609590711, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463371595006609590711n);
+ input.add4(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.ne_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint128, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.ne_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint128, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.ne_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint128, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.ne_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint128, euint4) => ebool test 1 (340282366920938463463366351520407667333, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463366351520407667333n);
+ input.add4(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.ge_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint128, euint4) => ebool test 2 (8, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(8n);
+ input.add4(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.ge_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint128, euint4) => ebool test 3 (12, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(12n);
+ input.add4(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.ge_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint128, euint4) => ebool test 4 (12, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(12n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.ge_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint128, euint4) => ebool test 1 (340282366920938463463367426041495203879, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463367426041495203879n);
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.gt_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint128, euint4) => ebool test 2 (9, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(9n);
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.gt_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint128, euint4) => ebool test 3 (13, 13)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(13n);
+ input.add4(13n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.gt_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint128, euint4) => ebool test 4 (13, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(13n);
+ input.add4(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.gt_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint128, euint4) => ebool test 1 (340282366920938463463373221658110991435, 1)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463373221658110991435n);
+ input.add4(1n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.le_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "le" overload (euint128, euint4) => ebool test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.le_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint128, euint4) => ebool test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.le_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint128, euint4) => ebool test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.le_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint128, euint4) => ebool test 1 (340282366920938463463368530671945258801, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463368530671945258801n);
+ input.add4(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.lt_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint128, euint4) => ebool test 2 (8, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(8n);
+ input.add4(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.lt_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint128, euint4) => ebool test 3 (12, 12)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(12n);
+ input.add4(12n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.lt_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint128, euint4) => ebool test 4 (12, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(12n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.lt_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint128, euint4) => euint128 test 1 (340282366920938463463373617043976262819, 6)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463373617043976262819n);
+ input.add4(6n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.min_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(6n);
+ });
+
+ it('test operator "min" overload (euint128, euint4) => euint128 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.min_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "min" overload (euint128, euint4) => euint128 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.min_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "min" overload (euint128, euint4) => euint128 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.min_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "max" overload (euint128, euint4) => euint128 test 1 (340282366920938463463368883145053125641, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463368883145053125641n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.max_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463368883145053125641n);
+ });
+
+ it('test operator "max" overload (euint128, euint4) => euint128 test 2 (4, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(4n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.max_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "max" overload (euint128, euint4) => euint128 test 3 (8, 8)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(8n);
+ input.add4(8n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.max_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "max" overload (euint128, euint4) => euint128 test 4 (8, 4)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(8n);
+ input.add4(4n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.max_euint128_euint4(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(8n);
+ });
+
+ it('test operator "add" overload (euint128, euint8) => euint128 test 1 (129, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(129n);
+ input.add8(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.add_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(131n);
+ });
+
+ it('test operator "add" overload (euint128, euint8) => euint128 test 2 (118, 120)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(118n);
+ input.add8(120n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.add_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(238n);
+ });
+
+ it('test operator "add" overload (euint128, euint8) => euint128 test 3 (120, 120)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(120n);
+ input.add8(120n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.add_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(240n);
+ });
+
+ it('test operator "add" overload (euint128, euint8) => euint128 test 4 (120, 118)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(120n);
+ input.add8(118n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.add_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(238n);
+ });
+
+ it('test operator "sub" overload (euint128, euint8) => euint128 test 1 (232, 232)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(232n);
+ input.add8(232n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.sub_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint128, euint8) => euint128 test 2 (232, 228)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(232n);
+ input.add8(228n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.sub_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint128, euint8) => euint128 test 1 (65, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(65n);
+ input.add8(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.mul_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(130n);
+ });
+
+ it('test operator "mul" overload (euint128, euint8) => euint128 test 2 (9, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(9n);
+ input.add8(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.mul_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(81n);
+ });
+
+ it('test operator "mul" overload (euint128, euint8) => euint128 test 3 (9, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(9n);
+ input.add8(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.mul_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(81n);
+ });
+
+ it('test operator "mul" overload (euint128, euint8) => euint128 test 4 (9, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(9n);
+ input.add8(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.mul_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(81n);
+ });
+
+ it('test operator "and" overload (euint128, euint8) => euint128 test 1 (340282366920938463463366313789187731763, 114)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463366313789187731763n);
+ input.add8(114n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.and_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(50n);
+ });
+
+ it('test operator "and" overload (euint128, euint8) => euint128 test 2 (110, 114)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(110n);
+ input.add8(114n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.and_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(98n);
+ });
+
+ it('test operator "and" overload (euint128, euint8) => euint128 test 3 (114, 114)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(114n);
+ input.add8(114n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.and_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(114n);
+ });
+
+ it('test operator "and" overload (euint128, euint8) => euint128 test 4 (114, 110)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(114n);
+ input.add8(110n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.and_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(98n);
+ });
+
+ it('test operator "or" overload (euint128, euint8) => euint128 test 1 (340282366920938463463374227521343598445, 112)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463374227521343598445n);
+ input.add8(112n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.or_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463374227521343598461n);
+ });
+
+ it('test operator "or" overload (euint128, euint8) => euint128 test 2 (108, 112)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(108n);
+ input.add8(112n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.or_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(124n);
+ });
+
+ it('test operator "or" overload (euint128, euint8) => euint128 test 3 (112, 112)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(112n);
+ input.add8(112n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.or_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(112n);
+ });
+
+ it('test operator "or" overload (euint128, euint8) => euint128 test 4 (112, 108)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(112n);
+ input.add8(108n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.or_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(124n);
+ });
+
+ it('test operator "xor" overload (euint128, euint8) => euint128 test 1 (340282366920938463463373857001835170765, 82)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463373857001835170765n);
+ input.add8(82n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.xor_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463373857001835170719n);
+ });
+
+ it('test operator "xor" overload (euint128, euint8) => euint128 test 2 (78, 82)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(78n);
+ input.add8(82n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.xor_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(28n);
+ });
+
+ it('test operator "xor" overload (euint128, euint8) => euint128 test 3 (82, 82)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(82n);
+ input.add8(82n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.xor_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint128, euint8) => euint128 test 4 (82, 78)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(82n);
+ input.add8(78n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.xor_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(28n);
+ });
+
+ it('test operator "eq" overload (euint128, euint8) => ebool test 1 (340282366920938463463368012116669397375, 111)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463368012116669397375n);
+ input.add8(111n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.eq_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint128, euint8) => ebool test 2 (107, 111)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(107n);
+ input.add8(111n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.eq_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "eq" overload (euint128, euint8) => ebool test 3 (111, 111)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(111n);
+ input.add8(111n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.eq_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "eq" overload (euint128, euint8) => ebool test 4 (111, 107)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(111n);
+ input.add8(107n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.eq_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint128, euint8) => ebool test 1 (340282366920938463463374264796523764465, 244)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463374264796523764465n);
+ input.add8(244n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.ne_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint128, euint8) => ebool test 2 (240, 244)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(240n);
+ input.add8(244n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.ne_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ne" overload (euint128, euint8) => ebool test 3 (244, 244)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(244n);
+ input.add8(244n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.ne_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ne" overload (euint128, euint8) => ebool test 4 (244, 240)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(244n);
+ input.add8(240n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.ne_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint128, euint8) => ebool test 1 (340282366920938463463365913686345200467, 55)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463365913686345200467n);
+ input.add8(55n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.ge_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint128, euint8) => ebool test 2 (51, 55)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(51n);
+ input.add8(55n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.ge_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "ge" overload (euint128, euint8) => ebool test 3 (55, 55)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(55n);
+ input.add8(55n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.ge_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "ge" overload (euint128, euint8) => ebool test 4 (55, 51)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(55n);
+ input.add8(51n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.ge_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint128, euint8) => ebool test 1 (340282366920938463463373004399886925283, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463373004399886925283n);
+ input.add8(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.gt_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "gt" overload (euint128, euint8) => ebool test 2 (5, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(5n);
+ input.add8(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.gt_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint128, euint8) => ebool test 3 (9, 9)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(9n);
+ input.add8(9n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.gt_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "gt" overload (euint128, euint8) => ebool test 4 (9, 5)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(9n);
+ input.add8(5n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.gt_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint128, euint8) => ebool test 1 (340282366920938463463373663014854424779, 48)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463373663014854424779n);
+ input.add8(48n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.le_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "le" overload (euint128, euint8) => ebool test 2 (44, 48)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(44n);
+ input.add8(48n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.le_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint128, euint8) => ebool test 3 (48, 48)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(48n);
+ input.add8(48n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.le_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "le" overload (euint128, euint8) => ebool test 4 (48, 44)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(48n);
+ input.add8(44n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.le_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint128, euint8) => ebool test 1 (340282366920938463463371295793146087759, 46)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463371295793146087759n);
+ input.add8(46n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.lt_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint128, euint8) => ebool test 2 (42, 46)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(42n);
+ input.add8(46n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.lt_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+
+ it('test operator "lt" overload (euint128, euint8) => ebool test 3 (46, 46)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(46n);
+ input.add8(46n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.lt_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "lt" overload (euint128, euint8) => ebool test 4 (46, 42)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(46n);
+ input.add8(42n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.lt_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+
+ it('test operator "min" overload (euint128, euint8) => euint128 test 1 (340282366920938463463366071622027178861, 33)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463366071622027178861n);
+ input.add8(33n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.min_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(33n);
+ });
+
+ it('test operator "min" overload (euint128, euint8) => euint128 test 2 (29, 33)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(29n);
+ input.add8(33n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.min_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(29n);
+ });
+
+ it('test operator "min" overload (euint128, euint8) => euint128 test 3 (33, 33)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(33n);
+ input.add8(33n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.min_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(33n);
+ });
+
+ it('test operator "min" overload (euint128, euint8) => euint128 test 4 (33, 29)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(33n);
+ input.add8(29n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.min_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(29n);
+ });
+
+ it('test operator "max" overload (euint128, euint8) => euint128 test 1 (340282366920938463463369691386082749829, 49)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463369691386082749829n);
+ input.add8(49n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.max_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463369691386082749829n);
+ });
+
+ it('test operator "max" overload (euint128, euint8) => euint128 test 2 (45, 49)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(45n);
+ input.add8(49n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.max_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(49n);
+ });
+
+ it('test operator "max" overload (euint128, euint8) => euint128 test 3 (49, 49)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(49n);
+ input.add8(49n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.max_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(49n);
+ });
+
+ it('test operator "max" overload (euint128, euint8) => euint128 test 4 (49, 45)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(49n);
+ input.add8(45n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.max_euint128_euint8(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(49n);
+ });
+
+ it('test operator "add" overload (euint128, euint16) => euint128 test 1 (32769, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(32769n);
+ input.add16(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.add_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(32771n);
+ });
+
+ it('test operator "add" overload (euint128, euint16) => euint128 test 2 (31253, 31255)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(31253n);
+ input.add16(31255n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.add_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(62508n);
+ });
+
+ it('test operator "add" overload (euint128, euint16) => euint128 test 3 (31255, 31255)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(31255n);
+ input.add16(31255n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.add_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(62510n);
+ });
+
+ it('test operator "add" overload (euint128, euint16) => euint128 test 4 (31255, 31253)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(31255n);
+ input.add16(31253n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.add_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(62508n);
+ });
+
+ it('test operator "sub" overload (euint128, euint16) => euint128 test 1 (25392, 25392)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(25392n);
+ input.add16(25392n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.sub_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "sub" overload (euint128, euint16) => euint128 test 2 (25392, 25388)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(25392n);
+ input.add16(25388n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.sub_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(4n);
+ });
+
+ it('test operator "mul" overload (euint128, euint16) => euint128 test 1 (16385, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(16385n);
+ input.add16(2n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.mul_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(32770n);
+ });
+
+ it('test operator "mul" overload (euint128, euint16) => euint128 test 2 (233, 233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(233n);
+ input.add16(233n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.mul_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(54289n);
+ });
+
+ it('test operator "mul" overload (euint128, euint16) => euint128 test 3 (233, 233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(233n);
+ input.add16(233n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.mul_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(54289n);
+ });
+
+ it('test operator "mul" overload (euint128, euint16) => euint128 test 4 (233, 233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(233n);
+ input.add16(233n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.mul_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(54289n);
+ });
+
+ it('test operator "and" overload (euint128, euint16) => euint128 test 1 (340282366920938463463371274545487982339, 11460)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463371274545487982339n);
+ input.add16(11460n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.and_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(11264n);
+ });
+
+ it('test operator "and" overload (euint128, euint16) => euint128 test 2 (11456, 11460)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(11456n);
+ input.add16(11460n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.and_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(11456n);
+ });
+
+ it('test operator "and" overload (euint128, euint16) => euint128 test 3 (11460, 11460)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(11460n);
+ input.add16(11460n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.and_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(11460n);
+ });
+
+ it('test operator "and" overload (euint128, euint16) => euint128 test 4 (11460, 11456)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(11460n);
+ input.add16(11456n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.and_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(11456n);
+ });
+
+ it('test operator "or" overload (euint128, euint16) => euint128 test 1 (340282366920938463463366623321205018087, 7136)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463366623321205018087n);
+ input.add16(7136n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.or_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463366623321205022695n);
+ });
+
+ it('test operator "or" overload (euint128, euint16) => euint128 test 2 (7132, 7136)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(7132n);
+ input.add16(7136n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.or_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(7164n);
+ });
+
+ it('test operator "or" overload (euint128, euint16) => euint128 test 3 (7136, 7136)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(7136n);
+ input.add16(7136n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.or_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(7136n);
+ });
+
+ it('test operator "or" overload (euint128, euint16) => euint128 test 4 (7136, 7132)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(7136n);
+ input.add16(7132n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.or_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(7164n);
+ });
- const contract5 = await deployTfheTestFixture5();
- this.contract5Address = await contract5.getAddress();
- this.contract5 = contract5;
+ it('test operator "xor" overload (euint128, euint16) => euint128 test 1 (340282366920938463463371581047560381685, 64364)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463371581047560381685n);
+ input.add16(64364n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.xor_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463371581047560363929n);
+ });
- const contract6 = await deployTfheTestFixture6();
- this.contract6Address = await contract6.getAddress();
- this.contract6 = contract6;
+ it('test operator "xor" overload (euint128, euint16) => euint128 test 2 (64360, 64364)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(64360n);
+ input.add16(64364n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.xor_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(4n);
+ });
- const instances = await createInstances(this.signers);
- this.instances = instances;
+ it('test operator "xor" overload (euint128, euint16) => euint128 test 3 (64364, 64364)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(64364n);
+ input.add16(64364n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.xor_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(0n);
+ });
+
+ it('test operator "xor" overload (euint128, euint16) => euint128 test 4 (64364, 64360)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(64364n);
+ input.add16(64360n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.xor_euint128_euint16(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(4n);
});
- it('test operator "eq" overload (euint32, euint64) => ebool test 1 (709957546, 18441724614470442911)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(709957546n);
- input.add64(18441724614470442911n);
+ it('test operator "eq" overload (euint128, euint16) => ebool test 1 (340282366920938463463365947218770561253, 63555)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463365947218770561253n);
+ input.add16(63555n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint32_euint64(
+ const tx = await this.contract8.eq_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint32, euint64) => ebool test 2 (709957542, 709957546)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(709957542n);
- input.add64(709957546n);
+ it('test operator "eq" overload (euint128, euint16) => ebool test 2 (63551, 63555)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(63551n);
+ input.add16(63555n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint32_euint64(
+ const tx = await this.contract8.eq_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint32, euint64) => ebool test 3 (709957546, 709957546)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(709957546n);
- input.add64(709957546n);
+ it('test operator "eq" overload (euint128, euint16) => ebool test 3 (63555, 63555)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(63555n);
+ input.add16(63555n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint32_euint64(
+ const tx = await this.contract8.eq_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint32, euint64) => ebool test 4 (709957546, 709957542)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(709957546n);
- input.add64(709957542n);
+ it('test operator "eq" overload (euint128, euint16) => ebool test 4 (63555, 63551)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(63555n);
+ input.add16(63551n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint32_euint64(
+ const tx = await this.contract8.eq_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint32, euint64) => ebool test 1 (897008808, 18446223426742336677)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(897008808n);
- input.add64(18446223426742336677n);
+ it('test operator "ne" overload (euint128, euint16) => ebool test 1 (340282366920938463463370265865713339199, 54670)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463370265865713339199n);
+ input.add16(54670n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint32_euint64(
+ const tx = await this.contract8.ne_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint32, euint64) => ebool test 2 (897008804, 897008808)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(897008804n);
- input.add64(897008808n);
+ it('test operator "ne" overload (euint128, euint16) => ebool test 2 (54666, 54670)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(54666n);
+ input.add16(54670n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint32_euint64(
+ const tx = await this.contract8.ne_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint32, euint64) => ebool test 3 (897008808, 897008808)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(897008808n);
- input.add64(897008808n);
+ it('test operator "ne" overload (euint128, euint16) => ebool test 3 (54670, 54670)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(54670n);
+ input.add16(54670n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint32_euint64(
+ const tx = await this.contract8.ne_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint32, euint64) => ebool test 4 (897008808, 897008804)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(897008808n);
- input.add64(897008804n);
+ it('test operator "ne" overload (euint128, euint16) => ebool test 4 (54670, 54666)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(54670n);
+ input.add16(54666n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint32_euint64(
+ const tx = await this.contract8.ne_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint32, euint64) => ebool test 1 (2551620349, 18444102078323452175)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2551620349n);
- input.add64(18444102078323452175n);
+ it('test operator "ge" overload (euint128, euint16) => ebool test 1 (340282366920938463463373250379836355353, 44459)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463373250379836355353n);
+ input.add16(44459n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint32_euint64(
+ const tx = await this.contract8.ge_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint32, euint64) => ebool test 2 (2551620345, 2551620349)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2551620345n);
- input.add64(2551620349n);
+ it('test operator "ge" overload (euint128, euint16) => ebool test 2 (44455, 44459)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(44455n);
+ input.add16(44459n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint32_euint64(
+ const tx = await this.contract8.ge_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint32, euint64) => ebool test 3 (2551620349, 2551620349)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2551620349n);
- input.add64(2551620349n);
+ it('test operator "ge" overload (euint128, euint16) => ebool test 3 (44459, 44459)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(44459n);
+ input.add16(44459n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint32_euint64(
+ const tx = await this.contract8.ge_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint32, euint64) => ebool test 4 (2551620349, 2551620345)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2551620349n);
- input.add64(2551620345n);
+ it('test operator "ge" overload (euint128, euint16) => ebool test 4 (44459, 44455)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(44459n);
+ input.add16(44455n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint32_euint64(
+ const tx = await this.contract8.ge_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint32, euint64) => ebool test 1 (2256977835, 18442208006659778105)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2256977835n);
- input.add64(18442208006659778105n);
+ it('test operator "gt" overload (euint128, euint16) => ebool test 1 (340282366920938463463368543313259159187, 51225)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463368543313259159187n);
+ input.add16(51225n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint32_euint64(
+ const tx = await this.contract8.gt_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint32, euint64) => ebool test 2 (2256977831, 2256977835)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2256977831n);
- input.add64(2256977835n);
+ it('test operator "gt" overload (euint128, euint16) => ebool test 2 (51221, 51225)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(51221n);
+ input.add16(51225n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint32_euint64(
+ const tx = await this.contract8.gt_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint32, euint64) => ebool test 3 (2256977835, 2256977835)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2256977835n);
- input.add64(2256977835n);
+ it('test operator "gt" overload (euint128, euint16) => ebool test 3 (51225, 51225)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(51225n);
+ input.add16(51225n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint32_euint64(
+ const tx = await this.contract8.gt_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint32, euint64) => ebool test 4 (2256977835, 2256977831)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2256977835n);
- input.add64(2256977831n);
+ it('test operator "gt" overload (euint128, euint16) => ebool test 4 (51225, 51221)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(51225n);
+ input.add16(51221n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint32_euint64(
+ const tx = await this.contract8.gt_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint32, euint64) => ebool test 1 (557237517, 18442682499983449751)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(557237517n);
- input.add64(18442682499983449751n);
+ it('test operator "le" overload (euint128, euint16) => ebool test 1 (340282366920938463463371412966556965647, 54237)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463371412966556965647n);
+ input.add16(54237n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint32_euint64(
+ const tx = await this.contract8.le_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "le" overload (euint32, euint64) => ebool test 2 (557237513, 557237517)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(557237513n);
- input.add64(557237517n);
+ it('test operator "le" overload (euint128, euint16) => ebool test 2 (54233, 54237)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(54233n);
+ input.add16(54237n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint32_euint64(
+ const tx = await this.contract8.le_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint32, euint64) => ebool test 3 (557237517, 557237517)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(557237517n);
- input.add64(557237517n);
+ it('test operator "le" overload (euint128, euint16) => ebool test 3 (54237, 54237)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(54237n);
+ input.add16(54237n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint32_euint64(
+ const tx = await this.contract8.le_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint32, euint64) => ebool test 4 (557237517, 557237513)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(557237517n);
- input.add64(557237513n);
+ it('test operator "le" overload (euint128, euint16) => ebool test 4 (54237, 54233)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(54237n);
+ input.add16(54233n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint32_euint64(
+ const tx = await this.contract8.le_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint32, euint64) => ebool test 1 (1941297565, 18438856464497751915)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1941297565n);
- input.add64(18438856464497751915n);
+ it('test operator "lt" overload (euint128, euint16) => ebool test 1 (340282366920938463463374223690909641239, 37855)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463374223690909641239n);
+ input.add16(37855n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint32_euint64(
+ const tx = await this.contract8.lt_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint32, euint64) => ebool test 2 (1941297561, 1941297565)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1941297561n);
- input.add64(1941297565n);
+ it('test operator "lt" overload (euint128, euint16) => ebool test 2 (37851, 37855)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(37851n);
+ input.add16(37855n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint32_euint64(
+ const tx = await this.contract8.lt_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint32, euint64) => ebool test 3 (1941297565, 1941297565)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1941297565n);
- input.add64(1941297565n);
+ it('test operator "lt" overload (euint128, euint16) => ebool test 3 (37855, 37855)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(37855n);
+ input.add16(37855n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint32_euint64(
+ const tx = await this.contract8.lt_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint32, euint64) => ebool test 4 (1941297565, 1941297561)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1941297565n);
- input.add64(1941297561n);
+ it('test operator "lt" overload (euint128, euint16) => ebool test 4 (37855, 37851)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(37855n);
+ input.add16(37851n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint32_euint64(
+ const tx = await this.contract8.lt_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(false);
});
- it('test operator "min" overload (euint32, euint64) => euint64 test 1 (3364933042, 18443534177311383841)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(3364933042n);
- input.add64(18443534177311383841n);
+ it('test operator "min" overload (euint128, euint16) => euint128 test 1 (340282366920938463463368542801038101753, 9714)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463368542801038101753n);
+ input.add16(9714n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint32_euint64(
+ const tx = await this.contract8.min_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(3364933042n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(9714n);
});
- it('test operator "min" overload (euint32, euint64) => euint64 test 2 (3364933038, 3364933042)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(3364933038n);
- input.add64(3364933042n);
+ it('test operator "min" overload (euint128, euint16) => euint128 test 2 (9710, 9714)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(9710n);
+ input.add16(9714n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint32_euint64(
+ const tx = await this.contract8.min_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(3364933038n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(9710n);
});
- it('test operator "min" overload (euint32, euint64) => euint64 test 3 (3364933042, 3364933042)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(3364933042n);
- input.add64(3364933042n);
+ it('test operator "min" overload (euint128, euint16) => euint128 test 3 (9714, 9714)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(9714n);
+ input.add16(9714n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint32_euint64(
+ const tx = await this.contract8.min_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(3364933042n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(9714n);
});
- it('test operator "min" overload (euint32, euint64) => euint64 test 4 (3364933042, 3364933038)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(3364933042n);
- input.add64(3364933038n);
+ it('test operator "min" overload (euint128, euint16) => euint128 test 4 (9714, 9710)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(9714n);
+ input.add16(9710n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint32_euint64(
+ const tx = await this.contract8.min_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(3364933038n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(9710n);
});
- it('test operator "max" overload (euint32, euint64) => euint64 test 1 (821915788, 18441217303884363213)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(821915788n);
- input.add64(18441217303884363213n);
+ it('test operator "max" overload (euint128, euint16) => euint128 test 1 (340282366920938463463370317782456018271, 38332)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463370317782456018271n);
+ input.add16(38332n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint32_euint64(
+ const tx = await this.contract8.max_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(18441217303884363213n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463370317782456018271n);
});
- it('test operator "max" overload (euint32, euint64) => euint64 test 2 (821915784, 821915788)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(821915784n);
- input.add64(821915788n);
+ it('test operator "max" overload (euint128, euint16) => euint128 test 2 (38328, 38332)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(38328n);
+ input.add16(38332n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint32_euint64(
+ const tx = await this.contract8.max_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(821915788n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(38332n);
});
- it('test operator "max" overload (euint32, euint64) => euint64 test 3 (821915788, 821915788)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(821915788n);
- input.add64(821915788n);
+ it('test operator "max" overload (euint128, euint16) => euint128 test 3 (38332, 38332)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(38332n);
+ input.add16(38332n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint32_euint64(
+ const tx = await this.contract8.max_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(821915788n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(38332n);
});
- it('test operator "max" overload (euint32, euint64) => euint64 test 4 (821915788, 821915784)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(821915788n);
- input.add64(821915784n);
+ it('test operator "max" overload (euint128, euint16) => euint128 test 4 (38332, 38328)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(38332n);
+ input.add16(38328n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint32_euint64(
+ const tx = await this.contract8.max_euint128_euint16(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(821915788n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(38332n);
});
- it('test operator "add" overload (euint32, uint32) => euint32 test 1 (451501910, 2087738652)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(451501910n);
-
+ it('test operator "add" overload (euint128, euint32) => euint128 test 1 (2147483649, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(2147483649n);
+ input.add32(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint32_uint32(
+ const tx = await this.contract8.add_euint128_euint32(
encryptedAmount.handles[0],
- 2087738652n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2539240562n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(2147483651n);
});
- it('test operator "add" overload (euint32, uint32) => euint32 test 2 (903003814, 903003818)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(903003814n);
-
+ it('test operator "add" overload (euint128, euint32) => euint128 test 2 (417384794, 417384798)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(417384794n);
+ input.add32(417384798n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint32_uint32(
+ const tx = await this.contract8.add_euint128_euint32(
encryptedAmount.handles[0],
- 903003818n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1806007632n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(834769592n);
});
- it('test operator "add" overload (euint32, uint32) => euint32 test 3 (903003818, 903003818)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(903003818n);
-
+ it('test operator "add" overload (euint128, euint32) => euint128 test 3 (417384798, 417384798)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(417384798n);
+ input.add32(417384798n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint32_uint32(
+ const tx = await this.contract8.add_euint128_euint32(
encryptedAmount.handles[0],
- 903003818n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1806007636n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(834769596n);
});
- it('test operator "add" overload (euint32, uint32) => euint32 test 4 (903003818, 903003814)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(903003818n);
-
+ it('test operator "add" overload (euint128, euint32) => euint128 test 4 (417384798, 417384794)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(417384798n);
+ input.add32(417384794n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint32_uint32(
+ const tx = await this.contract8.add_euint128_euint32(
encryptedAmount.handles[0],
- 903003814n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1806007632n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(834769592n);
});
- it('test operator "add" overload (uint32, euint32) => euint32 test 1 (823987277, 2087738652)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(2087738652n);
+ it('test operator "sub" overload (euint128, euint32) => euint128 test 1 (373346389, 373346389)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(373346389n);
+ input.add32(373346389n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_uint32_euint32(
- 823987277n,
+ const tx = await this.contract8.sub_euint128_euint32(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2911725929n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(0n);
});
- it('test operator "add" overload (uint32, euint32) => euint32 test 2 (903003814, 903003818)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(903003818n);
+ it('test operator "sub" overload (euint128, euint32) => euint128 test 2 (373346389, 373346385)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(373346389n);
+ input.add32(373346385n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_uint32_euint32(
- 903003814n,
+ const tx = await this.contract8.sub_euint128_euint32(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1806007632n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(4n);
});
- it('test operator "add" overload (uint32, euint32) => euint32 test 3 (903003818, 903003818)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(903003818n);
+ it('test operator "mul" overload (euint128, euint32) => euint128 test 1 (1073741825, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(1073741825n);
+ input.add32(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_uint32_euint32(
- 903003818n,
+ const tx = await this.contract8.mul_euint128_euint32(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1806007636n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(2147483650n);
});
- it('test operator "add" overload (uint32, euint32) => euint32 test 4 (903003818, 903003814)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(903003814n);
+ it('test operator "mul" overload (euint128, euint32) => euint128 test 2 (46331, 46331)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(46331n);
+ input.add32(46331n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_uint32_euint32(
- 903003818n,
+ const tx = await this.contract8.mul_euint128_euint32(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1806007632n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(2146561561n);
});
- it('test operator "sub" overload (euint32, uint32) => euint32 test 1 (296156690, 296156690)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(296156690n);
-
+ it('test operator "mul" overload (euint128, euint32) => euint128 test 3 (46331, 46331)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(46331n);
+ input.add32(46331n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.sub_euint32_uint32(
+ const tx = await this.contract8.mul_euint128_euint32(
encryptedAmount.handles[0],
- 296156690n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(0n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(2146561561n);
});
- it('test operator "sub" overload (euint32, uint32) => euint32 test 2 (296156690, 296156686)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(296156690n);
-
+ it('test operator "mul" overload (euint128, euint32) => euint128 test 4 (46331, 46331)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(46331n);
+ input.add32(46331n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.sub_euint32_uint32(
+ const tx = await this.contract8.mul_euint128_euint32(
encryptedAmount.handles[0],
- 296156686n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(4n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(2146561561n);
});
- it('test operator "sub" overload (uint32, euint32) => euint32 test 1 (296156690, 296156690)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(296156690n);
+ it('test operator "and" overload (euint128, euint32) => euint128 test 1 (340282366920938463463372796408614652419, 1038177724)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463372796408614652419n);
+ input.add32(1038177724n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.sub_uint32_euint32(
- 296156690n,
+ const tx = await this.contract8.and_euint128_euint32(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(0n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(272629760n);
});
- it('test operator "sub" overload (uint32, euint32) => euint32 test 2 (296156690, 296156686)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(296156686n);
+ it('test operator "and" overload (euint128, euint32) => euint128 test 2 (1038177720, 1038177724)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(1038177720n);
+ input.add32(1038177724n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.sub_uint32_euint32(
- 296156690n,
+ const tx = await this.contract8.and_euint128_euint32(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(4n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(1038177720n);
});
- it('test operator "mul" overload (euint32, uint32) => euint32 test 1 (54583, 52500)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(54583n);
-
+ it('test operator "and" overload (euint128, euint32) => euint128 test 3 (1038177724, 1038177724)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(1038177724n);
+ input.add32(1038177724n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint32_uint32(encryptedAmount.handles[0], 52500n, encryptedAmount.inputProof);
+ const tx = await this.contract8.and_euint128_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2865607500n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(1038177724n);
});
- it('test operator "mul" overload (euint32, uint32) => euint32 test 2 (42446, 42446)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(42446n);
-
+ it('test operator "and" overload (euint128, euint32) => euint128 test 4 (1038177724, 1038177720)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(1038177724n);
+ input.add32(1038177720n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint32_uint32(encryptedAmount.handles[0], 42446n, encryptedAmount.inputProof);
+ const tx = await this.contract8.and_euint128_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1801662916n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(1038177720n);
});
- it('test operator "mul" overload (euint32, uint32) => euint32 test 3 (42446, 42446)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(42446n);
-
+ it('test operator "or" overload (euint128, euint32) => euint128 test 1 (340282366920938463463370714852003960045, 1823556556)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463370714852003960045n);
+ input.add32(1823556556n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint32_uint32(encryptedAmount.handles[0], 42446n, encryptedAmount.inputProof);
+ const tx = await this.contract8.or_euint128_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1801662916n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463370714853213034477n);
});
- it('test operator "mul" overload (euint32, uint32) => euint32 test 4 (42446, 42446)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(42446n);
-
+ it('test operator "or" overload (euint128, euint32) => euint128 test 2 (1823556552, 1823556556)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(1823556552n);
+ input.add32(1823556556n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint32_uint32(encryptedAmount.handles[0], 42446n, encryptedAmount.inputProof);
+ const tx = await this.contract8.or_euint128_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1801662916n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(1823556556n);
});
- it('test operator "mul" overload (uint32, euint32) => euint32 test 1 (39745, 104998)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(104998n);
+ it('test operator "or" overload (euint128, euint32) => euint128 test 3 (1823556556, 1823556556)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(1823556556n);
+ input.add32(1823556556n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_uint32_euint32(39745n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract8.or_euint128_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(4173145510n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(1823556556n);
});
- it('test operator "mul" overload (uint32, euint32) => euint32 test 2 (42446, 42446)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(42446n);
+ it('test operator "or" overload (euint128, euint32) => euint128 test 4 (1823556556, 1823556552)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(1823556556n);
+ input.add32(1823556552n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_uint32_euint32(42446n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract8.or_euint128_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1801662916n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(1823556556n);
});
- it('test operator "mul" overload (uint32, euint32) => euint32 test 3 (42446, 42446)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(42446n);
+ it('test operator "xor" overload (euint128, euint32) => euint128 test 1 (340282366920938463463372336872535218607, 2309231003)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463372336872535218607n);
+ input.add32(2309231003n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_uint32_euint32(42446n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract8.xor_euint128_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1801662916n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463372336874538256436n);
});
- it('test operator "mul" overload (uint32, euint32) => euint32 test 4 (42446, 42446)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(42446n);
+ it('test operator "xor" overload (euint128, euint32) => euint128 test 2 (2309230999, 2309231003)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(2309230999n);
+ input.add32(2309231003n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_uint32_euint32(42446n, encryptedAmount.handles[0], encryptedAmount.inputProof);
+ const tx = await this.contract8.xor_euint128_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1801662916n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(12n);
});
- it('test operator "div" overload (euint32, uint32) => euint32 test 1 (1758653773, 1926631032)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1758653773n);
-
+ it('test operator "xor" overload (euint128, euint32) => euint128 test 3 (2309231003, 2309231003)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(2309231003n);
+ input.add32(2309231003n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.div_euint32_uint32(
+ const tx = await this.contract8.xor_euint128_euint32(
encryptedAmount.handles[0],
- 1926631032n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
+ const res = await decrypt128(await this.contract8.res128());
expect(res).to.equal(0n);
});
- it('test operator "div" overload (euint32, uint32) => euint32 test 2 (569518498, 569518502)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(569518498n);
+ it('test operator "xor" overload (euint128, euint32) => euint128 test 4 (2309231003, 2309230999)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(2309231003n);
+ input.add32(2309230999n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.xor_euint128_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(12n);
+ });
+ it('test operator "eq" overload (euint128, euint32) => ebool test 1 (340282366920938463463365905779679562131, 1923235589)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463365905779679562131n);
+ input.add32(1923235589n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.div_euint32_uint32(
+ const tx = await this.contract8.eq_euint128_euint32(
encryptedAmount.handles[0],
- 569518502n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(0n);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "div" overload (euint32, uint32) => euint32 test 3 (569518502, 569518502)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(569518502n);
+ it('test operator "eq" overload (euint128, euint32) => ebool test 2 (1923235585, 1923235589)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(1923235585n);
+ input.add32(1923235589n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.eq_euint128_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+ it('test operator "eq" overload (euint128, euint32) => ebool test 3 (1923235589, 1923235589)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(1923235589n);
+ input.add32(1923235589n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.div_euint32_uint32(
+ const tx = await this.contract8.eq_euint128_euint32(
encryptedAmount.handles[0],
- 569518502n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1n);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
});
- it('test operator "div" overload (euint32, uint32) => euint32 test 4 (569518502, 569518498)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(569518502n);
+ it('test operator "eq" overload (euint128, euint32) => ebool test 4 (1923235589, 1923235585)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(1923235589n);
+ input.add32(1923235585n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.eq_euint128_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+ it('test operator "ne" overload (euint128, euint32) => ebool test 1 (340282366920938463463374155295872552931, 1145053382)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463374155295872552931n);
+ input.add32(1145053382n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.div_euint32_uint32(
+ const tx = await this.contract8.ne_euint128_euint32(
encryptedAmount.handles[0],
- 569518498n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1n);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
});
- it('test operator "rem" overload (euint32, uint32) => euint32 test 1 (514826887, 2242906184)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(514826887n);
+ it('test operator "ne" overload (euint128, euint32) => ebool test 2 (1145053378, 1145053382)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(1145053378n);
+ input.add32(1145053382n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.ne_euint128_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+ it('test operator "ne" overload (euint128, euint32) => ebool test 3 (1145053382, 1145053382)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(1145053382n);
+ input.add32(1145053382n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.rem_euint32_uint32(
+ const tx = await this.contract8.ne_euint128_euint32(
encryptedAmount.handles[0],
- 2242906184n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(514826887n);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "rem" overload (euint32, uint32) => euint32 test 2 (514826883, 514826887)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(514826883n);
+ it('test operator "ne" overload (euint128, euint32) => ebool test 4 (1145053382, 1145053378)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(1145053382n);
+ input.add32(1145053378n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.ne_euint128_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+ it('test operator "ge" overload (euint128, euint32) => ebool test 1 (340282366920938463463370684518045415615, 2276077429)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463370684518045415615n);
+ input.add32(2276077429n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.rem_euint32_uint32(
+ const tx = await this.contract8.ge_euint128_euint32(
encryptedAmount.handles[0],
- 514826887n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(514826883n);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
});
- it('test operator "rem" overload (euint32, uint32) => euint32 test 3 (514826887, 514826887)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(514826887n);
+ it('test operator "ge" overload (euint128, euint32) => ebool test 2 (2276077425, 2276077429)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(2276077425n);
+ input.add32(2276077429n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.ge_euint128_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+ it('test operator "ge" overload (euint128, euint32) => ebool test 3 (2276077429, 2276077429)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(2276077429n);
+ input.add32(2276077429n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.rem_euint32_uint32(
+ const tx = await this.contract8.ge_euint128_euint32(
encryptedAmount.handles[0],
- 514826887n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(0n);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
});
- it('test operator "rem" overload (euint32, uint32) => euint32 test 4 (514826887, 514826883)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(514826887n);
+ it('test operator "ge" overload (euint128, euint32) => ebool test 4 (2276077429, 2276077425)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(2276077429n);
+ input.add32(2276077425n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.ge_euint128_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+ it('test operator "gt" overload (euint128, euint32) => ebool test 1 (340282366920938463463371084318415272059, 235874492)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463371084318415272059n);
+ input.add32(235874492n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.rem_euint32_uint32(
+ const tx = await this.contract8.gt_euint128_euint32(
encryptedAmount.handles[0],
- 514826883n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(4n);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint32, uint32) => ebool test 1 (287391998, 3065919083)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(287391998n);
+ it('test operator "gt" overload (euint128, euint32) => ebool test 2 (235874488, 235874492)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(235874488n);
+ input.add32(235874492n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.gt_euint128_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
+ });
+ it('test operator "gt" overload (euint128, euint32) => ebool test 3 (235874492, 235874492)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(235874492n);
+ input.add32(235874492n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint32_uint32(
+ const tx = await this.contract8.gt_euint128_euint32(
encryptedAmount.handles[0],
- 3065919083n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint32, uint32) => ebool test 2 (287391994, 287391998)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(287391994n);
+ it('test operator "gt" overload (euint128, euint32) => ebool test 4 (235874492, 235874488)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(235874492n);
+ input.add32(235874488n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.gt_euint128_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+ it('test operator "le" overload (euint128, euint32) => ebool test 1 (340282366920938463463372847665266392859, 623901814)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463372847665266392859n);
+ input.add32(623901814n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint32_uint32(
+ const tx = await this.contract8.le_euint128_euint32(
encryptedAmount.handles[0],
- 287391998n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (euint32, uint32) => ebool test 3 (287391998, 287391998)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(287391998n);
-
+ it('test operator "le" overload (euint128, euint32) => ebool test 2 (623901810, 623901814)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(623901810n);
+ input.add32(623901814n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint32_uint32(
+ const tx = await this.contract8.le_euint128_euint32(
encryptedAmount.handles[0],
- 287391998n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(true);
});
- it('test operator "eq" overload (euint32, uint32) => ebool test 4 (287391998, 287391994)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(287391998n);
+ it('test operator "le" overload (euint128, euint32) => ebool test 3 (623901814, 623901814)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(623901814n);
+ input.add32(623901814n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.le_euint128_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
+ it('test operator "le" overload (euint128, euint32) => ebool test 4 (623901814, 623901810)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(623901814n);
+ input.add32(623901810n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint32_uint32(
+ const tx = await this.contract8.le_euint128_euint32(
encryptedAmount.handles[0],
- 287391994n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (uint32, euint32) => ebool test 1 (833280044, 3065919083)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(3065919083n);
+ it('test operator "lt" overload (euint128, euint32) => ebool test 1 (340282366920938463463373212421821063067, 1708404829)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463373212421821063067n);
+ input.add32(1708404829n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_uint32_euint32(
- 833280044n,
+ const tx = await this.contract8.lt_euint128_euint32(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (uint32, euint32) => ebool test 2 (287391994, 287391998)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ it('test operator "lt" overload (euint128, euint32) => ebool test 2 (1708404825, 1708404829)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(1708404825n);
+ input.add32(1708404829n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.lt_euint128_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
+ });
- input.add32(287391998n);
+ it('test operator "lt" overload (euint128, euint32) => ebool test 3 (1708404829, 1708404829)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(1708404829n);
+ input.add32(1708404829n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_uint32_euint32(
- 287391994n,
+ const tx = await this.contract8.lt_euint128_euint32(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(false);
});
- it('test operator "eq" overload (uint32, euint32) => ebool test 3 (287391998, 287391998)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(287391998n);
+ it('test operator "lt" overload (euint128, euint32) => ebool test 4 (1708404829, 1708404825)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(1708404829n);
+ input.add32(1708404825n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_uint32_euint32(
- 287391998n,
+ const tx = await this.contract8.lt_euint128_euint32(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "eq" overload (uint32, euint32) => ebool test 4 (287391998, 287391994)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
+ it('test operator "min" overload (euint128, euint32) => euint128 test 1 (340282366920938463463373948652081205153, 4076998775)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463373948652081205153n);
+ input.add32(4076998775n);
+ const encryptedAmount = await input.encrypt();
+ const tx = await this.contract8.min_euint128_euint32(
+ encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
+ encryptedAmount.inputProof,
+ );
+ await tx.wait();
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(4076998775n);
+ });
- input.add32(287391994n);
+ it('test operator "min" overload (euint128, euint32) => euint128 test 2 (4076998771, 4076998775)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(4076998771n);
+ input.add32(4076998775n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_uint32_euint32(
- 287391998n,
+ const tx = await this.contract8.min_euint128_euint32(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(4076998771n);
});
- it('test operator "ne" overload (euint32, uint32) => ebool test 1 (221510600, 454323706)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(221510600n);
-
+ it('test operator "min" overload (euint128, euint32) => euint128 test 3 (4076998775, 4076998775)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(4076998775n);
+ input.add32(4076998775n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint32_uint32(
+ const tx = await this.contract8.min_euint128_euint32(
encryptedAmount.handles[0],
- 454323706n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(4076998775n);
});
- it('test operator "ne" overload (euint32, uint32) => ebool test 2 (221510596, 221510600)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(221510596n);
-
+ it('test operator "min" overload (euint128, euint32) => euint128 test 4 (4076998775, 4076998771)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(4076998775n);
+ input.add32(4076998771n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint32_uint32(
+ const tx = await this.contract8.min_euint128_euint32(
encryptedAmount.handles[0],
- 221510600n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(4076998771n);
});
- it('test operator "ne" overload (euint32, uint32) => ebool test 3 (221510600, 221510600)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(221510600n);
-
+ it('test operator "max" overload (euint128, euint32) => euint128 test 1 (340282366920938463463374411933353920761, 2226263511)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463374411933353920761n);
+ input.add32(2226263511n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint32_uint32(
+ const tx = await this.contract8.max_euint128_euint32(
encryptedAmount.handles[0],
- 221510600n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463374411933353920761n);
});
- it('test operator "ne" overload (euint32, uint32) => ebool test 4 (221510600, 221510596)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(221510600n);
-
+ it('test operator "max" overload (euint128, euint32) => euint128 test 2 (2226263507, 2226263511)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(2226263507n);
+ input.add32(2226263511n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint32_uint32(
+ const tx = await this.contract8.max_euint128_euint32(
encryptedAmount.handles[0],
- 221510596n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(2226263511n);
});
- it('test operator "ne" overload (uint32, euint32) => ebool test 1 (2107136281, 454323706)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(454323706n);
+ it('test operator "max" overload (euint128, euint32) => euint128 test 3 (2226263511, 2226263511)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(2226263511n);
+ input.add32(2226263511n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_uint32_euint32(
- 2107136281n,
+ const tx = await this.contract8.max_euint128_euint32(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(2226263511n);
});
- it('test operator "ne" overload (uint32, euint32) => ebool test 2 (221510596, 221510600)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(221510600n);
+ it('test operator "max" overload (euint128, euint32) => euint128 test 4 (2226263511, 2226263507)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(2226263511n);
+ input.add32(2226263507n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_uint32_euint32(
- 221510596n,
+ const tx = await this.contract8.max_euint128_euint32(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(2226263511n);
});
- it('test operator "ne" overload (uint32, euint32) => ebool test 3 (221510600, 221510600)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(221510600n);
+ it('test operator "add" overload (euint128, euint64) => euint128 test 1 (9223372036854775809, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(9223372036854775809n);
+ input.add64(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_uint32_euint32(
- 221510600n,
+ const tx = await this.contract8.add_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(9223372036854775811n);
});
- it('test operator "ne" overload (uint32, euint32) => ebool test 4 (221510600, 221510596)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(221510596n);
+ it('test operator "add" overload (euint128, euint64) => euint128 test 2 (9219789077213425563, 9219789077213425565)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(9219789077213425563n);
+ input.add64(9219789077213425565n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_uint32_euint32(
- 221510600n,
+ const tx = await this.contract8.add_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(18439578154426851128n);
});
- it('test operator "ge" overload (euint32, uint32) => ebool test 1 (1736787381, 3290514741)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1736787381n);
-
+ it('test operator "add" overload (euint128, euint64) => euint128 test 3 (9219789077213425565, 9219789077213425565)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(9219789077213425565n);
+ input.add64(9219789077213425565n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint32_uint32(
+ const tx = await this.contract8.add_euint128_euint64(
encryptedAmount.handles[0],
- 3290514741n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(18439578154426851130n);
});
- it('test operator "ge" overload (euint32, uint32) => ebool test 2 (970577158, 970577162)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(970577158n);
-
+ it('test operator "add" overload (euint128, euint64) => euint128 test 4 (9219789077213425565, 9219789077213425563)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(9219789077213425565n);
+ input.add64(9219789077213425563n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint32_uint32(
+ const tx = await this.contract8.add_euint128_euint64(
encryptedAmount.handles[0],
- 970577162n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(18439578154426851128n);
});
- it('test operator "ge" overload (euint32, uint32) => ebool test 3 (970577162, 970577162)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(970577162n);
-
+ it('test operator "sub" overload (euint128, euint64) => euint128 test 1 (18441111603467904997, 18441111603467904997)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18441111603467904997n);
+ input.add64(18441111603467904997n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint32_uint32(
+ const tx = await this.contract8.sub_euint128_euint64(
encryptedAmount.handles[0],
- 970577162n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(0n);
});
- it('test operator "ge" overload (euint32, uint32) => ebool test 4 (970577162, 970577158)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(970577162n);
-
+ it('test operator "sub" overload (euint128, euint64) => euint128 test 2 (18441111603467904997, 18441111603467904993)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18441111603467904997n);
+ input.add64(18441111603467904993n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint32_uint32(
+ const tx = await this.contract8.sub_euint128_euint64(
encryptedAmount.handles[0],
- 970577158n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(4n);
});
- it('test operator "ge" overload (uint32, euint32) => ebool test 1 (586395582, 3290514741)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(3290514741n);
+ it('test operator "mul" overload (euint128, euint64) => euint128 test 1 (4611686018427387905, 2)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(4611686018427387905n);
+ input.add64(2n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_uint32_euint32(
- 586395582n,
+ const tx = await this.contract8.mul_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(9223372036854775810n);
});
- it('test operator "ge" overload (uint32, euint32) => ebool test 2 (970577158, 970577162)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(970577162n);
+ it('test operator "mul" overload (euint128, euint64) => euint128 test 2 (4294304633, 4294304633)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(4294304633n);
+ input.add64(4294304633n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_uint32_euint32(
- 970577158n,
+ const tx = await this.contract8.mul_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(18441052281005264689n);
});
- it('test operator "ge" overload (uint32, euint32) => ebool test 3 (970577162, 970577162)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(970577162n);
+ it('test operator "mul" overload (euint128, euint64) => euint128 test 3 (4294304633, 4294304633)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(4294304633n);
+ input.add64(4294304633n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_uint32_euint32(
- 970577162n,
+ const tx = await this.contract8.mul_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(18441052281005264689n);
});
- it('test operator "ge" overload (uint32, euint32) => ebool test 4 (970577162, 970577158)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(970577158n);
+ it('test operator "mul" overload (euint128, euint64) => euint128 test 4 (4294304633, 4294304633)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(4294304633n);
+ input.add64(4294304633n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_uint32_euint32(
- 970577162n,
+ const tx = await this.contract8.mul_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(18441052281005264689n);
});
- it('test operator "gt" overload (euint32, uint32) => ebool test 1 (212629196, 4059879084)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(212629196n);
-
+ it('test operator "and" overload (euint128, euint64) => euint128 test 1 (340282366920938463463368706571541146173, 18442558600081086197)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463368706571541146173n);
+ input.add64(18442558600081086197n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint32_uint32(
+ const tx = await this.contract8.and_euint128_euint64(
encryptedAmount.handles[0],
- 4059879084n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(18438019519441568309n);
});
- it('test operator "gt" overload (euint32, uint32) => ebool test 2 (212629192, 212629196)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(212629192n);
-
+ it('test operator "and" overload (euint128, euint64) => euint128 test 2 (18442558600081086193, 18442558600081086197)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18442558600081086193n);
+ input.add64(18442558600081086197n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint32_uint32(
+ const tx = await this.contract8.and_euint128_euint64(
encryptedAmount.handles[0],
- 212629196n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(18442558600081086193n);
});
- it('test operator "gt" overload (euint32, uint32) => ebool test 3 (212629196, 212629196)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(212629196n);
-
+ it('test operator "and" overload (euint128, euint64) => euint128 test 3 (18442558600081086197, 18442558600081086197)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18442558600081086197n);
+ input.add64(18442558600081086197n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint32_uint32(
+ const tx = await this.contract8.and_euint128_euint64(
encryptedAmount.handles[0],
- 212629196n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(18442558600081086197n);
});
- it('test operator "gt" overload (euint32, uint32) => ebool test 4 (212629196, 212629192)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(212629196n);
-
+ it('test operator "and" overload (euint128, euint64) => euint128 test 4 (18442558600081086197, 18442558600081086193)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18442558600081086197n);
+ input.add64(18442558600081086193n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint32_uint32(
+ const tx = await this.contract8.and_euint128_euint64(
encryptedAmount.handles[0],
- 212629192n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(18442558600081086193n);
});
- it('test operator "gt" overload (uint32, euint32) => ebool test 1 (2732454384, 4059879084)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(4059879084n);
+ it('test operator "or" overload (euint128, euint64) => euint128 test 1 (340282366920938463463370949519145006273, 18439052795332501691)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463370949519145006273n);
+ input.add64(18439052795332501691n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_uint32_euint32(
- 2732454384n,
+ const tx = await this.contract8.or_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463372265437599364347n);
});
- it('test operator "gt" overload (uint32, euint32) => ebool test 2 (212629192, 212629196)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(212629196n);
+ it('test operator "or" overload (euint128, euint64) => euint128 test 2 (18439052795332501687, 18439052795332501691)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18439052795332501687n);
+ input.add64(18439052795332501691n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_uint32_euint32(
- 212629192n,
+ const tx = await this.contract8.or_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(18439052795332501695n);
});
- it('test operator "gt" overload (uint32, euint32) => ebool test 3 (212629196, 212629196)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(212629196n);
+ it('test operator "or" overload (euint128, euint64) => euint128 test 3 (18439052795332501691, 18439052795332501691)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18439052795332501691n);
+ input.add64(18439052795332501691n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_uint32_euint32(
- 212629196n,
+ const tx = await this.contract8.or_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(18439052795332501691n);
});
- it('test operator "gt" overload (uint32, euint32) => ebool test 4 (212629196, 212629192)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(212629192n);
+ it('test operator "or" overload (euint128, euint64) => euint128 test 4 (18439052795332501691, 18439052795332501687)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18439052795332501691n);
+ input.add64(18439052795332501687n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_uint32_euint32(
- 212629196n,
+ const tx = await this.contract8.or_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(18439052795332501695n);
});
- it('test operator "le" overload (euint32, uint32) => ebool test 1 (2708913268, 3120465053)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2708913268n);
-
+ it('test operator "xor" overload (euint128, euint64) => euint128 test 1 (340282366920938463463368977308831072123, 18442960701720483125)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463368977308831072123n);
+ input.add64(18442960701720483125n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint32_uint32(
+ const tx = await this.contract8.xor_euint128_euint64(
encryptedAmount.handles[0],
- 3120465053n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463444935023814972271182n);
});
- it('test operator "le" overload (euint32, uint32) => ebool test 2 (1446383130, 1446383134)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1446383130n);
-
+ it('test operator "xor" overload (euint128, euint64) => euint128 test 2 (18442960701720483121, 18442960701720483125)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18442960701720483121n);
+ input.add64(18442960701720483125n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint32_uint32(
+ const tx = await this.contract8.xor_euint128_euint64(
encryptedAmount.handles[0],
- 1446383134n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(4n);
});
- it('test operator "le" overload (euint32, uint32) => ebool test 3 (1446383134, 1446383134)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1446383134n);
-
+ it('test operator "xor" overload (euint128, euint64) => euint128 test 3 (18442960701720483125, 18442960701720483125)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18442960701720483125n);
+ input.add64(18442960701720483125n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint32_uint32(
+ const tx = await this.contract8.xor_euint128_euint64(
encryptedAmount.handles[0],
- 1446383134n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(0n);
});
- it('test operator "le" overload (euint32, uint32) => ebool test 4 (1446383134, 1446383130)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1446383134n);
-
+ it('test operator "xor" overload (euint128, euint64) => euint128 test 4 (18442960701720483125, 18442960701720483121)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18442960701720483125n);
+ input.add64(18442960701720483121n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint32_uint32(
+ const tx = await this.contract8.xor_euint128_euint64(
encryptedAmount.handles[0],
- 1446383130n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(4n);
});
- it('test operator "le" overload (uint32, euint32) => ebool test 1 (518556131, 3120465053)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(3120465053n);
+ it('test operator "eq" overload (euint128, euint64) => ebool test 1 (340282366920938463463373700954879453501, 18443047059286955551)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463373700954879453501n);
+ input.add64(18443047059286955551n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_uint32_euint32(
- 518556131n,
+ const tx = await this.contract8.eq_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "le" overload (uint32, euint32) => ebool test 2 (1446383130, 1446383134)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(1446383134n);
+ it('test operator "eq" overload (euint128, euint64) => ebool test 2 (18443047059286955547, 18443047059286955551)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18443047059286955547n);
+ input.add64(18443047059286955551n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_uint32_euint32(
- 1446383130n,
+ const tx = await this.contract8.eq_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "le" overload (uint32, euint32) => ebool test 3 (1446383134, 1446383134)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(1446383134n);
+ it('test operator "eq" overload (euint128, euint64) => ebool test 3 (18443047059286955551, 18443047059286955551)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18443047059286955551n);
+ input.add64(18443047059286955551n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_uint32_euint32(
- 1446383134n,
+ const tx = await this.contract8.eq_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (uint32, euint32) => ebool test 4 (1446383134, 1446383130)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(1446383130n);
+ it('test operator "eq" overload (euint128, euint64) => ebool test 4 (18443047059286955551, 18443047059286955547)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18443047059286955551n);
+ input.add64(18443047059286955547n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_uint32_euint32(
- 1446383134n,
+ const tx = await this.contract8.eq_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint32, uint32) => ebool test 1 (1837089382, 2866298985)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1837089382n);
-
+ it('test operator "ne" overload (euint128, euint64) => ebool test 1 (340282366920938463463367381041406724807, 18441880962783858343)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463367381041406724807n);
+ input.add64(18441880962783858343n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint32_uint32(
+ const tx = await this.contract8.ne_euint128_euint64(
encryptedAmount.handles[0],
- 2866298985n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint32, uint32) => ebool test 2 (1837089378, 1837089382)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1837089378n);
-
+ it('test operator "ne" overload (euint128, euint64) => ebool test 2 (18441880962783858339, 18441880962783858343)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18441880962783858339n);
+ input.add64(18441880962783858343n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint32_uint32(
+ const tx = await this.contract8.ne_euint128_euint64(
encryptedAmount.handles[0],
- 1837089382n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (euint32, uint32) => ebool test 3 (1837089382, 1837089382)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1837089382n);
-
+ it('test operator "ne" overload (euint128, euint64) => ebool test 3 (18441880962783858343, 18441880962783858343)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18441880962783858343n);
+ input.add64(18441880962783858343n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint32_uint32(
+ const tx = await this.contract8.ne_euint128_euint64(
encryptedAmount.handles[0],
- 1837089382n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(false);
});
- it('test operator "lt" overload (euint32, uint32) => ebool test 4 (1837089382, 1837089378)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(1837089382n);
-
+ it('test operator "ne" overload (euint128, euint64) => ebool test 4 (18441880962783858343, 18441880962783858339)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18441880962783858343n);
+ input.add64(18441880962783858339n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_euint32_uint32(
+ const tx = await this.contract8.ne_euint128_euint64(
encryptedAmount.handles[0],
- 1837089378n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
});
- it('test operator "lt" overload (uint32, euint32) => ebool test 1 (391192733, 2866298985)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(2866298985n);
+ it('test operator "ge" overload (euint128, euint64) => ebool test 1 (340282366920938463463371033714627819917, 18439188692806479297)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463371033714627819917n);
+ input.add64(18439188692806479297n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_uint32_euint32(
- 391192733n,
+ const tx = await this.contract8.ge_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(true);
});
- it('test operator "lt" overload (uint32, euint32) => ebool test 2 (1837089378, 1837089382)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(1837089382n);
+ it('test operator "ge" overload (euint128, euint64) => ebool test 2 (18439188692806479293, 18439188692806479297)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18439188692806479293n);
+ input.add64(18439188692806479297n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_uint32_euint32(
- 1837089378n,
+ const tx = await this.contract8.ge_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "lt" overload (uint32, euint32) => ebool test 3 (1837089382, 1837089382)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(1837089382n);
+ it('test operator "ge" overload (euint128, euint64) => ebool test 3 (18439188692806479297, 18439188692806479297)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18439188692806479297n);
+ input.add64(18439188692806479297n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_uint32_euint32(
- 1837089382n,
+ const tx = await this.contract8.ge_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
});
- it('test operator "lt" overload (uint32, euint32) => ebool test 4 (1837089382, 1837089378)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(1837089378n);
+ it('test operator "ge" overload (euint128, euint64) => ebool test 4 (18439188692806479297, 18439188692806479293)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18439188692806479297n);
+ input.add64(18439188692806479293n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.lt_uint32_euint32(
- 1837089382n,
+ const tx = await this.contract8.ge_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (euint32, uint32) => euint32 test 1 (4226618007, 2039277146)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(4226618007n);
-
+ it('test operator "gt" overload (euint128, euint64) => ebool test 1 (340282366920938463463366930376033772101, 18439752237470295949)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463366930376033772101n);
+ input.add64(18439752237470295949n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint32_uint32(
+ const tx = await this.contract8.gt_euint128_euint64(
encryptedAmount.handles[0],
- 2039277146n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2039277146n);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (euint32, uint32) => euint32 test 2 (2940808909, 2940808913)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2940808909n);
-
+ it('test operator "gt" overload (euint128, euint64) => ebool test 2 (18439752237470295945, 18439752237470295949)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18439752237470295945n);
+ input.add64(18439752237470295949n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint32_uint32(
+ const tx = await this.contract8.gt_euint128_euint64(
encryptedAmount.handles[0],
- 2940808913n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2940808909n);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "min" overload (euint32, uint32) => euint32 test 3 (2940808913, 2940808913)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2940808913n);
-
+ it('test operator "gt" overload (euint128, euint64) => ebool test 3 (18439752237470295949, 18439752237470295949)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18439752237470295949n);
+ input.add64(18439752237470295949n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint32_uint32(
+ const tx = await this.contract8.gt_euint128_euint64(
encryptedAmount.handles[0],
- 2940808913n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2940808913n);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "min" overload (euint32, uint32) => euint32 test 4 (2940808913, 2940808909)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2940808913n);
-
+ it('test operator "gt" overload (euint128, euint64) => ebool test 4 (18439752237470295949, 18439752237470295945)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18439752237470295949n);
+ input.add64(18439752237470295945n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_euint32_uint32(
+ const tx = await this.contract8.gt_euint128_euint64(
encryptedAmount.handles[0],
- 2940808909n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2940808909n);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (uint32, euint32) => euint32 test 1 (1778120575, 2039277146)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(2039277146n);
+ it('test operator "le" overload (euint128, euint64) => ebool test 1 (340282366920938463463366067679463384359, 18440549964651513569)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463366067679463384359n);
+ input.add64(18440549964651513569n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_uint32_euint32(
- 1778120575n,
+ const tx = await this.contract8.le_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1778120575n);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "min" overload (uint32, euint32) => euint32 test 2 (2940808909, 2940808913)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(2940808913n);
+ it('test operator "le" overload (euint128, euint64) => ebool test 2 (18440549964651513565, 18440549964651513569)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18440549964651513565n);
+ input.add64(18440549964651513569n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_uint32_euint32(
- 2940808909n,
+ const tx = await this.contract8.le_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2940808909n);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (uint32, euint32) => euint32 test 3 (2940808913, 2940808913)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(2940808913n);
+ it('test operator "le" overload (euint128, euint64) => ebool test 3 (18440549964651513569, 18440549964651513569)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18440549964651513569n);
+ input.add64(18440549964651513569n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_uint32_euint32(
- 2940808913n,
+ const tx = await this.contract8.le_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2940808913n);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
});
- it('test operator "min" overload (uint32, euint32) => euint32 test 4 (2940808913, 2940808909)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(2940808909n);
+ it('test operator "le" overload (euint128, euint64) => ebool test 4 (18440549964651513569, 18440549964651513565)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18440549964651513569n);
+ input.add64(18440549964651513565n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.min_uint32_euint32(
- 2940808913n,
+ const tx = await this.contract8.le_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2940808909n);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "max" overload (euint32, uint32) => euint32 test 1 (3535438432, 1480992326)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(3535438432n);
-
+ it('test operator "lt" overload (euint128, euint64) => ebool test 1 (340282366920938463463369469329980440219, 18446437448475645327)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463369469329980440219n);
+ input.add64(18446437448475645327n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint32_uint32(
+ const tx = await this.contract8.lt_euint128_euint64(
encryptedAmount.handles[0],
- 1480992326n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(3535438432n);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "max" overload (euint32, uint32) => euint32 test 2 (2851290841, 2851290845)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2851290841n);
-
+ it('test operator "lt" overload (euint128, euint64) => ebool test 2 (18446437448475645323, 18446437448475645327)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18446437448475645323n);
+ input.add64(18446437448475645327n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint32_uint32(
+ const tx = await this.contract8.lt_euint128_euint64(
encryptedAmount.handles[0],
- 2851290845n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2851290845n);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
});
- it('test operator "max" overload (euint32, uint32) => euint32 test 3 (2851290845, 2851290845)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2851290845n);
-
+ it('test operator "lt" overload (euint128, euint64) => ebool test 3 (18446437448475645327, 18446437448475645327)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18446437448475645327n);
+ input.add64(18446437448475645327n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint32_uint32(
+ const tx = await this.contract8.lt_euint128_euint64(
encryptedAmount.handles[0],
- 2851290845n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2851290845n);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "max" overload (euint32, uint32) => euint32 test 4 (2851290845, 2851290841)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add32(2851290845n);
-
+ it('test operator "lt" overload (euint128, euint64) => ebool test 4 (18446437448475645327, 18446437448475645323)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18446437448475645327n);
+ input.add64(18446437448475645323n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_euint32_uint32(
+ const tx = await this.contract8.lt_euint128_euint64(
encryptedAmount.handles[0],
- 2851290841n,
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2851290845n);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "max" overload (uint32, euint32) => euint32 test 1 (760733114, 1480992326)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(1480992326n);
+ it('test operator "min" overload (euint128, euint64) => euint128 test 1 (340282366920938463463372700048433567093, 18437970528445398453)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463372700048433567093n);
+ input.add64(18437970528445398453n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_uint32_euint32(
- 760733114n,
+ const tx = await this.contract8.min_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(1480992326n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(18437970528445398453n);
});
- it('test operator "max" overload (uint32, euint32) => euint32 test 2 (2851290841, 2851290845)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(2851290845n);
+ it('test operator "min" overload (euint128, euint64) => euint128 test 2 (18437970528445398449, 18437970528445398453)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18437970528445398449n);
+ input.add64(18437970528445398453n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_uint32_euint32(
- 2851290841n,
+ const tx = await this.contract8.min_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2851290845n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(18437970528445398449n);
});
- it('test operator "max" overload (uint32, euint32) => euint32 test 3 (2851290845, 2851290845)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(2851290845n);
+ it('test operator "min" overload (euint128, euint64) => euint128 test 3 (18437970528445398453, 18437970528445398453)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18437970528445398453n);
+ input.add64(18437970528445398453n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_uint32_euint32(
- 2851290845n,
+ const tx = await this.contract8.min_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2851290845n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(18437970528445398453n);
});
- it('test operator "max" overload (uint32, euint32) => euint32 test 4 (2851290845, 2851290841)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
-
- input.add32(2851290841n);
+ it('test operator "min" overload (euint128, euint64) => euint128 test 4 (18437970528445398453, 18437970528445398449)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18437970528445398453n);
+ input.add64(18437970528445398449n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.max_uint32_euint32(
- 2851290845n,
+ const tx = await this.contract8.min_euint128_euint64(
encryptedAmount.handles[0],
+ encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt32(await this.contract4.res32());
- expect(res).to.equal(2851290845n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(18437970528445398449n);
});
- it('test operator "add" overload (euint64, euint4) => euint64 test 1 (9, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(9n);
- input.add4(2n);
+ it('test operator "max" overload (euint128, euint64) => euint128 test 1 (340282366920938463463373867307519267223, 18442144243272238465)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463373867307519267223n);
+ input.add64(18442144243272238465n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint64_euint4(
+ const tx = await this.contract8.max_euint128_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(11n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463373867307519267223n);
});
- it('test operator "add" overload (euint64, euint4) => euint64 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(4n);
- input.add4(8n);
+ it('test operator "max" overload (euint128, euint64) => euint128 test 2 (18442144243272238461, 18442144243272238465)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18442144243272238461n);
+ input.add64(18442144243272238465n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint64_euint4(
+ const tx = await this.contract8.max_euint128_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(12n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(18442144243272238465n);
});
- it('test operator "add" overload (euint64, euint4) => euint64 test 3 (5, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(5n);
- input.add4(5n);
+ it('test operator "max" overload (euint128, euint64) => euint128 test 3 (18442144243272238465, 18442144243272238465)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18442144243272238465n);
+ input.add64(18442144243272238465n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint64_euint4(
+ const tx = await this.contract8.max_euint128_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(10n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(18442144243272238465n);
});
- it('test operator "add" overload (euint64, euint4) => euint64 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(8n);
- input.add4(4n);
+ it('test operator "max" overload (euint128, euint64) => euint128 test 4 (18442144243272238465, 18442144243272238461)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(18442144243272238465n);
+ input.add64(18442144243272238461n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.add_euint64_euint4(
+ const tx = await this.contract8.max_euint128_euint64(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(12n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(18442144243272238465n);
});
- it('test operator "sub" overload (euint64, euint4) => euint64 test 1 (10, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(10n);
- input.add4(10n);
+ it('test operator "add" overload (euint128, euint128) => euint128 test 1 (170141183460469231731685489259224150459, 170141183460469231731686328709125723252)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(170141183460469231731685489259224150459n);
+ input.add128(170141183460469231731686328709125723252n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.sub_euint64_euint4(
+ const tx = await this.contract8.add_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(0n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463371817968349873711n);
});
- it('test operator "sub" overload (euint64, euint4) => euint64 test 2 (10, 6)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(10n);
- input.add4(6n);
+ it('test operator "add" overload (euint128, euint128) => euint128 test 2 (170141183460469231731685489259224150457, 170141183460469231731685489259224150459)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(170141183460469231731685489259224150457n);
+ input.add128(170141183460469231731685489259224150459n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.sub_euint64_euint4(
+ const tx = await this.contract8.add_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(4n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463370978518448300916n);
});
- it('test operator "mul" overload (euint64, euint4) => euint64 test 1 (5, 2)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(5n);
- input.add4(2n);
+ it('test operator "add" overload (euint128, euint128) => euint128 test 3 (170141183460469231731685489259224150459, 170141183460469231731685489259224150459)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(170141183460469231731685489259224150459n);
+ input.add128(170141183460469231731685489259224150459n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint64_euint4(
+ const tx = await this.contract8.add_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(10n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463370978518448300918n);
});
- it('test operator "mul" overload (euint64, euint4) => euint64 test 2 (3, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(3n);
- input.add4(5n);
+ it('test operator "add" overload (euint128, euint128) => euint128 test 4 (170141183460469231731685489259224150459, 170141183460469231731685489259224150457)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(170141183460469231731685489259224150459n);
+ input.add128(170141183460469231731685489259224150457n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint64_euint4(
+ const tx = await this.contract8.add_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(15n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463370978518448300916n);
});
- it('test operator "mul" overload (euint64, euint4) => euint64 test 3 (3, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(3n);
- input.add4(3n);
+ it('test operator "sub" overload (euint128, euint128) => euint128 test 1 (340282366920938463463366688248127833841, 340282366920938463463366688248127833841)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463366688248127833841n);
+ input.add128(340282366920938463463366688248127833841n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint64_euint4(
+ const tx = await this.contract8.sub_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(9n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(0n);
});
- it('test operator "mul" overload (euint64, euint4) => euint64 test 4 (5, 3)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(5n);
- input.add4(3n);
+ it('test operator "sub" overload (euint128, euint128) => euint128 test 2 (340282366920938463463366688248127833841, 340282366920938463463366688248127833837)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463366688248127833841n);
+ input.add128(340282366920938463463366688248127833837n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.mul_euint64_euint4(
+ const tx = await this.contract8.sub_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(15n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(4n);
});
- it('test operator "and" overload (euint64, euint4) => euint64 test 1 (18444456172028398167, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(18444456172028398167n);
- input.add4(8n);
+ it('test operator "mul" overload (euint128, euint128) => euint128 test 1 (9223372036854775809, 9223372036854775809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(9223372036854775809n);
+ input.add128(9223372036854775809n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.and_euint64_euint4(
+ const tx = await this.contract8.mul_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(0n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(85070591730234615884290395931651604481n);
});
- it('test operator "and" overload (euint64, euint4) => euint64 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(4n);
- input.add4(8n);
+ it('test operator "mul" overload (euint128, euint128) => euint128 test 2 (9223372036854775809, 9223372036854775809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(9223372036854775809n);
+ input.add128(9223372036854775809n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.and_euint64_euint4(
+ const tx = await this.contract8.mul_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(0n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(85070591730234615884290395931651604481n);
});
- it('test operator "and" overload (euint64, euint4) => euint64 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(8n);
- input.add4(8n);
+ it('test operator "mul" overload (euint128, euint128) => euint128 test 3 (9223372036854775809, 9223372036854775809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(9223372036854775809n);
+ input.add128(9223372036854775809n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.and_euint64_euint4(
+ const tx = await this.contract8.mul_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(8n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(85070591730234615884290395931651604481n);
});
- it('test operator "and" overload (euint64, euint4) => euint64 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(8n);
- input.add4(4n);
+ it('test operator "mul" overload (euint128, euint128) => euint128 test 4 (9223372036854775809, 9223372036854775809)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(9223372036854775809n);
+ input.add128(9223372036854775809n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.and_euint64_euint4(
+ const tx = await this.contract8.mul_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(0n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(85070591730234615884290395931651604481n);
});
- it('test operator "or" overload (euint64, euint4) => euint64 test 1 (18443742079082438219, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(18443742079082438219n);
- input.add4(5n);
+ it('test operator "and" overload (euint128, euint128) => euint128 test 1 (340282366920938463463365754576278416105, 340282366920938463463366665489173165177)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463365754576278416105n);
+ input.add128(340282366920938463463366665489173165177n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint64_euint4(
+ const tx = await this.contract8.and_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(18443742079082438223n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463365750145734418537n);
});
- it('test operator "or" overload (euint64, euint4) => euint64 test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(4n);
- input.add4(8n);
+ it('test operator "and" overload (euint128, euint128) => euint128 test 2 (340282366920938463463365754576278416101, 340282366920938463463365754576278416105)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463365754576278416101n);
+ input.add128(340282366920938463463365754576278416105n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint64_euint4(
+ const tx = await this.contract8.and_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(12n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463365754576278416097n);
});
- it('test operator "or" overload (euint64, euint4) => euint64 test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(8n);
- input.add4(8n);
+ it('test operator "and" overload (euint128, euint128) => euint128 test 3 (340282366920938463463365754576278416105, 340282366920938463463365754576278416105)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463365754576278416105n);
+ input.add128(340282366920938463463365754576278416105n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint64_euint4(
+ const tx = await this.contract8.and_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(8n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463365754576278416105n);
});
- it('test operator "or" overload (euint64, euint4) => euint64 test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(8n);
- input.add4(4n);
+ it('test operator "and" overload (euint128, euint128) => euint128 test 4 (340282366920938463463365754576278416105, 340282366920938463463365754576278416101)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463365754576278416105n);
+ input.add128(340282366920938463463365754576278416101n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.or_euint64_euint4(
+ const tx = await this.contract8.and_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(12n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463365754576278416097n);
});
- it('test operator "xor" overload (euint64, euint4) => euint64 test 1 (18442015029052104347, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(18442015029052104347n);
- input.add4(10n);
+ it('test operator "or" overload (euint128, euint128) => euint128 test 1 (340282366920938463463367655063545859643, 340282366920938463463373469661379852713)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463367655063545859643n);
+ input.add128(340282366920938463463373469661379852713n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint64_euint4(
+ const tx = await this.contract8.or_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(18442015029052104337n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463374605231434923963n);
});
- it('test operator "xor" overload (euint64, euint4) => euint64 test 2 (6, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(6n);
- input.add4(10n);
+ it('test operator "or" overload (euint128, euint128) => euint128 test 2 (340282366920938463463367655063545859639, 340282366920938463463367655063545859643)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463367655063545859639n);
+ input.add128(340282366920938463463367655063545859643n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint64_euint4(
+ const tx = await this.contract8.or_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(12n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463367655063545859647n);
});
- it('test operator "xor" overload (euint64, euint4) => euint64 test 3 (10, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(10n);
- input.add4(10n);
+ it('test operator "or" overload (euint128, euint128) => euint128 test 3 (340282366920938463463367655063545859643, 340282366920938463463367655063545859643)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463367655063545859643n);
+ input.add128(340282366920938463463367655063545859643n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint64_euint4(
+ const tx = await this.contract8.or_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(0n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463367655063545859643n);
});
- it('test operator "xor" overload (euint64, euint4) => euint64 test 4 (10, 6)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(10n);
- input.add4(6n);
+ it('test operator "or" overload (euint128, euint128) => euint128 test 4 (340282366920938463463367655063545859643, 340282366920938463463367655063545859639)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463367655063545859643n);
+ input.add128(340282366920938463463367655063545859639n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.xor_euint64_euint4(
+ const tx = await this.contract8.or_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decrypt64(await this.contract4.res64());
- expect(res).to.equal(12n);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(340282366920938463463367655063545859647n);
});
- it('test operator "eq" overload (euint64, euint4) => ebool test 1 (18446728320459652857, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(18446728320459652857n);
- input.add4(10n);
+ it('test operator "xor" overload (euint128, euint128) => euint128 test 1 (340282366920938463463372080691181989981, 340282366920938463463368941059346865329)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463372080691181989981n);
+ input.add128(340282366920938463463368941059346865329n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint64_euint4(
+ const tx = await this.contract8.xor_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(8122674366786796n);
});
- it('test operator "eq" overload (euint64, euint4) => ebool test 2 (6, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(6n);
- input.add4(10n);
+ it('test operator "xor" overload (euint128, euint128) => euint128 test 2 (340282366920938463463368941059346865325, 340282366920938463463368941059346865329)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463368941059346865325n);
+ input.add128(340282366920938463463368941059346865329n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint64_euint4(
+ const tx = await this.contract8.xor_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(28n);
});
- it('test operator "eq" overload (euint64, euint4) => ebool test 3 (10, 10)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(10n);
- input.add4(10n);
+ it('test operator "xor" overload (euint128, euint128) => euint128 test 3 (340282366920938463463368941059346865329, 340282366920938463463368941059346865329)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463368941059346865329n);
+ input.add128(340282366920938463463368941059346865329n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint64_euint4(
+ const tx = await this.contract8.xor_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(0n);
});
- it('test operator "eq" overload (euint64, euint4) => ebool test 4 (10, 6)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(10n);
- input.add4(6n);
+ it('test operator "xor" overload (euint128, euint128) => euint128 test 4 (340282366920938463463368941059346865329, 340282366920938463463368941059346865325)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463368941059346865329n);
+ input.add128(340282366920938463463368941059346865325n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.eq_euint64_euint4(
+ const tx = await this.contract8.xor_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decrypt128(await this.contract8.res128());
+ expect(res).to.equal(28n);
});
- it('test operator "ne" overload (euint64, euint4) => ebool test 1 (18446041636272307563, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(18446041636272307563n);
- input.add4(8n);
+ it('test operator "eq" overload (euint128, euint128) => ebool test 1 (340282366920938463463371368021216956093, 340282366920938463463370243874611927705)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463371368021216956093n);
+ input.add128(340282366920938463463370243874611927705n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint64_euint4(
+ const tx = await this.contract8.eq_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint64, euint4) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(4n);
- input.add4(8n);
+ it('test operator "eq" overload (euint128, euint128) => ebool test 2 (340282366920938463463370243874611927701, 340282366920938463463370243874611927705)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463370243874611927701n);
+ input.add128(340282366920938463463370243874611927705n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint64_euint4(
+ const tx = await this.contract8.eq_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ne" overload (euint64, euint4) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(8n);
- input.add4(8n);
+ it('test operator "eq" overload (euint128, euint128) => ebool test 3 (340282366920938463463370243874611927705, 340282366920938463463370243874611927705)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463370243874611927705n);
+ input.add128(340282366920938463463370243874611927705n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint64_euint4(
+ const tx = await this.contract8.eq_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
});
- it('test operator "ne" overload (euint64, euint4) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(8n);
- input.add4(4n);
+ it('test operator "eq" overload (euint128, euint128) => ebool test 4 (340282366920938463463370243874611927705, 340282366920938463463370243874611927701)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463370243874611927705n);
+ input.add128(340282366920938463463370243874611927701n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ne_euint64_euint4(
+ const tx = await this.contract8.eq_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint64, euint4) => ebool test 1 (18439251641807718563, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(18439251641807718563n);
- input.add4(9n);
+ it('test operator "ne" overload (euint128, euint128) => ebool test 1 (340282366920938463463366690564024700303, 340282366920938463463366105643215363065)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463366690564024700303n);
+ input.add128(340282366920938463463366105643215363065n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint64_euint4(
+ const tx = await this.contract8.ne_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint64, euint4) => ebool test 2 (5, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(5n);
- input.add4(9n);
+ it('test operator "ne" overload (euint128, euint128) => ebool test 2 (340282366920938463463366105643215363061, 340282366920938463463366105643215363065)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463366105643215363061n);
+ input.add128(340282366920938463463366105643215363065n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint64_euint4(
+ const tx = await this.contract8.ne_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
});
- it('test operator "ge" overload (euint64, euint4) => ebool test 3 (9, 9)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(9n);
- input.add4(9n);
+ it('test operator "ne" overload (euint128, euint128) => ebool test 3 (340282366920938463463366105643215363065, 340282366920938463463366105643215363065)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463366105643215363065n);
+ input.add128(340282366920938463463366105643215363065n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint64_euint4(
+ const tx = await this.contract8.ne_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "ge" overload (euint64, euint4) => ebool test 4 (9, 5)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(9n);
- input.add4(5n);
+ it('test operator "ne" overload (euint128, euint128) => ebool test 4 (340282366920938463463366105643215363065, 340282366920938463463366105643215363061)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463366105643215363065n);
+ input.add128(340282366920938463463366105643215363061n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.ge_euint64_euint4(
+ const tx = await this.contract8.ne_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint64, euint4) => ebool test 1 (18441781451110763323, 1)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(18441781451110763323n);
- input.add4(1n);
+ it('test operator "ge" overload (euint128, euint128) => ebool test 1 (340282366920938463463369991167430665173, 340282366920938463463367243418798341499)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463369991167430665173n);
+ input.add128(340282366920938463463367243418798341499n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint64_euint4(
+ const tx = await this.contract8.ge_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint64, euint4) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(4n);
- input.add4(8n);
+ it('test operator "ge" overload (euint128, euint128) => ebool test 2 (340282366920938463463367243418798341495, 340282366920938463463367243418798341499)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463367243418798341495n);
+ input.add128(340282366920938463463367243418798341499n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint64_euint4(
+ const tx = await this.contract8.ge_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(false);
});
- it('test operator "gt" overload (euint64, euint4) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(8n);
- input.add4(8n);
+ it('test operator "ge" overload (euint128, euint128) => ebool test 3 (340282366920938463463367243418798341499, 340282366920938463463367243418798341499)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463367243418798341499n);
+ input.add128(340282366920938463463367243418798341499n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint64_euint4(
+ const tx = await this.contract8.ge_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
});
- it('test operator "gt" overload (euint64, euint4) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(8n);
- input.add4(4n);
+ it('test operator "ge" overload (euint128, euint128) => ebool test 4 (340282366920938463463367243418798341499, 340282366920938463463367243418798341495)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463367243418798341499n);
+ input.add128(340282366920938463463367243418798341495n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.gt_euint64_euint4(
+ const tx = await this.contract8.ge_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(true);
});
- it('test operator "le" overload (euint64, euint4) => ebool test 1 (18438089675582739325, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(18438089675582739325n);
- input.add4(8n);
+ it('test operator "gt" overload (euint128, euint128) => ebool test 1 (340282366920938463463367714696589499231, 340282366920938463463372280163710625125)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463367714696589499231n);
+ input.add128(340282366920938463463372280163710625125n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint64_euint4(
+ const tx = await this.contract8.gt_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
+ const res = await decryptBool(await this.contract8.resb());
expect(res).to.equal(false);
});
- it('test operator "le" overload (euint64, euint4) => ebool test 2 (4, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(4n);
- input.add4(8n);
+ it('test operator "gt" overload (euint128, euint128) => ebool test 2 (340282366920938463463367714696589499227, 340282366920938463463367714696589499231)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463367714696589499227n);
+ input.add128(340282366920938463463367714696589499231n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint64_euint4(
+ const tx = await this.contract8.gt_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "le" overload (euint64, euint4) => ebool test 3 (8, 8)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(8n);
- input.add4(8n);
+ it('test operator "gt" overload (euint128, euint128) => ebool test 3 (340282366920938463463367714696589499231, 340282366920938463463367714696589499231)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463367714696589499231n);
+ input.add128(340282366920938463463367714696589499231n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint64_euint4(
+ const tx = await this.contract8.gt_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(true);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(false);
});
- it('test operator "le" overload (euint64, euint4) => ebool test 4 (8, 4)', async function () {
- const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address);
- input.add64(8n);
- input.add4(4n);
+ it('test operator "gt" overload (euint128, euint128) => ebool test 4 (340282366920938463463367714696589499231, 340282366920938463463367714696589499227)', async function () {
+ const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address);
+ input.add128(340282366920938463463367714696589499231n);
+ input.add128(340282366920938463463367714696589499227n);
const encryptedAmount = await input.encrypt();
- const tx = await this.contract4.le_euint64_euint4(
+ const tx = await this.contract8.gt_euint128_euint128(
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
);
await tx.wait();
- const res = await decryptBool(await this.contract4.resb());
- expect(res).to.equal(false);
+ const res = await decryptBool(await this.contract8.resb());
+ expect(res).to.equal(true);
});
});
From c345bc041d35348a5ce813480b21f26da25271ca Mon Sep 17 00:00:00 2001
From: Manoranjith
Date: Fri, 18 Oct 2024 14:49:32 +0200
Subject: [PATCH 45/51] Minor fixes when running in localCoprocessor mode
(#576)
* fix: use gateway addr from parsedEnv
* fix: load relayer priv key only in mock
---
test/asyncDecrypt.ts | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/test/asyncDecrypt.ts b/test/asyncDecrypt.ts
index e9a16374..3dc3d0f7 100644
--- a/test/asyncDecrypt.ts
+++ b/test/asyncDecrypt.ts
@@ -33,8 +33,11 @@ const currentTime = (): string => {
};
const parsedEnv = dotenv.parse(fs.readFileSync('gateway/.env.gateway'));
-const privKeyRelayer = process.env.PRIVATE_KEY_GATEWAY_RELAYER;
-const relayer = new ethers.Wallet(privKeyRelayer!, ethers.provider);
+let relayer: Wallet;
+if (networkName === 'hardhat') {
+ const privKeyRelayer = process.env.PRIVATE_KEY_GATEWAY_RELAYER;
+ const relayer = new ethers.Wallet(privKeyRelayer!, ethers.provider);
+}
const argEvents =
'(uint256 indexed requestID, uint256[] cts, address contractCaller, bytes4 callbackSelector, uint256 msgValue, uint256 maxTimestamp, bool passSignaturesToCaller)';
@@ -90,7 +93,7 @@ const getAlreadyFulfilledDecryptions = async (): Promise<[bigint]> => {
let results = [];
const eventDecryptionResult = await gateway.filters.ResultCallback().getTopicFilter();
const filterDecryptionResult = {
- address: process.env.GATEWAY_CONTRACT_PREDEPLOY_ADDRESS,
+ address: parsedEnv.GATEWAY_CONTRACT_PREDEPLOY_ADDRESS,
fromBlock: firstBlockListening,
toBlock: 'latest',
topics: eventDecryptionResult,
@@ -107,7 +110,7 @@ const fulfillAllPastRequestsIds = async (mocked: boolean) => {
const eventDecryption = await gateway.filters.EventDecryption().getTopicFilter();
const results = await getAlreadyFulfilledDecryptions();
const filterDecryption = {
- address: process.env.GATEWAY_CONTRACT_PREDEPLOY_ADDRESS,
+ address: parsedEnv.GATEWAY_CONTRACT_PREDEPLOY_ADDRESS,
fromBlock: firstBlockListening,
toBlock: 'latest',
topics: eventDecryption,
From 9eabcf6ebbeb98bd30b1e1585f97882f3b65b52c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Fri, 18 Oct 2024 15:54:17 +0200
Subject: [PATCH 46/51] chore: awaitDeployment
---
test/gatewayDecrypt/testAsyncDecrypt.ts | 4 ++++
test/reencryption/reencryption.ts | 1 +
2 files changed, 5 insertions(+)
diff --git a/test/gatewayDecrypt/testAsyncDecrypt.ts b/test/gatewayDecrypt/testAsyncDecrypt.ts
index 803e957c..ece79f50 100644
--- a/test/gatewayDecrypt/testAsyncDecrypt.ts
+++ b/test/gatewayDecrypt/testAsyncDecrypt.ts
@@ -29,6 +29,7 @@ describe('TestAsyncDecrypt', function () {
beforeEach(async function () {
const contractFactory = await ethers.getContractFactory('TestAsyncDecrypt');
this.contract = await contractFactory.connect(this.signers.alice).deploy();
+ await this.contract.waitForDeployment();
this.contractAddress = await this.contract.getAddress();
this.instances = await createInstances(this.signers);
});
@@ -88,6 +89,7 @@ describe('TestAsyncDecrypt', function () {
it('test async decrypt bool trustless', async function () {
const contractFactory = await ethers.getContractFactory('TestAsyncDecrypt');
const contract2 = await contractFactory.connect(this.signers.alice).deploy();
+ await contract2.waitForDeployment();
const tx2 = await contract2.requestBoolTrustless({ gasLimit: 5_000_000 });
await tx2.wait();
await awaitAllDecryptionResults();
@@ -503,6 +505,7 @@ describe('TestAsyncDecrypt', function () {
it('test async decrypt ebytes256 non-trivial trustless', async function () {
const contractFactory = await ethers.getContractFactory('TestAsyncDecrypt');
const contract2 = await contractFactory.connect(this.signers.alice).deploy();
+ await contract2.waitForDeployment();
const inputAlice = this.instances.alice.createEncryptedInput(
await contract2.getAddress(),
this.signers.alice.address,
@@ -523,6 +526,7 @@ describe('TestAsyncDecrypt', function () {
it('test async decrypt mixed with ebytes256 trustless', async function () {
const contractFactory = await ethers.getContractFactory('TestAsyncDecrypt');
const contract2 = await contractFactory.connect(this.signers.alice).deploy();
+ await contract2.waitForDeployment();
const inputAlice = this.instances.alice.createEncryptedInput(
await contract2.getAddress(),
this.signers.alice.address,
diff --git a/test/reencryption/reencryption.ts b/test/reencryption/reencryption.ts
index a604f8f7..87c8e412 100644
--- a/test/reencryption/reencryption.ts
+++ b/test/reencryption/reencryption.ts
@@ -13,6 +13,7 @@ describe('Reencryption', function () {
const contractFactory = await ethers.getContractFactory('Reencrypt');
this.contract = await contractFactory.connect(this.signers.alice).deploy();
+ await this.contract.waitForDeployment();
this.contractAddress = await this.contract.getAddress();
this.instances = await createInstances(this.signers);
});
From 78c5fe92f42ef4f019772b5c10636ad491467362 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Fri, 18 Oct 2024 16:58:59 +0200
Subject: [PATCH 47/51] chore: fixed typo initializing relayer
---
test/asyncDecrypt.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/asyncDecrypt.ts b/test/asyncDecrypt.ts
index 3dc3d0f7..164a7010 100644
--- a/test/asyncDecrypt.ts
+++ b/test/asyncDecrypt.ts
@@ -36,7 +36,7 @@ const parsedEnv = dotenv.parse(fs.readFileSync('gateway/.env.gateway'));
let relayer: Wallet;
if (networkName === 'hardhat') {
const privKeyRelayer = process.env.PRIVATE_KEY_GATEWAY_RELAYER;
- const relayer = new ethers.Wallet(privKeyRelayer!, ethers.provider);
+ relayer = new ethers.Wallet(privKeyRelayer!, ethers.provider);
}
const argEvents =
From 20fac875d3d73f272c6aa98ffa8e74a6ed8b43f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Fri, 18 Oct 2024 18:46:09 +0200
Subject: [PATCH 48/51] chore: updated fhevmjs
---
package-lock.json | 24 ++++++++++++------------
package.json | 2 +-
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 1198eb33..61cbcdbc 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -41,7 +41,7 @@
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"ethers": "^6.8.0",
- "fhevmjs": "^0.6.0-1",
+ "fhevmjs": "^0.6.0-3",
"hardhat": "^2.22.10",
"hardhat-deploy": "^0.11.29",
"hardhat-gas-reporter": "^1.0.2",
@@ -5535,19 +5535,19 @@
}
},
"node_modules/fhevmjs": {
- "version": "0.6.0-1",
- "resolved": "https://registry.npmjs.org/fhevmjs/-/fhevmjs-0.6.0-1.tgz",
- "integrity": "sha512-KHZJZXq6E6WHl1psS8ddfOTFnzpXitCjJS+6EWBqiGgqQysjHb5gP4KdUfDG3ewkfxcojMgJR1TNK03vsN69Aw==",
+ "version": "0.6.0-3",
+ "resolved": "https://registry.npmjs.org/fhevmjs/-/fhevmjs-0.6.0-3.tgz",
+ "integrity": "sha512-U6yGUWZfW+eqvDBuGU0VzpRkY74jW8vxEdp+rrDJGwtsQoHlRNZx15g6XQdWAuoDGm4dvX6JJbD3WiBLSsUAsg==",
"dev": true,
"dependencies": {
"@types/keccak": "^3.0.4",
"bigint-buffer": "^1.1.5",
"commander": "^11.0.0",
"fetch-mock": "^11.1.3",
- "node-tfhe": "^0.8.0",
+ "node-tfhe": "^0.8.3",
"node-tkms": "^0.9.0-rc11",
"sha3": "^2.1.4",
- "tfhe": "^0.8.0",
+ "tfhe": "^0.8.3",
"tkms": "^0.9.0-rc11",
"url": "^0.11.3",
"web3-validator": "^2.0.6"
@@ -8070,9 +8070,9 @@
}
},
"node_modules/node-tfhe": {
- "version": "0.8.2",
- "resolved": "https://registry.npmjs.org/node-tfhe/-/node-tfhe-0.8.2.tgz",
- "integrity": "sha512-UWJFToNhtE9lCN/zHRrIFvDdC7OU7W5aZKyrIudgdWZ5SZur/PJ2DXUqASiRFq2yK28lAZeT2awfAF4GxYaccg==",
+ "version": "0.8.4",
+ "resolved": "https://registry.npmjs.org/node-tfhe/-/node-tfhe-0.8.4.tgz",
+ "integrity": "sha512-rk4QH5wqPorEdIwUWrcKeakGhaDbJwJErsZjnA4gWP5K18LkWZwF9gzeRItzk117B4WWaV4899oiFIgeyoBR1g==",
"dev": true
},
"node_modules/node-tkms": {
@@ -10212,9 +10212,9 @@
"dev": true
},
"node_modules/tfhe": {
- "version": "0.8.2",
- "resolved": "https://registry.npmjs.org/tfhe/-/tfhe-0.8.2.tgz",
- "integrity": "sha512-p/QQRGGaE3z8BSTFCCOGPLHnQQjtES2AhYLPNUl9vdIb6NdJIc2p7qU+7fWbGtzJnCmGaQZmbLA6788cL3WlCg==",
+ "version": "0.8.4",
+ "resolved": "https://registry.npmjs.org/tfhe/-/tfhe-0.8.4.tgz",
+ "integrity": "sha512-PUXfFo2iIZn3XRTyYaCGomDBz7ImPLS3qYoctYeIsUF8kKdx2yXZ+Uz7rJ/D6vRS630rZRR/NNSzGLpPKeSjfA==",
"dev": true
},
"node_modules/then-request": {
diff --git a/package.json b/package.json
index 1bc66eec..549cf02b 100644
--- a/package.json
+++ b/package.json
@@ -71,7 +71,7 @@
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"ethers": "^6.8.0",
- "fhevmjs": "^0.6.0-1",
+ "fhevmjs": "^0.6.0-3",
"hardhat": "^2.22.10",
"hardhat-deploy": "^0.11.29",
"hardhat-gas-reporter": "^1.0.2",
From d3214a1dea26f69bfe7919b11cbb91c2c6a00c1e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?=
Date: Sat, 19 Oct 2024 13:48:44 +0200
Subject: [PATCH 49/51] feat: checks if userAddress is diff than
contractAddress in reencrypt
---
test/fhevmjsMocked.ts | 3 +++
1 file changed, 3 insertions(+)
diff --git a/test/fhevmjsMocked.ts b/test/fhevmjsMocked.ts
index 9b1932f3..8018f3b0 100644
--- a/test/fhevmjsMocked.ts
+++ b/test/fhevmjsMocked.ts
@@ -147,6 +147,9 @@ export const reencryptRequestMocked = async (
if (!isAllowed) {
throw new Error('User is not authorized to reencrypt this handle!');
}
+ if (userAddress === contractAddress) {
+ throw new Error('userAddress should not be equal to contractAddress when requesting reencryption!');
+ }
await awaitCoprocessor();
return BigInt(await getClearText(handle));
};
From 25274131e2653854403f253a5423b28d6cd50e8b Mon Sep 17 00:00:00 2001
From: Silas Davis
Date: Mon, 21 Oct 2024 12:25:44 +0200
Subject: [PATCH 50/51] fix: Various Typescript type checker errors
Also improved a few bits of config
Signed-off-by: Silas Davis
---
.prettierrc.json | 2 +-
@types/fhevmjs/index.d.ts | 3 +
codegen/testgen.ts | 2 +-
hardhat.config.ts | 11 +-
hardhat.config.types.ts | 21 +++
lib/ACL.sol | 2 +-
package-lock.json | 18 +++
package.json | 4 +-
tasks/environment.ts | 7 +
tasks/taskDeploy.ts | 9 +-
tasks/taskGatewayRelayer.ts | 12 +-
tasks/upgradeProxy.ts | 1 -
test/asyncDecrypt.ts | 61 +++++----
test/coprocessorUtils.ts | 165 ++++++++++++------------
test/fhevmjsMocked.ts | 28 ++--
test/fhevmjsTest/fhevmjsTest.ts | 2 +-
test/gatewayDecrypt/testAsyncDecrypt.ts | 2 +-
test/governor/GovernorZama.fixture.ts | 2 +-
test/instance.ts | 34 +++--
test/rand/Rand.ts | 32 ++---
test/reencryption/reencryption.ts | 3 +-
test/signers.ts | 18 +--
test/tfheOperations/manual.ts | 12 +-
test/tfheOperations/tfheOperations1.ts | 31 ++---
test/tfheOperations/tfheOperations10.ts | 36 ++----
test/tfheOperations/tfheOperations11.ts | 36 ++----
test/tfheOperations/tfheOperations12.ts | 32 ++---
test/tfheOperations/tfheOperations13.ts | 36 ++----
test/tfheOperations/tfheOperations2.ts | 36 ++----
test/tfheOperations/tfheOperations3.ts | 31 ++---
test/tfheOperations/tfheOperations4.ts | 36 ++----
test/tfheOperations/tfheOperations5.ts | 36 ++----
test/tfheOperations/tfheOperations6.ts | 36 ++----
test/tfheOperations/tfheOperations7.ts | 36 ++----
test/tfheOperations/tfheOperations8.ts | 36 ++----
test/tfheOperations/tfheOperations9.ts | 34 ++---
test/types.ts | 3 +-
test/upgrades/upgrades.ts | 4 +-
tsconfig.json | 4 +-
39 files changed, 455 insertions(+), 459 deletions(-)
create mode 100644 @types/fhevmjs/index.d.ts
create mode 100644 hardhat.config.types.ts
create mode 100644 tasks/environment.ts
diff --git a/.prettierrc.json b/.prettierrc.json
index c9b04323..80d9b104 100644
--- a/.prettierrc.json
+++ b/.prettierrc.json
@@ -1,6 +1,6 @@
{
"printWidth": 120,
- "plugins": ["@trivago/prettier-plugin-sort-imports", "prettier-plugin-solidity"],
+ "plugins": ["prettier-plugin-organize-imports", "prettier-plugin-solidity"],
"overrides": [
{
"files": ["*.ts", ".js", ".cjs"],
diff --git a/@types/fhevmjs/index.d.ts b/@types/fhevmjs/index.d.ts
new file mode 100644
index 00000000..9fcadcf9
--- /dev/null
+++ b/@types/fhevmjs/index.d.ts
@@ -0,0 +1,3 @@
+// This is a horrible hack, see: https://github.com/zama-ai/fhevm/issues/582
+
+export * from 'fhevmjs/web';
diff --git a/codegen/testgen.ts b/codegen/testgen.ts
index 1e4ca03b..d17f3b64 100644
--- a/codegen/testgen.ts
+++ b/codegen/testgen.ts
@@ -70,7 +70,7 @@ function generateIntroTestCode(shards: OverloadShard[], idxSplit: number): strin
`);
shards.forEach((os) => {
intro.push(`
- import type { TFHETestSuite${os.shardNumber} } from '../../types/contracts/tests/TFHETestSuite${os.shardNumber}';
+ import type { TFHETestSuite${os.shardNumber} } from '../../types';
`);
});
diff --git a/hardhat.config.ts b/hardhat.config.ts
index 8179d1f6..0108e2e7 100644
--- a/hardhat.config.ts
+++ b/hardhat.config.ts
@@ -3,13 +3,11 @@ import '@openzeppelin/hardhat-upgrades';
import dotenv from 'dotenv';
import 'hardhat-deploy';
import 'hardhat-ignore-warnings';
-import type { HardhatUserConfig, extendProvider } from 'hardhat/config';
-import { task } from 'hardhat/config';
+import { extendProvider, HardhatUserConfig, task } from 'hardhat/config';
import type { NetworkUserConfig } from 'hardhat/types';
import { resolve } from 'path';
-
import CustomProvider from './CustomProvider';
-// Adjust the import path as needed
+import './hardhat.config.types';
import './tasks/accounts';
import './tasks/etherscanVerify';
import './tasks/getEthereumAddress';
@@ -19,7 +17,7 @@ import './tasks/taskGatewayRelayer';
import './tasks/taskTFHE';
import './tasks/upgradeProxy';
-extendProvider(async (provider, config, network) => {
+extendProvider(async (provider) => {
const newProvider = new CustomProvider(provider);
return newProvider;
});
@@ -53,6 +51,7 @@ const chainIds = {
function getChainConfig(chain: keyof typeof chainIds): NetworkUserConfig {
let jsonRpcUrl: string;
+ let gatewayUrl: string = 'http://localhost:7077';
switch (chain) {
case 'local':
jsonRpcUrl = 'http://localhost:8545';
@@ -68,6 +67,7 @@ function getChainConfig(chain: keyof typeof chainIds): NetworkUserConfig {
break;
case 'zama':
jsonRpcUrl = 'https://devnet.zama.ai';
+ gatewayUrl = 'https://gateway.devnet.zama.ai';
break;
case 'sepolia':
jsonRpcUrl = process.env.SEPOLIA_RPC_URL!;
@@ -80,6 +80,7 @@ function getChainConfig(chain: keyof typeof chainIds): NetworkUserConfig {
},
chainId: chainIds[chain],
url: jsonRpcUrl,
+ gatewayUrl,
};
}
diff --git a/hardhat.config.types.ts b/hardhat.config.types.ts
new file mode 100644
index 00000000..a8a0996c
--- /dev/null
+++ b/hardhat.config.types.ts
@@ -0,0 +1,21 @@
+import 'hardhat/types/config';
+import 'hardhat/types/runtime';
+
+// Merge types for extension config
+
+declare module 'hardhat/types/config' {
+ export interface HttpNetworkUserConfig {
+ gatewayUrl?: string;
+ }
+ export interface HttpNetworkConfig {
+ gatewayUrl?: string;
+ }
+}
+
+declare module 'hardhat/types/runtime' {
+ // This is an example of an extension to the Hardhat Runtime Environment.
+ // This new field will be available in tasks' actions, scripts, and tests.
+ export interface HardhatRuntimeEnvironment {
+ __SOLIDITY_COVERAGE_RUNNING: boolean;
+ }
+}
diff --git a/lib/ACL.sol b/lib/ACL.sol
index 6c79a6cc..3a35df65 100644
--- a/lib/ACL.sol
+++ b/lib/ACL.sol
@@ -149,7 +149,7 @@ contract ACL is UUPSUpgradeable, Ownable2StepUpgradeable {
emit AllowedForDecryption(handlesList);
}
- function isAllowedForDecryption(uint256 handle) public virtual returns (bool) {
+ function isAllowedForDecryption(uint256 handle) public view virtual returns (bool) {
ACLStorage storage $ = _getACLStorage();
return $.allowedForDecryption[handle];
}
diff --git a/package-lock.json b/package-lock.json
index 61cbcdbc..6a965a2b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -49,6 +49,7 @@
"lodash": "^4.17.21",
"mocha": "^10.1.0",
"prettier": "^3.0.0",
+ "prettier-plugin-organize-imports": "^4.1.0",
"prettier-plugin-solidity": "^1.1.3",
"rimraf": "^4.1.2",
"solidity-coverage": "0.8.12",
@@ -8469,6 +8470,23 @@
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
+ "node_modules/prettier-plugin-organize-imports": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.1.0.tgz",
+ "integrity": "sha512-5aWRdCgv645xaa58X8lOxzZoiHAldAPChljr/MT0crXVOWTZ+Svl4hIWlz+niYSlO6ikE5UXkN1JrRvIP2ut0A==",
+ "dev": true,
+ "license": "MIT",
+ "peerDependencies": {
+ "prettier": ">=2.0",
+ "typescript": ">=2.9",
+ "vue-tsc": "^2.1.0"
+ },
+ "peerDependenciesMeta": {
+ "vue-tsc": {
+ "optional": true
+ }
+ }
+ },
"node_modules/prettier-plugin-solidity": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.4.1.tgz",
diff --git a/package.json b/package.json
index 549cf02b..297315f5 100644
--- a/package.json
+++ b/package.json
@@ -14,8 +14,9 @@
"clean": "rimraf ./artifacts ./cache ./coverage ./types ./coverage.json && npm run typechain",
"compile": "cross-env TS_NODE_TRANSPILE_ONLY=true hardhat compile",
"deploy:contracts": "hardhat deploy",
- "lint": "npm run lint:sol && npm run lint:ts && npm run prettier:check",
+ "lint": "npm run lint:sol && npm run lint:ts && npm run prettier:check && lint:tsc",
"lint:ts": "eslint --ignore-path ./.eslintignore --ext .js,.ts .",
+ "lint:tsc": "tsc --noEmit",
"prettier:check": "prettier --check \"**/*.{js,json,md,sol,ts,yml}\"",
"prettier": "prettier --write \"**/*.{js,json,md,sol,ts,yml}\"",
"test:inband": "hardhat test",
@@ -79,6 +80,7 @@
"lodash": "^4.17.21",
"mocha": "^10.1.0",
"prettier": "^3.0.0",
+ "prettier-plugin-organize-imports": "^4.1.0",
"prettier-plugin-solidity": "^1.1.3",
"rimraf": "^4.1.2",
"solidity-coverage": "0.8.12",
diff --git a/tasks/environment.ts b/tasks/environment.ts
new file mode 100644
index 00000000..1ff9094a
--- /dev/null
+++ b/tasks/environment.ts
@@ -0,0 +1,7 @@
+export function mustGetEnv(name: string): string {
+ const value = process.env[name];
+ if (!value) {
+ throw new Error(`Missing env variable ${name}`);
+ }
+ return value;
+}
diff --git a/tasks/taskDeploy.ts b/tasks/taskDeploy.ts
index 4d0568c6..aa0ba56f 100644
--- a/tasks/taskDeploy.ts
+++ b/tasks/taskDeploy.ts
@@ -2,6 +2,8 @@ import dotenv from 'dotenv';
import fs from 'fs';
import { task, types } from 'hardhat/config';
import type { TaskArguments } from 'hardhat/types';
+import { KMSVerifier__factory } from '../types';
+import { mustGetEnv } from './environment';
task('task:deployGateway')
.addParam('privateKey', 'The deployer private key')
@@ -128,18 +130,17 @@ task('task:addSigners')
)
.setAction(async function (taskArguments: TaskArguments, { ethers }) {
const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
- const factory = await ethers.getContractFactory('KMSVerifier', deployer);
const kmsAdd = dotenv.parse(fs.readFileSync('lib/.env.kmsverifier')).KMS_VERIFIER_CONTRACT_ADDRESS;
- const kmsVerifier = await factory.attach(kmsAdd);
+ const kmsVerifier = KMSVerifier__factory.connect(kmsAdd, deployer);
for (let idx = 0; idx < taskArguments.numSigners; idx++) {
if (!taskArguments.useAddress) {
- const privKeySigner = process.env[`PRIVATE_KEY_KMS_SIGNER_${idx}`];
+ const privKeySigner = mustGetEnv(`PRIVATE_KEY_KMS_SIGNER_${idx}`);
const kmsSigner = new ethers.Wallet(privKeySigner).connect(ethers.provider);
const tx = await kmsVerifier.addSigner(kmsSigner.address);
await tx.wait();
console.log(`KMS signer no${idx} (${kmsSigner.address}) was added to KMSVerifier contract`);
} else {
- const kmsSignerAddress = process.env[`ADDRESS_KMS_SIGNER_${idx}`];
+ const kmsSignerAddress = mustGetEnv(`ADDRESS_KMS_SIGNER_${idx}`);
const tx = await kmsVerifier.addSigner(kmsSignerAddress);
await tx.wait();
console.log(`KMS signer no${idx} (${kmsSignerAddress}) was added to KMSVerifier contract`);
diff --git a/tasks/taskGatewayRelayer.ts b/tasks/taskGatewayRelayer.ts
index a2da8d2b..2371cb00 100644
--- a/tasks/taskGatewayRelayer.ts
+++ b/tasks/taskGatewayRelayer.ts
@@ -5,6 +5,7 @@ import { task, types } from 'hardhat/config';
import type { TaskArguments } from 'hardhat/types';
import path from 'path';
import { promisify } from 'util';
+import { mustGetEnv } from './environment';
const exec = promisify(oldExec);
@@ -93,13 +94,10 @@ task('task:launchFhevm')
.setAction(async function (taskArgs, hre) {
const privKeyDeployer = process.env.PRIVATE_KEY_GATEWAY_DEPLOYER;
const deployerAddress = new hre.ethers.Wallet(privKeyDeployer!).address;
- let relayerAddress;
- if (!taskArgs.useAddress) {
- const privKeyRelayer = process.env.PRIVATE_KEY_GATEWAY_RELAYER;
- relayerAddress = new hre.ethers.Wallet(privKeyRelayer!).address;
- } else {
- relayerAddress = process.env.ADDRESS_GATEWAY_RELAYER;
- }
+ const relayerAddress = !taskArgs.useAddress
+ ? new hre.ethers.Wallet(mustGetEnv('PRIVATE_KEY_GATEWAY_RELAYER')).address
+ : mustGetEnv('process.env.ADDRESS_GATEWAY_RELAYER');
+
if (!taskArgs.skipGetCoin) {
if (hre.network.name === 'hardhat') {
const bal = '0x1000000000000000000000000000000000000000';
diff --git a/tasks/upgradeProxy.ts b/tasks/upgradeProxy.ts
index 3971b2fd..4ec8c61e 100644
--- a/tasks/upgradeProxy.ts
+++ b/tasks/upgradeProxy.ts
@@ -1,4 +1,3 @@
-import { HardhatEthersHelpers } from '@nomicfoundation/hardhat-ethers/types';
import { HardhatUpgrades } from '@openzeppelin/hardhat-upgrades';
import dotenv from 'dotenv';
import fs from 'fs';
diff --git a/test/asyncDecrypt.ts b/test/asyncDecrypt.ts
index 164a7010..992911a4 100644
--- a/test/asyncDecrypt.ts
+++ b/test/asyncDecrypt.ts
@@ -1,9 +1,8 @@
import dotenv from 'dotenv';
-import { Wallet } from 'ethers';
+import { LogDescription, Wallet } from 'ethers';
import fs from 'fs';
-import { ethers, network } from 'hardhat';
-
-import { GatewayContract } from '../types';
+import hre, { ethers, network } from 'hardhat';
+import { ACL__factory, GatewayContract__factory } from '../types';
import { awaitCoprocessor, getClearText } from './coprocessorUtils';
import { waitNBlocks } from './utils';
@@ -27,6 +26,17 @@ const CiphertextType = {
11: 'bytes',
};
+function isCipherTextType(type: number): type is keyof typeof CiphertextType {
+ return type in CiphertextType;
+}
+
+function mustGetCiphertextType(type: number): (typeof CiphertextType)[keyof typeof CiphertextType] {
+ if (!isCipherTextType(type)) {
+ throw new Error(`Invalid ciphertext type: ${type}`);
+ }
+ return CiphertextType[type];
+}
+
const currentTime = (): string => {
const now = new Date();
return now.toLocaleTimeString('en-US', { hour12: true, hour: 'numeric', minute: 'numeric', second: 'numeric' });
@@ -46,35 +56,33 @@ const ifaceEventDecryption = new ethers.Interface(['event EventDecryption' + arg
const argEvents2 = '(uint256 indexed requestID, bool success, bytes result)';
const ifaceResultCallback = new ethers.Interface(['event ResultCallback' + argEvents2]);
-let gateway: GatewayContract;
+const gateway = GatewayContract__factory.connect(parsedEnv.GATEWAY_CONTRACT_PREDEPLOY_ADDRESS);
let firstBlockListening: number;
let lastBlockSnapshotForDecrypt: number;
export const initGateway = async (): Promise => {
firstBlockListening = await ethers.provider.getBlockNumber();
- if (networkName === 'hardhat' && hre.__SOLIDITY_COVERAGE_RUNNING !== true) {
+ if (networkName === 'hardhat' && !hre.__SOLIDITY_COVERAGE_RUNNING) {
// evm_snapshot is not supported in coverage mode
await ethers.provider.send('set_lastBlockSnapshotForDecrypt', [firstBlockListening]);
}
// this function will emit logs for every request and fulfilment of a decryption
- gateway = await ethers.getContractAt('GatewayContract', parsedEnv.GATEWAY_CONTRACT_PREDEPLOY_ADDRESS);
- gateway.on(
- 'EventDecryption',
- async (requestID, cts, contractCaller, callbackSelector, msgValue, maxTimestamp, eventData) => {
- const blockNumber = eventData.log.blockNumber;
+ await gateway.on(
+ gateway.getEvent('EventDecryption'),
+ async (requestID, cts, contractCaller, callbackSelector, msgValue, maxTimestamp, passSignaturesToCaller, log) => {
+ const blockNumber = log.blockNumber;
console.log(`${await currentTime()} - Requested decrypt on block ${blockNumber} (requestID ${requestID})`);
},
);
- gateway.on('ResultCallback', async (requestID, success, result, eventData) => {
- const blockNumber = eventData.log.blockNumber;
+ await gateway.on(gateway.getEvent('ResultCallback'), async (requestID, success, result, log) => {
+ const blockNumber = log.blockNumber;
console.log(`${await currentTime()} - Fulfilled decrypt on block ${blockNumber} (requestID ${requestID})`);
});
};
export const awaitAllDecryptionResults = async (): Promise => {
- gateway = await ethers.getContractAt('GatewayContract', parsedEnv.GATEWAY_CONTRACT_PREDEPLOY_ADDRESS);
const provider = ethers.provider;
- if (networkName === 'hardhat' && hre.__SOLIDITY_COVERAGE_RUNNING !== true) {
+ if (networkName === 'hardhat' && !hre.__SOLIDITY_COVERAGE_RUNNING) {
// evm_snapshot is not supported in coverage mode
lastBlockSnapshotForDecrypt = await provider.send('get_lastBlockSnapshotForDecrypt');
if (lastBlockSnapshotForDecrypt < firstBlockListening) {
@@ -83,14 +91,14 @@ export const awaitAllDecryptionResults = async (): Promise => {
}
await fulfillAllPastRequestsIds(networkName === 'hardhat');
firstBlockListening = (await ethers.provider.getBlockNumber()) + 1;
- if (networkName === 'hardhat' && hre.__SOLIDITY_COVERAGE_RUNNING !== true) {
+ if (networkName === 'hardhat' && !hre.__SOLIDITY_COVERAGE_RUNNING) {
// evm_snapshot is not supported in coverage mode
await provider.send('set_lastBlockSnapshotForDecrypt', [firstBlockListening]);
}
};
-const getAlreadyFulfilledDecryptions = async (): Promise<[bigint]> => {
- let results = [];
+const getAlreadyFulfilledDecryptions = async (): Promise => {
+ let results: (null | LogDescription)[] = [];
const eventDecryptionResult = await gateway.filters.ResultCallback().getTopicFilter();
const filterDecryptionResult = {
address: parsedEnv.GATEWAY_CONTRACT_PREDEPLOY_ADDRESS,
@@ -99,9 +107,9 @@ const getAlreadyFulfilledDecryptions = async (): Promise<[bigint]> => {
topics: eventDecryptionResult,
};
const pastResults = await ethers.provider.getLogs(filterDecryptionResult);
- results = results.concat(pastResults.map((result) => ifaceResultCallback.parseLog(result).args[0]));
+ results = results.concat(pastResults.map((result) => ifaceResultCallback.parseLog(result)));
- return results;
+ return results.filter((r): r is LogDescription => !!r).map((r) => BigInt(r?.args[0]));
};
const allTrue = (arr: boolean[], fn = Boolean) => arr.every(fn);
@@ -118,8 +126,12 @@ const fulfillAllPastRequestsIds = async (mocked: boolean) => {
const pastRequests = await ethers.provider.getLogs(filterDecryption);
for (const request of pastRequests) {
const event = ifaceEventDecryption.parseLog(request);
+ if (!event) {
+ throw new Error(`Could not parse event: ${request}`);
+ }
+ // TODO: get strongly typed event, this should be possible from typechain
const requestID = event.args[0];
- const handles = event.args[1];
+ const handles = (event.args[1] as (number | bigint | string)[]).map(BigInt);
const typesList = handles.map((handle) => parseInt(handle.toString(16).slice(-4, -2), 16));
const msgValue = event.args[4];
const passSignaturesToCaller = event.args[6];
@@ -130,13 +142,12 @@ const fulfillAllPastRequestsIds = async (mocked: boolean) => {
await awaitCoprocessor();
// first check tat all handles are allowed for decryption
- const aclFactory = await ethers.getContractFactory('ACL');
- const acl = aclFactory.attach(aclAdd);
- const isAllowedForDec = await Promise.all(handles.map(async (handle) => acl.isAllowedForDecryption(handle)));
+ const acl = ACL__factory.connect(aclAdd);
+ const isAllowedForDec = await Promise.all(handles.map((handle) => acl.isAllowedForDecryption(handle)));
if (!allTrue(isAllowedForDec)) {
throw new Error('Some handle is not authorized for decryption');
}
- const types = typesList.map((num) => CiphertextType[num]);
+ const types = typesList.map((num) => mustGetCiphertextType(num));
const values = await Promise.all(handles.map(async (handle) => BigInt(await getClearText(handle))));
const valuesFormatted = values.map((value, index) =>
types[index] === 'address' ? '0x' + value.toString(16).padStart(40, '0') : value,
diff --git a/test/coprocessorUtils.ts b/test/coprocessorUtils.ts
index 42222fea..c1e7864d 100644
--- a/test/coprocessorUtils.ts
+++ b/test/coprocessorUtils.ts
@@ -1,8 +1,8 @@
import dotenv from 'dotenv';
+import { FunctionFragment } from 'ethers';
import { log2 } from 'extra-bigint';
import * as fs from 'fs';
-import { ethers } from 'hardhat';
-import hre from 'hardhat';
+import hre, { ethers } from 'hardhat';
import { Database } from 'sqlite3';
const parsedEnvCoprocessor = dotenv.parse(fs.readFileSync('lib/.env.exec'));
@@ -23,18 +23,21 @@ const contractABI = JSON.parse(fs.readFileSync('artifacts/lib/TFHEExecutor.sol/T
const iface = new ethers.Interface(contractABI);
-const functions = iface.fragments.filter((fragment) => fragment.type === 'function');
+const functions = iface.fragments.filter((fragment): fragment is FunctionFragment => fragment.type === 'function');
-const selectors = functions.reduce((acc, func) => {
- const signature = `${func.name}(${func.inputs.map((input) => input.type).join(',')})`;
- acc[func.selector] = signature;
- return acc;
-}, {});
+const selectors = functions.reduce(
+ (acc, func) => {
+ const signature = `${func.name}(${func.inputs.map((input) => input.type).join(',')})`;
+ acc[func.selector] = signature;
+ return acc;
+ },
+ {} as Record,
+);
//const db = new Database('./sql.db'); // on-disk db for debugging
const db = new Database(':memory:');
-export function insertSQL(handle: string, clearText: BigInt, replace: boolean = false) {
+export function insertSQL(handle: string, clearText: bigint, replace: boolean = false) {
if (replace) {
// this is useful if using snapshots while sampling different random numbers on each revert
db.run('INSERT OR REPLACE INTO ciphertexts (handle, clearText) VALUES (?, ?)', [handle, clearText.toString()]);
@@ -43,9 +46,13 @@ export function insertSQL(handle: string, clearText: BigInt, replace: boolean =
}
}
+type Row = {
+ clearText: string;
+};
+
// Decrypt any handle, bypassing ACL
// WARNING : only for testing or internal use
-export const getClearText = async (handle: BigInt): Promise => {
+export const getClearText = async (handle: bigint | number): Promise => {
const handleStr = '0x' + handle.toString(16).padStart(64, '0');
return new Promise((resolve, reject) => {
@@ -57,7 +64,8 @@ export const getClearText = async (handle: BigInt): Promise => {
if (err) {
reject(new Error(`Error querying database: ${err.message}`));
} else if (row) {
- resolve(row.clearText);
+ // FIXME: parse rather than assert row type
+ resolve((row as Row).clearText);
} else if (attempts < maxRetries) {
attempts++;
executeQuery();
@@ -122,21 +130,6 @@ function extractCalldata(memory: string[], offset: number, size: number): string
return calldata.slice(calldataStart, calldataEnd);
}
-const TypesBytesSize = {
- 0: 1, //ebool
- 1: 1, //euint4
- 2: 1, //euint8
- 3: 2, //euint16
- 4: 4, //euint32
- 5: 8, //euint64
- 6: 16, //euint128
- 7: 20, //eaddress
- 8: 32, //euint256
- 9: 64, //ebytes64
- 10: 128, //ebytes128
- 11: 256, //ebytes256
-};
-
const NumBits = {
0: 1n, //ebool
1: 4n, //euint4
@@ -152,10 +145,21 @@ const NumBits = {
11: 2048n, //ebytes256
};
+function isNumBitsIdx(idx: number): idx is keyof typeof NumBits {
+ return idx in NumBits;
+}
+
+function getNumBits(idx: number): (typeof NumBits)[keyof typeof NumBits] {
+ if (!isNumBitsIdx(idx)) {
+ throw new Error(`Invalid NumBits index: ${idx}`);
+ }
+ return NumBits[idx];
+}
+
const HANDLE_VERSION = 0;
export function numberToEvenHexString(num: number) {
- if (typeof num !== 'number' || num < 0) {
+ if (num < 0) {
throw new Error('Input should be a non-negative number.');
}
let hexString = num.toString(16);
@@ -186,7 +190,7 @@ function getRandomBigInt(numBits: number): bigint {
}
async function insertHandle(
- obj2: EvmState,
+ obj2: { value: EvmState; index: number },
validIdxes: [number],
blockStatus: {
blockhash: string;
@@ -194,7 +198,7 @@ async function insertHandle(
},
) {
const obj = obj2.value;
- if (isCoprocAdd(obj!.stack.at(-2))) {
+ if (isCoprocAdd(obj?.stack?.at(-2))) {
const argsOffset = Number(`0x${obj!.stack.at(-4)}`);
const argsSize = Number(`0x${obj!.stack.at(-5)}`);
const calldata = extractCalldata(obj.memory, argsOffset, argsSize);
@@ -249,11 +253,11 @@ async function insertHandle(
clearLHS = await getClearText(decodedData[0]);
if (decodedData[2] === '0x01') {
clearText = BigInt(clearLHS) + decodedData[1];
- clearText = clearText % 2n ** NumBits[resultType];
+ clearText = clearText % 2n ** getNumBits(resultType);
} else {
clearRHS = await getClearText(decodedData[1]);
clearText = BigInt(clearLHS) + BigInt(clearRHS);
- clearText = clearText % 2n ** NumBits[resultType];
+ clearText = clearText % 2n ** getNumBits(resultType);
}
insertSQL(handle, clearText);
break;
@@ -271,13 +275,13 @@ async function insertHandle(
clearLHS = await getClearText(decodedData[0]);
if (decodedData[2] === '0x01') {
clearText = BigInt(clearLHS) - decodedData[1];
- if (clearText < 0n) clearText = clearText + 2n ** NumBits[resultType];
- clearText = clearText % 2n ** NumBits[resultType];
+ if (clearText < 0n) clearText = clearText + 2n ** getNumBits(resultType);
+ clearText = clearText % 2n ** getNumBits(resultType);
} else {
clearRHS = await getClearText(decodedData[1]);
clearText = BigInt(clearLHS) - BigInt(clearRHS);
- if (clearText < 0n) clearText = clearText + 2n ** NumBits[resultType];
- clearText = clearText % 2n ** NumBits[resultType];
+ if (clearText < 0n) clearText = clearText + 2n ** getNumBits(resultType);
+ clearText = clearText % 2n ** getNumBits(resultType);
}
insertSQL(handle, clearText);
break;
@@ -295,11 +299,11 @@ async function insertHandle(
clearLHS = await getClearText(decodedData[0]);
if (decodedData[2] === '0x01') {
clearText = BigInt(clearLHS) * decodedData[1];
- clearText = clearText % 2n ** NumBits[resultType];
+ clearText = clearText % 2n ** getNumBits(resultType);
} else {
clearRHS = await getClearText(decodedData[1]);
clearText = BigInt(clearLHS) * BigInt(clearRHS);
- clearText = clearText % 2n ** NumBits[resultType];
+ clearText = clearText % 2n ** getNumBits(resultType);
}
insertSQL(handle, clearText);
break;
@@ -355,11 +359,11 @@ async function insertHandle(
clearLHS = await getClearText(decodedData[0]);
if (decodedData[2] === '0x01') {
clearText = BigInt(clearLHS) & decodedData[1];
- clearText = clearText % 2n ** NumBits[resultType];
+ clearText = clearText % 2n ** getNumBits(resultType);
} else {
clearRHS = await getClearText(decodedData[1]);
clearText = BigInt(clearLHS) & BigInt(clearRHS);
- clearText = clearText % 2n ** NumBits[resultType];
+ clearText = clearText % 2n ** getNumBits(resultType);
}
insertSQL(handle, clearText);
break;
@@ -377,11 +381,11 @@ async function insertHandle(
clearLHS = await getClearText(decodedData[0]);
if (decodedData[2] === '0x01') {
clearText = BigInt(clearLHS) | decodedData[1];
- clearText = clearText % 2n ** NumBits[resultType];
+ clearText = clearText % 2n ** getNumBits(resultType);
} else {
clearRHS = await getClearText(decodedData[1]);
clearText = BigInt(clearLHS) | BigInt(clearRHS);
- clearText = clearText % 2n ** NumBits[resultType];
+ clearText = clearText % 2n ** getNumBits(resultType);
}
insertSQL(handle, clearText);
break;
@@ -399,11 +403,11 @@ async function insertHandle(
clearLHS = await getClearText(decodedData[0]);
if (decodedData[2] === '0x01') {
clearText = BigInt(clearLHS) ^ decodedData[1];
- clearText = clearText % 2n ** NumBits[resultType];
+ clearText = clearText % 2n ** getNumBits(resultType);
} else {
clearRHS = await getClearText(decodedData[1]);
clearText = BigInt(clearLHS) ^ BigInt(clearRHS);
- clearText = clearText % 2n ** NumBits[resultType];
+ clearText = clearText % 2n ** getNumBits(resultType);
}
insertSQL(handle, clearText);
break;
@@ -420,12 +424,12 @@ async function insertHandle(
handle = appendType(handle, resultType);
clearLHS = await getClearText(decodedData[0]);
if (decodedData[2] === '0x01') {
- clearText = BigInt(clearLHS) << decodedData[1] % NumBits[resultType];
- clearText = clearText % 2n ** NumBits[resultType];
+ clearText = BigInt(clearLHS) << decodedData[1] % getNumBits(resultType);
+ clearText = clearText % 2n ** getNumBits(resultType);
} else {
clearRHS = await getClearText(decodedData[1]);
- clearText = BigInt(clearLHS) << BigInt(clearRHS) % NumBits[resultType];
- clearText = clearText % 2n ** NumBits[resultType];
+ clearText = BigInt(clearLHS) << BigInt(clearRHS) % getNumBits(resultType);
+ clearText = clearText % 2n ** getNumBits(resultType);
}
insertSQL(handle, clearText);
break;
@@ -442,12 +446,12 @@ async function insertHandle(
handle = appendType(handle, resultType);
clearLHS = await getClearText(decodedData[0]);
if (decodedData[2] === '0x01') {
- clearText = BigInt(clearLHS) >> decodedData[1] % NumBits[resultType];
- clearText = clearText % 2n ** NumBits[resultType];
+ clearText = BigInt(clearLHS) >> decodedData[1] % getNumBits(resultType);
+ clearText = clearText % 2n ** getNumBits(resultType);
} else {
clearRHS = await getClearText(decodedData[1]);
- clearText = BigInt(clearLHS) >> BigInt(clearRHS) % NumBits[resultType];
- clearText = clearText % 2n ** NumBits[resultType];
+ clearText = BigInt(clearLHS) >> BigInt(clearRHS) % getNumBits(resultType);
+ clearText = clearText % 2n ** getNumBits(resultType);
}
insertSQL(handle, clearText);
break;
@@ -465,14 +469,14 @@ async function insertHandle(
clearLHS = await getClearText(decodedData[0]);
if (decodedData[2] === '0x01') {
- shift = decodedData[1] % NumBits[resultType];
- clearText = (BigInt(clearLHS) << shift) | (BigInt(clearLHS) >> (NumBits[resultType] - shift));
- clearText = clearText % 2n ** NumBits[resultType];
+ shift = decodedData[1] % getNumBits(resultType);
+ clearText = (BigInt(clearLHS) << shift) | (BigInt(clearLHS) >> (getNumBits(resultType) - shift));
+ clearText = clearText % 2n ** getNumBits(resultType);
} else {
clearRHS = await getClearText(decodedData[1]);
- shift = BigInt(clearRHS) % NumBits[resultType];
- clearText = (BigInt(clearLHS) << shift) | (BigInt(clearLHS) >> (NumBits[resultType] - shift));
- clearText = clearText % 2n ** NumBits[resultType];
+ shift = BigInt(clearRHS) % getNumBits(resultType);
+ clearText = (BigInt(clearLHS) << shift) | (BigInt(clearLHS) >> (getNumBits(resultType) - shift));
+ clearText = clearText % 2n ** getNumBits(resultType);
}
insertSQL(handle, clearText);
break;
@@ -490,14 +494,14 @@ async function insertHandle(
clearLHS = await getClearText(decodedData[0]);
if (decodedData[2] === '0x01') {
- shift = decodedData[1] % NumBits[resultType];
- clearText = (BigInt(clearLHS) >> shift) | (BigInt(clearLHS) << (NumBits[resultType] - shift));
- clearText = clearText % 2n ** NumBits[resultType];
+ shift = decodedData[1] % getNumBits(resultType);
+ clearText = (BigInt(clearLHS) >> shift) | (BigInt(clearLHS) << (getNumBits(resultType) - shift));
+ clearText = clearText % 2n ** getNumBits(resultType);
} else {
clearRHS = await getClearText(decodedData[1]);
- shift = BigInt(clearRHS) % NumBits[resultType];
- clearText = (BigInt(clearLHS) >> shift) | (BigInt(clearLHS) << (NumBits[resultType] - shift));
- clearText = clearText % 2n ** NumBits[resultType];
+ shift = BigInt(clearRHS) % getNumBits(resultType);
+ clearText = (BigInt(clearLHS) >> shift) | (BigInt(clearLHS) << (getNumBits(resultType) - shift));
+ clearText = clearText % 2n ** getNumBits(resultType);
}
insertSQL(handle, clearText);
break;
@@ -694,7 +698,7 @@ async function insertHandle(
[Operators.cast, decodedData[0], decodedData[1], aclAddress, chainId],
),
);
- clearText = BigInt(await getClearText(decodedData[0])) % 2n ** NumBits[resultType];
+ clearText = BigInt(await getClearText(decodedData[0])) % 2n ** getNumBits(resultType);
handle = appendType(handle, resultType);
insertSQL(handle, clearText);
break;
@@ -709,7 +713,7 @@ async function insertHandle(
);
handle = appendType(handle, resultType);
clearText = BigInt(await getClearText(decodedData[0]));
- clearText = bitwiseNotUintBits(clearText, Number(NumBits[resultType]));
+ clearText = bitwiseNotUintBits(clearText, Number(getNumBits(resultType)));
insertSQL(handle, clearText);
break;
@@ -723,8 +727,8 @@ async function insertHandle(
);
handle = appendType(handle, resultType);
clearText = BigInt(await getClearText(decodedData[0]));
- clearText = bitwiseNotUintBits(clearText, Number(NumBits[resultType]));
- clearText = (clearText + 1n) % 2n ** NumBits[resultType];
+ clearText = bitwiseNotUintBits(clearText, Number(getNumBits(resultType)));
+ clearText = (clearText + 1n) % 2n ** getNumBits(resultType);
insertSQL(handle, clearText);
break;
@@ -736,7 +740,7 @@ async function insertHandle(
}
break;
- case 'fheIfThenElse(uint256,uint256,uint256)':
+ case 'fheIfThenElse(uint256,uint256,uint256)': {
resultType = parseInt(decodedData[1].toString(16).slice(-4, -2), 16);
handle = ethers.keccak256(
ethers.solidityPacked(
@@ -755,6 +759,7 @@ async function insertHandle(
}
insertSQL(handle, clearText);
break;
+ }
case 'fheRand(bytes1)':
if (validIdxes.includes(obj2.index)) {
@@ -770,7 +775,7 @@ async function insertHandle(
ethers.solidityPacked(['uint8', 'bytes1', 'bytes16'], [Operators.fheRand, decodedData[0], seed]),
);
handle = appendType(handle, resultType);
- clearText = getRandomBigInt(Number(NumBits[resultType]));
+ clearText = getRandomBigInt(Number(getNumBits(resultType)));
insertSQL(handle, clearText, true);
counterRand++;
}
@@ -802,26 +807,24 @@ async function insertHandle(
}
}
-function bitwiseNotUintBits(value: BigInt, numBits: number) {
- if (typeof value !== 'bigint') {
- throw new TypeError('The input value must be a BigInt.');
- }
- if (typeof numBits !== 'number' || numBits <= 0) {
- throw new TypeError('The numBits parameter must be a positive integer.');
- }
-
+function bitwiseNotUintBits(value: bigint, numBits: number) {
// Create the mask with numBits bits set to 1
const BIT_MASK = (BigInt(1) << BigInt(numBits)) - BigInt(1);
return ~value & BIT_MASK;
}
-function isCoprocAdd(longString: string): boolean {
+function isCoprocAdd(longString: string | undefined): boolean {
+ if (!longString) {
+ return false;
+ }
const strippedLongString = longString.replace(/^0+/, '');
const normalizedLongString = strippedLongString.toLowerCase();
return normalizedLongString === coprocAdd;
}
+// TODO: provide proper typings (I've seen a StructLog type somewhere - ethers? viem?)
+
async function processLogs(trace, validSubcallsIndexes, blockStatus) {
for (const obj of trace.structLogs
.map((value, index) => ({ value, index }))
@@ -831,7 +834,7 @@ async function processLogs(trace, validSubcallsIndexes, blockStatus) {
}
export const awaitCoprocessor = async (): Promise => {
- chainId = (await ethers.provider.getNetwork()).chainId;
+ chainId = Number((await ethers.provider.getNetwork()).chainId);
const pastTxHashes = await getAllPastTransactionHashes();
for (const txHash of pastTxHashes) {
const trace = await ethers.provider.send('debug_traceTransaction', [txHash[0]]);
@@ -852,7 +855,7 @@ async function getAllPastTransactionHashes() {
const latestBlockNumber = await provider.getBlockNumber();
let txHashes = [];
- if (hre.__SOLIDITY_COVERAGE_RUNNING !== true) {
+ if (!hre.__SOLIDITY_COVERAGE_RUNNING) {
// evm_snapshot is not supported in coverage mode
[lastBlockSnapshot, lastCounterRand] = await provider.send('get_lastBlockSnapshot');
if (lastBlockSnapshot < firstBlockListening) {
@@ -873,7 +876,7 @@ async function getAllPastTransactionHashes() {
});
}
firstBlockListening = latestBlockNumber + 1;
- if (hre.__SOLIDITY_COVERAGE_RUNNING !== true) {
+ if (!hre.__SOLIDITY_COVERAGE_RUNNING) {
// evm_snapshot is not supported in coverage mode
await provider.send('set_lastBlockSnapshot', [firstBlockListening]);
}
diff --git a/test/fhevmjsMocked.ts b/test/fhevmjsMocked.ts
index 8018f3b0..3cb59e47 100644
--- a/test/fhevmjsMocked.ts
+++ b/test/fhevmjsMocked.ts
@@ -1,16 +1,14 @@
-import { toBigIntBE } from 'bigint-buffer';
-import { toBufferBE } from 'bigint-buffer';
+import { toBigIntBE, toBufferBE } from 'bigint-buffer';
import crypto from 'crypto';
import dotenv from 'dotenv';
import { Wallet, ethers } from 'ethers';
import * as fs from 'fs';
+import hre from 'hardhat';
import { Keccak } from 'sha3';
import { isAddress } from 'web3-validator';
-import { insertSQL } from './coprocessorUtils';
-import { awaitCoprocessor, getClearText } from './coprocessorUtils';
-
-const hre = require('hardhat');
+import { ACL__factory } from '../types';
+import { awaitCoprocessor, getClearText, insertSQL } from './coprocessorUtils';
const parsedEnvACL = dotenv.parse(fs.readFileSync('lib/.env.acl'));
const aclAdd = parsedEnvACL.ACL_CONTRACT_ADDRESS;
@@ -139,8 +137,7 @@ export const reencryptRequestMocked = async (
}
// ACL checking
- const aclFactory = await hre.ethers.getContractFactory('ACL');
- const acl = aclFactory.attach(aclAdd);
+ const acl = ACL__factory.connect(aclAdd);
const userAllowed = await acl.persistAllowed(handle, userAddress);
const contractAllowed = await acl.persistAllowed(handle, contractAddress);
const isAllowed = userAllowed && contractAllowed;
@@ -285,7 +282,7 @@ export const createEncryptedInputMocked = (contractAddress: string, userAddress:
bits.length = 0;
return this;
},
- async encrypt() {
+ async encrypt(): Promise<{ handles: Uint8Array[]; inputProof: Uint8Array }> {
let encrypted = Buffer.alloc(0);
bits.map((v, i) => {
@@ -348,7 +345,7 @@ export const createEncryptedInputMocked = (contractAddress: string, userAddress:
return {
handles,
- inputProof,
+ inputProof: Buffer.from(inputProof, 'hex'),
};
},
};
@@ -361,7 +358,7 @@ function uint8ArrayToHexString(uint8Array: Uint8Array) {
}
function numberToHex(num: number) {
- let hex = num.toString(16);
+ const hex = num.toString(16);
return hex.length % 2 ? '0' + hex : hex;
}
@@ -373,7 +370,6 @@ const checkEncryptedValue = (value: number | bigint, bits: number) => {
} else {
limit = BigInt(2 ** bits - 1);
}
- if (typeof value !== 'number' && typeof value !== 'bigint') throw new Error('Value must be a number or a bigint.');
if (value > limit) {
throw new Error(`The value exceeds the limit for ${bits}bits integer (${limit.toString()}).`);
}
@@ -403,7 +399,7 @@ async function computeInputSignatureCopro(
let signature: string;
const privKeySigner = process.env['PRIVATE_KEY_COPROCESSOR_ACCOUNT'];
if (privKeySigner) {
- const coprocSigner = new Wallet(privKeySigner).connect(ethers.provider);
+ const coprocSigner = new Wallet(privKeySigner).connect(hre.ethers.provider);
signature = await coprocSign(hash, handlesList, userAddress, contractAddress, coprocSigner);
} else {
throw new Error(`Private key for coprocessor not found in environment variables`);
@@ -421,7 +417,7 @@ async function computeInputSignaturesKMS(
for (let idx = 0; idx < numSigners; idx++) {
const privKeySigner = process.env[`PRIVATE_KEY_KMS_SIGNER_${idx}`];
if (privKeySigner) {
- const kmsSigner = new ethers.Wallet(privKeySigner).connect(ethers.provider);
+ const kmsSigner = new ethers.Wallet(privKeySigner).connect(hre.ethers.provider);
const signature = await kmsSign(hash, userAddress, contractAddress, kmsSigner);
signatures.push(signature);
} else {
@@ -439,7 +435,7 @@ async function coprocSign(
signer: Wallet,
): Promise {
const inputAdd = dotenv.parse(fs.readFileSync('lib/.env.inputverifier')).INPUT_VERIFIER_CONTRACT_ADDRESS;
- const chainId = hre.__SOLIDITY_COVERAGE_RUNNING ? 31337 : network.config.chainId;
+ const chainId = hre.__SOLIDITY_COVERAGE_RUNNING ? 31337 : hre.network.config.chainId;
const aclAdd = dotenv.parse(fs.readFileSync('lib/.env.acl')).ACL_CONTRACT_ADDRESS;
const domain = {
@@ -498,7 +494,7 @@ async function kmsSign(
signer: Wallet,
): Promise {
const kmsVerifierAdd = dotenv.parse(fs.readFileSync('lib/.env.kmsverifier')).KMS_VERIFIER_CONTRACT_ADDRESS;
- const chainId = hre.__SOLIDITY_COVERAGE_RUNNING ? 31337 : network.config.chainId;
+ const chainId = hre.__SOLIDITY_COVERAGE_RUNNING ? 31337 : hre.network.config.chainId;
const aclAdd = dotenv.parse(fs.readFileSync('lib/.env.acl')).ACL_CONTRACT_ADDRESS;
const domain = {
diff --git a/test/fhevmjsTest/fhevmjsTest.ts b/test/fhevmjsTest/fhevmjsTest.ts
index cfb76cb2..b66ada62 100644
--- a/test/fhevmjsTest/fhevmjsTest.ts
+++ b/test/fhevmjsTest/fhevmjsTest.ts
@@ -2,7 +2,7 @@ import { expect } from 'chai';
import { createInstances } from '../instance';
import { getSigners, initSigners } from '../signers';
-import { bigIntToBytes64, bigIntToBytes128, bigIntToBytes256 } from '../utils';
+import { bigIntToBytes128, bigIntToBytes64 } from '../utils';
describe('Testing fhevmjs/fhevmjsMocked', function () {
before(async function () {
diff --git a/test/gatewayDecrypt/testAsyncDecrypt.ts b/test/gatewayDecrypt/testAsyncDecrypt.ts
index ece79f50..59faf509 100644
--- a/test/gatewayDecrypt/testAsyncDecrypt.ts
+++ b/test/gatewayDecrypt/testAsyncDecrypt.ts
@@ -4,7 +4,7 @@ import { ethers, network } from 'hardhat';
import { awaitAllDecryptionResults, initGateway } from '../asyncDecrypt';
import { createInstances } from '../instance';
import { getSigners, initSigners } from '../signers';
-import { bigIntToBytes64, bigIntToBytes128, bigIntToBytes256, waitNBlocks } from '../utils';
+import { bigIntToBytes128, bigIntToBytes256, bigIntToBytes64, waitNBlocks } from '../utils';
describe('TestAsyncDecrypt', function () {
before(async function () {
diff --git a/test/governor/GovernorZama.fixture.ts b/test/governor/GovernorZama.fixture.ts
index cbee601c..b8662b4a 100644
--- a/test/governor/GovernorZama.fixture.ts
+++ b/test/governor/GovernorZama.fixture.ts
@@ -1,7 +1,7 @@
import { ethers } from 'hardhat';
-import { Comp } from '../../types';
import type { GovernorZama, Timelock } from '../../types';
+import { Comp } from '../../types';
import { getSigners } from '../signers';
export async function deployTimelockFixture(): Promise {
diff --git a/test/instance.ts b/test/instance.ts
index 453bf64c..2bb98971 100644
--- a/test/instance.ts
+++ b/test/instance.ts
@@ -6,9 +6,10 @@ import {
generateKeypair,
getCiphertextCallParams,
} from 'fhevmjs';
-import { readFileSync } from 'fs';
import * as fs from 'fs';
-import { ethers, ethers as hethers, network } from 'hardhat';
+import { readFileSync } from 'fs';
+import hre, { ethers, ethers as hethers, network } from 'hardhat';
+import { HttpNetworkConfig, NetworkConfig } from 'hardhat/types';
import { homedir } from 'os';
import path from 'path';
@@ -25,12 +26,15 @@ const kmsAdd = dotenv.parse(fs.readFileSync('lib/.env.kmsverifier')).KMS_VERIFIE
const aclAdd = dotenv.parse(fs.readFileSync('lib/.env.acl')).ACL_CONTRACT_ADDRESS;
const createInstanceMocked = async () => {
+ const { chainId } = await hre.ethers.provider.getNetwork();
const instance = {
reencrypt: reencryptRequestMocked,
createEncryptedInput: createEncryptedInputMocked,
getPublicKey: () => '0xFFAA44433',
generateKeypair: generateKeypair,
- createEIP712: createEIP712(network.config.chainId),
+ createEIP712: createEIP712(Number(chainId)),
+ // FIXME: provide?
+ getPublicParams: () => ({}),
};
return instance;
};
@@ -54,15 +58,21 @@ export const createInstances = async (accounts: Signers): Promise {
- console.log('net url:', network.config.url);
- const instance = await createFhevmInstance({
+ const config = network.config;
+ if (!isHttpNetworkConfig(config)) {
+ throw new Error('Only HTTP network config is supported for FhevmInstance');
+ }
+ return await createFhevmInstance({
kmsContractAddress: kmsAdd,
aclContractAddress: aclAdd,
- networkUrl: network.config.url,
- gatewayUrl: 'http://localhost:7077',
+ networkUrl: config.url,
+ gatewayUrl: config.gatewayUrl ?? 'http://localhost:7077',
});
- return instance;
};
const getCiphertext = async (handle: bigint, ethers: typeof hethers): Promise => {
@@ -114,7 +124,7 @@ export const decrypt4 = async (handle: bigint): Promise => {
await awaitCoprocessor();
return BigInt(await getClearText(handle));
} else {
- return getDecryptor().decrypt4(await getCiphertext(handle, ethers));
+ return BigInt(getDecryptor().decrypt4(await getCiphertext(handle, ethers)));
}
};
@@ -132,7 +142,7 @@ export const decrypt8 = async (handle: bigint): Promise => {
await awaitCoprocessor();
return BigInt(await getClearText(handle));
} else {
- return getDecryptor().decrypt8(await getCiphertext(handle, ethers));
+ return BigInt(getDecryptor().decrypt8(await getCiphertext(handle, ethers)));
}
};
@@ -150,7 +160,7 @@ export const decrypt16 = async (handle: bigint): Promise => {
await awaitCoprocessor();
return BigInt(await getClearText(handle));
} else {
- return getDecryptor().decrypt16(await getCiphertext(handle, ethers));
+ return BigInt(getDecryptor().decrypt16(await getCiphertext(handle, ethers)));
}
};
@@ -168,7 +178,7 @@ export const decrypt32 = async (handle: bigint): Promise => {
await awaitCoprocessor();
return BigInt(await getClearText(handle));
} else {
- return getDecryptor().decrypt32(await getCiphertext(handle, ethers));
+ return BigInt(getDecryptor().decrypt32(await getCiphertext(handle, ethers)));
}
};
diff --git a/test/rand/Rand.ts b/test/rand/Rand.ts
index e45886f6..4f2d4cbe 100644
--- a/test/rand/Rand.ts
+++ b/test/rand/Rand.ts
@@ -3,17 +3,17 @@ import { ethers, network } from 'hardhat';
import {
createInstances,
- decrypt4,
- decrypt8,
+ decrypt128,
decrypt16,
+ decrypt256,
decrypt32,
+ decrypt4,
decrypt64,
- decrypt128,
- decrypt256,
+ decrypt8,
decryptBool,
- decryptEbytes64,
decryptEbytes128,
decryptEbytes256,
+ decryptEbytes64,
} from '../instance';
import { getSigners, initSigners } from '../signers';
import { deployRandFixture } from './Rand.fixture';
@@ -46,7 +46,7 @@ describe('Rand', function () {
});
it('4 bits generate and decrypt', async function () {
- const values: number[] = [];
+ const values: bigint[] = [];
for (let i = 0; i < 5; i++) {
const txn = await this.rand.generate4();
await txn.wait();
@@ -61,7 +61,7 @@ describe('Rand', function () {
});
it('4 bits generate with upper bound and decrypt', async function () {
- const values: number[] = [];
+ const values: bigint[] = [];
for (let i = 0; i < 7; i++) {
const txn = await this.rand.generate4UpperBound(8);
await txn.wait();
@@ -76,7 +76,7 @@ describe('Rand', function () {
});
it('8 bits generate and decrypt', async function () {
- const values: number[] = [];
+ const values: bigint[] = [];
for (let i = 0; i < 5; i++) {
const txn = await this.rand.generate8();
await txn.wait();
@@ -91,7 +91,7 @@ describe('Rand', function () {
});
it('8 bits generate with upper bound and decrypt', async function () {
- const values: number[] = [];
+ const values: bigint[] = [];
for (let i = 0; i < 5; i++) {
const txn = await this.rand.generate8UpperBound(128);
await txn.wait();
@@ -106,7 +106,7 @@ describe('Rand', function () {
});
it('16 bits generate and decrypt', async function () {
- const values: number[] = [];
+ const values: bigint[] = [];
let has16bit: boolean = false;
for (let i = 0; i < 5; i++) {
const txn = await this.rand.generate16();
@@ -127,7 +127,7 @@ describe('Rand', function () {
});
it('16 bits generate with upper bound and decrypt', async function () {
- const values: number[] = [];
+ const values: bigint[] = [];
for (let i = 0; i < 5; i++) {
const txn = await this.rand.generate16UpperBound(8192);
await txn.wait();
@@ -142,7 +142,7 @@ describe('Rand', function () {
});
it('32 bits generate and decrypt', async function () {
- const values: number[] = [];
+ const values: bigint[] = [];
let has32bit: boolean = false;
for (let i = 0; i < 5; i++) {
const txn = await this.rand.generate32();
@@ -163,7 +163,7 @@ describe('Rand', function () {
});
it('32 bits generate with upper bound and decrypt', async function () {
- const values: number[] = [];
+ const values: bigint[] = [];
for (let i = 0; i < 5; i++) {
const txn = await this.rand.generate32UpperBound(262144);
await txn.wait();
@@ -350,7 +350,7 @@ describe('Rand', function () {
if (network.name === 'hardhat') {
// snapshots are only possible in hardhat node, i.e in mocked mode
this.snapshotId = await ethers.provider.send('evm_snapshot');
- const values: number[] = [];
+ const values: bigint[] = [];
for (let i = 0; i < 5; i++) {
const txn = await this.rand.generate8();
await txn.wait();
@@ -366,7 +366,7 @@ describe('Rand', function () {
await ethers.provider.send('evm_revert', [this.snapshotId]);
this.snapshotId = await ethers.provider.send('evm_snapshot');
- const values2: number[] = [];
+ const values2: bigint[] = [];
for (let i = 0; i < 5; i++) {
const txn = await this.rand.generate8();
await txn.wait();
@@ -380,7 +380,7 @@ describe('Rand', function () {
expect(unique2.size).to.be.greaterThanOrEqual(2);
await ethers.provider.send('evm_revert', [this.snapshotId]);
- const values3: number[] = [];
+ const values3: bigint[] = [];
let has16bit: boolean = false;
for (let i = 0; i < 5; i++) {
const txn = await this.rand.generate16();
diff --git a/test/reencryption/reencryption.ts b/test/reencryption/reencryption.ts
index 87c8e412..01046486 100644
--- a/test/reencryption/reencryption.ts
+++ b/test/reencryption/reencryption.ts
@@ -1,9 +1,8 @@
import { expect } from 'chai';
-import { ethers, network } from 'hardhat';
+import { ethers } from 'hardhat';
import { createInstances } from '../instance';
import { getSigners, initSigners } from '../signers';
-import { bigIntToBytes256 } from '../utils';
describe('Reencryption', function () {
before(async function () {
diff --git a/test/signers.ts b/test/signers.ts
index 3673b1ac..442ef1e0 100644
--- a/test/signers.ts
+++ b/test/signers.ts
@@ -1,18 +1,19 @@
-import { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers';
import { exec as oldExec } from 'child_process';
+import { Signer } from 'ethers';
import { config, ethers } from 'hardhat';
import { promisify } from 'util';
-
import { waitForBalance } from './utils';
const exec = promisify(oldExec);
+export type SignerWithAddress = Signer & { address: string };
+
export interface Signers {
- alice: HardhatEthersSigner;
- bob: HardhatEthersSigner;
- carol: HardhatEthersSigner;
- dave: HardhatEthersSigner;
- eve: HardhatEthersSigner;
+ alice: SignerWithAddress;
+ bob: SignerWithAddress;
+ carol: SignerWithAddress;
+ dave: SignerWithAddress;
+ eve: SignerWithAddress;
}
let signers: Signers;
@@ -61,7 +62,8 @@ export const initSigners = async (quantity: number): Promise => {
const faucetP: Promise[] = [];
for (let i = 0; i < q; i += 1) {
const account = signers[keys[i]];
- faucetP.push(faucet(account.address));
+ const address = await account.getAddress();
+ faucetP.push(faucet(address));
}
await Promise.all(faucetP);
}
diff --git a/test/tfheOperations/manual.ts b/test/tfheOperations/manual.ts
index d4a56b8e..e827a0b6 100644
--- a/test/tfheOperations/manual.ts
+++ b/test/tfheOperations/manual.ts
@@ -1,21 +1,21 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
-import type { TFHEManualTestSuite } from '../../types/contracts/tests/TFHEManualTestSuite';
+import type { TFHEManualTestSuite } from '../../types';
import {
createInstances,
- decrypt4,
- decrypt8,
+ decrypt128,
decrypt16,
+ decrypt256,
decrypt32,
+ decrypt4,
decrypt64,
- decrypt128,
- decrypt256,
+ decrypt8,
decryptAddress,
decryptBool,
- decryptEbytes64,
decryptEbytes128,
decryptEbytes256,
+ decryptEbytes64,
} from '../instance';
import { getSigners, initSigners } from '../signers';
import { bigIntToBytes256 } from '../utils';
diff --git a/test/tfheOperations/tfheOperations1.ts b/test/tfheOperations/tfheOperations1.ts
index 82012291..79f7ac90 100644
--- a/test/tfheOperations/tfheOperations1.ts
+++ b/test/tfheOperations/tfheOperations1.ts
@@ -1,26 +1,27 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
-import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1';
-import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2';
-import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3';
-import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
-import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
-import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
-import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
-import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
-import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
-import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
+import type {
+ TFHETestSuite1,
+ TFHETestSuite10,
+ TFHETestSuite11,
+ TFHETestSuite2,
+ TFHETestSuite3,
+ TFHETestSuite4,
+ TFHETestSuite5,
+ TFHETestSuite6,
+ TFHETestSuite7,
+ TFHETestSuite8,
+ TFHETestSuite9,
+} from '../../types';
import {
createInstances,
- decrypt4,
- decrypt8,
+ decrypt128,
decrypt16,
decrypt32,
+ decrypt4,
decrypt64,
- decrypt128,
- decrypt256,
+ decrypt8,
decryptBool,
} from '../instance';
import { getSigners, initSigners } from '../signers';
diff --git a/test/tfheOperations/tfheOperations10.ts b/test/tfheOperations/tfheOperations10.ts
index fa223d0d..1029ad16 100644
--- a/test/tfheOperations/tfheOperations10.ts
+++ b/test/tfheOperations/tfheOperations10.ts
@@ -1,28 +1,20 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
-import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1';
-import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2';
-import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3';
-import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
-import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
-import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
-import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
-import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
-import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
-import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
-import {
- createInstances,
- decrypt4,
- decrypt8,
- decrypt16,
- decrypt32,
- decrypt64,
- decrypt128,
- decrypt256,
- decryptBool,
-} from '../instance';
+import type {
+ TFHETestSuite1,
+ TFHETestSuite10,
+ TFHETestSuite11,
+ TFHETestSuite2,
+ TFHETestSuite3,
+ TFHETestSuite4,
+ TFHETestSuite5,
+ TFHETestSuite6,
+ TFHETestSuite7,
+ TFHETestSuite8,
+ TFHETestSuite9,
+} from '../../types';
+import { createInstances, decrypt128, decrypt256, decryptBool } from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
diff --git a/test/tfheOperations/tfheOperations11.ts b/test/tfheOperations/tfheOperations11.ts
index 74694fec..efde5b15 100644
--- a/test/tfheOperations/tfheOperations11.ts
+++ b/test/tfheOperations/tfheOperations11.ts
@@ -1,28 +1,20 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
-import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1';
-import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2';
-import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3';
-import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
-import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
-import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
-import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
-import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
-import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
-import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
-import {
- createInstances,
- decrypt4,
- decrypt8,
- decrypt16,
- decrypt32,
- decrypt64,
- decrypt128,
- decrypt256,
- decryptBool,
-} from '../instance';
+import type {
+ TFHETestSuite1,
+ TFHETestSuite10,
+ TFHETestSuite11,
+ TFHETestSuite2,
+ TFHETestSuite3,
+ TFHETestSuite4,
+ TFHETestSuite5,
+ TFHETestSuite6,
+ TFHETestSuite7,
+ TFHETestSuite8,
+ TFHETestSuite9,
+} from '../../types';
+import { createInstances, decrypt256, decryptBool } from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
diff --git a/test/tfheOperations/tfheOperations12.ts b/test/tfheOperations/tfheOperations12.ts
index 3c4e4b0f..9e0fdee9 100644
--- a/test/tfheOperations/tfheOperations12.ts
+++ b/test/tfheOperations/tfheOperations12.ts
@@ -1,26 +1,28 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
-import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1';
-import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2';
-import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3';
-import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
-import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
-import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
-import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
-import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
-import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
-import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
+import type {
+ TFHETestSuite1,
+ TFHETestSuite10,
+ TFHETestSuite11,
+ TFHETestSuite2,
+ TFHETestSuite3,
+ TFHETestSuite4,
+ TFHETestSuite5,
+ TFHETestSuite6,
+ TFHETestSuite7,
+ TFHETestSuite8,
+ TFHETestSuite9,
+} from '../../types';
import {
createInstances,
- decrypt4,
- decrypt8,
+ decrypt128,
decrypt16,
+ decrypt256,
decrypt32,
+ decrypt4,
decrypt64,
- decrypt128,
- decrypt256,
+ decrypt8,
decryptBool,
} from '../instance';
import { getSigners, initSigners } from '../signers';
diff --git a/test/tfheOperations/tfheOperations13.ts b/test/tfheOperations/tfheOperations13.ts
index db18a0e6..b218bd49 100644
--- a/test/tfheOperations/tfheOperations13.ts
+++ b/test/tfheOperations/tfheOperations13.ts
@@ -1,28 +1,20 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
-import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1';
-import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2';
-import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3';
-import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
-import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
-import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
-import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
-import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
-import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
-import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
-import {
- createInstances,
- decrypt4,
- decrypt8,
- decrypt16,
- decrypt32,
- decrypt64,
- decrypt128,
- decrypt256,
- decryptBool,
-} from '../instance';
+import type {
+ TFHETestSuite1,
+ TFHETestSuite10,
+ TFHETestSuite11,
+ TFHETestSuite2,
+ TFHETestSuite3,
+ TFHETestSuite4,
+ TFHETestSuite5,
+ TFHETestSuite6,
+ TFHETestSuite7,
+ TFHETestSuite8,
+ TFHETestSuite9,
+} from '../../types';
+import { createInstances, decrypt256 } from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
diff --git a/test/tfheOperations/tfheOperations2.ts b/test/tfheOperations/tfheOperations2.ts
index 93245365..68e9866e 100644
--- a/test/tfheOperations/tfheOperations2.ts
+++ b/test/tfheOperations/tfheOperations2.ts
@@ -1,28 +1,20 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
-import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1';
-import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2';
-import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3';
-import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
-import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
-import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
-import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
-import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
-import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
-import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
-import {
- createInstances,
- decrypt4,
- decrypt8,
- decrypt16,
- decrypt32,
- decrypt64,
- decrypt128,
- decrypt256,
- decryptBool,
-} from '../instance';
+import type {
+ TFHETestSuite1,
+ TFHETestSuite10,
+ TFHETestSuite11,
+ TFHETestSuite2,
+ TFHETestSuite3,
+ TFHETestSuite4,
+ TFHETestSuite5,
+ TFHETestSuite6,
+ TFHETestSuite7,
+ TFHETestSuite8,
+ TFHETestSuite9,
+} from '../../types';
+import { createInstances, decrypt128, decrypt16, decrypt256, decrypt4, decrypt8, decryptBool } from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
diff --git a/test/tfheOperations/tfheOperations3.ts b/test/tfheOperations/tfheOperations3.ts
index 33df958e..14aca6ca 100644
--- a/test/tfheOperations/tfheOperations3.ts
+++ b/test/tfheOperations/tfheOperations3.ts
@@ -1,26 +1,27 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
-import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1';
-import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2';
-import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3';
-import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
-import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
-import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
-import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
-import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
-import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
-import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
+import type {
+ TFHETestSuite1,
+ TFHETestSuite10,
+ TFHETestSuite11,
+ TFHETestSuite2,
+ TFHETestSuite3,
+ TFHETestSuite4,
+ TFHETestSuite5,
+ TFHETestSuite6,
+ TFHETestSuite7,
+ TFHETestSuite8,
+ TFHETestSuite9,
+} from '../../types';
import {
createInstances,
- decrypt4,
- decrypt8,
+ decrypt128,
decrypt16,
+ decrypt256,
decrypt32,
decrypt64,
- decrypt128,
- decrypt256,
+ decrypt8,
decryptBool,
} from '../instance';
import { getSigners, initSigners } from '../signers';
diff --git a/test/tfheOperations/tfheOperations4.ts b/test/tfheOperations/tfheOperations4.ts
index 6dbd34d9..4b6551cc 100644
--- a/test/tfheOperations/tfheOperations4.ts
+++ b/test/tfheOperations/tfheOperations4.ts
@@ -1,28 +1,20 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
-import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1';
-import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2';
-import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3';
-import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
-import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
-import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
-import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
-import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
-import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
-import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
-import {
- createInstances,
- decrypt4,
- decrypt8,
- decrypt16,
- decrypt32,
- decrypt64,
- decrypt128,
- decrypt256,
- decryptBool,
-} from '../instance';
+import type {
+ TFHETestSuite1,
+ TFHETestSuite10,
+ TFHETestSuite11,
+ TFHETestSuite2,
+ TFHETestSuite3,
+ TFHETestSuite4,
+ TFHETestSuite5,
+ TFHETestSuite6,
+ TFHETestSuite7,
+ TFHETestSuite8,
+ TFHETestSuite9,
+} from '../../types';
+import { createInstances, decrypt16, decrypt32, decrypt64, decrypt8, decryptBool } from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
diff --git a/test/tfheOperations/tfheOperations5.ts b/test/tfheOperations/tfheOperations5.ts
index 8bdaf504..dfe57773 100644
--- a/test/tfheOperations/tfheOperations5.ts
+++ b/test/tfheOperations/tfheOperations5.ts
@@ -1,28 +1,20 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
-import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1';
-import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2';
-import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3';
-import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
-import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
-import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
-import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
-import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
-import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
-import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
-import {
- createInstances,
- decrypt4,
- decrypt8,
- decrypt16,
- decrypt32,
- decrypt64,
- decrypt128,
- decrypt256,
- decryptBool,
-} from '../instance';
+import type {
+ TFHETestSuite1,
+ TFHETestSuite10,
+ TFHETestSuite11,
+ TFHETestSuite2,
+ TFHETestSuite3,
+ TFHETestSuite4,
+ TFHETestSuite5,
+ TFHETestSuite6,
+ TFHETestSuite7,
+ TFHETestSuite8,
+ TFHETestSuite9,
+} from '../../types';
+import { createInstances, decrypt128, decrypt16, decrypt256, decrypt32, decrypt64, decryptBool } from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
diff --git a/test/tfheOperations/tfheOperations6.ts b/test/tfheOperations/tfheOperations6.ts
index 08d806b1..106684d1 100644
--- a/test/tfheOperations/tfheOperations6.ts
+++ b/test/tfheOperations/tfheOperations6.ts
@@ -1,28 +1,20 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
-import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1';
-import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2';
-import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3';
-import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
-import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
-import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
-import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
-import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
-import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
-import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
-import {
- createInstances,
- decrypt4,
- decrypt8,
- decrypt16,
- decrypt32,
- decrypt64,
- decrypt128,
- decrypt256,
- decryptBool,
-} from '../instance';
+import type {
+ TFHETestSuite1,
+ TFHETestSuite10,
+ TFHETestSuite11,
+ TFHETestSuite2,
+ TFHETestSuite3,
+ TFHETestSuite4,
+ TFHETestSuite5,
+ TFHETestSuite6,
+ TFHETestSuite7,
+ TFHETestSuite8,
+ TFHETestSuite9,
+} from '../../types';
+import { createInstances, decrypt128, decrypt256, decrypt32, decrypt64, decryptBool } from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
diff --git a/test/tfheOperations/tfheOperations7.ts b/test/tfheOperations/tfheOperations7.ts
index 078e9d2d..3c4fb586 100644
--- a/test/tfheOperations/tfheOperations7.ts
+++ b/test/tfheOperations/tfheOperations7.ts
@@ -1,28 +1,20 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
-import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1';
-import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2';
-import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3';
-import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
-import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
-import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
-import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
-import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
-import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
-import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
-import {
- createInstances,
- decrypt4,
- decrypt8,
- decrypt16,
- decrypt32,
- decrypt64,
- decrypt128,
- decrypt256,
- decryptBool,
-} from '../instance';
+import type {
+ TFHETestSuite1,
+ TFHETestSuite10,
+ TFHETestSuite11,
+ TFHETestSuite2,
+ TFHETestSuite3,
+ TFHETestSuite4,
+ TFHETestSuite5,
+ TFHETestSuite6,
+ TFHETestSuite7,
+ TFHETestSuite8,
+ TFHETestSuite9,
+} from '../../types';
+import { createInstances, decrypt256, decrypt32, decrypt64, decryptBool } from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
diff --git a/test/tfheOperations/tfheOperations8.ts b/test/tfheOperations/tfheOperations8.ts
index 4b38a2ec..90cb1710 100644
--- a/test/tfheOperations/tfheOperations8.ts
+++ b/test/tfheOperations/tfheOperations8.ts
@@ -1,28 +1,20 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
-import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1';
-import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2';
-import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3';
-import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
-import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
-import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
-import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
-import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
-import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
-import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
-import {
- createInstances,
- decrypt4,
- decrypt8,
- decrypt16,
- decrypt32,
- decrypt64,
- decrypt128,
- decrypt256,
- decryptBool,
-} from '../instance';
+import type {
+ TFHETestSuite1,
+ TFHETestSuite10,
+ TFHETestSuite11,
+ TFHETestSuite2,
+ TFHETestSuite3,
+ TFHETestSuite4,
+ TFHETestSuite5,
+ TFHETestSuite6,
+ TFHETestSuite7,
+ TFHETestSuite8,
+ TFHETestSuite9,
+} from '../../types';
+import { createInstances, decrypt128, decrypt256, decrypt64, decryptBool } from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
diff --git a/test/tfheOperations/tfheOperations9.ts b/test/tfheOperations/tfheOperations9.ts
index 4ab60160..82e8917b 100644
--- a/test/tfheOperations/tfheOperations9.ts
+++ b/test/tfheOperations/tfheOperations9.ts
@@ -1,28 +1,20 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
-import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1';
-import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2';
-import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3';
-import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4';
-import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5';
-import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6';
-import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7';
-import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8';
-import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9';
-import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10';
-import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11';
import {
- createInstances,
- decrypt4,
- decrypt8,
- decrypt16,
- decrypt32,
- decrypt64,
- decrypt128,
- decrypt256,
- decryptBool,
-} from '../instance';
+ TFHETestSuite1,
+ TFHETestSuite10,
+ TFHETestSuite11,
+ TFHETestSuite2,
+ TFHETestSuite3,
+ TFHETestSuite4,
+ TFHETestSuite5,
+ TFHETestSuite6,
+ TFHETestSuite7,
+ TFHETestSuite8,
+ TFHETestSuite9,
+} from '../../types';
+import { createInstances, decrypt128, decryptBool } from '../instance';
import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
diff --git a/test/types.ts b/test/types.ts
index 597a9a97..10d89a70 100644
--- a/test/types.ts
+++ b/test/types.ts
@@ -1,6 +1,6 @@
import type { FhevmInstance } from 'fhevmjs';
-import { BlindAuction, Comp, EncryptedERC20, GovernorZama, IdentifiedERC20, IdentityRegistry, Rand } from '../types';
+import { BlindAuction, Comp, EncryptedERC20, GovernorZama, IdentityRegistry, Rand } from '../types';
import type { Signers } from './signers';
declare module 'mocha' {
@@ -12,7 +12,6 @@ declare module 'mocha' {
blindAuction: BlindAuction;
rand: Rand;
identityRegistry: IdentityRegistry;
- identifiedErc20: IdentifiedERC20;
comp: Comp;
governor: GovernorZama;
}
diff --git a/test/upgrades/upgrades.ts b/test/upgrades/upgrades.ts
index 59034f47..4b866d38 100644
--- a/test/upgrades/upgrades.ts
+++ b/test/upgrades/upgrades.ts
@@ -3,13 +3,13 @@ import dotenv from 'dotenv';
import fs from 'fs';
import { ethers, upgrades } from 'hardhat';
+import { ACL__factory } from '../../types';
import { getSigners, initSigners } from '../signers';
describe('Upgrades', function () {
before(async function () {
await initSigners(2);
this.signers = await getSigners();
- this.aclFactory = await ethers.getContractFactory('ACL');
this.aclFactoryUpgraded = await ethers.getContractFactory('ACLUpgradedExample');
this.kmsFactory = await ethers.getContractFactory('KMSVerifier');
this.kmsFactoryUpgraded = await ethers.getContractFactory('KMSVerifierUpgradedExample');
@@ -96,7 +96,7 @@ describe('Upgrades', function () {
const acl = await this.aclFactory.attach(origACLAdd, deployer);
expect(await acl.getVersion()).to.equal('ACL v0.1.0');
const newaclFactoryUpgraded = await ethers.getContractFactory('ACLUpgradedExample', deployer);
- const acl2 = await upgrades.upgradeProxy(acl, newaclFactoryUpgraded);
+ const acl2 = ACL__factory.connect(await (await upgrades.upgradeProxy(acl, newaclFactoryUpgraded)).getAddress());
await acl2.waitForDeployment();
expect(await acl2.getVersion()).to.equal('ACL v0.2.0');
expect(await acl2.getAddress()).to.equal(origACLAdd);
diff --git a/tsconfig.json b/tsconfig.json
index 734e21a2..42fee636 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -14,7 +14,9 @@
"resolveJsonModule": true,
"sourceMap": true,
"strict": true,
- "target": "es2020"
+ "target": "es2020",
+ "skipLibCheck": true,
+ "typeRoots": ["./node_modules/@types", "**/node_modules/@types", "./@types"]
},
"exclude": ["node_modules"],
"files": ["./hardhat.config.ts"],
From 9b847217a121fd12f9c619c8aefe45793bdfc0a2 Mon Sep 17 00:00:00 2001
From: Silas Davis
Date: Mon, 4 Nov 2024 15:54:08 +0700
Subject: [PATCH 51/51] feat: Make FHEVM use FHEVMConfig rather than hardcoded
addresses (#5)
* feat: Make FHEVM use FHEVMConfig rather than hardcoded addresses
This all feels a bit contorted, but trying to maintain compatibility
with the existing structure that uses assembly code to house an
FHEVMConfig within the storage of TFHEExecutor.
The idea is to make this config object the source of truth. Since there
is a circular dependency between ACL and TFHEExecutor we need to pass a
TFHEExecutor into ACL, and then later call Impl.setFHEVM to doubly link
them.
I'm not sure this is how I'd build it from the ground up but I'm hoping
keeping things close to how they are will make future upgrades easier.
In principle the code should maintain its current behaviour when not
configured, however to configure custom addresses the flow should be
something like:
1. Deploy `TFHEExecutor tfheExecutor` (an `IFHEVMProvider`)
2. Deploy `ACL acl`
3. Call `acl.setFHEVMProvider(tfheExecutor)`
4. Deploy `IFHEPayment payment`
5. Deploy `IKMSVerifier kmsVerifier`
6. Deploy `IInputVerifier inputVerifier`
7. Call `tfheExecutor.setFHEVM({ tfheExecutor, acl, payment,
kmsVerifier, inputVerifier}) (in `Impl.sol` - completing the closure
of the circular dependency between `TFHEExecutor` and `ACL`)
8. Deploy `GatewayContract.sol gateway`
9. Call `gateway.setFHEVMProvider(tfheExecutor)
Then cross your fingers I guess...
Signed-off-by: Silas Davis
* fix: compile errors and bash on NixOS
Signed-off-by: Silas Davis
* chore: prettier test
Signed-off-by: Silas Davis
* fix: match codegen with TFHE.sol and Payment.sol
Signed-off-by: Silas Davis
---------
Signed-off-by: Silas Davis
---
.prettierrc.json | 6 +-
ci/scripts/prepare_fhe_keys_ci.sh | 2 +-
ci/scripts/prepare_fhe_keys_for_e2e_test.sh | 4 +-
ci/scripts/run_ERC20.sh | 4 +-
ci/scripts/run_ERC20_ci_test.sh | 4 +-
ci/scripts/run_ERC20_e2e_test.sh | 2 +-
codegen/templates.ts | 12 +-
codegen/testgen.ts | 7 +-
gateway/GatewayContract.sol | 15 +-
hardhat.config.ts | 5 +-
launch-fhevm-sepolia.sh | 5 +-
lib/ACL.sol | 23 ++-
lib/FHEVMConfig.sol | 17 +-
lib/IFHEPayment.sol | 95 ++++++++++
lib/IInputVerifier.sol | 16 ++
lib/Impl.sol | 1 +
lib/InputVerifier.coprocessor.sol | 7 +-
lib/InputVerifier.native.sol | 3 +-
lib/TFHE.sol | 4 +
lib/TFHEExecutor.sol | 199 +++++++++-----------
package.json | 2 +-
payment/Payment.sol | 7 +-
precompute-addresses.sh | 4 +-
scripts/faucet.sh | 4 +-
tasks/taskDeploy.ts | 12 +-
test/tfheOperations/tfheOperations1.ts | 22 +--
test/tfheOperations/tfheOperations10.ts | 4 +-
test/tfheOperations/tfheOperations11.ts | 4 +-
test/tfheOperations/tfheOperations12.ts | 24 +--
test/tfheOperations/tfheOperations13.ts | 4 +-
test/tfheOperations/tfheOperations2.ts | 4 +-
test/tfheOperations/tfheOperations3.ts | 22 +--
test/tfheOperations/tfheOperations4.ts | 4 +-
test/tfheOperations/tfheOperations5.ts | 4 +-
test/tfheOperations/tfheOperations6.ts | 4 +-
test/tfheOperations/tfheOperations7.ts | 4 +-
test/tfheOperations/tfheOperations8.ts | 4 +-
test/tfheOperations/tfheOperations9.ts | 6 +-
38 files changed, 348 insertions(+), 222 deletions(-)
create mode 100644 lib/IFHEPayment.sol
create mode 100644 lib/IInputVerifier.sol
diff --git a/.prettierrc.json b/.prettierrc.json
index 80d9b104..d419e144 100644
--- a/.prettierrc.json
+++ b/.prettierrc.json
@@ -5,11 +5,7 @@
{
"files": ["*.ts", ".js", ".cjs"],
"options": {
- "singleQuote": true,
- "importOrder": ["", "^[./]"],
- "importOrderParserPlugins": ["typescript"],
- "importOrderSeparation": true,
- "importOrderSortSpecifiers": true
+ "singleQuote": true
}
},
{
diff --git a/ci/scripts/prepare_fhe_keys_ci.sh b/ci/scripts/prepare_fhe_keys_ci.sh
index 53725ef3..07ea7c57 100755
--- a/ci/scripts/prepare_fhe_keys_ci.sh
+++ b/ci/scripts/prepare_fhe_keys_ci.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
set -Eeuo pipefail
diff --git a/ci/scripts/prepare_fhe_keys_for_e2e_test.sh b/ci/scripts/prepare_fhe_keys_for_e2e_test.sh
index d629c0f3..72d22eaa 100755
--- a/ci/scripts/prepare_fhe_keys_for_e2e_test.sh
+++ b/ci/scripts/prepare_fhe_keys_for_e2e_test.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
set -Eeuo pipefail
@@ -14,7 +14,7 @@ KEYS_FULL_PATH=$1
mkdir -p $NETWORK_KEYS_PUBLIC_PATH
MANDATORY_KEYS_LIST=('pks')
-
+
echo "check folder $KEYS_FULL_PATH"
for key in "${MANDATORY_KEYS_LIST[@]}"
do
diff --git a/ci/scripts/run_ERC20.sh b/ci/scripts/run_ERC20.sh
index 1d5081d8..972a975e 100755
--- a/ci/scripts/run_ERC20.sh
+++ b/ci/scripts/run_ERC20.sh
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/usr/bin/env bash
-# This script execute a python script within a ready-to-use docker image with all the required python modules.
+# This script execute a python script within a ready-to-use docker image with all the required python modules.
# The script takes two arguments:
# 1. The private key of the main account which has already funds.
# 2. (Optional) The node address (default: http://host.docker.internal:8545)
diff --git a/ci/scripts/run_ERC20_ci_test.sh b/ci/scripts/run_ERC20_ci_test.sh
index 213724a9..f79feeda 100755
--- a/ci/scripts/run_ERC20_ci_test.sh
+++ b/ci/scripts/run_ERC20_ci_test.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# This script exports an Ethereum private key from an evmos node and uses it to run a Python script.
# The script takes two arguments:
@@ -25,4 +25,4 @@ PRIVATE_KEY=$(docker compose -f $PATH_TO_EVMOS/docker-compose/docker-compose.val
echo "Exported private key: $PRIVATE_KEY"
# Run the Python script with the exported private key as an argument
-docker compose -f ci/docker-compose.yml run app python ci/tests/ERC20.py $PRIVATE_KEY
\ No newline at end of file
+docker compose -f ci/docker-compose.yml run app python ci/tests/ERC20.py $PRIVATE_KEY
diff --git a/ci/scripts/run_ERC20_e2e_test.sh b/ci/scripts/run_ERC20_e2e_test.sh
index 32634ec3..726e349f 100755
--- a/ci/scripts/run_ERC20_e2e_test.sh
+++ b/ci/scripts/run_ERC20_e2e_test.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# This script exports an Ethereum private key from an evmos node and uses it to run a Python script.
# The script takes two arguments:
diff --git a/codegen/templates.ts b/codegen/templates.ts
index 8fe74ee5..c6c067d3 100644
--- a/codegen/templates.ts
+++ b/codegen/templates.ts
@@ -95,6 +95,7 @@ library Impl {
$.TFHEExecutorAddress = fhevmConfig.TFHEExecutorAddress;
$.FHEPaymentAddress = fhevmConfig.FHEPaymentAddress;
$.KMSVerifierAddress = fhevmConfig.KMSVerifierAddress;
+ $.InputVerifierAddress = fhevmConfig.InputVerifierAddress;
}
`);
@@ -236,6 +237,10 @@ ${commonSolLib()}
library TFHE {
+ function use(IFHEVMConfigProvider provider) internal {
+ Impl.setFHEVM(provider.getFHEVMConfig());
+ }
+
function setFHEVM(FHEVMConfig.FHEVMConfigStruct memory fhevmConfig) internal {
Impl.setFHEVM(fhevmConfig);
}
@@ -1474,12 +1479,7 @@ pragma solidity ^0.8.24;
import "../lib/FHEVMConfig.sol";
import "../lib/Impl.sol";
-
-interface IFHEPayment {
- function depositETH(address account) external payable;
- function withdrawETH(uint256 amount, address receiver) external;
- function getAvailableDepositsETH(address account) external view returns(uint256);
-}
+import "../lib/IFHEPayment.sol";
library Payment {
function depositForAccount(address account, uint256 amount) internal {
diff --git a/codegen/testgen.ts b/codegen/testgen.ts
index d17f3b64..0a362140 100644
--- a/codegen/testgen.ts
+++ b/codegen/testgen.ts
@@ -68,11 +68,10 @@ function generateIntroTestCode(shards: OverloadShard[], idxSplit: number): strin
import { getSigners, initSigners } from '../signers';
`);
- shards.forEach((os) => {
- intro.push(`
- import type { TFHETestSuite${os.shardNumber} } from '../../types';
+ intro.push(`
+ import type {
+${shards.map((os) => ` TFHETestSuite${os.shardNumber}`).join(',\n')} } from '../../types';
`);
- });
shards.forEach((os) => {
intro.push(`
diff --git a/gateway/GatewayContract.sol b/gateway/GatewayContract.sol
index d78995c8..835491b6 100644
--- a/gateway/GatewayContract.sol
+++ b/gateway/GatewayContract.sol
@@ -6,11 +6,9 @@ import "../lib/TFHE.sol";
import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
-import "../lib/KMSVerifierAddress.sol";
-import "../lib/ACLAddress.sol";
import "./IKMSVerifier.sol";
-contract GatewayContract is UUPSUpgradeable, Ownable2StepUpgradeable {
+contract GatewayContract is UUPSUpgradeable, Ownable2StepUpgradeable, IFHEVMProviderReceiver {
/// @notice Name of the contract
string private constant CONTRACT_NAME = "GatewayContract";
@@ -19,8 +17,7 @@ contract GatewayContract is UUPSUpgradeable, Ownable2StepUpgradeable {
uint256 private constant MINOR_VERSION = 1;
uint256 private constant PATCH_VERSION = 0;
- IKMSVerifier private constant kmsVerifier = IKMSVerifier(kmsVerifierAdd);
- address private constant aclAddress = aclAdd;
+ IFHEVMConfigProvider private fhevmProvider;
uint256 private constant MAX_DELAY = 1 days;
@@ -96,6 +93,10 @@ contract GatewayContract is UUPSUpgradeable, Ownable2StepUpgradeable {
__Ownable_init(_gatewayOwner);
}
+ function setFHEVMProvider(address fhevmProviderAddress) external onlyOwner {
+ fhevmProvider = IFHEVMConfigProvider(fhevmProviderAddress);
+ }
+
modifier onlyRelayer() {
GatewayContractStorage storage $ = _getGatewayContractStorage();
require($.isRelayer[msg.sender], "Not relayer");
@@ -177,9 +178,11 @@ contract GatewayContract is UUPSUpgradeable, Ownable2StepUpgradeable {
bytes[] memory signatures
) external payable virtual onlyRelayer {
GatewayContractStorage storage $ = _getGatewayContractStorage();
+ FHEVMConfig.FHEVMConfigStruct memory config = fhevmProvider.getFHEVMConfig();
+ IKMSVerifier kmsVerifier = IKMSVerifier(config.KMSVerifierAddress);
require(
kmsVerifier.verifyDecryptionEIP712KMSSignatures(
- aclAddress,
+ config.ACLAddress,
$.decryptionRequests[requestID].cts,
decryptedCts,
signatures
diff --git a/hardhat.config.ts b/hardhat.config.ts
index 0108e2e7..f955895e 100644
--- a/hardhat.config.ts
+++ b/hardhat.config.ts
@@ -9,6 +9,7 @@ import { resolve } from 'path';
import CustomProvider from './CustomProvider';
import './hardhat.config.types';
import './tasks/accounts';
+import { mustGetEnv } from './tasks/environment';
import './tasks/etherscanVerify';
import './tasks/getEthereumAddress';
import './tasks/mint';
@@ -70,7 +71,7 @@ function getChainConfig(chain: keyof typeof chainIds): NetworkUserConfig {
gatewayUrl = 'https://gateway.devnet.zama.ai';
break;
case 'sepolia':
- jsonRpcUrl = process.env.SEPOLIA_RPC_URL!;
+ jsonRpcUrl = mustGetEnv('SEPOLIA_RPC_URL');
}
return {
accounts: {
@@ -133,7 +134,7 @@ const config: HardhatUserConfig = {
},
gasReporter: {
currency: 'USD',
- enabled: process.env.REPORT_GAS ? true : false,
+ enabled: !!process.env.REPORT_GAS,
excludeContracts: [],
src: './examples',
},
diff --git a/launch-fhevm-sepolia.sh b/launch-fhevm-sepolia.sh
index f78bd042..bc1ebf22 100755
--- a/launch-fhevm-sepolia.sh
+++ b/launch-fhevm-sepolia.sh
@@ -1,4 +1,5 @@
-#!/bin/bash
+#!/usr/bin/env bash
+set -e
# This script should be launched after precomputing the addresses via `precompute-addresses.sh`, and preferably after setting up the different services - KMS, Geth node, Gateway
npx hardhat clean
@@ -20,4 +21,4 @@ npx hardhat task:launchFhevm --skip-get-coin true --use-address true --network s
echo "Waiting 2 minutes before contract verification... Please wait..."
sleep 120 # makes sure that contracts bytescode propagates on Etherscan, otherwise contracts verification might fail in next step
-npx hardhat task:verifyContracts --network sepolia
\ No newline at end of file
+npx hardhat task:verifyContracts --network sepolia
diff --git a/lib/ACL.sol b/lib/ACL.sol
index 3a35df65..a7810ee1 100644
--- a/lib/ACL.sol
+++ b/lib/ACL.sol
@@ -5,9 +5,10 @@ pragma solidity ^0.8.24;
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
-import "./TFHEExecutorAddress.sol";
+import "./FHEVMConfig.sol";
+import "./Impl.sol";
-contract ACL is UUPSUpgradeable, Ownable2StepUpgradeable {
+contract ACL is UUPSUpgradeable, Ownable2StepUpgradeable, IFHEVMConfigReceiver, IFHEVMConfigProvider {
/// @notice Name of the contract
string private constant CONTRACT_NAME = "ACL";
@@ -16,8 +17,6 @@ contract ACL is UUPSUpgradeable, Ownable2StepUpgradeable {
uint256 private constant MINOR_VERSION = 1;
uint256 private constant PATCH_VERSION = 0;
- address private constant tfheExecutorAddress = tfheExecutorAdd;
-
/// @custom:storage-location erc7201:fhevm.storage.ACL
struct ACLStorage {
mapping(uint256 handle => mapping(address account => bool isAllowed)) persistedAllowedPairs;
@@ -34,11 +33,6 @@ contract ACL is UUPSUpgradeable, Ownable2StepUpgradeable {
}
}
- /// @notice Getter function for the TFHEExecutor contract address
- function getTFHEExecutorAddress() public view virtual returns (address) {
- return tfheExecutorAddress;
- }
-
event NewDelegation(address indexed sender, address indexed delegatee, address indexed contractAddress);
event AllowedForDecryption(uint256[] handlesList);
@@ -58,7 +52,8 @@ contract ACL is UUPSUpgradeable, Ownable2StepUpgradeable {
// The caller must be allowed to use `handle` for allowTransient() to succeed. If not, allowTransient() reverts.
// @note: The Coprocessor contract can always `allowTransient`, contrarily to `allow`
function allowTransient(uint256 handle, address account) public virtual {
- if (msg.sender != tfheExecutorAddress) {
+ FHEVMConfig.FHEVMConfigStruct storage $ = Impl.getFHEVMConfig();
+ if (msg.sender != $.TFHEExecutorAddress) {
require(isAllowed(handle, msg.sender), "sender isn't allowed");
}
bytes32 key = keccak256(abi.encodePacked(handle, account));
@@ -170,4 +165,12 @@ contract ACL is UUPSUpgradeable, Ownable2StepUpgradeable {
)
);
}
+
+ function setFHEVMConfig(FHEVMConfig.FHEVMConfigStruct memory fhevmConfig) external onlyOwner {
+ Impl.setFHEVM(fhevmConfig);
+ }
+
+ function getFHEVMConfig() external view returns (FHEVMConfig.FHEVMConfigStruct memory $) {
+ $ = Impl.getFHEVMConfig();
+ }
}
diff --git a/lib/FHEVMConfig.sol b/lib/FHEVMConfig.sol
index a3b48eaf..a167b583 100644
--- a/lib/FHEVMConfig.sol
+++ b/lib/FHEVMConfig.sol
@@ -6,6 +6,19 @@ import "./ACLAddress.sol";
import "./FHEPaymentAddress.sol";
import "./KMSVerifierAddress.sol";
import "./TFHEExecutorAddress.sol";
+import "./InputVerifierAddress.sol";
+
+interface IFHEVMConfigProvider {
+ function getFHEVMConfig() external view returns (FHEVMConfig.FHEVMConfigStruct memory fhevmConfig);
+}
+
+interface IFHEVMConfigReceiver {
+ function setFHEVMConfig(FHEVMConfig.FHEVMConfigStruct memory fhevmConfig) external;
+}
+
+interface IFHEVMProviderReceiver {
+ function setFHEVMProvider(address fhevmProviderAddress) external;
+}
library FHEVMConfig {
struct FHEVMConfigStruct {
@@ -13,6 +26,7 @@ library FHEVMConfig {
address TFHEExecutorAddress;
address FHEPaymentAddress;
address KMSVerifierAddress;
+ address InputVerifierAddress;
}
/// @dev Function to return an immutable struct
@@ -22,7 +36,8 @@ library FHEVMConfig {
ACLAddress: aclAdd,
TFHEExecutorAddress: tfheExecutorAdd,
FHEPaymentAddress: fhePaymentAdd,
- KMSVerifierAddress: kmsVerifierAdd
+ KMSVerifierAddress: kmsVerifierAdd,
+ InputVerifierAddress: inputVerifierAdd
});
}
}
diff --git a/lib/IFHEPayment.sol b/lib/IFHEPayment.sol
new file mode 100644
index 00000000..e300e08e
--- /dev/null
+++ b/lib/IFHEPayment.sol
@@ -0,0 +1,95 @@
+// SPDX-License-Identifier: UNLICENSED
+pragma solidity ^0.8.0;
+
+// Define interface based on FHEPayment contract
+interface IFHEPayment {
+ function depositETH(address account) external payable;
+
+ function withdrawETH(uint256 amount, address receiver) external;
+
+ function getAvailableDepositsETH(address account) external view returns (uint256);
+
+ function payForFheAnd(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheOr(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheXor(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheNot(address payer, uint8 resultType) external;
+
+ function payForFheNand(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheNor(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheXnor(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheMux(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheMux16(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheMux32(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheMux64(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheMux128(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheMux256(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheMux512(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheMux1024(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheAdd(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheSub(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheMul(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheDiv(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheMod(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheLt(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheLe(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheGt(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheGe(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheEq(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheNe(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheShl(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheShr(address payer, uint8 result, bytes1 scalarByte) external;
+
+ function payForFheRand(address payer, uint8 resultType) external;
+
+ function payForFheRandBounded(address payer, uint8 resultType) external;
+
+ function payForFheRem(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheBitAnd(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheBitOr(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheBitXor(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheRotl(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheRotr(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheMin(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheMax(address payer, uint8 resultType, bytes1 scalarByte) external;
+
+ function payForFheNeg(address payer, uint8 resultType) external;
+
+ function payForCast(address payer, uint8 resultType) external;
+
+ function payForTrivialEncrypt(address payer, uint8 resultType) external;
+
+ function payForIfThenElse(address payer, uint8 resultType) external;
+}
diff --git a/lib/IInputVerifier.sol b/lib/IInputVerifier.sol
new file mode 100644
index 00000000..ec24812b
--- /dev/null
+++ b/lib/IInputVerifier.sol
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: UNLICENSED
+pragma solidity ^0.8.0;
+
+interface IInputVerifier {
+ struct ContextUserInputs {
+ address aclAddress;
+ address userAddress;
+ address contractAddress;
+ }
+
+ function verifyCiphertext(
+ ContextUserInputs memory context,
+ bytes32 inputHandle,
+ bytes memory inputProof
+ ) external returns (uint256);
+}
diff --git a/lib/Impl.sol b/lib/Impl.sol
index cf1183db..1e7d98f4 100644
--- a/lib/Impl.sol
+++ b/lib/Impl.sol
@@ -68,6 +68,7 @@ library Impl {
$.TFHEExecutorAddress = fhevmConfig.TFHEExecutorAddress;
$.FHEPaymentAddress = fhevmConfig.FHEPaymentAddress;
$.KMSVerifierAddress = fhevmConfig.KMSVerifierAddress;
+ $.InputVerifierAddress = fhevmConfig.InputVerifierAddress;
}
function add(uint256 lhs, uint256 rhs, bool scalar) internal returns (uint256 result) {
diff --git a/lib/InputVerifier.coprocessor.sol b/lib/InputVerifier.coprocessor.sol
index 48641cb8..1f1eecc1 100644
--- a/lib/InputVerifier.coprocessor.sol
+++ b/lib/InputVerifier.coprocessor.sol
@@ -5,6 +5,7 @@ import "./KMSVerifier.sol";
import "./TFHEExecutor.sol";
import "./KMSVerifierAddress.sol";
import "./CoprocessorAddress.sol";
+import "./IInputVerifier.sol";
// Importing OpenZeppelin contracts for cryptographic signature verification and access control.
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
@@ -67,7 +68,7 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad
}
/// @notice Initializes the contract setting `initialOwner` as the initial owner
- function initialize(address initialOwner) external initializer {
+ function initialize(address initialOwner) public initializer {
__Ownable_init(initialOwner);
__EIP712_init(CONTRACT_NAME, "1");
}
@@ -98,10 +99,10 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad
}
function verifyCiphertext(
- TFHEExecutor.ContextUserInputs memory context,
+ IInputVerifier.ContextUserInputs memory context,
bytes32 inputHandle,
bytes memory inputProof
- ) external virtual returns (uint256) {
+ ) public virtual returns (uint256) {
(bool isProofCached, bytes32 cacheKey) = checkProofCache(
inputProof,
context.userAddress,
diff --git a/lib/InputVerifier.native.sol b/lib/InputVerifier.native.sol
index ca14fe31..7d956fab 100644
--- a/lib/InputVerifier.native.sol
+++ b/lib/InputVerifier.native.sol
@@ -5,6 +5,7 @@ import "./KMSVerifier.sol";
import "./TFHEExecutor.sol";
import "./KMSVerifierAddress.sol";
import "./CoprocessorAddress.sol";
+import "./IInputVerifier.sol";
// Importing OpenZeppelin contracts for cryptographic signature verification and access control.
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
@@ -73,7 +74,7 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function verifyCiphertext(
- TFHEExecutor.ContextUserInputs memory context,
+ IInputVerifier.ContextUserInputs memory context,
bytes32 inputHandle,
bytes memory inputProof
) external virtual returns (uint256) {
diff --git a/lib/TFHE.sol b/lib/TFHE.sol
index cf10186c..d1268cbe 100644
--- a/lib/TFHE.sol
+++ b/lib/TFHE.sol
@@ -36,6 +36,10 @@ library Common {
}
library TFHE {
+ function use(IFHEVMConfigProvider provider) internal {
+ Impl.setFHEVM(provider.getFHEVMConfig());
+ }
+
function setFHEVM(FHEVMConfig.FHEVMConfigStruct memory fhevmConfig) internal {
Impl.setFHEVM(fhevmConfig);
}
diff --git a/lib/TFHEExecutor.sol b/lib/TFHEExecutor.sol
index 5ff0fe92..a323738b 100644
--- a/lib/TFHEExecutor.sol
+++ b/lib/TFHEExecutor.sol
@@ -3,23 +3,13 @@
pragma solidity ^0.8.24;
import "./ACL.sol";
-import "./FHEPayment.sol";
-import "./ACLAddress.sol";
-import "./FHEPaymentAddress.sol";
-import "./InputVerifierAddress.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
+import "./IFHEPayment.sol";
+import "./IInputVerifier.sol";
-interface IInputVerifier {
- function verifyCiphertext(
- TFHEExecutor.ContextUserInputs memory context,
- bytes32 inputHandle,
- bytes memory inputProof
- ) external returns (uint256);
-}
-
-contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
+contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable, IFHEVMProviderReceiver {
/// @notice Handle version
uint8 public constant HANDLE_VERSION = 0;
@@ -31,21 +21,13 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
uint256 private constant MINOR_VERSION = 1;
uint256 private constant PATCH_VERSION = 0;
- ACL private constant acl = ACL(aclAdd);
- FHEPayment private constant fhePayment = FHEPayment(fhePaymentAdd);
- IInputVerifier private constant inputVerifier = IInputVerifier(inputVerifierAdd);
+ IFHEVMConfigProvider private fhevmProvider;
/// @custom:storage-location erc7201:fhevm.storage.TFHEExecutor
struct TFHEExecutorStorage {
uint256 counterRand; /// @notice counter used for computing handles of randomness operators
}
- struct ContextUserInputs {
- address aclAddress;
- address userAddress;
- address contractAddress;
- }
-
// keccak256(abi.encode(uint256(keccak256("fhevm.storage.TFHEExecutor")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant TFHEExecutorStorageLocation =
0xa436a06f0efce5ea38c956a21e24202a59b3b746d48a23fb52b4a5bc33fe3e00;
@@ -58,21 +40,6 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
function _authorizeUpgrade(address _newImplementation) internal virtual override onlyOwner {}
- /// @notice Getter function for the ACL contract address
- function getACLAddress() public view virtual returns (address) {
- return address(acl);
- }
-
- /// @notice Getter function for the FHEPayment contract address
- function getFHEPaymentAddress() public view virtual returns (address) {
- return address(fhePayment);
- }
-
- /// @notice Getter function for the InputVerifier contract address
- function getInputVerifierAddress() public view virtual returns (address) {
- return address(inputVerifier);
- }
-
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
@@ -138,11 +105,11 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
}
function unaryOp(Operators op, uint256 ct) internal virtual returns (uint256 result) {
- require(acl.isAllowed(ct, msg.sender), "Sender doesn't own ct on op");
- result = uint256(keccak256(abi.encodePacked(op, ct, acl, block.chainid)));
+ require(getACL().isAllowed(ct, msg.sender), "Sender doesn't own ct on op");
+ result = uint256(keccak256(abi.encodePacked(op, ct, getACL(), block.chainid)));
uint8 typeCt = typeOf(ct);
result = appendType(result, typeCt);
- acl.allowTransient(result, msg.sender);
+ getACL().allowTransient(result, msg.sender);
}
function binaryOp(
@@ -152,16 +119,16 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
bytes1 scalar,
uint8 resultType
) internal virtual returns (uint256 result) {
- require(acl.isAllowed(lhs, msg.sender), "Sender doesn't own lhs on op");
+ require(getACL().isAllowed(lhs, msg.sender), "Sender doesn't own lhs on op");
if (scalar == 0x00) {
- require(acl.isAllowed(rhs, msg.sender), "Sender doesn't own rhs on op");
+ require(getACL().isAllowed(rhs, msg.sender), "Sender doesn't own rhs on op");
uint8 typeRhs = typeOf(rhs);
uint8 typeLhs = typeOf(lhs);
require(typeLhs == typeRhs, "Incompatible types for lhs and rhs");
}
- result = uint256(keccak256(abi.encodePacked(op, lhs, rhs, scalar, acl, block.chainid)));
+ result = uint256(keccak256(abi.encodePacked(op, lhs, rhs, scalar, getACL(), block.chainid)));
result = appendType(result, resultType);
- acl.allowTransient(result, msg.sender);
+ getACL().allowTransient(result, msg.sender);
}
function ternaryOp(
@@ -170,17 +137,17 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
uint256 middle,
uint256 rhs
) internal virtual returns (uint256 result) {
- require(acl.isAllowed(lhs, msg.sender), "Sender doesn't own lhs on op");
- require(acl.isAllowed(middle, msg.sender), "Sender doesn't own middle on op");
- require(acl.isAllowed(rhs, msg.sender), "Sender doesn't own rhs on op");
+ require(getACL().isAllowed(lhs, msg.sender), "Sender doesn't own lhs on op");
+ require(getACL().isAllowed(middle, msg.sender), "Sender doesn't own middle on op");
+ require(getACL().isAllowed(rhs, msg.sender), "Sender doesn't own rhs on op");
uint8 typeLhs = typeOf(lhs);
uint8 typeMiddle = typeOf(middle);
uint8 typeRhs = typeOf(rhs);
require(typeLhs == 0, "Unsupported type for lhs"); // lhs must be ebool
require(typeMiddle == typeRhs, "Incompatible types for middle and rhs");
- result = uint256(keccak256(abi.encodePacked(op, lhs, middle, rhs, acl, block.chainid)));
+ result = uint256(keccak256(abi.encodePacked(op, lhs, middle, rhs, getACL(), block.chainid)));
result = appendType(result, typeMiddle);
- acl.allowTransient(result, msg.sender);
+ getACL().allowTransient(result, msg.sender);
}
function fheAdd(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
@@ -188,7 +155,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
- fhePayment.payForFheAdd(msg.sender, lhsType, scalar);
+ getFHEPayment().payForFheAdd(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheAdd, lhs, rhs, scalar, lhsType);
}
@@ -197,7 +164,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
- fhePayment.payForFheSub(msg.sender, lhsType, scalar);
+ getFHEPayment().payForFheSub(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheSub, lhs, rhs, scalar, lhsType);
}
@@ -206,7 +173,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
- fhePayment.payForFheMul(msg.sender, lhsType, scalar);
+ getFHEPayment().payForFheMul(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheMul, lhs, rhs, scalar, lhsType);
}
@@ -217,7 +184,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
- fhePayment.payForFheDiv(msg.sender, lhsType, scalar);
+ getFHEPayment().payForFheDiv(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheDiv, lhs, rhs, scalar, lhsType);
}
@@ -228,7 +195,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
- fhePayment.payForFheRem(msg.sender, lhsType, scalar);
+ getFHEPayment().payForFheRem(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheRem, lhs, rhs, scalar, lhsType);
}
@@ -237,7 +204,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
- fhePayment.payForFheBitAnd(msg.sender, lhsType, scalar);
+ getFHEPayment().payForFheBitAnd(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheBitAnd, lhs, rhs, scalar, lhsType);
}
@@ -246,7 +213,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
- fhePayment.payForFheBitOr(msg.sender, lhsType, scalar);
+ getFHEPayment().payForFheBitOr(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheBitOr, lhs, rhs, scalar, lhsType);
}
@@ -255,7 +222,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
- fhePayment.payForFheBitXor(msg.sender, lhsType, scalar);
+ getFHEPayment().payForFheBitXor(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheBitXor, lhs, rhs, scalar, lhsType);
}
@@ -264,7 +231,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
- fhePayment.payForFheShl(msg.sender, lhsType, scalar);
+ getFHEPayment().payForFheShl(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheShl, lhs, rhs, scalar, lhsType);
}
@@ -273,7 +240,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
- fhePayment.payForFheShr(msg.sender, lhsType, scalar);
+ getFHEPayment().payForFheShr(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheShr, lhs, rhs, scalar, lhsType);
}
@@ -282,7 +249,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
- fhePayment.payForFheRotl(msg.sender, lhsType, scalar);
+ getFHEPayment().payForFheRotl(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheRotl, lhs, rhs, scalar, lhsType);
}
@@ -291,7 +258,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
- fhePayment.payForFheRotr(msg.sender, lhsType, scalar);
+ getFHEPayment().payForFheRotr(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheRotr, lhs, rhs, scalar, lhsType);
}
@@ -314,7 +281,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
if (scalar == 0x01) {
require(lhsType <= 8, "Scalar fheEq for ebytesXXX types must use the overloaded fheEq");
}
- fhePayment.payForFheEq(msg.sender, lhsType, scalar);
+ getFHEPayment().payForFheEq(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheEq, lhs, rhs, scalar, 0);
}
@@ -324,8 +291,8 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
require(scalar == 0x01, "Overloaded fheEq is only for scalar ebytesXXX second operand");
- fhePayment.payForFheEq(msg.sender, lhsType, scalar);
- require(acl.isAllowed(lhs, msg.sender), "Sender doesn't own lhs on op");
+ getFHEPayment().payForFheEq(msg.sender, lhsType, scalar);
+ require(getACL().isAllowed(lhs, msg.sender), "Sender doesn't own lhs on op");
uint256 lenBytesPT = rhs.length;
if (lhsType == 9) {
require(lenBytesPT == 64, "Bytes array length of Bytes64 should be 64");
@@ -335,9 +302,9 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
// @note: i.e lhsType == 11 thanks to the first pre-condition
require(lenBytesPT == 256, "Bytes array length of Bytes256 should be 256");
}
- result = uint256(keccak256(abi.encodePacked(Operators.fheEq, lhs, rhs, scalar, acl, block.chainid)));
+ result = uint256(keccak256(abi.encodePacked(Operators.fheEq, lhs, rhs, scalar, getACL(), block.chainid)));
result = appendType(result, 0);
- acl.allowTransient(result, msg.sender);
+ getACL().allowTransient(result, msg.sender);
}
function fheNe(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
@@ -359,7 +326,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
if (scalar == 0x01) {
require(lhsType <= 8, "Scalar fheNe for ebytesXXX types must use the overloaded fheNe");
}
- fhePayment.payForFheNe(msg.sender, lhsType, scalar);
+ getFHEPayment().payForFheNe(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheNe, lhs, rhs, scalar, 0);
}
@@ -369,8 +336,8 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
require(scalar == 0x01, "Overloaded fheNe is only for scalar ebytesXXX second operand");
- fhePayment.payForFheNe(msg.sender, lhsType, scalar);
- require(acl.isAllowed(lhs, msg.sender), "Sender doesn't own lhs on op");
+ getFHEPayment().payForFheNe(msg.sender, lhsType, scalar);
+ require(getACL().isAllowed(lhs, msg.sender), "Sender doesn't own lhs on op");
uint256 lenBytesPT = rhs.length;
if (lhsType == 9) {
require(lenBytesPT == 64, "Bytes array length of Bytes64 should be 64");
@@ -380,9 +347,9 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
// @note: i.e lhsType == 11 thanks to the first pre-condition
require(lenBytesPT == 256, "Bytes array length of Bytes256 should be 256");
}
- result = uint256(keccak256(abi.encodePacked(Operators.fheNe, lhs, rhs, scalar, acl, block.chainid)));
+ result = uint256(keccak256(abi.encodePacked(Operators.fheNe, lhs, rhs, scalar, getACL(), block.chainid)));
result = appendType(result, 0);
- acl.allowTransient(result, msg.sender);
+ getACL().allowTransient(result, msg.sender);
}
function fheGe(uint256 lhs, uint256 rhs, bytes1 scalarByte) external virtual returns (uint256 result) {
@@ -390,7 +357,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
- fhePayment.payForFheGe(msg.sender, lhsType, scalar);
+ getFHEPayment().payForFheGe(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheGe, lhs, rhs, scalar, 0);
}
@@ -399,7 +366,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
- fhePayment.payForFheGt(msg.sender, lhsType, scalar);
+ getFHEPayment().payForFheGt(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheGt, lhs, rhs, scalar, 0);
}
@@ -408,7 +375,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
- fhePayment.payForFheLe(msg.sender, lhsType, scalar);
+ getFHEPayment().payForFheLe(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheLe, lhs, rhs, scalar, 0);
}
@@ -417,7 +384,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
- fhePayment.payForFheLt(msg.sender, lhsType, scalar);
+ getFHEPayment().payForFheLt(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheLt, lhs, rhs, scalar, 0);
}
@@ -426,7 +393,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
- fhePayment.payForFheMin(msg.sender, lhsType, scalar);
+ getFHEPayment().payForFheMin(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheMin, lhs, rhs, scalar, lhsType);
}
@@ -435,7 +402,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
requireType(lhs, supportedTypes);
uint8 lhsType = typeOf(lhs);
bytes1 scalar = scalarByte & 0x01;
- fhePayment.payForFheMax(msg.sender, lhsType, scalar);
+ getFHEPayment().payForFheMax(msg.sender, lhsType, scalar);
result = binaryOp(Operators.fheMax, lhs, rhs, scalar, lhsType);
}
@@ -443,7 +410,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(ct, supportedTypes);
uint8 typeCt = typeOf(ct);
- fhePayment.payForFheNeg(msg.sender, typeCt);
+ getFHEPayment().payForFheNeg(msg.sender, typeCt);
result = unaryOp(Operators.fheNeg, ct);
}
@@ -451,7 +418,7 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
requireType(ct, supportedTypes);
uint8 typeCt = typeOf(ct);
- fhePayment.payForFheNot(msg.sender, typeCt);
+ getFHEPayment().payForFheNot(msg.sender, typeCt);
result = unaryOp(Operators.fheNot, ct);
}
@@ -460,20 +427,20 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
address userAddress,
bytes memory inputProof,
bytes1 inputType
- ) external virtual returns (uint256 result) {
- ContextUserInputs memory contextUserInputs = ContextUserInputs({
- aclAddress: address(acl),
+ ) public virtual returns (uint256 result) {
+ IInputVerifier.ContextUserInputs memory contextUserInputs = IInputVerifier.ContextUserInputs({
+ aclAddress: address(getACL()),
userAddress: userAddress,
contractAddress: msg.sender
});
uint8 typeCt = typeOf(uint256(inputHandle));
require(uint8(inputType) == typeCt, "Wrong type");
- result = inputVerifier.verifyCiphertext(contextUserInputs, inputHandle, inputProof);
- acl.allowTransient(result, msg.sender);
+ result = getInputVerifier().verifyCiphertext(contextUserInputs, inputHandle, inputProof);
+ getACL().allowTransient(result, msg.sender);
}
- function cast(uint256 ct, bytes1 toType) external virtual returns (uint256 result) {
- require(acl.isAllowed(ct, msg.sender), "Sender doesn't own ct on cast");
+ function cast(uint256 ct, bytes1 toType) public virtual returns (uint256 result) {
+ require(getACL().isAllowed(ct, msg.sender), "Sender doesn't own ct on cast");
uint256 supportedTypesInput = (1 << 0) +
(1 << 1) +
(1 << 2) +
@@ -487,13 +454,13 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
require((1 << uint8(toType)) & supportedTypesOutput > 0, "Unsupported output type");
uint8 typeCt = typeOf(ct);
require(bytes1(typeCt) != toType, "Cannot cast to same type");
- fhePayment.payForCast(msg.sender, typeCt);
- result = uint256(keccak256(abi.encodePacked(Operators.cast, ct, toType, acl, block.chainid)));
+ getFHEPayment().payForCast(msg.sender, typeCt);
+ result = uint256(keccak256(abi.encodePacked(Operators.cast, ct, toType, getACL(), block.chainid)));
result = appendType(result, uint8(toType));
- acl.allowTransient(result, msg.sender);
+ getACL().allowTransient(result, msg.sender);
}
- function trivialEncrypt(uint256 pt, bytes1 toType) external virtual returns (uint256 result) {
+ function trivialEncrypt(uint256 pt, bytes1 toType) public virtual returns (uint256 result) {
uint256 supportedTypes = (1 << 0) +
(1 << 1) +
(1 << 2) +
@@ -505,18 +472,18 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
(1 << 8);
uint8 toT = uint8(toType);
require((1 << toT) & supportedTypes > 0, "Unsupported type");
- fhePayment.payForTrivialEncrypt(msg.sender, toT);
- result = uint256(keccak256(abi.encodePacked(Operators.trivialEncrypt, pt, toType, acl, block.chainid)));
+ getFHEPayment().payForTrivialEncrypt(msg.sender, toT);
+ result = uint256(keccak256(abi.encodePacked(Operators.trivialEncrypt, pt, toType, getACL(), block.chainid)));
result = appendType(result, toT);
- acl.allowTransient(result, msg.sender);
+ getACL().allowTransient(result, msg.sender);
}
- function trivialEncrypt(bytes memory pt, bytes1 toType) external virtual returns (uint256 result) {
+ function trivialEncrypt(bytes memory pt, bytes1 toType) public virtual returns (uint256 result) {
// @note: overloaded function for ebytesXX types
uint256 supportedTypes = (1 << 9) + (1 << 10) + (1 << 11);
uint8 toT = uint8(toType);
require((1 << toT) & supportedTypes > 0, "Unsupported type");
- fhePayment.payForTrivialEncrypt(msg.sender, toT);
+ getFHEPayment().payForTrivialEncrypt(msg.sender, toT);
uint256 lenBytesPT = pt.length;
if (toT == 9) {
require(lenBytesPT == 64, "Bytes array length of Bytes64 should be 64");
@@ -526,9 +493,9 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
// @note: i.e toT == 11 thanks to the pre-condition above
require(lenBytesPT == 256, "Bytes array length of Bytes256 should be 256");
}
- result = uint256(keccak256(abi.encodePacked(Operators.trivialEncrypt, pt, toType, acl, block.chainid)));
+ result = uint256(keccak256(abi.encodePacked(Operators.trivialEncrypt, pt, toType, getACL(), block.chainid)));
result = appendType(result, toT);
- acl.allowTransient(result, msg.sender);
+ getACL().allowTransient(result, msg.sender);
}
function fheIfThenElse(uint256 control, uint256 ifTrue, uint256 ifFalse) external virtual returns (uint256 result) {
@@ -546,11 +513,11 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
(1 << 11);
requireType(ifTrue, supportedTypes);
uint8 typeCt = typeOf(ifTrue);
- fhePayment.payForIfThenElse(msg.sender, typeCt);
+ getFHEPayment().payForIfThenElse(msg.sender, typeCt);
result = ternaryOp(Operators.fheIfThenElse, control, ifTrue, ifFalse);
}
- function fheRand(bytes1 randType) external virtual returns (uint256 result) {
+ function fheRand(bytes1 randType) public virtual returns (uint256 result) {
TFHEExecutorStorage storage $ = _getTFHEExecutorStorage();
uint256 supportedTypes = (1 << 0) +
(1 << 1) +
@@ -565,32 +532,52 @@ contract TFHEExecutor is UUPSUpgradeable, Ownable2StepUpgradeable {
(1 << 11);
uint8 randT = uint8(randType);
require((1 << randT) & supportedTypes > 0, "Unsupported erandom type");
- fhePayment.payForFheRand(msg.sender, randT);
+ getFHEPayment().payForFheRand(msg.sender, randT);
bytes16 seed = bytes16(
- keccak256(abi.encodePacked($.counterRand, acl, block.chainid, blockhash(block.number - 1), block.timestamp))
+ keccak256(
+ abi.encodePacked($.counterRand, getACL(), block.chainid, blockhash(block.number - 1), block.timestamp)
+ )
);
result = uint256(keccak256(abi.encodePacked(Operators.fheRand, randType, seed)));
result = appendType(result, randT);
- acl.allowTransient(result, msg.sender);
+ getACL().allowTransient(result, msg.sender);
$.counterRand++;
}
- function fheRandBounded(uint256 upperBound, bytes1 randType) external virtual returns (uint256 result) {
+ function fheRandBounded(uint256 upperBound, bytes1 randType) public virtual returns (uint256 result) {
TFHEExecutorStorage storage $ = _getTFHEExecutorStorage();
uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8);
uint8 randT = uint8(randType);
require((1 << randT) & supportedTypes > 0, "Unsupported erandom type");
require(isPowerOfTwo(upperBound), "UpperBound must be a power of 2");
- fhePayment.payForFheRandBounded(msg.sender, randT);
+ getFHEPayment().payForFheRandBounded(msg.sender, randT);
bytes16 seed = bytes16(
- keccak256(abi.encodePacked($.counterRand, acl, block.chainid, blockhash(block.number - 1), block.timestamp))
+ keccak256(
+ abi.encodePacked($.counterRand, getACL(), block.chainid, blockhash(block.number - 1), block.timestamp)
+ )
);
result = uint256(keccak256(abi.encodePacked(Operators.fheRandBounded, upperBound, randType, seed)));
result = appendType(result, randT);
- acl.allowTransient(result, msg.sender);
+ getACL().allowTransient(result, msg.sender);
$.counterRand++;
}
+ function getFHEPayment() internal view returns (IFHEPayment) {
+ return IFHEPayment(fhevmProvider.getFHEVMConfig().FHEPaymentAddress);
+ }
+
+ function getInputVerifier() internal view returns (IInputVerifier) {
+ return IInputVerifier(fhevmProvider.getFHEVMConfig().InputVerifierAddress);
+ }
+
+ function getACL() internal view returns (ACL) {
+ return ACL(fhevmProvider.getFHEVMConfig().ACLAddress);
+ }
+
+ function setFHEVMProvider(address fhevmProviderAddress) external onlyOwner {
+ fhevmProvider = IFHEVMConfigProvider(fhevmProviderAddress);
+ }
+
/// @notice Getter for the name and version of the contract
/// @return string representing the name and the version of the contract
function getVersion() external pure virtual returns (string memory) {
diff --git a/package.json b/package.json
index 297315f5..9c4b54ed 100644
--- a/package.json
+++ b/package.json
@@ -30,7 +30,7 @@
"task:deployGateway": "hardhat task:deployGateway",
"task:addRelayer": "hardhat task:addRelayer",
"task:removeRelayer": "hardhat task:removeRelayer",
- "fhevm:start": " ./launch-fhevm.sh",
+ "fhevm:start": " ./launch-fhevm-sepolia.sh",
"fhevm:stop": "docker rm -f fhevm",
"fhevm:restart": "fhevm:stop && fhevm:start"
},
diff --git a/payment/Payment.sol b/payment/Payment.sol
index 09f844f8..f233eab6 100644
--- a/payment/Payment.sol
+++ b/payment/Payment.sol
@@ -4,12 +4,7 @@ pragma solidity ^0.8.24;
import "../lib/FHEVMConfig.sol";
import "../lib/Impl.sol";
-
-interface IFHEPayment {
- function depositETH(address account) external payable;
- function withdrawETH(uint256 amount, address receiver) external;
- function getAvailableDepositsETH(address account) external view returns (uint256);
-}
+import "../lib/IFHEPayment.sol";
library Payment {
function depositForAccount(address account, uint256 amount) internal {
diff --git a/precompute-addresses.sh b/precompute-addresses.sh
index d4754064..c4091cb1 100755
--- a/precompute-addresses.sh
+++ b/precompute-addresses.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
npx hardhat clean
PRIVATE_KEY_GATEWAY_DEPLOYER=$(grep PRIVATE_KEY_GATEWAY_DEPLOYER .env | cut -d '"' -f 2)
@@ -9,4 +9,4 @@ npx hardhat task:computeACLAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
npx hardhat task:computeTFHEExecutorAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
npx hardhat task:computeKMSVerifierAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
npx hardhat task:computeInputVerifierAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --use-address true
-npx hardhat task:computeFHEPaymentAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
\ No newline at end of file
+npx hardhat task:computeFHEPaymentAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER"
diff --git a/scripts/faucet.sh b/scripts/faucet.sh
index bc06af3e..39a6990b 100755
--- a/scripts/faucet.sh
+++ b/scripts/faucet.sh
@@ -1,8 +1,8 @@
-#!/bin/bash
+#!/usr/bin/env bash
# Alice
npm run fhevm:faucet
-sleep 8
+sleep 8
npm run fhevm:faucet:bob
sleep 8
npm run fhevm:faucet:carol
diff --git a/tasks/taskDeploy.ts b/tasks/taskDeploy.ts
index aa0ba56f..5c687298 100644
--- a/tasks/taskDeploy.ts
+++ b/tasks/taskDeploy.ts
@@ -1,8 +1,8 @@
import dotenv from 'dotenv';
+import { ContractTransactionResponse } from 'ethers';
import fs from 'fs';
import { task, types } from 'hardhat/config';
import type { TaskArguments } from 'hardhat/types';
-import { KMSVerifier__factory } from '../types';
import { mustGetEnv } from './environment';
task('task:deployGateway')
@@ -119,6 +119,10 @@ task('task:deployFHEPayment')
console.log('FHEPayment was deployed at address:', address);
});
+interface IKMSVerifierMinimal {
+ addSigner(signer: string): Promise;
+}
+
task('task:addSigners')
.addParam('privateKey', 'The deployer private key')
.addParam('numSigners', 'Number of KMS signers to add')
@@ -130,8 +134,12 @@ task('task:addSigners')
)
.setAction(async function (taskArguments: TaskArguments, { ethers }) {
const deployer = new ethers.Wallet(taskArguments.privateKey).connect(ethers.provider);
+ const factory = await ethers.getContractFactory('KMSVerifier', deployer);
const kmsAdd = dotenv.parse(fs.readFileSync('lib/.env.kmsverifier')).KMS_VERIFIER_CONTRACT_ADDRESS;
- const kmsVerifier = KMSVerifier__factory.connect(kmsAdd, deployer);
+ // NOTE: we cannot use the Typechain types here due to bootstrapping issues: from a fresh clone types are
+ // not available, and if we use them here npm run typechain will fail, if we could then we'd use:
+ // const kmsVerifier = KMSVerifier__factory.connect(kmsAdd, deployer);
+ const kmsVerifier = factory.attach(kmsAdd) as unknown as IKMSVerifierMinimal;
for (let idx = 0; idx < taskArguments.numSigners; idx++) {
if (!taskArguments.useAddress) {
const privKeySigner = mustGetEnv(`PRIVATE_KEY_KMS_SIGNER_${idx}`);
diff --git a/test/tfheOperations/tfheOperations1.ts b/test/tfheOperations/tfheOperations1.ts
index 79f7ac90..223ca867 100644
--- a/test/tfheOperations/tfheOperations1.ts
+++ b/test/tfheOperations/tfheOperations1.ts
@@ -1,5 +1,16 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
+import {
+ createInstances,
+ decrypt128,
+ decrypt16,
+ decrypt32,
+ decrypt4,
+ decrypt64,
+ decrypt8,
+ decryptBool,
+} from '../instance';
+import { getSigners, initSigners } from '../signers';
import type {
TFHETestSuite1,
@@ -14,17 +25,6 @@ import type {
TFHETestSuite8,
TFHETestSuite9,
} from '../../types';
-import {
- createInstances,
- decrypt128,
- decrypt16,
- decrypt32,
- decrypt4,
- decrypt64,
- decrypt8,
- decryptBool,
-} from '../instance';
-import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
const signers = await getSigners();
diff --git a/test/tfheOperations/tfheOperations10.ts b/test/tfheOperations/tfheOperations10.ts
index 1029ad16..511033d6 100644
--- a/test/tfheOperations/tfheOperations10.ts
+++ b/test/tfheOperations/tfheOperations10.ts
@@ -1,5 +1,7 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
+import { createInstances, decrypt128, decrypt256, decryptBool } from '../instance';
+import { getSigners, initSigners } from '../signers';
import type {
TFHETestSuite1,
@@ -14,8 +16,6 @@ import type {
TFHETestSuite8,
TFHETestSuite9,
} from '../../types';
-import { createInstances, decrypt128, decrypt256, decryptBool } from '../instance';
-import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
const signers = await getSigners();
diff --git a/test/tfheOperations/tfheOperations11.ts b/test/tfheOperations/tfheOperations11.ts
index efde5b15..4bc3db29 100644
--- a/test/tfheOperations/tfheOperations11.ts
+++ b/test/tfheOperations/tfheOperations11.ts
@@ -1,5 +1,7 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
+import { createInstances, decrypt256, decryptBool } from '../instance';
+import { getSigners, initSigners } from '../signers';
import type {
TFHETestSuite1,
@@ -14,8 +16,6 @@ import type {
TFHETestSuite8,
TFHETestSuite9,
} from '../../types';
-import { createInstances, decrypt256, decryptBool } from '../instance';
-import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
const signers = await getSigners();
diff --git a/test/tfheOperations/tfheOperations12.ts b/test/tfheOperations/tfheOperations12.ts
index 9e0fdee9..67a577b0 100644
--- a/test/tfheOperations/tfheOperations12.ts
+++ b/test/tfheOperations/tfheOperations12.ts
@@ -1,5 +1,17 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
+import {
+ createInstances,
+ decrypt128,
+ decrypt16,
+ decrypt256,
+ decrypt32,
+ decrypt4,
+ decrypt64,
+ decrypt8,
+ decryptBool,
+} from '../instance';
+import { getSigners, initSigners } from '../signers';
import type {
TFHETestSuite1,
@@ -14,18 +26,6 @@ import type {
TFHETestSuite8,
TFHETestSuite9,
} from '../../types';
-import {
- createInstances,
- decrypt128,
- decrypt16,
- decrypt256,
- decrypt32,
- decrypt4,
- decrypt64,
- decrypt8,
- decryptBool,
-} from '../instance';
-import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
const signers = await getSigners();
diff --git a/test/tfheOperations/tfheOperations13.ts b/test/tfheOperations/tfheOperations13.ts
index b218bd49..4d17d9a5 100644
--- a/test/tfheOperations/tfheOperations13.ts
+++ b/test/tfheOperations/tfheOperations13.ts
@@ -1,5 +1,7 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
+import { createInstances, decrypt256 } from '../instance';
+import { getSigners, initSigners } from '../signers';
import type {
TFHETestSuite1,
@@ -14,8 +16,6 @@ import type {
TFHETestSuite8,
TFHETestSuite9,
} from '../../types';
-import { createInstances, decrypt256 } from '../instance';
-import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
const signers = await getSigners();
diff --git a/test/tfheOperations/tfheOperations2.ts b/test/tfheOperations/tfheOperations2.ts
index 68e9866e..a5344567 100644
--- a/test/tfheOperations/tfheOperations2.ts
+++ b/test/tfheOperations/tfheOperations2.ts
@@ -1,5 +1,7 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
+import { createInstances, decrypt128, decrypt16, decrypt256, decrypt4, decrypt8, decryptBool } from '../instance';
+import { getSigners, initSigners } from '../signers';
import type {
TFHETestSuite1,
@@ -14,8 +16,6 @@ import type {
TFHETestSuite8,
TFHETestSuite9,
} from '../../types';
-import { createInstances, decrypt128, decrypt16, decrypt256, decrypt4, decrypt8, decryptBool } from '../instance';
-import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
const signers = await getSigners();
diff --git a/test/tfheOperations/tfheOperations3.ts b/test/tfheOperations/tfheOperations3.ts
index 14aca6ca..0527de58 100644
--- a/test/tfheOperations/tfheOperations3.ts
+++ b/test/tfheOperations/tfheOperations3.ts
@@ -1,5 +1,16 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
+import {
+ createInstances,
+ decrypt128,
+ decrypt16,
+ decrypt256,
+ decrypt32,
+ decrypt64,
+ decrypt8,
+ decryptBool,
+} from '../instance';
+import { getSigners, initSigners } from '../signers';
import type {
TFHETestSuite1,
@@ -14,17 +25,6 @@ import type {
TFHETestSuite8,
TFHETestSuite9,
} from '../../types';
-import {
- createInstances,
- decrypt128,
- decrypt16,
- decrypt256,
- decrypt32,
- decrypt64,
- decrypt8,
- decryptBool,
-} from '../instance';
-import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
const signers = await getSigners();
diff --git a/test/tfheOperations/tfheOperations4.ts b/test/tfheOperations/tfheOperations4.ts
index 4b6551cc..71579f02 100644
--- a/test/tfheOperations/tfheOperations4.ts
+++ b/test/tfheOperations/tfheOperations4.ts
@@ -1,5 +1,7 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
+import { createInstances, decrypt16, decrypt32, decrypt64, decrypt8, decryptBool } from '../instance';
+import { getSigners, initSigners } from '../signers';
import type {
TFHETestSuite1,
@@ -14,8 +16,6 @@ import type {
TFHETestSuite8,
TFHETestSuite9,
} from '../../types';
-import { createInstances, decrypt16, decrypt32, decrypt64, decrypt8, decryptBool } from '../instance';
-import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
const signers = await getSigners();
diff --git a/test/tfheOperations/tfheOperations5.ts b/test/tfheOperations/tfheOperations5.ts
index dfe57773..a8fcbcae 100644
--- a/test/tfheOperations/tfheOperations5.ts
+++ b/test/tfheOperations/tfheOperations5.ts
@@ -1,5 +1,7 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
+import { createInstances, decrypt128, decrypt16, decrypt256, decrypt32, decrypt64, decryptBool } from '../instance';
+import { getSigners, initSigners } from '../signers';
import type {
TFHETestSuite1,
@@ -14,8 +16,6 @@ import type {
TFHETestSuite8,
TFHETestSuite9,
} from '../../types';
-import { createInstances, decrypt128, decrypt16, decrypt256, decrypt32, decrypt64, decryptBool } from '../instance';
-import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
const signers = await getSigners();
diff --git a/test/tfheOperations/tfheOperations6.ts b/test/tfheOperations/tfheOperations6.ts
index 106684d1..60d91584 100644
--- a/test/tfheOperations/tfheOperations6.ts
+++ b/test/tfheOperations/tfheOperations6.ts
@@ -1,5 +1,7 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
+import { createInstances, decrypt128, decrypt256, decrypt32, decrypt64, decryptBool } from '../instance';
+import { getSigners, initSigners } from '../signers';
import type {
TFHETestSuite1,
@@ -14,8 +16,6 @@ import type {
TFHETestSuite8,
TFHETestSuite9,
} from '../../types';
-import { createInstances, decrypt128, decrypt256, decrypt32, decrypt64, decryptBool } from '../instance';
-import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
const signers = await getSigners();
diff --git a/test/tfheOperations/tfheOperations7.ts b/test/tfheOperations/tfheOperations7.ts
index 3c4fb586..bffa349c 100644
--- a/test/tfheOperations/tfheOperations7.ts
+++ b/test/tfheOperations/tfheOperations7.ts
@@ -1,5 +1,7 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
+import { createInstances, decrypt256, decrypt32, decrypt64, decryptBool } from '../instance';
+import { getSigners, initSigners } from '../signers';
import type {
TFHETestSuite1,
@@ -14,8 +16,6 @@ import type {
TFHETestSuite8,
TFHETestSuite9,
} from '../../types';
-import { createInstances, decrypt256, decrypt32, decrypt64, decryptBool } from '../instance';
-import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
const signers = await getSigners();
diff --git a/test/tfheOperations/tfheOperations8.ts b/test/tfheOperations/tfheOperations8.ts
index 90cb1710..0914435f 100644
--- a/test/tfheOperations/tfheOperations8.ts
+++ b/test/tfheOperations/tfheOperations8.ts
@@ -1,5 +1,7 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
+import { createInstances, decrypt128, decrypt256, decrypt64, decryptBool } from '../instance';
+import { getSigners, initSigners } from '../signers';
import type {
TFHETestSuite1,
@@ -14,8 +16,6 @@ import type {
TFHETestSuite8,
TFHETestSuite9,
} from '../../types';
-import { createInstances, decrypt128, decrypt256, decrypt64, decryptBool } from '../instance';
-import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
const signers = await getSigners();
diff --git a/test/tfheOperations/tfheOperations9.ts b/test/tfheOperations/tfheOperations9.ts
index 82e8917b..a92d2337 100644
--- a/test/tfheOperations/tfheOperations9.ts
+++ b/test/tfheOperations/tfheOperations9.ts
@@ -1,7 +1,9 @@
import { expect } from 'chai';
import { ethers } from 'hardhat';
+import { createInstances, decrypt128, decryptBool } from '../instance';
+import { getSigners, initSigners } from '../signers';
-import {
+import type {
TFHETestSuite1,
TFHETestSuite10,
TFHETestSuite11,
@@ -14,8 +16,6 @@ import {
TFHETestSuite8,
TFHETestSuite9,
} from '../../types';
-import { createInstances, decrypt128, decryptBool } from '../instance';
-import { getSigners, initSigners } from '../signers';
async function deployTfheTestFixture1(): Promise {
const signers = await getSigners();