mirror of
https://github.com/selfxyz/self.git
synced 2026-01-07 22:04:03 -05:00
Feature/add prettier formatter (#568)
* Add Prettier configuration and ignore files for code formatting - Created .prettierignore to exclude specific directories and files from formatting. - Added .prettierrc.yml with custom settings for print width and trailing commas. - Updated package.json to include Prettier and its Solidity plugin as dependencies, along with scripts for formatting and checking code. * Run prettier formatting
This commit is contained in:
17
contracts/.prettierignore
Normal file
17
contracts/.prettierignore
Normal file
@@ -0,0 +1,17 @@
|
||||
# directories
|
||||
broadcast
|
||||
cache
|
||||
coverage
|
||||
node_modules
|
||||
out
|
||||
|
||||
# files
|
||||
*.env
|
||||
*.log
|
||||
.DS_Store
|
||||
.pnp.*
|
||||
bun.lockb
|
||||
lcov.info
|
||||
package-lock.json
|
||||
pnpm-lock.yaml
|
||||
yarn.lock
|
||||
8
contracts/.prettierrc.yml
Normal file
8
contracts/.prettierrc.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
printWidth: 120
|
||||
trailingComma: "all"
|
||||
overrides:
|
||||
- files: "*.md"
|
||||
options:
|
||||
proseWrap: "always"
|
||||
plugins:
|
||||
- prettier-plugin-solidity
|
||||
@@ -7,11 +7,14 @@ This is the implementation of contracts for verification and management of ident
|
||||
## ⚠️Cautions⚠️
|
||||
|
||||
When you do the upgrade, be careful with this storage patterns
|
||||
|
||||
- You can not change the order in which the contract state variables are declared, nor their type.
|
||||
|
||||
Pls see this page for more details: https://docs.openzeppelin.com/upgrades-plugins/writing-upgradeable#modifying-your-contracts
|
||||
Pls see this page for more details:
|
||||
https://docs.openzeppelin.com/upgrades-plugins/writing-upgradeable#modifying-your-contracts
|
||||
|
||||
## Integration Guide
|
||||
|
||||
In the npm package, you'll find the following directory structure:
|
||||
|
||||
```bash
|
||||
@@ -26,7 +29,7 @@ In the npm package, you'll find the following directory structure:
|
||||
│ ├── IIdentityRegistryV1.sol
|
||||
│ ├── IIdentityVerificationHubV1.sol
|
||||
│ ├── IPassportAirdropRoot.sol
|
||||
│ ├── IRegisterCircuitVerifier.sol
|
||||
│ ├── IRegisterCircuitVerifier.sol
|
||||
│ ├── ISelfVerificationRoot.sol
|
||||
│ └── IVcAndDiscloseCircuitVerifier.sol
|
||||
└── libraries
|
||||
@@ -37,53 +40,60 @@ In the npm package, you'll find the following directory structure:
|
||||
If you want to integrate SelfVerificationRoot.sol into your contract, you should also import these files.
|
||||
|
||||
```solidity
|
||||
import {SelfVerificationRoot} from "@selfxyz/contracts/contracts/abstract/SelfVerificationRoot.sol";
|
||||
import { SelfVerificationRoot } from "@selfxyz/contracts/contracts/abstract/SelfVerificationRoot.sol";
|
||||
|
||||
import {IVcAndDiscloseCircuitVerifier} from "@selfxyz/contracts/contracts/interfaces/IVcAndDiscloseCircuitVerifier.sol";
|
||||
import {
|
||||
IVcAndDiscloseCircuitVerifier
|
||||
} from "@selfxyz/contracts/contracts/interfaces/IVcAndDiscloseCircuitVerifier.sol";
|
||||
|
||||
import {IIdentityVerificationHubV1} from "@selfxyz/contracts/contracts/interfaces/IIdentityVerificationHubV1.sol";
|
||||
import { IIdentityVerificationHubV1 } from "@selfxyz/contracts/contracts/interfaces/IIdentityVerificationHubV1.sol";
|
||||
|
||||
import {CircuitConstants} from "@selfxyz/contracts/contracts/constants/CircuitConstants.sol";
|
||||
import { CircuitConstants } from "@selfxyz/contracts/contracts/constants/CircuitConstants.sol";
|
||||
```
|
||||
|
||||
And override verifySelfProof function and write your own logic.
|
||||
You can take a look at these examples.
|
||||
And override verifySelfProof function and write your own logic. You can take a look at these examples.
|
||||
|
||||
- [Airdrop](https://github.com/selfxyz/self/blob/main/contracts/contracts/example/Airdrop.sol)
|
||||
- [HappyBirthday](https://github.com/selfxyz/happy-birthday/blob/main/contracts/contracts/HappyBirthday.sol)
|
||||
|
||||
In the verifySelfProof function, you should add these validations
|
||||
|
||||
- Mandatory
|
||||
- scope validation
|
||||
- attestation id validation
|
||||
- scope validation
|
||||
- attestation id validation
|
||||
- Optional
|
||||
- nullifier validation
|
||||
- user id validation
|
||||
- age verification with olderThan
|
||||
- forbidden countries validation
|
||||
- ofac validation
|
||||
- nullifier validation
|
||||
- user id validation
|
||||
- age verification with olderThan
|
||||
- forbidden countries validation
|
||||
- ofac validation
|
||||
|
||||
Also, if you want to play with some attributes in the passport, you should import these libraries.
|
||||
``` solidity
|
||||
import {CircuitAttributeHandler} from "@selfxyz/contracts/contracts/libraries/CircuitAttributeHandler.sol";
|
||||
import {Formatter} from "@selfxyz/contracts/contracts/libraries/Formatter.sol";
|
||||
|
||||
```solidity
|
||||
import { CircuitAttributeHandler } from "@selfxyz/contracts/contracts/libraries/CircuitAttributeHandler.sol";
|
||||
import { Formatter } from "@selfxyz/contracts/contracts/libraries/Formatter.sol";
|
||||
```
|
||||
|
||||
CircuitAttributeHandler is the library to extract readable attributes in the passport from public signals.
|
||||
The formatter is responsible for converting other data included in the public signals.
|
||||
Use it when you want to validate information related to birthdays or the time when the proof was generated.
|
||||
CircuitAttributeHandler is the library to extract readable attributes in the passport from public signals. The formatter
|
||||
is responsible for converting other data included in the public signals. Use it when you want to validate information
|
||||
related to birthdays or the time when the proof was generated.
|
||||
|
||||
As an example, please refer to the following contract.
|
||||
|
||||
- [HappyBirthday](https://github.com/selfxyz/happy-birthday/blob/main/contracts/contracts/HappyBirthday.sol)
|
||||
- [getReadableRevealedData function in the hub contract](https://github.com/selfxyz/self/blob/bdcf9537b01570b2197ae378815adbcc9c8747e8/contracts/contracts/IdentityVerificationHubImplV1.sol#L313-L357)
|
||||
|
||||
## Building Contracts
|
||||
|
||||
1. Install dependencies:
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
2. Compile the contracts:
|
||||
|
||||
```bash
|
||||
yarn run compile
|
||||
```
|
||||
@@ -91,21 +101,25 @@ yarn run compile
|
||||
## Deployments
|
||||
|
||||
1. Deploy verifiers
|
||||
|
||||
```bash
|
||||
yarn run deploy:allverifiers:celo
|
||||
```
|
||||
|
||||
2. Deploy registry proxy and impl
|
||||
|
||||
```bash
|
||||
yarn run deploy:registry:celo
|
||||
```
|
||||
|
||||
3. Deploy hub proxy and impl
|
||||
|
||||
```bash
|
||||
yarn run deploy:hub:celo
|
||||
```
|
||||
|
||||
4. Update csca, ofac and hub address in registry
|
||||
|
||||
```bash
|
||||
yarn run update:cscaroot:celo
|
||||
yarn run update:ofacroot:celo
|
||||
@@ -115,11 +129,11 @@ yarn run update:hub:celo
|
||||
## Testing
|
||||
|
||||
When you compile the circuits, make sure you set the build flag to true for these circuits:
|
||||
|
||||
- register_sha256_sha256_sha256_rsa_65537_4096
|
||||
- dsc_sha256_rsa_65537_4096
|
||||
- vc_and_disclose
|
||||
Go to ../circuits/scripts/build/ and change false to true for these circuits.
|
||||
Then you can run the following command to see the coverage.
|
||||
- vc_and_disclose Go to ../circuits/scripts/build/ and change false to true for these circuits. Then you can run the
|
||||
following command to see the coverage.
|
||||
|
||||
```shell
|
||||
cd ../circuits
|
||||
@@ -130,45 +144,45 @@ yarn run test:coverage:local
|
||||
|
||||
## Deployed Contract Addresses
|
||||
|
||||
| Contract | Address |
|
||||
|----------|---------|
|
||||
| Verifier_dsc_sha1_ecdsa_brainpoolP256r1 | 0xE7B4A70fc1d96D3Fb6577206c932eF1e634Cf2d0 |
|
||||
| Verifier_dsc_sha1_rsa_65537_4096 | 0x19E25a5772df0D7D6Db59D94a4d6FBd7098a3012 |
|
||||
| Verifier_dsc_sha256_ecdsa_brainpoolP256r1 | 0x1F3afAe85992B1B8CF6946B091225dAF8307675d |
|
||||
| Verifier_dsc_sha256_ecdsa_brainpoolP384r1 | 0x52A6EF39655D662A8Cf8eB56CD853883fe43eb2b |
|
||||
| Verifier_dsc_sha256_ecdsa_secp256r1 | 0x643735Cd44F8b2BDa47b4a7962c8BDf12E6CDdf8 |
|
||||
| Verifier_dsc_sha256_ecdsa_secp384r1 | 0x00F0D1A32Def293DAB78100A6569ebb4EC035F82 |
|
||||
| Verifier_dsc_sha256_rsa_65537_4096 | 0x711e655c43410fB985c4EDB48E9bCBdDb770368d |
|
||||
| Verifier_dsc_sha256_rsapss_3_32_3072 | 0xDAFF470e561F3f96C7410AeF02196913E981fF1B |
|
||||
| Verifier_dsc_sha256_rsapss_65537_32_3072 | 0x07B6C2FFB098B131eAD104396d399177014ae15f |
|
||||
| Verifier_dsc_sha256_rsapss_65537_32_4096 | 0xFBDDADb864b24B2c4336081A22f41D04E7b35DA9 |
|
||||
| Verifier_dsc_sha384_ecdsa_brainpoolP384r1 | 0x6a40dfa6f99FA178aB6cc88928Bf30661e917A76 |
|
||||
| Verifier_dsc_sha384_ecdsa_secp384r1 | 0x1719430107E66717d8b34d4190838dfABAf810e6 |
|
||||
| Verifier_dsc_sha512_rsa_65537_4096 | 0xf5eE920d6D50a8A83C22f548bf406fCBcD558751 |
|
||||
| Verifier_dsc_sha512_rsapss_65537_64_4096 | 0x5438C4ebFD8Fcce6eb54542e3A5C192B22227f70 |
|
||||
| Verifier_register_sha1_sha1_sha1_ecdsa_brainpoolP224r1 | 0x8588e473428cf415F10AC96CAa701F6Cd1C8641F |
|
||||
| Verifier_register_sha1_sha1_sha1_rsa_65537_4096 | 0x15fd0d58cfF9DaA4A60105c0DAC73659530BB7f7 |
|
||||
| Verifier_register_sha1_sha256_sha256_rsa_65537_4096 | 0xaC5166A01Aee75A10703177896122F4d6e3836d1 |
|
||||
| Contract | Address |
|
||||
| ------------------------------------------------------------ | ------------------------------------------ |
|
||||
| Verifier_dsc_sha1_ecdsa_brainpoolP256r1 | 0xE7B4A70fc1d96D3Fb6577206c932eF1e634Cf2d0 |
|
||||
| Verifier_dsc_sha1_rsa_65537_4096 | 0x19E25a5772df0D7D6Db59D94a4d6FBd7098a3012 |
|
||||
| Verifier_dsc_sha256_ecdsa_brainpoolP256r1 | 0x1F3afAe85992B1B8CF6946B091225dAF8307675d |
|
||||
| Verifier_dsc_sha256_ecdsa_brainpoolP384r1 | 0x52A6EF39655D662A8Cf8eB56CD853883fe43eb2b |
|
||||
| Verifier_dsc_sha256_ecdsa_secp256r1 | 0x643735Cd44F8b2BDa47b4a7962c8BDf12E6CDdf8 |
|
||||
| Verifier_dsc_sha256_ecdsa_secp384r1 | 0x00F0D1A32Def293DAB78100A6569ebb4EC035F82 |
|
||||
| Verifier_dsc_sha256_rsa_65537_4096 | 0x711e655c43410fB985c4EDB48E9bCBdDb770368d |
|
||||
| Verifier_dsc_sha256_rsapss_3_32_3072 | 0xDAFF470e561F3f96C7410AeF02196913E981fF1B |
|
||||
| Verifier_dsc_sha256_rsapss_65537_32_3072 | 0x07B6C2FFB098B131eAD104396d399177014ae15f |
|
||||
| Verifier_dsc_sha256_rsapss_65537_32_4096 | 0xFBDDADb864b24B2c4336081A22f41D04E7b35DA9 |
|
||||
| Verifier_dsc_sha384_ecdsa_brainpoolP384r1 | 0x6a40dfa6f99FA178aB6cc88928Bf30661e917A76 |
|
||||
| Verifier_dsc_sha384_ecdsa_secp384r1 | 0x1719430107E66717d8b34d4190838dfABAf810e6 |
|
||||
| Verifier_dsc_sha512_rsa_65537_4096 | 0xf5eE920d6D50a8A83C22f548bf406fCBcD558751 |
|
||||
| Verifier_dsc_sha512_rsapss_65537_64_4096 | 0x5438C4ebFD8Fcce6eb54542e3A5C192B22227f70 |
|
||||
| Verifier_register_sha1_sha1_sha1_ecdsa_brainpoolP224r1 | 0x8588e473428cf415F10AC96CAa701F6Cd1C8641F |
|
||||
| Verifier_register_sha1_sha1_sha1_rsa_65537_4096 | 0x15fd0d58cfF9DaA4A60105c0DAC73659530BB7f7 |
|
||||
| Verifier_register_sha1_sha256_sha256_rsa_65537_4096 | 0xaC5166A01Aee75A10703177896122F4d6e3836d1 |
|
||||
| Verifier_register_sha224_sha224_sha224_ecdsa_brainpoolP224r1 | 0x7d9b7D2A95541b50CECDB44d82c0570a818111Ac |
|
||||
| Verifier_register_sha256_sha224_sha224_ecdsa_secp224r1 | 0x48cEc90de8d746efD316968Ea65417e74C6A1a74 |
|
||||
| Verifier_register_sha256_sha224_sha224_ecdsa_secp224r1 | 0x48cEc90de8d746efD316968Ea65417e74C6A1a74 |
|
||||
| Verifier_register_sha256_sha256_sha256_ecdsa_brainpoolP256r1 | 0x9C5Af0FC9A32b457e300905929A05356D3C0DB25 |
|
||||
| Verifier_register_sha256_sha256_sha256_ecdsa_brainpoolP384r1 | 0x5286E20745A0d4C35E6D97832D56e30A28303BD6 |
|
||||
| Verifier_register_sha256_sha256_sha256_ecdsa_secp256r1 | 0xaC861bf9FC8B44ccbAde8E2A39C851bbCf38c392 |
|
||||
| Verifier_register_sha256_sha256_sha256_ecdsa_secp384r1 | 0x03FCc979cf2d69275647095E4079A3389F24525D |
|
||||
| Verifier_register_sha256_sha256_sha256_rsa_3_4096 | 0xbE036B26317F013D2c6cB092Aa1fa903220be846 |
|
||||
| Verifier_register_sha256_sha256_sha256_rsa_65537_4096 | 0xE80537B3399bd405e40136D08e24c250397c09F1 |
|
||||
| Verifier_register_sha256_sha256_sha256_rsapss_3_32_2048 | 0xe063BD3188341B2D17d96cE38FD31584147d3219 |
|
||||
| Verifier_register_sha256_sha256_sha256_rsapss_65537_32_2048 | 0xe93Be9382868f30150cAF77793aF384905c2C7E4 |
|
||||
| Verifier_register_sha256_sha256_sha256_rsapss_65537_32_3072 | 0xD39E5eAfb6d266E3c4AC8255578F23a514fd8B36 |
|
||||
| Verifier_register_sha256_sha256_sha256_ecdsa_secp256r1 | 0xaC861bf9FC8B44ccbAde8E2A39C851bbCf38c392 |
|
||||
| Verifier_register_sha256_sha256_sha256_ecdsa_secp384r1 | 0x03FCc979cf2d69275647095E4079A3389F24525D |
|
||||
| Verifier_register_sha256_sha256_sha256_rsa_3_4096 | 0xbE036B26317F013D2c6cB092Aa1fa903220be846 |
|
||||
| Verifier_register_sha256_sha256_sha256_rsa_65537_4096 | 0xE80537B3399bd405e40136D08e24c250397c09F1 |
|
||||
| Verifier_register_sha256_sha256_sha256_rsapss_3_32_2048 | 0xe063BD3188341B2D17d96cE38FD31584147d3219 |
|
||||
| Verifier_register_sha256_sha256_sha256_rsapss_65537_32_2048 | 0xe93Be9382868f30150cAF77793aF384905c2C7E4 |
|
||||
| Verifier_register_sha256_sha256_sha256_rsapss_65537_32_3072 | 0xD39E5eAfb6d266E3c4AC8255578F23a514fd8B36 |
|
||||
| Verifier_register_sha384_sha384_sha384_ecdsa_brainpoolP384r1 | 0xd2F65a76A10f5E0e7aE9d18826ab463f4CEb33C9 |
|
||||
| Verifier_register_sha384_sha384_sha384_ecdsa_secp384r1 | 0xC33E6A04b7296A3062Cf438C33dc8D8157c3916d |
|
||||
| Verifier_register_sha384_sha384_sha384_rsapss_65537_48_2048 | 0xa7A5A581C2Eb8dF39f486e9ABBc4898546D70C3e |
|
||||
| Verifier_register_sha512_sha512_sha512_rsa_65537_4096 | 0x6C88A6Afc38cA2859e157532b1b872EcC1ED0424 |
|
||||
| Verifier_register_sha512_sha512_sha512_rsapss_65537_64_2048 | 0x04A1D0d51Bc078CB137088424b2ec569699dd7A5 |
|
||||
| Verifier_vc_and_disclose | 0x44d314c2F9b3690735808d26d17dFCc9F906A9B4 |
|
||||
| PoseidonT3 | 0xF134707a4C4a3a76b8410fC0294d620A7c341581 |
|
||||
| IdentityRegistryImplV1 | 0xC473d5F784e424A70Bf7aCf887E33448E64F8798 |
|
||||
| IdentityRegistry | 0x37F5CB8cB1f6B00aa768D8aA99F1A9289802A968 |
|
||||
| IdentityVerificationHubImplV1 | 0x85FD004B2312a6703F1ce293242Dc15B719772b1 |
|
||||
| IdentityVerificationHub | 0x77117D60eaB7C044e785D68edB6C7E0e134970Ea |
|
||||
| VerifyAll | 0xe6D61680A6ED381bb5A0dB5cF4E9Cc933cF43915 |
|
||||
| Verifier_register_sha384_sha384_sha384_ecdsa_secp384r1 | 0xC33E6A04b7296A3062Cf438C33dc8D8157c3916d |
|
||||
| Verifier_register_sha384_sha384_sha384_rsapss_65537_48_2048 | 0xa7A5A581C2Eb8dF39f486e9ABBc4898546D70C3e |
|
||||
| Verifier_register_sha512_sha512_sha512_rsa_65537_4096 | 0x6C88A6Afc38cA2859e157532b1b872EcC1ED0424 |
|
||||
| Verifier_register_sha512_sha512_sha512_rsapss_65537_64_2048 | 0x04A1D0d51Bc078CB137088424b2ec569699dd7A5 |
|
||||
| Verifier_vc_and_disclose | 0x44d314c2F9b3690735808d26d17dFCc9F906A9B4 |
|
||||
| PoseidonT3 | 0xF134707a4C4a3a76b8410fC0294d620A7c341581 |
|
||||
| IdentityRegistryImplV1 | 0xC473d5F784e424A70Bf7aCf887E33448E64F8798 |
|
||||
| IdentityRegistry | 0x37F5CB8cB1f6B00aa768D8aA99F1A9289802A968 |
|
||||
| IdentityVerificationHubImplV1 | 0x85FD004B2312a6703F1ce293242Dc15B719772b1 |
|
||||
| IdentityVerificationHub | 0x77117D60eaB7C044e785D68edB6C7E0e134970Ea |
|
||||
| VerifyAll | 0xe6D61680A6ED381bb5A0dB5cF4E9Cc933cF43915 |
|
||||
|
||||
@@ -16,4 +16,4 @@ contract IdentityVerificationHub is ProxyRoot {
|
||||
* @param _data The initialization data to be executed in the context of the implementation contract.
|
||||
*/
|
||||
constructor(address _logic, bytes memory _data) ProxyRoot(_logic, _data) {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,25 +17,25 @@ import {ImplRoot} from "./upgradeable/ImplRoot.sol";
|
||||
/**
|
||||
* @notice ⚠️ CRITICAL STORAGE LAYOUT WARNING ⚠️
|
||||
* =============================================
|
||||
*
|
||||
*
|
||||
* This contract uses the UUPS upgradeable pattern which makes storage layout EXTREMELY SENSITIVE.
|
||||
*
|
||||
*
|
||||
* 🚫 NEVER MODIFY OR REORDER existing storage variables
|
||||
* 🚫 NEVER INSERT new variables between existing ones
|
||||
* 🚫 NEVER CHANGE THE TYPE of existing variables
|
||||
*
|
||||
*
|
||||
* ✅ New storage variables MUST be added in one of these two ways ONLY:
|
||||
* 1. At the END of the storage layout
|
||||
* 2. In a new V2 contract that inherits from this V1
|
||||
*
|
||||
*
|
||||
* Examples of forbidden changes:
|
||||
* - Changing uint256 to uint128
|
||||
* - Changing bytes32 to bytes
|
||||
* - Changing array type to mapping
|
||||
*
|
||||
*
|
||||
* For more detailed information about forbidden changes, please refer to:
|
||||
* https://docs.openzeppelin.com/upgrades-plugins/writing-upgradeable#modifying-your-contracts
|
||||
*
|
||||
*
|
||||
* ⚠️ VIOLATION OF THESE RULES WILL CAUSE CATASTROPHIC STORAGE COLLISIONS IN FUTURE UPGRADES ⚠️
|
||||
* =============================================
|
||||
*/
|
||||
@@ -45,13 +45,11 @@ import {ImplRoot} from "./upgradeable/ImplRoot.sol";
|
||||
* @notice Storage contract for IdentityVerificationHubImplV1.
|
||||
* @dev Inherits from ImplRoot to include upgradeability functionality.
|
||||
*/
|
||||
abstract contract IdentityVerificationHubStorageV1 is
|
||||
ImplRoot
|
||||
{
|
||||
abstract contract IdentityVerificationHubStorageV1 is ImplRoot {
|
||||
// ====================================================
|
||||
// Storage Variables
|
||||
// ====================================================
|
||||
|
||||
|
||||
/// @notice Address of the Identity Registry.
|
||||
address internal _registry;
|
||||
|
||||
@@ -70,10 +68,7 @@ abstract contract IdentityVerificationHubStorageV1 is
|
||||
* @notice Implementation contract for the Identity Verification Hub.
|
||||
* @dev Provides functions for registering commitments and verifying groth16 proofs and inclusion proofs.
|
||||
*/
|
||||
contract IdentityVerificationHubImplV1 is
|
||||
IdentityVerificationHubStorageV1,
|
||||
IIdentityVerificationHubV1
|
||||
{
|
||||
contract IdentityVerificationHubImplV1 is IdentityVerificationHubStorageV1, IIdentityVerificationHubV1 {
|
||||
using Formatter for uint256;
|
||||
|
||||
uint256 constant MAX_FORBIDDEN_COUNTRIES_LIST_LENGTH = 40;
|
||||
@@ -92,7 +87,7 @@ contract IdentityVerificationHubImplV1 is
|
||||
* @param dscCircuitVerifiers Array of DSC circuit verifier addresses.
|
||||
*/
|
||||
event HubInitialized(
|
||||
address registry,
|
||||
address registry,
|
||||
address vcAndDiscloseCircuitVerifier,
|
||||
uint256[] registerCircuitVerifierIds,
|
||||
address[] registerCircuitVerifiers,
|
||||
@@ -129,51 +124,51 @@ contract IdentityVerificationHubImplV1 is
|
||||
/// @notice Thrown when the lengths of provided arrays do not match.
|
||||
/// @dev Used when initializing or updating arrays that must have equal length.
|
||||
error LENGTH_MISMATCH();
|
||||
|
||||
|
||||
/// @notice Thrown when no verifier is set for a given signature type.
|
||||
/// @dev Indicates that the mapping lookup for the verifier returned the zero address.
|
||||
error NO_VERIFIER_SET();
|
||||
|
||||
|
||||
/// @notice Thrown when the current date in the proof is not within the valid range.
|
||||
/// @dev Ensures that the provided proof's date is within one day of the expected start time.
|
||||
error CURRENT_DATE_NOT_IN_VALID_RANGE();
|
||||
|
||||
|
||||
/// @notice Thrown when the 'older than' attribute in the proof is invalid.
|
||||
/// @dev The 'older than' value derived from the proof does not match the expected criteria.
|
||||
error INVALID_OLDER_THAN();
|
||||
|
||||
|
||||
/// @notice Thrown when the provided forbidden countries list is invalid.
|
||||
/// @dev The forbidden countries list in the proof does not match the expected packed data.
|
||||
error INVALID_FORBIDDEN_COUNTRIES();
|
||||
|
||||
|
||||
/// @notice Thrown when the OFAC check fails.
|
||||
/// @dev Indicates that the proof did not satisfy the required OFAC conditions.
|
||||
error INVALID_OFAC();
|
||||
|
||||
|
||||
/// @notice Thrown when the register circuit proof is invalid.
|
||||
/// @dev The register circuit verifier did not validate the provided proof.
|
||||
error INVALID_REGISTER_PROOF();
|
||||
|
||||
|
||||
/// @notice Thrown when the DSC circuit proof is invalid.
|
||||
/// @dev The DSC circuit verifier did not validate the provided proof.
|
||||
error INVALID_DSC_PROOF();
|
||||
|
||||
|
||||
/// @notice Thrown when the VC and Disclose proof is invalid.
|
||||
/// @dev The VC and Disclose circuit verifier did not validate the provided proof.
|
||||
error INVALID_VC_AND_DISCLOSE_PROOF();
|
||||
|
||||
|
||||
/// @notice Thrown when the provided commitment root is invalid.
|
||||
/// @dev Used in proofs to ensure that the commitment root matches the expected value in the registry.
|
||||
error INVALID_COMMITMENT_ROOT();
|
||||
|
||||
|
||||
/// @notice Thrown when the provided OFAC root is invalid.
|
||||
/// @dev Indicates that the OFAC root from the proof does not match the expected OFAC root.
|
||||
error INVALID_OFAC_ROOT();
|
||||
|
||||
|
||||
/// @notice Thrown when the provided CSCA root is invalid.
|
||||
/// @dev Indicates that the CSCA root from the DSC proof does not match the expected CSCA root.
|
||||
error INVALID_CSCA_ROOT();
|
||||
|
||||
|
||||
/// @notice Thrown when the revealed data type is invalid or not supported.
|
||||
/// @dev Raised during the processing of revealed data if it does not match any supported type.
|
||||
error INVALID_REVEALED_DATA_TYPE();
|
||||
@@ -228,7 +223,7 @@ contract IdentityVerificationHubImplV1 is
|
||||
_sigTypeToDscCircuitVerifiers[dscCircuitVerifierIds[i]] = dscCircuitVerifierAddresses[i];
|
||||
}
|
||||
emit HubInitialized(
|
||||
registryAddress,
|
||||
registryAddress,
|
||||
vcAndDiscloseCircuitVerifierAddress,
|
||||
registerCircuitVerifierIds,
|
||||
registerCircuitVerifierAddresses,
|
||||
@@ -245,13 +240,7 @@ contract IdentityVerificationHubImplV1 is
|
||||
* @notice Retrieves the registry address.
|
||||
* @return The address of the Identity Registry.
|
||||
*/
|
||||
function registry()
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
view
|
||||
returns (address)
|
||||
{
|
||||
function registry() external view virtual onlyProxy returns (address) {
|
||||
return _registry;
|
||||
}
|
||||
|
||||
@@ -259,13 +248,7 @@ contract IdentityVerificationHubImplV1 is
|
||||
* @notice Retrieves the VC and Disclose circuit verifier address.
|
||||
* @return The address of the VC and Disclose circuit verifier.
|
||||
*/
|
||||
function vcAndDiscloseCircuitVerifier()
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
view
|
||||
returns (address)
|
||||
{
|
||||
function vcAndDiscloseCircuitVerifier() external view virtual onlyProxy returns (address) {
|
||||
return _vcAndDiscloseCircuitVerifier;
|
||||
}
|
||||
|
||||
@@ -274,15 +257,7 @@ contract IdentityVerificationHubImplV1 is
|
||||
* @param typeId The signature type identifier.
|
||||
* @return The register circuit verifier address.
|
||||
*/
|
||||
function sigTypeToRegisterCircuitVerifiers(
|
||||
uint256 typeId
|
||||
)
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
view
|
||||
returns (address)
|
||||
{
|
||||
function sigTypeToRegisterCircuitVerifiers(uint256 typeId) external view virtual onlyProxy returns (address) {
|
||||
return _sigTypeToRegisterCircuitVerifiers[typeId];
|
||||
}
|
||||
|
||||
@@ -291,15 +266,7 @@ contract IdentityVerificationHubImplV1 is
|
||||
* @param typeId The signature type identifier.
|
||||
* @return The DSC circuit verifier address.
|
||||
*/
|
||||
function sigTypeToDscCircuitVerifiers(
|
||||
uint256 typeId
|
||||
)
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
view
|
||||
returns (address)
|
||||
{
|
||||
function sigTypeToDscCircuitVerifiers(uint256 typeId) external view virtual onlyProxy returns (address) {
|
||||
return _sigTypeToDscCircuitVerifiers[typeId];
|
||||
}
|
||||
|
||||
@@ -313,16 +280,8 @@ contract IdentityVerificationHubImplV1 is
|
||||
function getReadableRevealedData(
|
||||
uint256[3] memory revealedDataPacked,
|
||||
RevealedDataType[] memory types
|
||||
)
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
view
|
||||
returns (ReadableRevealedData memory)
|
||||
{
|
||||
bytes memory charcodes = Formatter.fieldElementsToBytes(
|
||||
revealedDataPacked
|
||||
);
|
||||
) external view virtual onlyProxy returns (ReadableRevealedData memory) {
|
||||
bytes memory charcodes = Formatter.fieldElementsToBytes(revealedDataPacked);
|
||||
|
||||
ReadableRevealedData memory attrs;
|
||||
|
||||
@@ -363,13 +322,7 @@ contract IdentityVerificationHubImplV1 is
|
||||
*/
|
||||
function getReadableForbiddenCountries(
|
||||
uint256[4] memory forbiddenCountriesListPacked
|
||||
)
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
view
|
||||
returns (string[MAX_FORBIDDEN_COUNTRIES_LIST_LENGTH] memory)
|
||||
{
|
||||
) external view virtual onlyProxy returns (string[MAX_FORBIDDEN_COUNTRIES_LIST_LENGTH] memory) {
|
||||
return Formatter.extractForbiddenCountriesFromPacked(forbiddenCountriesListPacked);
|
||||
}
|
||||
|
||||
@@ -381,26 +334,28 @@ contract IdentityVerificationHubImplV1 is
|
||||
*/
|
||||
function verifyVcAndDisclose(
|
||||
VcAndDiscloseHubProof memory proof
|
||||
)
|
||||
external
|
||||
virtual
|
||||
view
|
||||
onlyProxy
|
||||
returns (VcAndDiscloseVerificationResult memory)
|
||||
{
|
||||
) external view virtual onlyProxy returns (VcAndDiscloseVerificationResult memory) {
|
||||
VcAndDiscloseVerificationResult memory result;
|
||||
|
||||
|
||||
result.identityCommitmentRoot = _verifyVcAndDiscloseProof(proof);
|
||||
|
||||
for (uint256 i = 0; i < 3; i++) {
|
||||
result.revealedDataPacked[i] = proof.vcAndDiscloseProof.pubSignals[CircuitConstants.VC_AND_DISCLOSE_REVEALED_DATA_PACKED_INDEX + i];
|
||||
result.revealedDataPacked[i] = proof.vcAndDiscloseProof.pubSignals[
|
||||
CircuitConstants.VC_AND_DISCLOSE_REVEALED_DATA_PACKED_INDEX + i
|
||||
];
|
||||
}
|
||||
for (uint256 i = 0; i < 4; i++) {
|
||||
result.forbiddenCountriesListPacked[i] = proof.vcAndDiscloseProof.pubSignals[CircuitConstants.VC_AND_DISCLOSE_FORBIDDEN_COUNTRIES_LIST_PACKED_INDEX + i];
|
||||
result.forbiddenCountriesListPacked[i] = proof.vcAndDiscloseProof.pubSignals[
|
||||
CircuitConstants.VC_AND_DISCLOSE_FORBIDDEN_COUNTRIES_LIST_PACKED_INDEX + i
|
||||
];
|
||||
}
|
||||
result.nullifier = proof.vcAndDiscloseProof.pubSignals[CircuitConstants.VC_AND_DISCLOSE_NULLIFIER_INDEX];
|
||||
result.attestationId = proof.vcAndDiscloseProof.pubSignals[CircuitConstants.VC_AND_DISCLOSE_ATTESTATION_ID_INDEX];
|
||||
result.userIdentifier = proof.vcAndDiscloseProof.pubSignals[CircuitConstants.VC_AND_DISCLOSE_USER_IDENTIFIER_INDEX];
|
||||
result.attestationId = proof.vcAndDiscloseProof.pubSignals[
|
||||
CircuitConstants.VC_AND_DISCLOSE_ATTESTATION_ID_INDEX
|
||||
];
|
||||
result.userIdentifier = proof.vcAndDiscloseProof.pubSignals[
|
||||
CircuitConstants.VC_AND_DISCLOSE_USER_IDENTIFIER_INDEX
|
||||
];
|
||||
result.scope = proof.vcAndDiscloseProof.pubSignals[CircuitConstants.VC_AND_DISCLOSE_SCOPE_INDEX];
|
||||
return result;
|
||||
}
|
||||
@@ -418,11 +373,7 @@ contract IdentityVerificationHubImplV1 is
|
||||
function registerPassportCommitment(
|
||||
uint256 registerCircuitVerifierId,
|
||||
IRegisterCircuitVerifier.RegisterCircuitProof memory registerCircuitProof
|
||||
)
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
{
|
||||
) external virtual onlyProxy {
|
||||
_verifyPassportRegisterProof(registerCircuitVerifierId, registerCircuitProof);
|
||||
IIdentityRegistryV1(_registry).registerCommitment(
|
||||
AttestationId.E_PASSPORT,
|
||||
@@ -440,18 +391,13 @@ contract IdentityVerificationHubImplV1 is
|
||||
function registerDscKeyCommitment(
|
||||
uint256 dscCircuitVerifierId,
|
||||
IDscCircuitVerifier.DscCircuitProof memory dscCircuitProof
|
||||
)
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
{
|
||||
) external virtual onlyProxy {
|
||||
_verifyPassportDscProof(dscCircuitVerifierId, dscCircuitProof);
|
||||
IIdentityRegistryV1(_registry).registerDscKeyCommitment(
|
||||
dscCircuitProof.pubSignals[CircuitConstants.DSC_TREE_LEAF_INDEX]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ====================================================
|
||||
// External Functions - Only Owner
|
||||
// ====================================================
|
||||
@@ -460,14 +406,7 @@ contract IdentityVerificationHubImplV1 is
|
||||
* @notice Updates the registry address.
|
||||
* @param registryAddress The new registry address.
|
||||
*/
|
||||
function updateRegistry(
|
||||
address registryAddress
|
||||
)
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
onlyOwner
|
||||
{
|
||||
function updateRegistry(address registryAddress) external virtual onlyProxy onlyOwner {
|
||||
_registry = registryAddress;
|
||||
emit RegistryUpdated(registryAddress);
|
||||
}
|
||||
@@ -478,12 +417,7 @@ contract IdentityVerificationHubImplV1 is
|
||||
*/
|
||||
function updateVcAndDiscloseCircuit(
|
||||
address vcAndDiscloseCircuitVerifierAddress
|
||||
)
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
onlyOwner
|
||||
{
|
||||
) external virtual onlyProxy onlyOwner {
|
||||
_vcAndDiscloseCircuitVerifier = vcAndDiscloseCircuitVerifierAddress;
|
||||
emit VcAndDiscloseCircuitUpdated(vcAndDiscloseCircuitVerifierAddress);
|
||||
}
|
||||
@@ -494,14 +428,9 @@ contract IdentityVerificationHubImplV1 is
|
||||
* @param verifierAddress The new register circuit verifier address.
|
||||
*/
|
||||
function updateRegisterCircuitVerifier(
|
||||
uint256 typeId,
|
||||
uint256 typeId,
|
||||
address verifierAddress
|
||||
)
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
onlyOwner
|
||||
{
|
||||
) external virtual onlyProxy onlyOwner {
|
||||
_sigTypeToRegisterCircuitVerifiers[typeId] = verifierAddress;
|
||||
emit RegisterCircuitVerifierUpdated(typeId, verifierAddress);
|
||||
}
|
||||
@@ -511,15 +440,7 @@ contract IdentityVerificationHubImplV1 is
|
||||
* @param typeId The signature type identifier.
|
||||
* @param verifierAddress The new DSC circuit verifier address.
|
||||
*/
|
||||
function updateDscVerifier(
|
||||
uint256 typeId,
|
||||
address verifierAddress
|
||||
)
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
onlyOwner
|
||||
{
|
||||
function updateDscVerifier(uint256 typeId, address verifierAddress) external virtual onlyProxy onlyOwner {
|
||||
_sigTypeToDscCircuitVerifiers[typeId] = verifierAddress;
|
||||
emit DscCircuitVerifierUpdated(typeId, verifierAddress);
|
||||
}
|
||||
@@ -532,12 +453,7 @@ contract IdentityVerificationHubImplV1 is
|
||||
function batchUpdateRegisterCircuitVerifiers(
|
||||
uint256[] calldata typeIds,
|
||||
address[] calldata verifierAddresses
|
||||
)
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
onlyOwner
|
||||
{
|
||||
) external virtual onlyProxy onlyOwner {
|
||||
if (typeIds.length != verifierAddresses.length) {
|
||||
revert LENGTH_MISMATCH();
|
||||
}
|
||||
@@ -555,12 +471,7 @@ contract IdentityVerificationHubImplV1 is
|
||||
function batchUpdateDscCircuitVerifiers(
|
||||
uint256[] calldata typeIds,
|
||||
address[] calldata verifierAddresses
|
||||
)
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
onlyOwner
|
||||
{
|
||||
) external virtual onlyProxy onlyOwner {
|
||||
if (typeIds.length != verifierAddresses.length) {
|
||||
revert LENGTH_MISMATCH();
|
||||
}
|
||||
@@ -582,13 +493,13 @@ contract IdentityVerificationHubImplV1 is
|
||||
*/
|
||||
function _verifyVcAndDiscloseProof(
|
||||
VcAndDiscloseHubProof memory proof
|
||||
)
|
||||
internal
|
||||
view
|
||||
returns (uint256 identityCommitmentRoot)
|
||||
{
|
||||
) internal view returns (uint256 identityCommitmentRoot) {
|
||||
// verify identity commitment root
|
||||
if (!IIdentityRegistryV1(_registry).checkIdentityCommitmentRoot(proof.vcAndDiscloseProof.pubSignals[CircuitConstants.VC_AND_DISCLOSE_MERKLE_ROOT_INDEX])) {
|
||||
if (
|
||||
!IIdentityRegistryV1(_registry).checkIdentityCommitmentRoot(
|
||||
proof.vcAndDiscloseProof.pubSignals[CircuitConstants.VC_AND_DISCLOSE_MERKLE_ROOT_INDEX]
|
||||
)
|
||||
) {
|
||||
revert INVALID_COMMITMENT_ROOT();
|
||||
}
|
||||
|
||||
@@ -599,7 +510,7 @@ contract IdentityVerificationHubImplV1 is
|
||||
}
|
||||
|
||||
uint currentTimestamp = Formatter.proofDateToUnixTimestamp(dateNum);
|
||||
if(
|
||||
if (
|
||||
currentTimestamp < _getStartOfDayTimestamp() - 1 days + 1 ||
|
||||
currentTimestamp > _getStartOfDayTimestamp() + 1 days - 1
|
||||
) {
|
||||
@@ -609,34 +520,48 @@ contract IdentityVerificationHubImplV1 is
|
||||
// verify attributes
|
||||
uint256[3] memory revealedDataPacked;
|
||||
for (uint256 i = 0; i < 3; i++) {
|
||||
revealedDataPacked[i] = proof.vcAndDiscloseProof.pubSignals[CircuitConstants.VC_AND_DISCLOSE_REVEALED_DATA_PACKED_INDEX + i];
|
||||
revealedDataPacked[i] = proof.vcAndDiscloseProof.pubSignals[
|
||||
CircuitConstants.VC_AND_DISCLOSE_REVEALED_DATA_PACKED_INDEX + i
|
||||
];
|
||||
}
|
||||
if (proof.olderThanEnabled) {
|
||||
if (!CircuitAttributeHandler.compareOlderThan(Formatter.fieldElementsToBytes(revealedDataPacked), proof.olderThan)) {
|
||||
if (
|
||||
!CircuitAttributeHandler.compareOlderThan(
|
||||
Formatter.fieldElementsToBytes(revealedDataPacked),
|
||||
proof.olderThan
|
||||
)
|
||||
) {
|
||||
revert INVALID_OLDER_THAN();
|
||||
}
|
||||
}
|
||||
if (proof.ofacEnabled[0] || proof.ofacEnabled[1] || proof.ofacEnabled[2]) {
|
||||
if (!CircuitAttributeHandler.compareOfac(
|
||||
Formatter.fieldElementsToBytes(revealedDataPacked),
|
||||
proof.ofacEnabled[0],
|
||||
proof.ofacEnabled[1],
|
||||
proof.ofacEnabled[2]
|
||||
)) {
|
||||
if (
|
||||
!CircuitAttributeHandler.compareOfac(
|
||||
Formatter.fieldElementsToBytes(revealedDataPacked),
|
||||
proof.ofacEnabled[0],
|
||||
proof.ofacEnabled[1],
|
||||
proof.ofacEnabled[2]
|
||||
)
|
||||
) {
|
||||
revert INVALID_OFAC();
|
||||
}
|
||||
if (!IIdentityRegistryV1(_registry).checkOfacRoots(
|
||||
proof.vcAndDiscloseProof.pubSignals[CircuitConstants.VC_AND_DISCLOSE_PASSPORT_NO_SMT_ROOT_INDEX],
|
||||
proof.vcAndDiscloseProof.pubSignals[CircuitConstants.VC_AND_DISCLOSE_NAME_DOB_SMT_ROOT_INDEX],
|
||||
proof.vcAndDiscloseProof.pubSignals[CircuitConstants.VC_AND_DISCLOSE_NAME_YOB_SMT_ROOT_INDEX]
|
||||
)) {
|
||||
if (
|
||||
!IIdentityRegistryV1(_registry).checkOfacRoots(
|
||||
proof.vcAndDiscloseProof.pubSignals[CircuitConstants.VC_AND_DISCLOSE_PASSPORT_NO_SMT_ROOT_INDEX],
|
||||
proof.vcAndDiscloseProof.pubSignals[CircuitConstants.VC_AND_DISCLOSE_NAME_DOB_SMT_ROOT_INDEX],
|
||||
proof.vcAndDiscloseProof.pubSignals[CircuitConstants.VC_AND_DISCLOSE_NAME_YOB_SMT_ROOT_INDEX]
|
||||
)
|
||||
) {
|
||||
revert INVALID_OFAC_ROOT();
|
||||
}
|
||||
}
|
||||
if (proof.forbiddenCountriesEnabled) {
|
||||
for (uint256 i = 0; i < 4; i++) {
|
||||
if (
|
||||
proof.forbiddenCountriesListPacked[i] != proof.vcAndDiscloseProof.pubSignals[CircuitConstants.VC_AND_DISCLOSE_FORBIDDEN_COUNTRIES_LIST_PACKED_INDEX + i]
|
||||
proof.forbiddenCountriesListPacked[i] !=
|
||||
proof.vcAndDiscloseProof.pubSignals[
|
||||
CircuitConstants.VC_AND_DISCLOSE_FORBIDDEN_COUNTRIES_LIST_PACKED_INDEX + i
|
||||
]
|
||||
) {
|
||||
revert INVALID_FORBIDDEN_COUNTRIES();
|
||||
}
|
||||
@@ -644,7 +569,14 @@ contract IdentityVerificationHubImplV1 is
|
||||
}
|
||||
|
||||
// verify the proof using the VC and Disclose circuit verifier
|
||||
if (!IVcAndDiscloseCircuitVerifier(_vcAndDiscloseCircuitVerifier).verifyProof(proof.vcAndDiscloseProof.a, proof.vcAndDiscloseProof.b, proof.vcAndDiscloseProof.c, proof.vcAndDiscloseProof.pubSignals)) {
|
||||
if (
|
||||
!IVcAndDiscloseCircuitVerifier(_vcAndDiscloseCircuitVerifier).verifyProof(
|
||||
proof.vcAndDiscloseProof.a,
|
||||
proof.vcAndDiscloseProof.b,
|
||||
proof.vcAndDiscloseProof.c,
|
||||
proof.vcAndDiscloseProof.pubSignals
|
||||
)
|
||||
) {
|
||||
revert INVALID_VC_AND_DISCLOSE_PROOF();
|
||||
}
|
||||
|
||||
@@ -660,25 +592,28 @@ contract IdentityVerificationHubImplV1 is
|
||||
function _verifyPassportRegisterProof(
|
||||
uint256 registerCircuitVerifierId,
|
||||
IRegisterCircuitVerifier.RegisterCircuitProof memory registerCircuitProof
|
||||
)
|
||||
internal
|
||||
view
|
||||
{
|
||||
) internal view {
|
||||
address verifier = _sigTypeToRegisterCircuitVerifiers[registerCircuitVerifierId];
|
||||
if (verifier == address(0)) {
|
||||
revert NO_VERIFIER_SET();
|
||||
}
|
||||
|
||||
if (!IIdentityRegistryV1(_registry).checkDscKeyCommitmentMerkleRoot(registerCircuitProof.pubSignals[CircuitConstants.REGISTER_MERKLE_ROOT_INDEX])) {
|
||||
if (
|
||||
!IIdentityRegistryV1(_registry).checkDscKeyCommitmentMerkleRoot(
|
||||
registerCircuitProof.pubSignals[CircuitConstants.REGISTER_MERKLE_ROOT_INDEX]
|
||||
)
|
||||
) {
|
||||
revert INVALID_COMMITMENT_ROOT();
|
||||
}
|
||||
|
||||
if(!IRegisterCircuitVerifier(verifier).verifyProof(
|
||||
registerCircuitProof.a,
|
||||
registerCircuitProof.b,
|
||||
registerCircuitProof.c,
|
||||
registerCircuitProof.pubSignals
|
||||
)) {
|
||||
if (
|
||||
!IRegisterCircuitVerifier(verifier).verifyProof(
|
||||
registerCircuitProof.a,
|
||||
registerCircuitProof.b,
|
||||
registerCircuitProof.c,
|
||||
registerCircuitProof.pubSignals
|
||||
)
|
||||
) {
|
||||
revert INVALID_REGISTER_PROOF();
|
||||
}
|
||||
}
|
||||
@@ -692,25 +627,28 @@ contract IdentityVerificationHubImplV1 is
|
||||
function _verifyPassportDscProof(
|
||||
uint256 dscCircuitVerifierId,
|
||||
IDscCircuitVerifier.DscCircuitProof memory dscCircuitProof
|
||||
)
|
||||
internal
|
||||
view
|
||||
{
|
||||
) internal view {
|
||||
address verifier = _sigTypeToDscCircuitVerifiers[dscCircuitVerifierId];
|
||||
if (verifier == address(0)) {
|
||||
revert NO_VERIFIER_SET();
|
||||
}
|
||||
|
||||
if (!IIdentityRegistryV1(_registry).checkCscaRoot(dscCircuitProof.pubSignals[CircuitConstants.DSC_CSCA_ROOT_INDEX])) {
|
||||
if (
|
||||
!IIdentityRegistryV1(_registry).checkCscaRoot(
|
||||
dscCircuitProof.pubSignals[CircuitConstants.DSC_CSCA_ROOT_INDEX]
|
||||
)
|
||||
) {
|
||||
revert INVALID_CSCA_ROOT();
|
||||
}
|
||||
|
||||
if(!IDscCircuitVerifier(verifier).verifyProof(
|
||||
dscCircuitProof.a,
|
||||
dscCircuitProof.b,
|
||||
dscCircuitProof.c,
|
||||
dscCircuitProof.pubSignals
|
||||
)) {
|
||||
if (
|
||||
!IDscCircuitVerifier(verifier).verifyProof(
|
||||
dscCircuitProof.a,
|
||||
dscCircuitProof.b,
|
||||
dscCircuitProof.c,
|
||||
dscCircuitProof.pubSignals
|
||||
)
|
||||
) {
|
||||
revert INVALID_DSC_PROOF();
|
||||
}
|
||||
}
|
||||
@@ -723,4 +661,4 @@ contract IdentityVerificationHubImplV1 is
|
||||
function _getStartOfDayTimestamp() internal view returns (uint256) {
|
||||
return block.timestamp - (block.timestamp % 1 days);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import {AttestationId} from "../constants/AttestationId.sol";
|
||||
* @dev Provides base functionality for verifying and disclosing identity credentials
|
||||
*/
|
||||
abstract contract SelfVerificationRoot is ISelfVerificationRoot {
|
||||
|
||||
// ====================================================
|
||||
// Storage Variables
|
||||
// ====================================================
|
||||
@@ -40,7 +39,8 @@ abstract contract SelfVerificationRoot is ISelfVerificationRoot {
|
||||
|
||||
// Make CircuitConstants available to inheriting contracts
|
||||
uint256 internal constant REVEALED_DATA_PACKED_INDEX = CircuitConstants.VC_AND_DISCLOSE_REVEALED_DATA_PACKED_INDEX;
|
||||
uint256 internal constant FORBIDDEN_COUNTRIES_LIST_PACKED_INDEX = CircuitConstants.VC_AND_DISCLOSE_FORBIDDEN_COUNTRIES_LIST_PACKED_INDEX;
|
||||
uint256 internal constant FORBIDDEN_COUNTRIES_LIST_PACKED_INDEX =
|
||||
CircuitConstants.VC_AND_DISCLOSE_FORBIDDEN_COUNTRIES_LIST_PACKED_INDEX;
|
||||
uint256 internal constant NULLIFIER_INDEX = CircuitConstants.VC_AND_DISCLOSE_NULLIFIER_INDEX;
|
||||
uint256 internal constant ATTESTATION_ID_INDEX = CircuitConstants.VC_AND_DISCLOSE_ATTESTATION_ID_INDEX;
|
||||
uint256 internal constant MERKLE_ROOT_INDEX = CircuitConstants.VC_AND_DISCLOSE_MERKLE_ROOT_INDEX;
|
||||
@@ -75,11 +75,7 @@ abstract contract SelfVerificationRoot is ISelfVerificationRoot {
|
||||
* @param scope The expected proof scope for user registration.
|
||||
* @param attestationIds The expected attestation identifiers required in proofs.
|
||||
*/
|
||||
constructor(
|
||||
address identityVerificationHub,
|
||||
uint256 scope,
|
||||
uint256[] memory attestationIds
|
||||
) {
|
||||
constructor(address identityVerificationHub, uint256 scope, uint256[] memory attestationIds) {
|
||||
_identityVerificationHub = IIdentityVerificationHubV1(identityVerificationHub);
|
||||
_scope = scope;
|
||||
for (uint256 i = 0; i < attestationIds.length; i++) {
|
||||
@@ -92,12 +88,10 @@ abstract contract SelfVerificationRoot is ISelfVerificationRoot {
|
||||
* @dev Used to set or update verification parameters after contract deployment
|
||||
* @param verificationConfig The new verification configuration to apply
|
||||
*/
|
||||
function _setVerificationConfig(
|
||||
ISelfVerificationRoot.VerificationConfig memory verificationConfig
|
||||
) internal {
|
||||
function _setVerificationConfig(ISelfVerificationRoot.VerificationConfig memory verificationConfig) internal {
|
||||
_verificationConfig = verificationConfig;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notice Returns the current verification configuration
|
||||
* @dev Used to retrieve the current verification settings
|
||||
@@ -140,7 +134,9 @@ abstract contract SelfVerificationRoot is ISelfVerificationRoot {
|
||||
* @param pubSignals The proof's public signals
|
||||
* @return revealedDataPacked Array of the three packed revealed data values
|
||||
*/
|
||||
function getRevealedDataPacked(uint256[21] memory pubSignals) internal pure returns (uint256[3] memory revealedDataPacked) {
|
||||
function getRevealedDataPacked(
|
||||
uint256[21] memory pubSignals
|
||||
) internal pure returns (uint256[3] memory revealedDataPacked) {
|
||||
revealedDataPacked[0] = pubSignals[REVEALED_DATA_PACKED_INDEX];
|
||||
revealedDataPacked[1] = pubSignals[REVEALED_DATA_PACKED_INDEX + 1];
|
||||
revealedDataPacked[2] = pubSignals[REVEALED_DATA_PACKED_INDEX + 2];
|
||||
@@ -152,12 +148,7 @@ abstract contract SelfVerificationRoot is ISelfVerificationRoot {
|
||||
* @dev Validates scope and attestation ID before performing verification through the identity hub
|
||||
* @param proof The proof data for verification and disclosure
|
||||
*/
|
||||
function verifySelfProof(
|
||||
ISelfVerificationRoot.DiscloseCircuitProof memory proof
|
||||
)
|
||||
public
|
||||
virtual
|
||||
{
|
||||
function verifySelfProof(ISelfVerificationRoot.DiscloseCircuitProof memory proof) public virtual {
|
||||
if (_scope != proof.pubSignals[CircuitConstants.VC_AND_DISCLOSE_SCOPE_INDEX]) {
|
||||
revert InvalidScope();
|
||||
}
|
||||
@@ -182,4 +173,4 @@ abstract contract SelfVerificationRoot is ISelfVerificationRoot {
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,74 +8,73 @@ pragma solidity 0.8.28;
|
||||
* @dev These indices map directly to specific data fields in the corresponding circuits proofs.
|
||||
*/
|
||||
library CircuitConstants {
|
||||
|
||||
// ---------------------------
|
||||
// Register Circuit Constants
|
||||
// ---------------------------
|
||||
|
||||
|
||||
/**
|
||||
* @notice Index to access the nullifier in the register circuit public signals.
|
||||
*/
|
||||
uint256 constant REGISTER_NULLIFIER_INDEX = 0;
|
||||
|
||||
|
||||
/**
|
||||
* @notice Index to access the commitment in the register circuit public signals.
|
||||
*/
|
||||
uint256 constant REGISTER_COMMITMENT_INDEX = 1;
|
||||
|
||||
|
||||
/**
|
||||
* @notice Index to access the Merkle root in the register circuit public signals.
|
||||
*/
|
||||
uint256 constant REGISTER_MERKLE_ROOT_INDEX = 2;
|
||||
|
||||
|
||||
// ---------------------------
|
||||
// DSC Circuit Constants
|
||||
// ---------------------------
|
||||
|
||||
|
||||
/**
|
||||
* @notice Index to access the tree leaf in the DSC circuit public signals.
|
||||
*/
|
||||
uint256 constant DSC_TREE_LEAF_INDEX = 0;
|
||||
|
||||
|
||||
/**
|
||||
* @notice Index to access the CSCA root in the DSC circuit public signals.
|
||||
*/
|
||||
uint256 constant DSC_CSCA_ROOT_INDEX = 1;
|
||||
|
||||
|
||||
// -------------------------------------
|
||||
// VC and Disclose Circuit Constants
|
||||
// -------------------------------------
|
||||
|
||||
|
||||
/**
|
||||
* @notice Index to access the packed revealed data in the VC and Disclose circuit public signals.
|
||||
*/
|
||||
uint256 constant VC_AND_DISCLOSE_REVEALED_DATA_PACKED_INDEX = 0;
|
||||
|
||||
|
||||
/**
|
||||
* @notice Index to access the forbidden countries list (packed) in the VC and Disclose circuit public signals.
|
||||
*/
|
||||
uint256 constant VC_AND_DISCLOSE_FORBIDDEN_COUNTRIES_LIST_PACKED_INDEX = 3;
|
||||
|
||||
|
||||
/**
|
||||
* @notice Index to access the nullifier in the VC and Disclose circuit public signals.
|
||||
*/
|
||||
uint256 constant VC_AND_DISCLOSE_NULLIFIER_INDEX = 7;
|
||||
|
||||
|
||||
/**
|
||||
* @notice Index to access the attestation ID in the VC and Disclose circuit public signals.
|
||||
*/
|
||||
uint256 constant VC_AND_DISCLOSE_ATTESTATION_ID_INDEX = 8;
|
||||
|
||||
|
||||
/**
|
||||
* @notice Index to access the Merkle root in the VC and Disclose circuit public signals.
|
||||
*/
|
||||
uint256 constant VC_AND_DISCLOSE_MERKLE_ROOT_INDEX = 9;
|
||||
|
||||
|
||||
/**
|
||||
* @notice Index to access the current date in the VC and Disclose circuit public signals.
|
||||
*/
|
||||
uint256 constant VC_AND_DISCLOSE_CURRENT_DATE_INDEX = 10;
|
||||
|
||||
|
||||
/**
|
||||
* @notice Index to access the passport number SMT root in the VC and Disclose circuit public signals.
|
||||
*/
|
||||
@@ -100,4 +99,4 @@ library CircuitConstants {
|
||||
* @notice Index to access the user identifier in the VC and Disclose circuit public signals.
|
||||
*/
|
||||
uint256 constant VC_AND_DISCLOSE_USER_IDENTIFIER_INDEX = 20;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,20 +95,13 @@ contract Airdrop is SelfVerificationRoot, Ownable {
|
||||
* @param _token The address of the ERC20 token for airdrop.
|
||||
*/
|
||||
constructor(
|
||||
address _identityVerificationHub,
|
||||
uint256 _scope,
|
||||
address _identityVerificationHub,
|
||||
uint256 _scope,
|
||||
uint256[] memory _attestationIds,
|
||||
address _token
|
||||
)
|
||||
SelfVerificationRoot(
|
||||
_identityVerificationHub,
|
||||
_scope,
|
||||
_attestationIds
|
||||
)
|
||||
Ownable(_msgSender())
|
||||
{
|
||||
) SelfVerificationRoot(_identityVerificationHub, _scope, _attestationIds) Ownable(_msgSender()) {
|
||||
token = IERC20(_token);
|
||||
}
|
||||
}
|
||||
|
||||
// ====================================================
|
||||
// External/Public Functions
|
||||
@@ -170,7 +163,7 @@ contract Airdrop is SelfVerificationRoot, Ownable {
|
||||
*/
|
||||
function openRegistration() external onlyOwner {
|
||||
isRegistrationOpen = true;
|
||||
emit RegistrationOpen();
|
||||
emit RegistrationOpen();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -205,13 +198,7 @@ contract Airdrop is SelfVerificationRoot, Ownable {
|
||||
* @dev Reverts if the registration phase is not open.
|
||||
* @param proof The VC and Disclose proof data used to verify and register the user.
|
||||
*/
|
||||
function verifySelfProof(
|
||||
ISelfVerificationRoot.DiscloseCircuitProof memory proof
|
||||
)
|
||||
public
|
||||
override
|
||||
{
|
||||
|
||||
function verifySelfProof(ISelfVerificationRoot.DiscloseCircuitProof memory proof) public override {
|
||||
if (!isRegistrationOpen) {
|
||||
revert RegistrationNotOpen();
|
||||
}
|
||||
@@ -219,7 +206,7 @@ contract Airdrop is SelfVerificationRoot, Ownable {
|
||||
if (_nullifiers[proof.pubSignals[NULLIFIER_INDEX]] != 0) {
|
||||
revert RegisteredNullifier();
|
||||
}
|
||||
|
||||
|
||||
if (proof.pubSignals[USER_IDENTIFIER_INDEX] == 0) {
|
||||
revert InvalidUserIdentifier();
|
||||
}
|
||||
@@ -283,11 +270,7 @@ contract Airdrop is SelfVerificationRoot, Ownable {
|
||||
* @param amount The amount of tokens to be claimed.
|
||||
* @param merkleProof The Merkle proof verifying the claim.
|
||||
*/
|
||||
function claim(
|
||||
uint256 index,
|
||||
uint256 amount,
|
||||
bytes32[] memory merkleProof
|
||||
) external {
|
||||
function claim(uint256 index, uint256 amount, bytes32[] memory merkleProof) external {
|
||||
if (isRegistrationOpen) {
|
||||
revert RegistrationNotClosed();
|
||||
}
|
||||
|
||||
@@ -32,18 +32,14 @@ contract SelfPassportERC721 is SelfVerificationRoot, ERC721, Ownable {
|
||||
// Events
|
||||
// ====================================================
|
||||
|
||||
event PassportNFTMinted(
|
||||
uint256 indexed tokenId,
|
||||
address indexed owner,
|
||||
SelfCircuitLibrary.PassportData attributes
|
||||
);
|
||||
event PassportNFTMinted(uint256 indexed tokenId, address indexed owner, SelfCircuitLibrary.PassportData attributes);
|
||||
|
||||
/// @notice Emitted when the scope is updated
|
||||
event ScopeUpdated(uint256 newScope);
|
||||
|
||||
|
||||
/// @notice Emitted when a new attestation ID is added
|
||||
event AttestationIdAdded(uint256 attestationId);
|
||||
|
||||
|
||||
/// @notice Emitted when an attestation ID is removed
|
||||
event AttestationIdRemoved(uint256 attestationId);
|
||||
|
||||
@@ -73,11 +69,7 @@ contract SelfPassportERC721 is SelfVerificationRoot, ERC721, Ownable {
|
||||
uint256[] memory attestationIds,
|
||||
string memory name,
|
||||
string memory symbol
|
||||
)
|
||||
SelfVerificationRoot(identityVerificationHub, scope, attestationIds)
|
||||
ERC721(name, symbol)
|
||||
Ownable(_msgSender())
|
||||
{}
|
||||
) SelfVerificationRoot(identityVerificationHub, scope, attestationIds) ERC721(name, symbol) Ownable(_msgSender()) {}
|
||||
|
||||
// ====================================================
|
||||
// External/Public Functions
|
||||
@@ -128,9 +120,7 @@ contract SelfPassportERC721 is SelfVerificationRoot, ERC721, Ownable {
|
||||
* @notice Verifies a self-proof and mints an NFT with passport attributes
|
||||
* @param proof The VC and Disclose proof data used to verify and register the user
|
||||
*/
|
||||
function verifySelfProof(
|
||||
ISelfVerificationRoot.DiscloseCircuitProof memory proof
|
||||
) public override {
|
||||
function verifySelfProof(ISelfVerificationRoot.DiscloseCircuitProof memory proof) public override {
|
||||
if (_usedNullifiers[proof.pubSignals[NULLIFIER_INDEX]]) {
|
||||
revert NullifierAlreadyUsed();
|
||||
}
|
||||
@@ -213,4 +203,4 @@ contract SelfPassportERC721 is SelfVerificationRoot, ERC721, Ownable {
|
||||
function _exists(uint256 tokenId) internal view returns (bool) {
|
||||
return _ownerOf(tokenId) != address(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ pragma solidity 0.8.28;
|
||||
* @dev This interface defines the structure of a DSC circuit proof and exposes a function to verify such proofs.
|
||||
*/
|
||||
interface IDscCircuitVerifier {
|
||||
|
||||
/**
|
||||
* @notice Represents a DSC circuit proof.
|
||||
* @param a An array of two unsigned integers representing the proof component 'a'.
|
||||
@@ -31,10 +30,10 @@ interface IDscCircuitVerifier {
|
||||
* @param _pubSignals The public signals associated with the proof.
|
||||
* @return A boolean value indicating whether the provided proof is valid (true) or not (false).
|
||||
*/
|
||||
function verifyProof (
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[2] calldata _pubSignals
|
||||
) external view returns (bool);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,19 +20,14 @@ interface IIdentityRegistryV1 {
|
||||
* @param nullifier The nullifier to check.
|
||||
* @return True if the nullifier is registered; otherwise, false.
|
||||
*/
|
||||
function nullifiers(
|
||||
bytes32 attestationId,
|
||||
uint256 nullifier
|
||||
) external view returns (bool);
|
||||
function nullifiers(bytes32 attestationId, uint256 nullifier) external view returns (bool);
|
||||
|
||||
/**
|
||||
* @notice Checks whether a DSC key commitment is registered.
|
||||
* @param commitment The DSC key commitment to check.
|
||||
* @return True if the commitment is registered, false otherwise.
|
||||
*/
|
||||
function isRegisteredDscKeyCommitment(
|
||||
uint256 commitment
|
||||
) external view returns (bool);
|
||||
function isRegisteredDscKeyCommitment(uint256 commitment) external view returns (bool);
|
||||
|
||||
/**
|
||||
* @notice Retrieves the timestamp at which a given Merkle tree root was created.
|
||||
@@ -46,9 +41,7 @@ interface IIdentityRegistryV1 {
|
||||
* @param root The Merkle tree root to check.
|
||||
* @return True if the root exists in the tree, false otherwise.
|
||||
*/
|
||||
function checkIdentityCommitmentRoot(
|
||||
uint256 root
|
||||
) external view returns (bool);
|
||||
function checkIdentityCommitmentRoot(uint256 root) external view returns (bool);
|
||||
|
||||
/**
|
||||
* @notice Retrieves the total number of identity commitments in the Merkle tree.
|
||||
@@ -67,9 +60,7 @@ interface IIdentityRegistryV1 {
|
||||
* @param commitment The identity commitment to locate.
|
||||
* @return The index position of the provided commitment.
|
||||
*/
|
||||
function getIdentityCommitmentIndex(
|
||||
uint256 commitment
|
||||
) external view returns (uint256);
|
||||
function getIdentityCommitmentIndex(uint256 commitment) external view returns (uint256);
|
||||
|
||||
/**
|
||||
* @notice Retrieves the current passport number OFAC root.
|
||||
@@ -113,9 +104,7 @@ interface IIdentityRegistryV1 {
|
||||
* @param root The CSCA root to verify.
|
||||
* @return True if the given root equals the stored CSCA root, otherwise false.
|
||||
*/
|
||||
function checkCscaRoot(
|
||||
uint256 root
|
||||
) external view returns (bool);
|
||||
function checkCscaRoot(uint256 root) external view returns (bool);
|
||||
|
||||
/**
|
||||
* @notice Retrieves the current Merkle root of the DSC key commitments.
|
||||
@@ -128,9 +117,7 @@ interface IIdentityRegistryV1 {
|
||||
* @param root The root to check.
|
||||
* @return True if it matches the current root, false otherwise.
|
||||
*/
|
||||
function checkDscKeyCommitmentMerkleRoot(
|
||||
uint256 root
|
||||
) external view returns (bool);
|
||||
function checkDscKeyCommitmentMerkleRoot(uint256 root) external view returns (bool);
|
||||
|
||||
/**
|
||||
* @notice Retrieves the total number of DSC key commitments in the Merkle tree.
|
||||
@@ -143,9 +130,7 @@ interface IIdentityRegistryV1 {
|
||||
* @param commitment The DSC key commitment to locate.
|
||||
* @return The index of the provided commitment.
|
||||
*/
|
||||
function getDscKeyCommitmentIndex(
|
||||
uint256 commitment
|
||||
) external view returns (uint256);
|
||||
function getDscKeyCommitmentIndex(uint256 commitment) external view returns (uint256);
|
||||
|
||||
/**
|
||||
* @notice Registers a new identity commitment.
|
||||
@@ -154,18 +139,12 @@ interface IIdentityRegistryV1 {
|
||||
* @param nullifier A unique nullifier to prevent double registration.
|
||||
* @param commitment The identity commitment to register.
|
||||
*/
|
||||
function registerCommitment(
|
||||
bytes32 attestationId,
|
||||
uint256 nullifier,
|
||||
uint256 commitment
|
||||
) external;
|
||||
function registerCommitment(bytes32 attestationId, uint256 nullifier, uint256 commitment) external;
|
||||
|
||||
/**
|
||||
* @notice Registers a new DSC key commitment.
|
||||
* @dev Must be called by the identity verification hub. Reverts if the DSC key commitment is already registered.
|
||||
* @param dscCommitment The DSC key commitment to register.
|
||||
*/
|
||||
function registerDscKeyCommitment(
|
||||
uint256 dscCommitment
|
||||
) external;
|
||||
function registerDscKeyCommitment(uint256 dscCommitment) external;
|
||||
}
|
||||
|
||||
@@ -12,22 +12,21 @@ import {CircuitConstants} from "../constants/CircuitConstants.sol";
|
||||
* @dev Defines data structures and external functions for verifying proofs and recovering human-readable data.
|
||||
*/
|
||||
interface IIdentityVerificationHubV1 {
|
||||
|
||||
/**
|
||||
* @notice Enum representing types of data that may be revealed.
|
||||
*/
|
||||
enum RevealedDataType {
|
||||
ISSUING_STATE, // The issuing state of the passport.
|
||||
NAME, // The full name of the passport holder.
|
||||
PASSPORT_NUMBER, // The passport number.
|
||||
NATIONALITY, // The nationality.
|
||||
DATE_OF_BIRTH, // The date of birth.
|
||||
GENDER, // The gender.
|
||||
EXPIRY_DATE, // The passport expiry date.
|
||||
OLDER_THAN, // The "older than" age verification value.
|
||||
PASSPORT_NO_OFAC, // The passport number OFAC status.
|
||||
ISSUING_STATE, // The issuing state of the passport.
|
||||
NAME, // The full name of the passport holder.
|
||||
PASSPORT_NUMBER, // The passport number.
|
||||
NATIONALITY, // The nationality.
|
||||
DATE_OF_BIRTH, // The date of birth.
|
||||
GENDER, // The gender.
|
||||
EXPIRY_DATE, // The passport expiry date.
|
||||
OLDER_THAN, // The "older than" age verification value.
|
||||
PASSPORT_NO_OFAC, // The passport number OFAC status.
|
||||
NAME_AND_DOB_OFAC, // The name and date of birth OFAC verification result.
|
||||
NAME_AND_YOB_OFAC // The name and year of birth OFAC verification result.
|
||||
NAME_AND_YOB_OFAC // The name and year of birth OFAC verification result.
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,10 +103,7 @@ interface IIdentityVerificationHubV1 {
|
||||
*/
|
||||
function verifyVcAndDisclose(
|
||||
VcAndDiscloseHubProof memory proof
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (VcAndDiscloseVerificationResult memory result);
|
||||
) external view returns (VcAndDiscloseVerificationResult memory result);
|
||||
|
||||
/**
|
||||
* @notice Converts packed revealed data into a human-readable format.
|
||||
@@ -119,10 +115,7 @@ interface IIdentityVerificationHubV1 {
|
||||
function getReadableRevealedData(
|
||||
uint256[3] memory revealedDataPacked,
|
||||
RevealedDataType[] memory types
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (ReadableRevealedData memory readableData);
|
||||
) external view returns (ReadableRevealedData memory readableData);
|
||||
|
||||
/**
|
||||
* @notice Retrieves a human-readable list of forbidden countries.
|
||||
@@ -132,10 +125,7 @@ interface IIdentityVerificationHubV1 {
|
||||
*/
|
||||
function getReadableForbiddenCountries(
|
||||
uint256[4] memory forbiddenCountriesListPacked
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (string[40] memory forbiddenCountries);
|
||||
) external view returns (string[40] memory forbiddenCountries);
|
||||
|
||||
/**
|
||||
* @notice Registers a passport commitment using a register circuit proof.
|
||||
@@ -146,8 +136,7 @@ interface IIdentityVerificationHubV1 {
|
||||
function registerPassportCommitment(
|
||||
uint256 registerCircuitVerifierId,
|
||||
IRegisterCircuitVerifier.RegisterCircuitProof memory registerCircuitProof
|
||||
)
|
||||
external;
|
||||
) external;
|
||||
|
||||
/**
|
||||
* @notice Registers a DSC key commitment using a DSC circuit proof.
|
||||
@@ -158,8 +147,7 @@ interface IIdentityVerificationHubV1 {
|
||||
function registerDscKeyCommitment(
|
||||
uint256 dscCircuitVerifierId,
|
||||
IDscCircuitVerifier.DscCircuitProof memory dscCircuitProof
|
||||
)
|
||||
external;
|
||||
) external;
|
||||
|
||||
/**
|
||||
* @notice Returns the address of the Identity Registry.
|
||||
@@ -178,22 +166,12 @@ interface IIdentityVerificationHubV1 {
|
||||
* @param typeId The signature type identifier.
|
||||
* @return verifier The address of the register circuit verifier.
|
||||
*/
|
||||
function sigTypeToRegisterCircuitVerifiers(
|
||||
uint256 typeId
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (address verifier);
|
||||
function sigTypeToRegisterCircuitVerifiers(uint256 typeId) external view returns (address verifier);
|
||||
|
||||
/**
|
||||
* @notice Retrieves the DSC circuit verifier for a given signature type.
|
||||
* @param typeId The signature type identifier.
|
||||
* @return verifier The address of the DSC circuit verifier.
|
||||
*/
|
||||
function sigTypeToDscCircuitVerifiers(
|
||||
uint256 typeId
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (address verifier);
|
||||
}
|
||||
function sigTypeToDscCircuitVerifiers(uint256 typeId) external view returns (address verifier);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ pragma solidity 0.8.28;
|
||||
* the verification process during passport airdrop registration.
|
||||
*/
|
||||
interface IPassportAirdropRoot {
|
||||
|
||||
/**
|
||||
* @notice Configuration settings for the verification process.
|
||||
* @dev These settings determine which attributes are enabled for verification and the expected values.
|
||||
@@ -25,5 +24,4 @@ interface IPassportAirdropRoot {
|
||||
uint256[4] forbiddenCountriesListPacked;
|
||||
bool[3] ofacEnabled;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ pragma solidity 0.8.28;
|
||||
* @dev This interface defines the structure of a register circuit proof and exposes a function to verify such proofs.
|
||||
*/
|
||||
interface IRegisterCircuitVerifier {
|
||||
|
||||
/**
|
||||
* @notice Represents a register circuit proof.
|
||||
* @dev This structure encapsulates the required proof elements.
|
||||
@@ -31,10 +30,10 @@ interface IRegisterCircuitVerifier {
|
||||
* @param pubSignals The public signals associated with the proof.
|
||||
* @return isValid A boolean value indicating whether the provided proof is valid (true) or not (false).
|
||||
*/
|
||||
function verifyProof (
|
||||
function verifyProof(
|
||||
uint[2] calldata a,
|
||||
uint[2][2] calldata b,
|
||||
uint[2] calldata c,
|
||||
uint[3] calldata pubSignals
|
||||
) external view returns (bool isValid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ pragma solidity 0.8.28;
|
||||
import {IVcAndDiscloseCircuitVerifier} from "./IVcAndDiscloseCircuitVerifier.sol";
|
||||
|
||||
interface ISelfVerificationRoot {
|
||||
|
||||
struct VerificationConfig {
|
||||
bool olderThanEnabled;
|
||||
uint256 olderThan;
|
||||
@@ -19,13 +18,10 @@ interface ISelfVerificationRoot {
|
||||
uint256[2] c;
|
||||
uint256[21] pubSignals;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notice Verifies a self-proof
|
||||
* @param proof The proof data for verification and disclosure
|
||||
*/
|
||||
function verifySelfProof(
|
||||
DiscloseCircuitProof memory proof
|
||||
) external;
|
||||
|
||||
}
|
||||
function verifySelfProof(DiscloseCircuitProof memory proof) external;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ pragma solidity 0.8.28;
|
||||
* @dev This interface defines the structure of a VC and Disclose proof and a function to verify such proofs.
|
||||
*/
|
||||
interface IVcAndDiscloseCircuitVerifier {
|
||||
|
||||
/**
|
||||
* @notice Represents a VC and Disclose proof.
|
||||
* @param a An array of two unsigned integers representing the proof component 'a'.
|
||||
@@ -31,10 +30,10 @@ interface IVcAndDiscloseCircuitVerifier {
|
||||
* @param pubSignals The public signals associated with the proof.
|
||||
* @return A boolean value indicating whether the proof is valid (true) or not (false).
|
||||
*/
|
||||
function verifyProof (
|
||||
function verifyProof(
|
||||
uint[2] calldata a,
|
||||
uint[2][2] calldata b,
|
||||
uint[2] calldata c,
|
||||
uint[21] calldata pubSignals
|
||||
) external view returns (bool);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import {Formatter} from "./Formatter.sol";
|
||||
* @dev Utilizes the Formatter library for converting and formatting specific fields.
|
||||
*/
|
||||
library CircuitAttributeHandler {
|
||||
|
||||
/**
|
||||
* @dev Reverts when the provided character codes array does not contain enough data to extract an attribute.
|
||||
*/
|
||||
@@ -114,8 +113,10 @@ library CircuitAttributeHandler {
|
||||
* @return The extracted age as a uint256.
|
||||
*/
|
||||
function getOlderThan(bytes memory charcodes) internal pure returns (uint256) {
|
||||
return Formatter.numAsciiToUint(uint8(charcodes[OLDER_THAN_START])) * 10
|
||||
+ Formatter.numAsciiToUint(uint8(charcodes[OLDER_THAN_START + 1]));
|
||||
return
|
||||
Formatter.numAsciiToUint(uint8(charcodes[OLDER_THAN_START])) *
|
||||
10 +
|
||||
Formatter.numAsciiToUint(uint8(charcodes[OLDER_THAN_START + 1]));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -161,9 +162,10 @@ library CircuitAttributeHandler {
|
||||
bool checkNameAndDob,
|
||||
bool checkNameAndYob
|
||||
) internal pure returns (bool) {
|
||||
return (!checkPassportNo || getPassportNoOfac(charcodes) == 1) &&
|
||||
(!checkNameAndDob || getNameAndDobOfac(charcodes) == 1) &&
|
||||
(!checkNameAndYob || getNameAndYobOfac(charcodes) == 1);
|
||||
return
|
||||
(!checkPassportNo || getPassportNoOfac(charcodes) == 1) &&
|
||||
(!checkNameAndDob || getNameAndDobOfac(charcodes) == 1) &&
|
||||
(!checkNameAndYob || getNameAndYobOfac(charcodes) == 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -172,10 +174,7 @@ library CircuitAttributeHandler {
|
||||
* @param olderThan The threshold value to compare against.
|
||||
* @return True if the extracted age is greater than or equal to the threshold, false otherwise.
|
||||
*/
|
||||
function compareOlderThan(
|
||||
bytes memory charcodes,
|
||||
uint256 olderThan
|
||||
) internal pure returns (bool) {
|
||||
function compareOlderThan(bytes memory charcodes, uint256 olderThan) internal pure returns (bool) {
|
||||
return getOlderThan(charcodes) >= olderThan;
|
||||
}
|
||||
|
||||
@@ -187,7 +186,11 @@ library CircuitAttributeHandler {
|
||||
* @param end The ending index (inclusive) of the attribute in the byte array.
|
||||
* @return The extracted attribute as a string.
|
||||
*/
|
||||
function extractStringAttribute(bytes memory charcodes, uint256 start, uint256 end) internal pure returns (string memory) {
|
||||
function extractStringAttribute(
|
||||
bytes memory charcodes,
|
||||
uint256 start,
|
||||
uint256 end
|
||||
) internal pure returns (string memory) {
|
||||
if (charcodes.length <= end) {
|
||||
revert INSUFFICIENT_CHARCODE_LEN();
|
||||
}
|
||||
@@ -197,5 +200,4 @@ library CircuitAttributeHandler {
|
||||
}
|
||||
return string(attributeBytes);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,9 +23,7 @@ library Formatter {
|
||||
* @param input The input string structured as "lastName<<firstName(s)".
|
||||
* @return names An array of two strings: [firstName(s), lastName].
|
||||
*/
|
||||
function formatName(
|
||||
string memory input
|
||||
) internal pure returns (string[] memory) {
|
||||
function formatName(string memory input) internal pure returns (string[] memory) {
|
||||
bytes memory inputBytes = bytes(input);
|
||||
bytes memory firstNameBytes;
|
||||
bytes memory lastNameBytes;
|
||||
@@ -49,10 +47,7 @@ library Formatter {
|
||||
}
|
||||
firstNameBytes = abi.encodePacked(firstNameBytes, " ");
|
||||
} else {
|
||||
firstNameBytes = abi.encodePacked(
|
||||
firstNameBytes,
|
||||
inputBytes[i]
|
||||
);
|
||||
firstNameBytes = abi.encodePacked(firstNameBytes, inputBytes[i]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
@@ -69,19 +64,17 @@ library Formatter {
|
||||
* @param date A string representing the date in YYMMDD format.
|
||||
* @return A formatted date string in the format "DD-MM-YY".
|
||||
*/
|
||||
function formatDate(
|
||||
string memory date
|
||||
) internal pure returns (string memory) {
|
||||
function formatDate(string memory date) internal pure returns (string memory) {
|
||||
bytes memory dateBytes = bytes(date);
|
||||
if (dateBytes.length != 6) {
|
||||
revert InvalidDateLength();
|
||||
}
|
||||
|
||||
if (dateBytes[2] > '1' || (dateBytes[2] == '1' && dateBytes[3] > '2')) {
|
||||
if (dateBytes[2] > "1" || (dateBytes[2] == "1" && dateBytes[3] > "2")) {
|
||||
revert InvalidMonthRange();
|
||||
}
|
||||
|
||||
if (dateBytes[4] > '3' || (dateBytes[4] == '3' && dateBytes[5] > '1')) {
|
||||
if (dateBytes[4] > "3" || (dateBytes[4] == "3" && dateBytes[5] > "1")) {
|
||||
revert InvalidDayRange();
|
||||
}
|
||||
|
||||
@@ -109,9 +102,7 @@ library Formatter {
|
||||
* @param publicSignals An array of three unsigned integers representing field elements.
|
||||
* @return bytesArray A bytes array of total length 93 that encodes the three field elements.
|
||||
*/
|
||||
function fieldElementsToBytes(
|
||||
uint256[3] memory publicSignals
|
||||
) internal pure returns (bytes memory) {
|
||||
function fieldElementsToBytes(uint256[3] memory publicSignals) internal pure returns (bytes memory) {
|
||||
if (
|
||||
publicSignals[0] >= SNARK_SCALAR_FIELD ||
|
||||
publicSignals[1] >= SNARK_SCALAR_FIELD ||
|
||||
@@ -142,13 +133,7 @@ library Formatter {
|
||||
*/
|
||||
function extractForbiddenCountriesFromPacked(
|
||||
uint256[4] memory publicSignals
|
||||
)
|
||||
internal
|
||||
pure
|
||||
returns (
|
||||
string[MAX_FORBIDDEN_COUNTRIES_LIST_LENGTH] memory forbiddenCountries
|
||||
)
|
||||
{
|
||||
) internal pure returns (string[MAX_FORBIDDEN_COUNTRIES_LIST_LENGTH] memory forbiddenCountries) {
|
||||
for (uint256 i = 0; i < 4; i++) {
|
||||
if (publicSignals[i] >= SNARK_SCALAR_FIELD) {
|
||||
revert InvalidFieldElement();
|
||||
@@ -187,30 +172,25 @@ library Formatter {
|
||||
}
|
||||
|
||||
return forbiddenCountries;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @notice Converts an array of 6 numerical values representing a date into a Unix timestamp.
|
||||
* @dev Each element in the dateNum array is taken modulo 10, converted to its ASCII digit,
|
||||
* and concatenated to form a date string in YYMMDD format. This string is then converted
|
||||
* @dev Each element in the dateNum array is taken modulo 10, converted to its ASCII digit,
|
||||
* and concatenated to form a date string in YYMMDD format. This string is then converted
|
||||
* into a Unix timestamp using dateToUnixTimestamp.
|
||||
* @param dateNum An array of 6 unsigned integers representing a date in YYMMDD format.
|
||||
* @return timestamp The Unix timestamp corresponding to the provided date.
|
||||
*/
|
||||
function proofDateToUnixTimestamp(
|
||||
uint256[6] memory dateNum
|
||||
) internal pure returns (uint256) {
|
||||
function proofDateToUnixTimestamp(uint256[6] memory dateNum) internal pure returns (uint256) {
|
||||
for (uint256 i = 0; i < 6; i++) {
|
||||
if (dateNum[i] > 9) {
|
||||
revert InvalidDateDigit();
|
||||
if (dateNum[i] > 9) {
|
||||
revert InvalidDateDigit();
|
||||
}
|
||||
}
|
||||
string memory date = "";
|
||||
for (uint256 i = 0; i < 6; i++) {
|
||||
date = string(
|
||||
abi.encodePacked(date, bytes1(uint8(48 + (dateNum[i] % 10))))
|
||||
);
|
||||
date = string(abi.encodePacked(date, bytes1(uint8(48 + (dateNum[i] % 10)))));
|
||||
}
|
||||
uint256 currentTimestamp = dateToUnixTimestamp(date);
|
||||
return currentTimestamp;
|
||||
@@ -224,19 +204,17 @@ library Formatter {
|
||||
* @param date A 6-character string representing the date in YYMMDD format.
|
||||
* @return timestamp The Unix timestamp corresponding to the input date.
|
||||
*/
|
||||
function dateToUnixTimestamp(
|
||||
string memory date
|
||||
) internal pure returns (uint256) {
|
||||
function dateToUnixTimestamp(string memory date) internal pure returns (uint256) {
|
||||
bytes memory dateBytes = bytes(date);
|
||||
if (dateBytes.length != 6) {
|
||||
revert InvalidDateLength();
|
||||
}
|
||||
|
||||
if (dateBytes[2] > '1' || (dateBytes[2] == '1' && dateBytes[3] > '2')) {
|
||||
if (dateBytes[2] > "1" || (dateBytes[2] == "1" && dateBytes[3] > "2")) {
|
||||
revert InvalidMonthRange();
|
||||
}
|
||||
|
||||
if (dateBytes[4] > '3' || (dateBytes[4] == '3' && dateBytes[5] > '1')) {
|
||||
if (dateBytes[4] > "3" || (dateBytes[4] == "3" && dateBytes[5] > "1")) {
|
||||
revert InvalidDayRange();
|
||||
}
|
||||
|
||||
@@ -255,11 +233,7 @@ library Formatter {
|
||||
* @param endIndex The ending index of the substring (exclusive).
|
||||
* @return The resulting substring.
|
||||
*/
|
||||
function substring(
|
||||
string memory str,
|
||||
uint startIndex,
|
||||
uint endIndex
|
||||
) internal pure returns (string memory) {
|
||||
function substring(string memory str, uint startIndex, uint endIndex) internal pure returns (string memory) {
|
||||
bytes memory strBytes = bytes(str);
|
||||
bytes memory result = new bytes(endIndex - startIndex);
|
||||
|
||||
@@ -300,11 +274,7 @@ library Formatter {
|
||||
* @param day The day of the month.
|
||||
* @return timestamp The Unix timestamp corresponding to the given date.
|
||||
*/
|
||||
function toTimestamp(
|
||||
uint256 year,
|
||||
uint256 month,
|
||||
uint256 day
|
||||
) internal pure returns (uint timestamp) {
|
||||
function toTimestamp(uint256 year, uint256 month, uint256 day) internal pure returns (uint timestamp) {
|
||||
uint16 i;
|
||||
|
||||
if (year < 1970 || year > 2100) {
|
||||
@@ -377,5 +347,4 @@ library Formatter {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,20 +34,21 @@ library SelfCircuitLibrary {
|
||||
*/
|
||||
function extractPassportData(uint256[3] memory revealedDataPacked) internal pure returns (PassportData memory) {
|
||||
bytes memory charcodes = Formatter.fieldElementsToBytes(revealedDataPacked);
|
||||
|
||||
return PassportData({
|
||||
issuingState: CircuitAttributeHandler.getIssuingState(charcodes),
|
||||
name: CircuitAttributeHandler.getName(charcodes),
|
||||
passportNumber: CircuitAttributeHandler.getPassportNumber(charcodes),
|
||||
nationality: CircuitAttributeHandler.getNationality(charcodes),
|
||||
dateOfBirth: CircuitAttributeHandler.getDateOfBirth(charcodes),
|
||||
gender: CircuitAttributeHandler.getGender(charcodes),
|
||||
expiryDate: CircuitAttributeHandler.getExpiryDate(charcodes),
|
||||
olderThan: CircuitAttributeHandler.getOlderThan(charcodes),
|
||||
passportNoOfac: CircuitAttributeHandler.getPassportNoOfac(charcodes) == 1,
|
||||
nameAndDobOfac: CircuitAttributeHandler.getNameAndDobOfac(charcodes) == 1,
|
||||
nameAndYobOfac: CircuitAttributeHandler.getNameAndYobOfac(charcodes) == 1
|
||||
});
|
||||
|
||||
return
|
||||
PassportData({
|
||||
issuingState: CircuitAttributeHandler.getIssuingState(charcodes),
|
||||
name: CircuitAttributeHandler.getName(charcodes),
|
||||
passportNumber: CircuitAttributeHandler.getPassportNumber(charcodes),
|
||||
nationality: CircuitAttributeHandler.getNationality(charcodes),
|
||||
dateOfBirth: CircuitAttributeHandler.getDateOfBirth(charcodes),
|
||||
gender: CircuitAttributeHandler.getGender(charcodes),
|
||||
expiryDate: CircuitAttributeHandler.getExpiryDate(charcodes),
|
||||
olderThan: CircuitAttributeHandler.getOlderThan(charcodes),
|
||||
passportNoOfac: CircuitAttributeHandler.getPassportNoOfac(charcodes) == 1,
|
||||
nameAndDobOfac: CircuitAttributeHandler.getNameAndDobOfac(charcodes) == 1,
|
||||
nameAndYobOfac: CircuitAttributeHandler.getNameAndYobOfac(charcodes) == 1
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -186,12 +187,7 @@ library SelfCircuitLibrary {
|
||||
bool checkNameAndYob
|
||||
) internal pure returns (bool) {
|
||||
bytes memory charcodes = Formatter.fieldElementsToBytes(revealedDataPacked);
|
||||
return CircuitAttributeHandler.compareOfac(
|
||||
charcodes,
|
||||
checkPassportNo,
|
||||
checkNameAndDob,
|
||||
checkNameAndYob
|
||||
);
|
||||
return CircuitAttributeHandler.compareOfac(charcodes, checkPassportNo, checkNameAndDob, checkNameAndYob);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,4 +16,4 @@ contract IdentityRegistry is ProxyRoot {
|
||||
* @param _data The initialization data passed to the implementation during deployment.
|
||||
*/
|
||||
constructor(address _logic, bytes memory _data) ProxyRoot(_logic, _data) {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,34 +4,34 @@ pragma solidity 0.8.28;
|
||||
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
|
||||
import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
|
||||
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
|
||||
import { InternalLeanIMT, LeanIMTData } from "@zk-kit/imt.sol/internal/InternalLeanIMT.sol";
|
||||
import {InternalLeanIMT, LeanIMTData} from "@zk-kit/imt.sol/internal/InternalLeanIMT.sol";
|
||||
import {IIdentityRegistryV1} from "../interfaces/IIdentityRegistryV1.sol";
|
||||
import {IIdentityVerificationHubV1} from "../interfaces/IIdentityVerificationHubV1.sol";
|
||||
import {ImplRoot} from "../upgradeable/ImplRoot.sol";
|
||||
/**
|
||||
* @notice ⚠️ CRITICAL STORAGE LAYOUT WARNING ⚠️
|
||||
* =============================================
|
||||
*
|
||||
*
|
||||
* This contract uses the UUPS upgradeable pattern which makes storage layout EXTREMELY SENSITIVE.
|
||||
*
|
||||
*
|
||||
* 🚫 NEVER MODIFY OR REORDER existing storage variables
|
||||
* 🚫 NEVER INSERT new variables between existing ones
|
||||
* 🚫 NEVER CHANGE THE TYPE of existing variables
|
||||
*
|
||||
*
|
||||
* ✅ New storage variables MUST be added in one of these two ways ONLY:
|
||||
* 1. At the END of the storage layout
|
||||
* 2. In a new V2 contract that inherits from this V1
|
||||
* ✅ It is safe to rename variables (e.g., changing 'variable' to 'oldVariable')
|
||||
* as long as the type and order remain the same
|
||||
*
|
||||
*
|
||||
* Examples of forbidden changes:
|
||||
* - Changing uint256 to uint128
|
||||
* - Changing bytes32 to bytes
|
||||
* - Changing array type to mapping
|
||||
*
|
||||
*
|
||||
* For more detailed information about forbidden changes, please refer to:
|
||||
* https://docs.openzeppelin.com/upgrades-plugins/writing-upgradeable#modifying-your-contracts
|
||||
*
|
||||
*
|
||||
* ⚠️ VIOLATION OF THESE RULES WILL CAUSE CATASTROPHIC STORAGE COLLISIONS IN FUTURE UPGRADES ⚠️
|
||||
* =============================================
|
||||
*/
|
||||
@@ -41,9 +41,7 @@ import {ImplRoot} from "../upgradeable/ImplRoot.sol";
|
||||
* @dev Abstract contract for storage layout of IdentityRegistryImplV1.
|
||||
* Inherits from ImplRoot to provide upgradeable functionality.
|
||||
*/
|
||||
abstract contract IdentityRegistryStorageV1 is
|
||||
ImplRoot
|
||||
{
|
||||
abstract contract IdentityRegistryStorageV1 is ImplRoot {
|
||||
// ====================================================
|
||||
// Storage Variables
|
||||
// ====================================================
|
||||
@@ -85,10 +83,7 @@ abstract contract IdentityRegistryStorageV1 is
|
||||
* @notice Provides functions to register and manage identity commitments using a Merkle tree structure.
|
||||
* @dev Inherits from IdentityRegistryStorageV1 and implements IIdentityRegistryV1.
|
||||
*/
|
||||
contract IdentityRegistryImplV1 is
|
||||
IdentityRegistryStorageV1,
|
||||
IIdentityRegistryV1
|
||||
{
|
||||
contract IdentityRegistryImplV1 is IdentityRegistryStorageV1, IIdentityRegistryV1 {
|
||||
using InternalLeanIMT for LeanIMTData;
|
||||
|
||||
// ====================================================
|
||||
@@ -108,11 +103,25 @@ contract IdentityRegistryImplV1 is
|
||||
/// @notice Emitted when the name and year of birth OFAC root is updated.
|
||||
event NameAndYobOfacRootUpdated(uint256 nameAndYobOfacRoot);
|
||||
/// @notice Emitted when an identity commitment is successfully registered.
|
||||
event CommitmentRegistered(bytes32 indexed attestationId, uint256 indexed nullifier, uint256 indexed commitment, uint256 timestamp, uint256 imtRoot, uint256 imtIndex);
|
||||
event CommitmentRegistered(
|
||||
bytes32 indexed attestationId,
|
||||
uint256 indexed nullifier,
|
||||
uint256 indexed commitment,
|
||||
uint256 timestamp,
|
||||
uint256 imtRoot,
|
||||
uint256 imtIndex
|
||||
);
|
||||
/// @notice Emitted when a DSC key commitment is successfully registered.
|
||||
event DscKeyCommitmentRegistered(uint256 indexed commitment, uint256 timestamp, uint256 imtRoot, uint256 imtIndex);
|
||||
/// @notice Emitted when a identity commitment is added by dev team.
|
||||
event DevCommitmentRegistered(bytes32 indexed attestationId, uint256 indexed nullifier, uint256 indexed commitment, uint256 timestamp, uint256 imtRoot, uint256 imtIndex);
|
||||
event DevCommitmentRegistered(
|
||||
bytes32 indexed attestationId,
|
||||
uint256 indexed nullifier,
|
||||
uint256 indexed commitment,
|
||||
uint256 timestamp,
|
||||
uint256 imtRoot,
|
||||
uint256 imtIndex
|
||||
);
|
||||
/// @notice Emitted when a identity commitment is updated by dev team.
|
||||
event DevCommitmentUpdated(uint256 indexed oldLeaf, uint256 indexed newLeaf, uint256 imtRoot, uint256 timestamp);
|
||||
/// @notice Emitted when a identity commitment is removed by dev team.
|
||||
@@ -138,7 +147,7 @@ contract IdentityRegistryImplV1 is
|
||||
error ONLY_HUB_CAN_ACCESS();
|
||||
/// @notice Thrown when attempting to register a commitment that has already been registered.
|
||||
error REGISTERED_COMMITMENT();
|
||||
|
||||
|
||||
// ====================================================
|
||||
// Modifiers
|
||||
// ====================================================
|
||||
@@ -164,7 +173,7 @@ contract IdentityRegistryImplV1 is
|
||||
constructor() {
|
||||
_disableInitializers();
|
||||
}
|
||||
|
||||
|
||||
// ====================================================
|
||||
// Initializer
|
||||
// ====================================================
|
||||
@@ -173,12 +182,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @dev Sets the hub address and initializes the UUPS upgradeable feature.
|
||||
* @param _hub The address of the identity verification hub.
|
||||
*/
|
||||
function initialize(
|
||||
address _hub
|
||||
)
|
||||
external
|
||||
initializer
|
||||
{
|
||||
function initialize(address _hub) external initializer {
|
||||
__ImplRoot_init();
|
||||
_hub = _hub;
|
||||
emit RegistryInitialized(_hub);
|
||||
@@ -192,13 +196,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @notice Retrieves the hub address.
|
||||
* @return The current identity verification hub address.
|
||||
*/
|
||||
function hub()
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
view
|
||||
returns (address)
|
||||
{
|
||||
function hub() external view virtual onlyProxy returns (address) {
|
||||
return _hub;
|
||||
}
|
||||
|
||||
@@ -208,16 +206,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @param nullifier The nullifier to be checked.
|
||||
* @return True if the nullifier has been registered, false otherwise.
|
||||
*/
|
||||
function nullifiers(
|
||||
bytes32 attestationId,
|
||||
uint256 nullifier
|
||||
)
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
view
|
||||
returns (bool)
|
||||
{
|
||||
function nullifiers(bytes32 attestationId, uint256 nullifier) external view virtual onlyProxy returns (bool) {
|
||||
return _nullifiers[attestationId][nullifier];
|
||||
}
|
||||
|
||||
@@ -226,15 +215,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @param commitment The DSC key commitment.
|
||||
* @return True if the DSC key commitment is registered, false otherwise.
|
||||
*/
|
||||
function isRegisteredDscKeyCommitment(
|
||||
uint256 commitment
|
||||
)
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
view
|
||||
returns (bool)
|
||||
{
|
||||
function isRegisteredDscKeyCommitment(uint256 commitment) external view virtual onlyProxy returns (bool) {
|
||||
return _isRegisteredDscKeyCommitment[commitment];
|
||||
}
|
||||
|
||||
@@ -243,15 +224,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @param root The Merkle tree root.
|
||||
* @return The timestamp corresponding to the given root.
|
||||
*/
|
||||
function rootTimestamps(
|
||||
uint256 root
|
||||
)
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function rootTimestamps(uint256 root) external view virtual onlyProxy returns (uint256) {
|
||||
return _rootTimestamps[root];
|
||||
}
|
||||
|
||||
@@ -260,14 +233,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @param root The Merkle tree root.
|
||||
* @return True if the root exists, false otherwise.
|
||||
*/
|
||||
function checkIdentityCommitmentRoot(
|
||||
uint256 root
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (bool)
|
||||
{
|
||||
function checkIdentityCommitmentRoot(uint256 root) external view onlyProxy returns (bool) {
|
||||
return _rootTimestamps[root] != 0;
|
||||
}
|
||||
|
||||
@@ -275,12 +241,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @notice Retrieves the number of identity commitments in the Merkle tree.
|
||||
* @return The size of the identity commitment Merkle tree.
|
||||
*/
|
||||
function getIdentityCommitmentMerkleTreeSize()
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function getIdentityCommitmentMerkleTreeSize() external view onlyProxy returns (uint256) {
|
||||
return _identityCommitmentIMT.size;
|
||||
}
|
||||
|
||||
@@ -288,12 +249,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @notice Retrieves the current Merkle root of the identity commitments.
|
||||
* @return The current identity commitment Merkle root.
|
||||
*/
|
||||
function getIdentityCommitmentMerkleRoot()
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function getIdentityCommitmentMerkleRoot() external view onlyProxy returns (uint256) {
|
||||
return _identityCommitmentIMT._root();
|
||||
}
|
||||
|
||||
@@ -302,14 +258,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @param commitment The identity commitment to locate.
|
||||
* @return The index of the provided commitment within the Merkle tree.
|
||||
*/
|
||||
function getIdentityCommitmentIndex(
|
||||
uint256 commitment
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function getIdentityCommitmentIndex(uint256 commitment) external view onlyProxy returns (uint256) {
|
||||
return _identityCommitmentIMT._indexOf(commitment);
|
||||
}
|
||||
|
||||
@@ -317,12 +266,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @notice Retrieves the current passport number OFAC root.
|
||||
* @return The stored passport number OFAC root.
|
||||
*/
|
||||
function getPassportNoOfacRoot()
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function getPassportNoOfacRoot() external view onlyProxy returns (uint256) {
|
||||
return _passportNoOfacRoot;
|
||||
}
|
||||
|
||||
@@ -330,12 +274,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @notice Retrieves the current name and date of birth OFAC root.
|
||||
* @return The stored name and date of birth OFAC root.
|
||||
*/
|
||||
function getNameAndDobOfacRoot()
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function getNameAndDobOfacRoot() external view onlyProxy returns (uint256) {
|
||||
return _nameAndDobOfacRoot;
|
||||
}
|
||||
|
||||
@@ -343,12 +282,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @notice Retrieves the current name and year of birth OFAC root.
|
||||
* @return The stored name and year of birth OFAC root.
|
||||
*/
|
||||
function getNameAndYobOfacRoot()
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function getNameAndYobOfacRoot() external view onlyProxy returns (uint256) {
|
||||
return _nameAndYobOfacRoot;
|
||||
}
|
||||
|
||||
@@ -363,27 +297,18 @@ contract IdentityRegistryImplV1 is
|
||||
uint256 passportNoRoot,
|
||||
uint256 nameAndDobRoot,
|
||||
uint256 nameAndYobRoot
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (bool)
|
||||
{
|
||||
return _passportNoOfacRoot == passportNoRoot
|
||||
&& _nameAndDobOfacRoot == nameAndDobRoot
|
||||
&& _nameAndYobOfacRoot == nameAndYobRoot;
|
||||
) external view onlyProxy returns (bool) {
|
||||
return
|
||||
_passportNoOfacRoot == passportNoRoot &&
|
||||
_nameAndDobOfacRoot == nameAndDobRoot &&
|
||||
_nameAndYobOfacRoot == nameAndYobRoot;
|
||||
}
|
||||
|
||||
/**
|
||||
* @notice Retrieves the current CSCA root.
|
||||
* @return The stored CSCA root.
|
||||
*/
|
||||
function getCscaRoot()
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function getCscaRoot() external view onlyProxy returns (uint256) {
|
||||
return _cscaRoot;
|
||||
}
|
||||
|
||||
@@ -392,14 +317,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @param root The CSCA root to validate.
|
||||
* @return True if the provided root is equal to the stored CSCA root, false otherwise.
|
||||
*/
|
||||
function checkCscaRoot(
|
||||
uint256 root
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (bool)
|
||||
{
|
||||
function checkCscaRoot(uint256 root) external view onlyProxy returns (bool) {
|
||||
return _cscaRoot == root;
|
||||
}
|
||||
|
||||
@@ -407,12 +325,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @notice Retrieves the current Merkle root of the DSC key commitments.
|
||||
* @return The current DSC key commitment Merkle root.
|
||||
*/
|
||||
function getDscKeyCommitmentMerkleRoot()
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function getDscKeyCommitmentMerkleRoot() external view onlyProxy returns (uint256) {
|
||||
return _dscKeyCommitmentIMT._root();
|
||||
}
|
||||
|
||||
@@ -421,14 +334,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @param root The root to validate.
|
||||
* @return True if the roots match, false otherwise.
|
||||
*/
|
||||
function checkDscKeyCommitmentMerkleRoot(
|
||||
uint256 root
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (bool)
|
||||
{
|
||||
function checkDscKeyCommitmentMerkleRoot(uint256 root) external view onlyProxy returns (bool) {
|
||||
return _dscKeyCommitmentIMT._root() == root;
|
||||
}
|
||||
|
||||
@@ -436,12 +342,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @notice Retrieves the number of DSC key commitments in the Merkle tree.
|
||||
* @return The DSC key commitment Merkle tree size.
|
||||
*/
|
||||
function getDscKeyCommitmentTreeSize()
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function getDscKeyCommitmentTreeSize() external view onlyProxy returns (uint256) {
|
||||
return _dscKeyCommitmentIMT.size;
|
||||
}
|
||||
|
||||
@@ -450,14 +351,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @param commitment The DSC key commitment to locate.
|
||||
* @return The index of the provided commitment within the DSC key commitment Merkle tree.
|
||||
*/
|
||||
function getDscKeyCommitmentIndex(
|
||||
uint256 commitment
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function getDscKeyCommitmentIndex(uint256 commitment) external view onlyProxy returns (uint256) {
|
||||
return _dscKeyCommitmentIMT._indexOf(commitment);
|
||||
}
|
||||
|
||||
@@ -476,11 +370,7 @@ contract IdentityRegistryImplV1 is
|
||||
bytes32 attestationId,
|
||||
uint256 nullifier,
|
||||
uint256 commitment
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
onlyHub
|
||||
{
|
||||
) external onlyProxy onlyHub {
|
||||
if (_nullifiers[attestationId][nullifier]) revert REGISTERED_COMMITMENT();
|
||||
|
||||
_nullifiers[attestationId][nullifier] = true;
|
||||
@@ -495,13 +385,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @dev Caller must be the hub. Reverts if the commitment has already been registered.
|
||||
* @param dscCommitment The DSC key commitment to register.
|
||||
*/
|
||||
function registerDscKeyCommitment(
|
||||
uint256 dscCommitment
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
onlyHub
|
||||
{
|
||||
function registerDscKeyCommitment(uint256 dscCommitment) external onlyProxy onlyHub {
|
||||
if (_isRegisteredDscKeyCommitment[dscCommitment]) revert REGISTERED_COMMITMENT();
|
||||
|
||||
_isRegisteredDscKeyCommitment[dscCommitment] = true;
|
||||
@@ -509,7 +393,7 @@ contract IdentityRegistryImplV1 is
|
||||
uint256 imt_root = _addCommitment(_dscKeyCommitmentIMT, dscCommitment);
|
||||
emit DscKeyCommitmentRegistered(dscCommitment, block.timestamp, imt_root, index);
|
||||
}
|
||||
|
||||
|
||||
// ====================================================
|
||||
// External Functions - Only Owner
|
||||
// ====================================================
|
||||
@@ -519,13 +403,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @dev Callable only via a proxy and restricted to the contract owner.
|
||||
* @param newHubAddress The new address of the hub.
|
||||
*/
|
||||
function updateHub(
|
||||
address newHubAddress
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
onlyOwner
|
||||
{
|
||||
function updateHub(address newHubAddress) external onlyProxy onlyOwner {
|
||||
_hub = newHubAddress;
|
||||
emit HubUpdated(newHubAddress);
|
||||
}
|
||||
@@ -535,13 +413,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @dev Callable only via a proxy and restricted to the contract owner.
|
||||
* @param newPassportNoOfacRoot The new passport number OFAC root value.
|
||||
*/
|
||||
function updatePassportNoOfacRoot(
|
||||
uint256 newPassportNoOfacRoot
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
onlyOwner
|
||||
{
|
||||
function updatePassportNoOfacRoot(uint256 newPassportNoOfacRoot) external onlyProxy onlyOwner {
|
||||
_passportNoOfacRoot = newPassportNoOfacRoot;
|
||||
emit PassportNoOfacRootUpdated(newPassportNoOfacRoot);
|
||||
}
|
||||
@@ -551,13 +423,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @dev Callable only via a proxy and restricted to the contract owner.
|
||||
* @param newNameAndDobOfacRoot The new name and date of birth OFAC root value.
|
||||
*/
|
||||
function updateNameAndDobOfacRoot(
|
||||
uint256 newNameAndDobOfacRoot
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
onlyOwner
|
||||
{
|
||||
function updateNameAndDobOfacRoot(uint256 newNameAndDobOfacRoot) external onlyProxy onlyOwner {
|
||||
_nameAndDobOfacRoot = newNameAndDobOfacRoot;
|
||||
emit NameAndDobOfacRootUpdated(newNameAndDobOfacRoot);
|
||||
}
|
||||
@@ -567,13 +433,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @dev Callable only via a proxy and restricted to the contract owner.
|
||||
* @param newNameAndYobOfacRoot The new name and year of birth OFAC root value.
|
||||
*/
|
||||
function updateNameAndYobOfacRoot(
|
||||
uint256 newNameAndYobOfacRoot
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
onlyOwner
|
||||
{
|
||||
function updateNameAndYobOfacRoot(uint256 newNameAndYobOfacRoot) external onlyProxy onlyOwner {
|
||||
_nameAndYobOfacRoot = newNameAndYobOfacRoot;
|
||||
emit NameAndYobOfacRootUpdated(newNameAndYobOfacRoot);
|
||||
}
|
||||
@@ -583,18 +443,11 @@ contract IdentityRegistryImplV1 is
|
||||
* @dev Callable only via a proxy and restricted to the contract owner.
|
||||
* @param newCscaRoot The new CSCA root value.
|
||||
*/
|
||||
function updateCscaRoot(
|
||||
uint256 newCscaRoot
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
onlyOwner
|
||||
{
|
||||
function updateCscaRoot(uint256 newCscaRoot) external onlyProxy onlyOwner {
|
||||
_cscaRoot = newCscaRoot;
|
||||
emit CscaRootUpdated(newCscaRoot);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notice (DEV) Force-adds an identity commitment.
|
||||
* @dev Callable only by the owner for testing or administration.
|
||||
@@ -606,11 +459,7 @@ contract IdentityRegistryImplV1 is
|
||||
bytes32 attestationId,
|
||||
uint256 nullifier,
|
||||
uint256 commitment
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
onlyOwner
|
||||
{
|
||||
) external onlyProxy onlyOwner {
|
||||
_nullifiers[attestationId][nullifier] = true;
|
||||
uint256 imt_root = _addCommitment(_identityCommitmentIMT, commitment);
|
||||
_rootTimestamps[imt_root] = block.timestamp;
|
||||
@@ -629,11 +478,7 @@ contract IdentityRegistryImplV1 is
|
||||
uint256 oldLeaf,
|
||||
uint256 newLeaf,
|
||||
uint256[] calldata siblingNodes
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
onlyOwner
|
||||
{
|
||||
) external onlyProxy onlyOwner {
|
||||
uint256 imt_root = _updateCommitment(_identityCommitmentIMT, oldLeaf, newLeaf, siblingNodes);
|
||||
_rootTimestamps[imt_root] = block.timestamp;
|
||||
emit DevCommitmentUpdated(oldLeaf, newLeaf, imt_root, block.timestamp);
|
||||
@@ -645,31 +490,18 @@ contract IdentityRegistryImplV1 is
|
||||
* @param oldLeaf The identity commitment to remove.
|
||||
* @param siblingNodes An array of sibling nodes for Merkle proof generation.
|
||||
*/
|
||||
function devRemoveCommitment(
|
||||
uint256 oldLeaf,
|
||||
uint256[] calldata siblingNodes
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
onlyOwner
|
||||
{
|
||||
function devRemoveCommitment(uint256 oldLeaf, uint256[] calldata siblingNodes) external onlyProxy onlyOwner {
|
||||
uint256 imt_root = _removeCommitment(_identityCommitmentIMT, oldLeaf, siblingNodes);
|
||||
_rootTimestamps[imt_root] = block.timestamp;
|
||||
emit DevCommitmentRemoved(oldLeaf, imt_root, block.timestamp);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notice (DEV) Force-adds a DSC key commitment.
|
||||
* @dev Callable only by the owner for testing or administration.
|
||||
* @param dscCommitment The DSC key commitment to add.
|
||||
*/
|
||||
function devAddDscKeyCommitment(
|
||||
uint256 dscCommitment
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
onlyOwner
|
||||
{
|
||||
function devAddDscKeyCommitment(uint256 dscCommitment) external onlyProxy onlyOwner {
|
||||
_isRegisteredDscKeyCommitment[dscCommitment] = true;
|
||||
uint256 imt_root = _addCommitment(_dscKeyCommitmentIMT, dscCommitment);
|
||||
uint256 index = _dscKeyCommitmentIMT._indexOf(dscCommitment);
|
||||
@@ -687,11 +519,7 @@ contract IdentityRegistryImplV1 is
|
||||
uint256 oldLeaf,
|
||||
uint256 newLeaf,
|
||||
uint256[] calldata siblingNodes
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
onlyOwner
|
||||
{
|
||||
) external onlyProxy onlyOwner {
|
||||
uint256 imt_root = _updateCommitment(_dscKeyCommitmentIMT, oldLeaf, newLeaf, siblingNodes);
|
||||
emit DevDscKeyCommitmentUpdated(oldLeaf, newLeaf, imt_root);
|
||||
}
|
||||
@@ -702,14 +530,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @param oldLeaf The DSC key commitment to remove.
|
||||
* @param siblingNodes An array of sibling nodes for Merkle proof generation.
|
||||
*/
|
||||
function devRemoveDscKeyCommitment(
|
||||
uint256 oldLeaf,
|
||||
uint256[] calldata siblingNodes
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
onlyOwner
|
||||
{
|
||||
function devRemoveDscKeyCommitment(uint256 oldLeaf, uint256[] calldata siblingNodes) external onlyProxy onlyOwner {
|
||||
uint256 imt_root = _removeCommitment(_dscKeyCommitmentIMT, oldLeaf, siblingNodes);
|
||||
emit DevDscKeyCommitmentRemoved(oldLeaf, imt_root);
|
||||
}
|
||||
@@ -725,11 +546,7 @@ contract IdentityRegistryImplV1 is
|
||||
bytes32 attestationId,
|
||||
uint256 nullifier,
|
||||
bool state
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
onlyOwner
|
||||
{
|
||||
) external onlyProxy onlyOwner {
|
||||
_nullifiers[attestationId][nullifier] = state;
|
||||
emit DevNullifierStateChanged(attestationId, nullifier, state);
|
||||
}
|
||||
@@ -740,14 +557,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @param dscCommitment The DSC key commitment.
|
||||
* @param state The new state of the DSC key commitment (true for registered, false for not registered).
|
||||
*/
|
||||
function devChangeDscKeyCommitmentState(
|
||||
uint256 dscCommitment,
|
||||
bool state
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
onlyOwner
|
||||
{
|
||||
function devChangeDscKeyCommitmentState(uint256 dscCommitment, bool state) external onlyProxy onlyOwner {
|
||||
_isRegisteredDscKeyCommitment[dscCommitment] = state;
|
||||
emit DevDscKeyCommitmentStateChanged(dscCommitment, state);
|
||||
}
|
||||
@@ -763,13 +573,7 @@ contract IdentityRegistryImplV1 is
|
||||
* @param commitment The commitment to add.
|
||||
* @return imt_root The new Merkle tree root after insertion.
|
||||
*/
|
||||
function _addCommitment(
|
||||
LeanIMTData storage imt,
|
||||
uint256 commitment
|
||||
)
|
||||
internal
|
||||
returns(uint256 imt_root)
|
||||
{
|
||||
function _addCommitment(LeanIMTData storage imt, uint256 commitment) internal returns (uint256 imt_root) {
|
||||
imt_root = imt._insert(commitment);
|
||||
}
|
||||
|
||||
@@ -787,10 +591,7 @@ contract IdentityRegistryImplV1 is
|
||||
uint256 oldLeaf,
|
||||
uint256 newLeaf,
|
||||
uint256[] calldata siblingNodes
|
||||
)
|
||||
internal
|
||||
returns(uint256 imt_root)
|
||||
{
|
||||
) internal returns (uint256 imt_root) {
|
||||
imt_root = imt._update(oldLeaf, newLeaf, siblingNodes);
|
||||
}
|
||||
|
||||
@@ -806,10 +607,7 @@ contract IdentityRegistryImplV1 is
|
||||
LeanIMTData storage imt,
|
||||
uint256 oldLeaf,
|
||||
uint256[] calldata siblingNodes
|
||||
)
|
||||
internal
|
||||
returns(uint256 imt_root)
|
||||
{
|
||||
) internal returns (uint256 imt_root) {
|
||||
imt_root = imt._remove(oldLeaf, siblingNodes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,17 +10,13 @@ import {CircuitConstants} from "../constants/CircuitConstants.sol";
|
||||
/// @notice A contract for verifying identity proofs and revealing selected data
|
||||
/// @dev This contract interacts with IdentityVerificationHub and IdentityRegistry
|
||||
contract VerifyAll is Ownable {
|
||||
|
||||
IIdentityVerificationHubV1 public hub;
|
||||
IIdentityRegistryV1 public registry;
|
||||
|
||||
/// @notice Initializes the contract with hub and registry addresses
|
||||
/// @param hubAddress The address of the IdentityVerificationHub contract
|
||||
/// @param registryAddress The address of the IdentityRegistry contract
|
||||
constructor(
|
||||
address hubAddress,
|
||||
address registryAddress
|
||||
) Ownable(msg.sender) {
|
||||
constructor(address hubAddress, address registryAddress) Ownable(msg.sender) {
|
||||
hub = IIdentityVerificationHubV1(hubAddress);
|
||||
registry = IIdentityRegistryV1(registryAddress);
|
||||
}
|
||||
@@ -31,22 +27,15 @@ contract VerifyAll is Ownable {
|
||||
/// @param types Array of data types to reveal
|
||||
/// @return readableData The revealed data in readable format
|
||||
/// @return success Whether the verification was successful
|
||||
function verifyAll (
|
||||
function verifyAll(
|
||||
uint256 targetRootTimestamp,
|
||||
IIdentityVerificationHubV1.VcAndDiscloseHubProof memory proof,
|
||||
IIdentityVerificationHubV1.RevealedDataType[] memory types
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (
|
||||
IIdentityVerificationHubV1.ReadableRevealedData memory,
|
||||
bool,
|
||||
string memory
|
||||
)
|
||||
{
|
||||
|
||||
) external view returns (IIdentityVerificationHubV1.ReadableRevealedData memory, bool, string memory) {
|
||||
IIdentityVerificationHubV1.VcAndDiscloseVerificationResult memory result;
|
||||
try hub.verifyVcAndDisclose(proof) returns (IIdentityVerificationHubV1.VcAndDiscloseVerificationResult memory _result) {
|
||||
try hub.verifyVcAndDisclose(proof) returns (
|
||||
IIdentityVerificationHubV1.VcAndDiscloseVerificationResult memory _result
|
||||
) {
|
||||
result = _result;
|
||||
} catch (bytes memory lowLevelData) {
|
||||
string memory errorCode;
|
||||
@@ -71,25 +60,8 @@ contract VerifyAll is Ownable {
|
||||
errorCode = "INVALID_VC_AND_DISCLOSE_PROOF";
|
||||
}
|
||||
}
|
||||
IIdentityVerificationHubV1.ReadableRevealedData memory emptyData = IIdentityVerificationHubV1.ReadableRevealedData({
|
||||
issuingState: "",
|
||||
name: new string[](0),
|
||||
passportNumber: "",
|
||||
nationality: "",
|
||||
dateOfBirth: "",
|
||||
gender: "",
|
||||
expiryDate: "",
|
||||
olderThan: 0,
|
||||
passportNoOfac: 1,
|
||||
nameAndDobOfac: 1,
|
||||
nameAndYobOfac: 1
|
||||
});
|
||||
return (emptyData, false, errorCode);
|
||||
}
|
||||
|
||||
if (targetRootTimestamp != 0) {
|
||||
if (registry.rootTimestamps(result.identityCommitmentRoot) != targetRootTimestamp) {
|
||||
IIdentityVerificationHubV1.ReadableRevealedData memory emptyData = IIdentityVerificationHubV1.ReadableRevealedData({
|
||||
IIdentityVerificationHubV1.ReadableRevealedData memory emptyData = IIdentityVerificationHubV1
|
||||
.ReadableRevealedData({
|
||||
issuingState: "",
|
||||
name: new string[](0),
|
||||
passportNumber: "",
|
||||
@@ -102,12 +74,33 @@ contract VerifyAll is Ownable {
|
||||
nameAndDobOfac: 1,
|
||||
nameAndYobOfac: 1
|
||||
});
|
||||
return (emptyData, false, errorCode);
|
||||
}
|
||||
if (targetRootTimestamp != 0) {
|
||||
if (registry.rootTimestamps(result.identityCommitmentRoot) != targetRootTimestamp) {
|
||||
IIdentityVerificationHubV1.ReadableRevealedData memory emptyData = IIdentityVerificationHubV1
|
||||
.ReadableRevealedData({
|
||||
issuingState: "",
|
||||
name: new string[](0),
|
||||
passportNumber: "",
|
||||
nationality: "",
|
||||
dateOfBirth: "",
|
||||
gender: "",
|
||||
expiryDate: "",
|
||||
olderThan: 0,
|
||||
passportNoOfac: 1,
|
||||
nameAndDobOfac: 1,
|
||||
nameAndYobOfac: 1
|
||||
});
|
||||
return (emptyData, false, "INVALID_TIMESTAMP");
|
||||
}
|
||||
}
|
||||
|
||||
uint256[3] memory revealedDataPacked = result.revealedDataPacked;
|
||||
IIdentityVerificationHubV1.ReadableRevealedData memory readableData = hub.getReadableRevealedData(revealedDataPacked, types);
|
||||
IIdentityVerificationHubV1.ReadableRevealedData memory readableData = hub.getReadableRevealedData(
|
||||
revealedDataPacked,
|
||||
types
|
||||
);
|
||||
|
||||
return (readableData, true, "");
|
||||
}
|
||||
@@ -125,5 +118,4 @@ contract VerifyAll is Ownable {
|
||||
function setRegistry(address registryAddress) external onlyOwner {
|
||||
registry = IIdentityRegistryV1(registryAddress);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,15 +58,14 @@ contract TestCircuitAttributeHandler {
|
||||
bool checkNameAndDob,
|
||||
bool checkNameAndYob
|
||||
) external pure returns (bool) {
|
||||
return CircuitAttributeHandler.compareOfac(
|
||||
charcodes,
|
||||
checkPassportNo,
|
||||
checkNameAndDob,
|
||||
checkNameAndYob
|
||||
);
|
||||
return CircuitAttributeHandler.compareOfac(charcodes, checkPassportNo, checkNameAndDob, checkNameAndYob);
|
||||
}
|
||||
|
||||
function testExtractStringAttribute(bytes memory charcodes, uint256 start, uint256 end) external pure returns (string memory) {
|
||||
function testExtractStringAttribute(
|
||||
bytes memory charcodes,
|
||||
uint256 start,
|
||||
uint256 end
|
||||
) external pure returns (string memory) {
|
||||
return CircuitAttributeHandler.extractStringAttribute(charcodes, start, end);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,11 +20,9 @@ contract TestFormatter {
|
||||
return Formatter.fieldElementsToBytes(publicSignals);
|
||||
}
|
||||
|
||||
function testExtractForbiddenCountriesFromPacked(uint256[4] memory publicSignals)
|
||||
external
|
||||
pure
|
||||
returns (string[40] memory)
|
||||
{
|
||||
function testExtractForbiddenCountriesFromPacked(
|
||||
uint256[4] memory publicSignals
|
||||
) external pure returns (string[40] memory) {
|
||||
return Formatter.extractForbiddenCountriesFromPacked(publicSignals);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,16 +4,15 @@ pragma solidity 0.8.28;
|
||||
import {ImplRoot} from "../../contracts/upgradeable/ImplRoot.sol";
|
||||
|
||||
contract MockImplRoot is ImplRoot {
|
||||
|
||||
function exposed__ImplRoot_init() external {
|
||||
__ImplRoot_init();
|
||||
}
|
||||
|
||||
function exposed__Ownable_init(address initialOwner) external initializer() {
|
||||
function exposed__Ownable_init(address initialOwner) external initializer {
|
||||
__Ownable_init(initialOwner);
|
||||
}
|
||||
|
||||
function exposed_authorizeUpgrade(address newImplementation) external {
|
||||
_authorizeUpgrade(newImplementation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,15 +2,14 @@
|
||||
pragma solidity 0.8.28;
|
||||
|
||||
import {IdentityRegistryStorageV1} from "../registry/IdentityRegistryImplV1.sol";
|
||||
import { InternalLeanIMT, LeanIMTData } from "@zk-kit/imt.sol/internal/InternalLeanIMT.sol";
|
||||
import {InternalLeanIMT, LeanIMTData} from "@zk-kit/imt.sol/internal/InternalLeanIMT.sol";
|
||||
|
||||
/**
|
||||
* @title IdentityRegistryStorageV1
|
||||
* @dev Abstract contract for storage layout of IdentityRegistryImplV1.
|
||||
* Inherits from ImplRoot to provide upgradeable functionality.
|
||||
*/
|
||||
abstract contract UpgradedIdentityRegistryStorageV1
|
||||
{
|
||||
abstract contract UpgradedIdentityRegistryStorageV1 {
|
||||
bool internal _isTest;
|
||||
}
|
||||
|
||||
@@ -19,12 +18,9 @@ abstract contract UpgradedIdentityRegistryStorageV1
|
||||
* @notice Provides functions to register and manage identity commitments using a Merkle tree structure.
|
||||
* @dev Inherits from IdentityRegistryStorageV1 and implements IIdentityRegistryV1.
|
||||
*/
|
||||
contract testUpgradedIdentityRegistryImplV1 is
|
||||
IdentityRegistryStorageV1,
|
||||
UpgradedIdentityRegistryStorageV1
|
||||
{
|
||||
contract testUpgradedIdentityRegistryImplV1 is IdentityRegistryStorageV1, UpgradedIdentityRegistryStorageV1 {
|
||||
using InternalLeanIMT for LeanIMTData;
|
||||
|
||||
|
||||
// ====================================================
|
||||
// Events
|
||||
// ====================================================
|
||||
@@ -45,7 +41,7 @@ contract testUpgradedIdentityRegistryImplV1 is
|
||||
constructor() {
|
||||
_disableInitializers();
|
||||
}
|
||||
|
||||
|
||||
// ====================================================
|
||||
// Initializer
|
||||
// ====================================================
|
||||
@@ -54,12 +50,7 @@ contract testUpgradedIdentityRegistryImplV1 is
|
||||
* @dev Sets the hub address and initializes the UUPS upgradeable feature.
|
||||
* @param isTestInput The address of the identity verification hub.
|
||||
*/
|
||||
function initialize(
|
||||
bool isTestInput
|
||||
)
|
||||
external
|
||||
reinitializer(2)
|
||||
{
|
||||
function initialize(bool isTestInput) external reinitializer(2) {
|
||||
__ImplRoot_init();
|
||||
_isTest = isTestInput;
|
||||
emit TestRegistryInitialized();
|
||||
@@ -69,127 +60,51 @@ contract testUpgradedIdentityRegistryImplV1 is
|
||||
// External Functions - View & Checks
|
||||
// ====================================================
|
||||
|
||||
function isTest()
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
view
|
||||
returns (bool)
|
||||
{
|
||||
function isTest() external view virtual onlyProxy returns (bool) {
|
||||
return _isTest;
|
||||
}
|
||||
|
||||
function hub()
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
view
|
||||
returns (address)
|
||||
{
|
||||
function hub() external view virtual onlyProxy returns (address) {
|
||||
return _hub;
|
||||
}
|
||||
|
||||
function nullifiers(
|
||||
bytes32 attestationId,
|
||||
uint256 nullifier
|
||||
)
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
view
|
||||
returns (bool)
|
||||
{
|
||||
function nullifiers(bytes32 attestationId, uint256 nullifier) external view virtual onlyProxy returns (bool) {
|
||||
return _nullifiers[attestationId][nullifier];
|
||||
}
|
||||
|
||||
function isRegisteredDscKeyCommitment(
|
||||
uint256 commitment
|
||||
)
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
view
|
||||
returns (bool)
|
||||
{
|
||||
function isRegisteredDscKeyCommitment(uint256 commitment) external view virtual onlyProxy returns (bool) {
|
||||
return _isRegisteredDscKeyCommitment[commitment];
|
||||
}
|
||||
|
||||
function rootTimestamps(
|
||||
uint256 root
|
||||
)
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function rootTimestamps(uint256 root) external view virtual onlyProxy returns (uint256) {
|
||||
return _rootTimestamps[root];
|
||||
}
|
||||
|
||||
function checkIdentityCommitmentRoot(
|
||||
uint256 root
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (bool)
|
||||
{
|
||||
function checkIdentityCommitmentRoot(uint256 root) external view onlyProxy returns (bool) {
|
||||
return _rootTimestamps[root] != 0;
|
||||
}
|
||||
|
||||
function getIdentityCommitmentMerkleTreeSize()
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function getIdentityCommitmentMerkleTreeSize() external view onlyProxy returns (uint256) {
|
||||
return _identityCommitmentIMT.size;
|
||||
}
|
||||
|
||||
function getIdentityCommitmentMerkleRoot()
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function getIdentityCommitmentMerkleRoot() external view onlyProxy returns (uint256) {
|
||||
return _identityCommitmentIMT._root();
|
||||
}
|
||||
|
||||
function getIdentityCommitmentIndex(
|
||||
uint256 commitment
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function getIdentityCommitmentIndex(uint256 commitment) external view onlyProxy returns (uint256) {
|
||||
return _identityCommitmentIMT._indexOf(commitment);
|
||||
}
|
||||
|
||||
function getPassportNoOfacRoot()
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function getPassportNoOfacRoot() external view onlyProxy returns (uint256) {
|
||||
return _passportNoOfacRoot;
|
||||
}
|
||||
|
||||
function getNameAndDobOfacRoot()
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function getNameAndDobOfacRoot() external view onlyProxy returns (uint256) {
|
||||
return _nameAndDobOfacRoot;
|
||||
}
|
||||
|
||||
function getNameAndYobOfacRoot()
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function getNameAndYobOfacRoot() external view onlyProxy returns (uint256) {
|
||||
return _nameAndYobOfacRoot;
|
||||
}
|
||||
|
||||
@@ -197,75 +112,34 @@ contract testUpgradedIdentityRegistryImplV1 is
|
||||
uint256 passportNoRoot,
|
||||
uint256 nameAndDobRoot,
|
||||
uint256 nameAndYobRoot
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (bool)
|
||||
{
|
||||
return _passportNoOfacRoot == passportNoRoot
|
||||
&& _nameAndDobOfacRoot == nameAndDobRoot
|
||||
&& _nameAndYobOfacRoot == nameAndYobRoot;
|
||||
) external view onlyProxy returns (bool) {
|
||||
return
|
||||
_passportNoOfacRoot == passportNoRoot &&
|
||||
_nameAndDobOfacRoot == nameAndDobRoot &&
|
||||
_nameAndYobOfacRoot == nameAndYobRoot;
|
||||
}
|
||||
|
||||
function getCscaRoot()
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function getCscaRoot() external view onlyProxy returns (uint256) {
|
||||
return _cscaRoot;
|
||||
}
|
||||
|
||||
function checkCscaRoot(
|
||||
uint256 root
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (bool)
|
||||
{
|
||||
function checkCscaRoot(uint256 root) external view onlyProxy returns (bool) {
|
||||
return _cscaRoot == root;
|
||||
}
|
||||
|
||||
function getDscKeyCommitmentMerkleRoot()
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function getDscKeyCommitmentMerkleRoot() external view onlyProxy returns (uint256) {
|
||||
return _dscKeyCommitmentIMT._root();
|
||||
}
|
||||
|
||||
function checkDscKeyCommitmentMerkleRoot(
|
||||
uint256 root
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (bool)
|
||||
{
|
||||
function checkDscKeyCommitmentMerkleRoot(uint256 root) external view onlyProxy returns (bool) {
|
||||
return _dscKeyCommitmentIMT._root() == root;
|
||||
}
|
||||
|
||||
function getDscKeyCommitmentTreeSize()
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function getDscKeyCommitmentTreeSize() external view onlyProxy returns (uint256) {
|
||||
return _dscKeyCommitmentIMT.size;
|
||||
}
|
||||
|
||||
function getDscKeyCommitmentIndex(
|
||||
uint256 commitment
|
||||
)
|
||||
external
|
||||
onlyProxy
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
function getDscKeyCommitmentIndex(uint256 commitment) external view onlyProxy returns (uint256) {
|
||||
return _dscKeyCommitmentIMT._indexOf(commitment);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,7 @@ pragma solidity 0.8.28;
|
||||
|
||||
import {IdentityVerificationHubStorageV1} from "../IdentityVerificationHubImplV1.sol";
|
||||
|
||||
abstract contract UpgradedIdentityVerificationHubStorageV1
|
||||
{
|
||||
abstract contract UpgradedIdentityVerificationHubStorageV1 {
|
||||
bool internal _isTest;
|
||||
}
|
||||
|
||||
@@ -13,11 +12,10 @@ abstract contract UpgradedIdentityVerificationHubStorageV1
|
||||
* @notice Implementation contract for the Identity Verification Hub.
|
||||
* @dev Provides functions for registering commitments and verifying groth16 proofs and inclusion proofs.
|
||||
*/
|
||||
contract testUpgradedIdentityVerificationHubImplV1 is
|
||||
contract testUpgradedIdentityVerificationHubImplV1 is
|
||||
IdentityVerificationHubStorageV1,
|
||||
UpgradedIdentityVerificationHubStorageV1
|
||||
{
|
||||
|
||||
// ====================================================
|
||||
// Events
|
||||
// ====================================================
|
||||
@@ -48,12 +46,7 @@ contract testUpgradedIdentityVerificationHubImplV1 is
|
||||
* @dev Sets the registry, VC and Disclose circuit verifier address, register circuit verifiers, and DSC circuit verifiers.
|
||||
* @param isTestInput Boolean value which shows it is test or not
|
||||
*/
|
||||
function initialize(
|
||||
bool isTestInput
|
||||
)
|
||||
external
|
||||
reinitializer(3)
|
||||
{
|
||||
function initialize(bool isTestInput) external reinitializer(3) {
|
||||
__ImplRoot_init();
|
||||
_isTest = isTestInput;
|
||||
emit TestHubInitialized();
|
||||
@@ -63,58 +56,23 @@ contract testUpgradedIdentityVerificationHubImplV1 is
|
||||
// External View Functions
|
||||
// ====================================================
|
||||
|
||||
function isTest()
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
view
|
||||
returns (bool)
|
||||
{
|
||||
function isTest() external view virtual onlyProxy returns (bool) {
|
||||
return _isTest;
|
||||
}
|
||||
|
||||
function registry()
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
view
|
||||
returns (address)
|
||||
{
|
||||
function registry() external view virtual onlyProxy returns (address) {
|
||||
return _registry;
|
||||
}
|
||||
|
||||
function vcAndDiscloseCircuitVerifier()
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
view
|
||||
returns (address)
|
||||
{
|
||||
function vcAndDiscloseCircuitVerifier() external view virtual onlyProxy returns (address) {
|
||||
return _vcAndDiscloseCircuitVerifier;
|
||||
}
|
||||
|
||||
function sigTypeToRegisterCircuitVerifiers(
|
||||
uint256 typeId
|
||||
)
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
view
|
||||
returns (address)
|
||||
{
|
||||
|
||||
function sigTypeToRegisterCircuitVerifiers(uint256 typeId) external view virtual onlyProxy returns (address) {
|
||||
return _sigTypeToRegisterCircuitVerifiers[typeId];
|
||||
}
|
||||
|
||||
function sigTypeToDscCircuitVerifiers(
|
||||
uint256 typeId
|
||||
)
|
||||
external
|
||||
virtual
|
||||
onlyProxy
|
||||
view
|
||||
returns (address)
|
||||
{
|
||||
function sigTypeToDscCircuitVerifiers(uint256 typeId) external view virtual onlyProxy returns (address) {
|
||||
return _sigTypeToDscCircuitVerifiers[typeId];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,9 @@ import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable/acces
|
||||
* Serves as a base for upgradeable implementations.
|
||||
*/
|
||||
abstract contract ImplRoot is UUPSUpgradeable, Ownable2StepUpgradeable {
|
||||
|
||||
// Reserved storage space to allow for layout changes in the future.
|
||||
uint256[50] private __gap;
|
||||
|
||||
|
||||
/**
|
||||
* @dev Initializes the contract by setting the deployer as the initial owner and initializing
|
||||
* the UUPS proxy functionality.
|
||||
@@ -27,18 +26,12 @@ abstract contract ImplRoot is UUPSUpgradeable, Ownable2StepUpgradeable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Authorizes an upgrade to a new implementation.
|
||||
* @dev Authorizes an upgrade to a new implementation.
|
||||
* Requirements:
|
||||
* - Must be called through a proxy.
|
||||
* - Caller must be the contract owner.
|
||||
*
|
||||
* @param newImplementation The address of the new implementation contract.
|
||||
*/
|
||||
function _authorizeUpgrade(address newImplementation)
|
||||
internal
|
||||
virtual
|
||||
override
|
||||
onlyProxy
|
||||
onlyOwner
|
||||
{}
|
||||
function _authorizeUpgrade(address newImplementation) internal virtual override onlyProxy onlyOwner {}
|
||||
}
|
||||
|
||||
@@ -15,4 +15,4 @@ contract ProxyRoot is ERC1967Proxy {
|
||||
* @param _data The initialization calldata to be passed to the implementation contract.
|
||||
*/
|
||||
constructor(address _logic, bytes memory _data) ERC1967Proxy(_logic, _data) {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,9 +56,7 @@ contract PCR0Manager is Ownable {
|
||||
* @param pcr0 The PCR0 value (must be exactly 48 bytes).
|
||||
* @return exists True if the PCR0 entry is set, false otherwise.
|
||||
*/
|
||||
function isPCR0Set(
|
||||
bytes calldata pcr0
|
||||
) external view returns (bool exists) {
|
||||
function isPCR0Set(bytes calldata pcr0) external view returns (bool exists) {
|
||||
require(pcr0.length == 48, "PCR0 must be 48 bytes");
|
||||
bytes32 key = keccak256(pcr0);
|
||||
return pcr0Mapping[key];
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_vc_and_disclose {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,81 +42,84 @@ contract Verifier_vc_and_disclose {
|
||||
uint256 constant deltay1 = 11327385974519668968032322736085307141713806429709421661182708424466117238997;
|
||||
uint256 constant deltay2 = 10012305292867396754099447814288164358641801402945324446509796861150789568449;
|
||||
|
||||
|
||||
uint256 constant IC0x = 5645809423132108234526155064520926563161700247800213537205723921444703247217;
|
||||
uint256 constant IC0y = 19273662370473753554670561090991166814029325379251212873103161241607581584566;
|
||||
|
||||
|
||||
uint256 constant IC1x = 1797669655256453130371220220781770764170539267531220862021381942885591828064;
|
||||
uint256 constant IC1y = 7001586812758904198735882543207168343594801214486108350714954778228545102578;
|
||||
|
||||
|
||||
uint256 constant IC2x = 16151498656936517849109903512557528108224465357388552905088955276567940069352;
|
||||
uint256 constant IC2y = 21290383973737261995392203381388245229530591066391887542266051339172122980610;
|
||||
|
||||
|
||||
uint256 constant IC3x = 13594306613618663328469180492848909213054943576045786330757072453957461211429;
|
||||
uint256 constant IC3y = 17106191422608317011071228510210313119098258902423951406450677354622457559954;
|
||||
|
||||
|
||||
uint256 constant IC4x = 10540562137042439306820327362182488961461252811713311037793556389563213988367;
|
||||
uint256 constant IC4y = 13390475227407915257414653696902926958379562466610252657969000491800379839832;
|
||||
|
||||
|
||||
uint256 constant IC5x = 14047770242565207987849727178067237797960577221760083987091292937338321362192;
|
||||
uint256 constant IC5y = 4607949095956681151208754684340954434065140599773002127904735754740923457290;
|
||||
|
||||
|
||||
uint256 constant IC6x = 533605635141604091468837890450980097899976907187175033882725759869648895139;
|
||||
uint256 constant IC6y = 5121343922882143859016572020277997629769211588320816684559275427523086391260;
|
||||
|
||||
|
||||
uint256 constant IC7x = 20950810023595074636645188401126777396931698429970632510329364260508114254649;
|
||||
uint256 constant IC7y = 15363004416976419598006096303962722739509622870059250392680729963552585027821;
|
||||
|
||||
|
||||
uint256 constant IC8x = 21141369375300299590026264437282327654307650673045833038665014396619386405360;
|
||||
uint256 constant IC8y = 13568060724977289928853639950012597657294256347073414147013319159524409681097;
|
||||
|
||||
|
||||
uint256 constant IC9x = 12070388761580959399164669209709461362321643934983690375125147552128464963953;
|
||||
uint256 constant IC9y = 13122752493285998578654222539640165097582774244857666169217998263040175338511;
|
||||
|
||||
|
||||
uint256 constant IC10x = 3155043394395334396684505740101602478801121319174204325455833353483450426603;
|
||||
uint256 constant IC10y = 4001903316495741471727515697485538626849994288595198286197670853000376952608;
|
||||
|
||||
|
||||
uint256 constant IC11x = 11580817845413390940484294910470637940735781669534450285058891649231298055438;
|
||||
uint256 constant IC11y = 11745932694467884175811632165252866594271326601859010100723177984958589451650;
|
||||
|
||||
|
||||
uint256 constant IC12x = 2881070016945796223001080172114503185514285867729144217331063554991484954126;
|
||||
uint256 constant IC12y = 14167304337176286668786874852785788018624401891816801704956527547500195848883;
|
||||
|
||||
|
||||
uint256 constant IC13x = 18883405056778717265600091502443498671078474036444505009504491224347768060512;
|
||||
uint256 constant IC13y = 14812978301212555409657902542346841425786957827465950093762300162318026670295;
|
||||
|
||||
|
||||
uint256 constant IC14x = 6577157458950343654298030929658788314638268827611749219037795310784295524862;
|
||||
uint256 constant IC14y = 8429244719525290744211189219610479430815666050697340325468837559505312383856;
|
||||
|
||||
|
||||
uint256 constant IC15x = 16374040167465027877148927308323868423523506482577951143585975183285308096400;
|
||||
uint256 constant IC15y = 19848062855727074979497070827222518475377208981773894131613945308293152037386;
|
||||
|
||||
|
||||
uint256 constant IC16x = 5369066939278676378968646518060321291123419641615507226693819438606229259727;
|
||||
uint256 constant IC16y = 16729550092204417517172374565729920596490405185877796985933449527255634235308;
|
||||
|
||||
|
||||
uint256 constant IC17x = 14649963317278229594447647740414141466603479012579221101904384047636220514768;
|
||||
uint256 constant IC17y = 14247491789479084970737272226075028063019925997471420682570205007884944759477;
|
||||
|
||||
|
||||
uint256 constant IC18x = 11902572680644837317532839083230381253517912078611490650871537384207738042092;
|
||||
uint256 constant IC18y = 20016771317149607035640286896673339585314902815531231665552693497445627584165;
|
||||
|
||||
|
||||
uint256 constant IC19x = 13662298766996950339241997202544532479906071787308616133742838930447382591478;
|
||||
uint256 constant IC19y = 20739438792451670425639845258461859578645504245239453508387345820702014104428;
|
||||
|
||||
|
||||
uint256 constant IC20x = 11743378744218879600087835709388165328591499404152675849147563493614332998904;
|
||||
uint256 constant IC20y = 4541034768018638352186080395830990298417361588467317129716290912950603785160;
|
||||
|
||||
|
||||
uint256 constant IC21x = 11482551398584236834849590479781862497389279604940066814152820783286286153167;
|
||||
uint256 constant IC21y = 12585642819692696296358219602072676911890723261269077558436703827603489236308;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[21] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[21] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -124,7 +127,7 @@ contract Verifier_vc_and_disclose {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -159,49 +162,48 @@ contract Verifier_vc_and_disclose {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC4x, IC4y, calldataload(add(pubSignals, 96)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC5x, IC5y, calldataload(add(pubSignals, 128)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC6x, IC6y, calldataload(add(pubSignals, 160)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC7x, IC7y, calldataload(add(pubSignals, 192)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC8x, IC8y, calldataload(add(pubSignals, 224)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC9x, IC9y, calldataload(add(pubSignals, 256)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC10x, IC10y, calldataload(add(pubSignals, 288)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC11x, IC11y, calldataload(add(pubSignals, 320)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC12x, IC12y, calldataload(add(pubSignals, 352)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC13x, IC13y, calldataload(add(pubSignals, 384)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC14x, IC14y, calldataload(add(pubSignals, 416)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC15x, IC15y, calldataload(add(pubSignals, 448)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC16x, IC16y, calldataload(add(pubSignals, 480)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC17x, IC17y, calldataload(add(pubSignals, 512)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC18x, IC18y, calldataload(add(pubSignals, 544)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC19x, IC19y, calldataload(add(pubSignals, 576)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC20x, IC20y, calldataload(add(pubSignals, 608)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC21x, IC21y, calldataload(add(pubSignals, 640)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -227,7 +229,6 @@ contract Verifier_vc_and_disclose {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -244,7 +245,6 @@ contract Verifier_vc_and_disclose {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -254,55 +254,54 @@ contract Verifier_vc_and_disclose {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 96)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 128)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 160)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 192)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 224)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 256)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 288)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 320)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 352)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 384)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 416)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 448)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 480)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 512)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 544)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 576)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 608)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 640)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_dsc_sha1_ecdsa_brainpoolP256r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,24 +42,27 @@ contract Verifier_dsc_sha1_ecdsa_brainpoolP256r1 {
|
||||
uint256 constant deltay1 = 17358074359516820567886963253083730754218121289514382698389644314857108532365;
|
||||
uint256 constant deltay2 = 17847472407947487752691527368222893047739716651050784182328983734421006293675;
|
||||
|
||||
|
||||
uint256 constant IC0x = 5393250947825600017034594097684527686937701214367414304055479197751874088030;
|
||||
uint256 constant IC0y = 12743141085881515208211444893873526784081968137100496383444454251322551211985;
|
||||
|
||||
|
||||
uint256 constant IC1x = 10514854796363697297569362261835279316630400942002767803921572203129303152326;
|
||||
uint256 constant IC1y = 1925130313540533490506552085039235567072217015193498811482669066605751206996;
|
||||
|
||||
|
||||
uint256 constant IC2x = 13643299466840868611336555216971795865784486256260896870186827756722920150974;
|
||||
uint256 constant IC2y = 20031729898069918506238105181470744579329641989307020151184529733341690802885;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[2] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -67,7 +70,7 @@ contract Verifier_dsc_sha1_ecdsa_brainpoolP256r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -102,11 +105,10 @@ contract Verifier_dsc_sha1_ecdsa_brainpoolP256r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -132,7 +134,6 @@ contract Verifier_dsc_sha1_ecdsa_brainpoolP256r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -149,7 +150,6 @@ contract Verifier_dsc_sha1_ecdsa_brainpoolP256r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -159,17 +159,16 @@ contract Verifier_dsc_sha1_ecdsa_brainpoolP256r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_dsc_sha1_ecdsa_secp256r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 20491192805390485299153009773594534940189261866228447918068658471970481763042;
|
||||
uint256 constant alphay = 9383485363053290200918347156157836566562967994039712273449902621266178545958;
|
||||
uint256 constant betax1 = 4252822878758300859123897981450591353533073413197771768651442665752259397132;
|
||||
uint256 constant betax2 = 6375614351688725206403948262868962793625744043794305715222011528459656738731;
|
||||
uint256 constant betay1 = 21847035105528745403288232691147584728191162732299865338377159692350059136679;
|
||||
uint256 constant betay2 = 10505242626370262277552901082094356697409835680220590971873171140371331206856;
|
||||
uint256 constant alphax = 20491192805390485299153009773594534940189261866228447918068658471970481763042;
|
||||
uint256 constant alphay = 9383485363053290200918347156157836566562967994039712273449902621266178545958;
|
||||
uint256 constant betax1 = 4252822878758300859123897981450591353533073413197771768651442665752259397132;
|
||||
uint256 constant betax2 = 6375614351688725206403948262868962793625744043794305715222011528459656738731;
|
||||
uint256 constant betay1 = 21847035105528745403288232691147584728191162732299865338377159692350059136679;
|
||||
uint256 constant betay2 = 10505242626370262277552901082094356697409835680220590971873171140371331206856;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,24 +42,27 @@ contract Verifier_dsc_sha1_ecdsa_secp256r1 {
|
||||
uint256 constant deltay1 = 3390456600443455506302148812517000321496337766593349757273547140119846451145;
|
||||
uint256 constant deltay2 = 2683709453415812541600943744993443543337313128850472580051355886800639784468;
|
||||
|
||||
|
||||
uint256 constant IC0x = 12675676047730170209192964659628979792421583884835081061924340503292148118580;
|
||||
uint256 constant IC0y = 8005429490912458496906425839158171340037163354900427604245368710533256420277;
|
||||
|
||||
|
||||
uint256 constant IC1x = 13193321346355881915958099639943008897517981868830729558074615648670520439544;
|
||||
uint256 constant IC1y = 17870182800722312867297093464655968487190506046659071779290715428562669992693;
|
||||
|
||||
|
||||
uint256 constant IC2x = 3886285320844557718123920951668542008337481352970679360571120460620571049685;
|
||||
uint256 constant IC2y = 17415151548883447323439745357012235200330074749013787777992538418692677126646;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[2] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -67,7 +70,7 @@ contract Verifier_dsc_sha1_ecdsa_secp256r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -102,11 +105,10 @@ contract Verifier_dsc_sha1_ecdsa_secp256r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -132,7 +134,6 @@ contract Verifier_dsc_sha1_ecdsa_secp256r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -149,7 +150,6 @@ contract Verifier_dsc_sha1_ecdsa_secp256r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -159,17 +159,16 @@ contract Verifier_dsc_sha1_ecdsa_secp256r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_dsc_sha1_rsa_65537_4096 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,24 +42,27 @@ contract Verifier_dsc_sha1_rsa_65537_4096 {
|
||||
uint256 constant deltay1 = 12386861633939357897311726220181767463730553921920146231142618441123850504498;
|
||||
uint256 constant deltay2 = 20674470883201731689984003870617302131050815771343007030459371218911924891868;
|
||||
|
||||
|
||||
uint256 constant IC0x = 19441255926750545468944197116731261414848766598030018894405396352503089003164;
|
||||
uint256 constant IC0y = 15758814426349860038201583006832227885235721848718900437115777674827804990280;
|
||||
|
||||
|
||||
uint256 constant IC1x = 10417978209792236210293888779006003847323452503588218449033164070712168975609;
|
||||
uint256 constant IC1y = 10346660830455043902305284201555484334037542391965487678647332366643675343646;
|
||||
|
||||
|
||||
uint256 constant IC2x = 4394258923847165352620826784124810658800222064222876328666862381090940769588;
|
||||
uint256 constant IC2y = 19075507518746698810956333568507654968578908476359054856477836730424433683865;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[2] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -67,7 +70,7 @@ contract Verifier_dsc_sha1_rsa_65537_4096 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -102,11 +105,10 @@ contract Verifier_dsc_sha1_rsa_65537_4096 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -132,7 +134,6 @@ contract Verifier_dsc_sha1_rsa_65537_4096 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -149,7 +150,6 @@ contract Verifier_dsc_sha1_rsa_65537_4096 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -159,17 +159,16 @@ contract Verifier_dsc_sha1_rsa_65537_4096 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_dsc_sha256_ecdsa_brainpoolP256r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,24 +42,27 @@ contract Verifier_dsc_sha256_ecdsa_brainpoolP256r1 {
|
||||
uint256 constant deltay1 = 10676263205742724055795903745183410124676856230246162639796185570871828571842;
|
||||
uint256 constant deltay2 = 5765951428532505799282159403858152905631348236021397710413408355430143979177;
|
||||
|
||||
|
||||
uint256 constant IC0x = 15367206121839955762011823176432875107209278826038812451160502020912672517809;
|
||||
uint256 constant IC0y = 21041512010143355829864892490387365789381441587680866631795817779631552157379;
|
||||
|
||||
|
||||
uint256 constant IC1x = 13491594000860333403409728050591279594321593348934521148282685322678157005802;
|
||||
uint256 constant IC1y = 111168464183420135602775825900785322345837453044710078090288369588249275324;
|
||||
|
||||
|
||||
uint256 constant IC2x = 13658331438879300214497268120729163368666540297060972204419000979008026097718;
|
||||
uint256 constant IC2y = 20379908478303656704441112836919060185289193632233027919281111997672857211682;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[2] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -67,7 +70,7 @@ contract Verifier_dsc_sha256_ecdsa_brainpoolP256r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -102,11 +105,10 @@ contract Verifier_dsc_sha256_ecdsa_brainpoolP256r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -132,7 +134,6 @@ contract Verifier_dsc_sha256_ecdsa_brainpoolP256r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -149,7 +150,6 @@ contract Verifier_dsc_sha256_ecdsa_brainpoolP256r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -159,17 +159,16 @@ contract Verifier_dsc_sha256_ecdsa_brainpoolP256r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_dsc_sha256_ecdsa_brainpoolP384r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,24 +42,27 @@ contract Verifier_dsc_sha256_ecdsa_brainpoolP384r1 {
|
||||
uint256 constant deltay1 = 6889184159765420951789007505474196844250709203374834149407655944002134144724;
|
||||
uint256 constant deltay2 = 1966263721788283447467356361246921957144249784577408980069297668772679638312;
|
||||
|
||||
|
||||
uint256 constant IC0x = 659580088998578070030981389513074306430378313664542931151252973393681626386;
|
||||
uint256 constant IC0y = 15847497078695440584225276689193018348032687730924578011825150388408764804768;
|
||||
|
||||
|
||||
uint256 constant IC1x = 21193150887587401583734730471147635346010384352640028637879272340826407561623;
|
||||
uint256 constant IC1y = 4335578117508572478842733173142116229350958709149315332942355277584504377334;
|
||||
|
||||
|
||||
uint256 constant IC2x = 19337579933634766979148936619938139523936041901664035344355521113670520489071;
|
||||
uint256 constant IC2y = 20973272345953147783510881552260259207464823597684557274545396051166816559680;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[2] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -67,7 +70,7 @@ contract Verifier_dsc_sha256_ecdsa_brainpoolP384r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -102,11 +105,10 @@ contract Verifier_dsc_sha256_ecdsa_brainpoolP384r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -132,7 +134,6 @@ contract Verifier_dsc_sha256_ecdsa_brainpoolP384r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -149,7 +150,6 @@ contract Verifier_dsc_sha256_ecdsa_brainpoolP384r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -159,17 +159,16 @@ contract Verifier_dsc_sha256_ecdsa_brainpoolP384r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_dsc_sha256_ecdsa_secp256r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,24 +42,27 @@ contract Verifier_dsc_sha256_ecdsa_secp256r1 {
|
||||
uint256 constant deltay1 = 1379990108520784981499684190353513521686894359798300105485844449527113172532;
|
||||
uint256 constant deltay2 = 16032227002624596941901664869778919446531437354171143943844739013887015790377;
|
||||
|
||||
|
||||
uint256 constant IC0x = 12230279487075355588146232877411380641395694907111257837299763475907667270301;
|
||||
uint256 constant IC0y = 6665239488894449502473370954745820351617517323389685182308103006269196795762;
|
||||
|
||||
|
||||
uint256 constant IC1x = 13491594000860333403409728050591279594321593348934521148282685322678157005802;
|
||||
uint256 constant IC1y = 111168464183420135602775825900785322345837453044710078090288369588249275324;
|
||||
|
||||
|
||||
uint256 constant IC2x = 13658331438879300214497268120729163368666540297060972204419000979008026097718;
|
||||
uint256 constant IC2y = 20379908478303656704441112836919060185289193632233027919281111997672857211682;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[2] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -67,7 +70,7 @@ contract Verifier_dsc_sha256_ecdsa_secp256r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -102,11 +105,10 @@ contract Verifier_dsc_sha256_ecdsa_secp256r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -132,7 +134,6 @@ contract Verifier_dsc_sha256_ecdsa_secp256r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -149,7 +150,6 @@ contract Verifier_dsc_sha256_ecdsa_secp256r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -159,17 +159,16 @@ contract Verifier_dsc_sha256_ecdsa_secp256r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_dsc_sha256_ecdsa_secp384r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,24 +42,27 @@ contract Verifier_dsc_sha256_ecdsa_secp384r1 {
|
||||
uint256 constant deltay1 = 13512628501729381786391242403503084146555269333604181607408712699616544867996;
|
||||
uint256 constant deltay2 = 16722612627662957493583650570582460390230415127323126464445453467663398955195;
|
||||
|
||||
|
||||
uint256 constant IC0x = 18191126408084701504224562638938466976633511856094029564921061288421096529536;
|
||||
uint256 constant IC0y = 7874170387655554596704243322916448411301165813842964589259974876466852751248;
|
||||
|
||||
|
||||
uint256 constant IC1x = 21193150887587401583734730471147635346010384352640028637879272340826407561623;
|
||||
uint256 constant IC1y = 4335578117508572478842733173142116229350958709149315332942355277584504377334;
|
||||
|
||||
|
||||
uint256 constant IC2x = 19337579933634766979148936619938139523936041901664035344355521113670520489071;
|
||||
uint256 constant IC2y = 20973272345953147783510881552260259207464823597684557274545396051166816559680;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[2] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -67,7 +70,7 @@ contract Verifier_dsc_sha256_ecdsa_secp384r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -102,11 +105,10 @@ contract Verifier_dsc_sha256_ecdsa_secp384r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -132,7 +134,6 @@ contract Verifier_dsc_sha256_ecdsa_secp384r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -149,7 +150,6 @@ contract Verifier_dsc_sha256_ecdsa_secp384r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -159,17 +159,16 @@ contract Verifier_dsc_sha256_ecdsa_secp384r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_dsc_sha256_ecdsa_secp521r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 20491192805390485299153009773594534940189261866228447918068658471970481763042;
|
||||
uint256 constant alphay = 9383485363053290200918347156157836566562967994039712273449902621266178545958;
|
||||
uint256 constant betax1 = 4252822878758300859123897981450591353533073413197771768651442665752259397132;
|
||||
uint256 constant betax2 = 6375614351688725206403948262868962793625744043794305715222011528459656738731;
|
||||
uint256 constant betay1 = 21847035105528745403288232691147584728191162732299865338377159692350059136679;
|
||||
uint256 constant betay2 = 10505242626370262277552901082094356697409835680220590971873171140371331206856;
|
||||
uint256 constant alphax = 20491192805390485299153009773594534940189261866228447918068658471970481763042;
|
||||
uint256 constant alphay = 9383485363053290200918347156157836566562967994039712273449902621266178545958;
|
||||
uint256 constant betax1 = 4252822878758300859123897981450591353533073413197771768651442665752259397132;
|
||||
uint256 constant betax2 = 6375614351688725206403948262868962793625744043794305715222011528459656738731;
|
||||
uint256 constant betay1 = 21847035105528745403288232691147584728191162732299865338377159692350059136679;
|
||||
uint256 constant betay2 = 10505242626370262277552901082094356697409835680220590971873171140371331206856;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,24 +42,27 @@ contract Verifier_dsc_sha256_ecdsa_secp521r1 {
|
||||
uint256 constant deltay1 = 968125866770846796808710939585846643817058108093372960570701629910784318864;
|
||||
uint256 constant deltay2 = 12216864206212511235315976798082889872627544441390643890886155153587471762186;
|
||||
|
||||
|
||||
uint256 constant IC0x = 11198407869990430604822080005647844132231169087019364625207841772083886082756;
|
||||
uint256 constant IC0y = 13774799428851210074159336555321647634507660666641475242236156913076712041741;
|
||||
|
||||
|
||||
uint256 constant IC1x = 18127585251129548982798743775509646040146824771883849376184488771237227369472;
|
||||
uint256 constant IC1y = 12012396820154965172043684747339519822260284246794442681353248417864489833145;
|
||||
|
||||
|
||||
uint256 constant IC2x = 7608609333225637846753797474786477234041135378858688651993341996547239218662;
|
||||
uint256 constant IC2y = 13036970020621774119816858757427303597665775583602766779799942821487978394693;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[2] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -67,7 +70,7 @@ contract Verifier_dsc_sha256_ecdsa_secp521r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -102,11 +105,10 @@ contract Verifier_dsc_sha256_ecdsa_secp521r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -132,7 +134,6 @@ contract Verifier_dsc_sha256_ecdsa_secp521r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -149,7 +150,6 @@ contract Verifier_dsc_sha256_ecdsa_secp521r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -159,17 +159,16 @@ contract Verifier_dsc_sha256_ecdsa_secp521r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_dsc_sha256_rsa_65537_4096 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,24 +42,27 @@ contract Verifier_dsc_sha256_rsa_65537_4096 {
|
||||
uint256 constant deltay1 = 661501627404154996169608794002694935021757801103289852114117015566911946329;
|
||||
uint256 constant deltay2 = 16567452430156862387837146752441453364293918383742739848718397860115822800064;
|
||||
|
||||
|
||||
uint256 constant IC0x = 16241005142482247661355611805985713223142625546320321652729411817292725880336;
|
||||
uint256 constant IC0y = 3849621357564233957000975509069645451659363466776730319973246136787524980317;
|
||||
|
||||
|
||||
uint256 constant IC1x = 8352778648791263369503966033632779420798087559812079395669202372333678178104;
|
||||
uint256 constant IC1y = 5637663102630412183678496048776811555521187255440600874467344574229490812411;
|
||||
|
||||
|
||||
uint256 constant IC2x = 17687125118780526381226454443022323594075307431677202777564475001260807144360;
|
||||
uint256 constant IC2y = 14674940982284194393439442374112009934497090740281796410892352815734408931543;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[2] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -67,7 +70,7 @@ contract Verifier_dsc_sha256_rsa_65537_4096 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -102,11 +105,10 @@ contract Verifier_dsc_sha256_rsa_65537_4096 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -132,7 +134,6 @@ contract Verifier_dsc_sha256_rsa_65537_4096 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -149,7 +150,6 @@ contract Verifier_dsc_sha256_rsa_65537_4096 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -159,17 +159,16 @@ contract Verifier_dsc_sha256_rsa_65537_4096 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_dsc_sha256_rsapss_3_32_3072 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,24 +42,27 @@ contract Verifier_dsc_sha256_rsapss_3_32_3072 {
|
||||
uint256 constant deltay1 = 232140573053947840553411220443388261235372949489202414188606995434296840450;
|
||||
uint256 constant deltay2 = 8130092547923778131965928343347244161930368940161259856055262342565208619784;
|
||||
|
||||
|
||||
uint256 constant IC0x = 12620464585052290819007856763660336208940278196659572856453355517783047375742;
|
||||
uint256 constant IC0y = 3390602569146793076585074263480269117585089933082768513956969996350087851372;
|
||||
|
||||
|
||||
uint256 constant IC1x = 2185708085199591083273326716936718570815950593570414890234854265905865839474;
|
||||
uint256 constant IC1y = 10862432198472964463816618245757112732031601535229097320367073608750311929625;
|
||||
|
||||
|
||||
uint256 constant IC2x = 2489498112724333902281234525518992117856181811211455677336589248443139008958;
|
||||
uint256 constant IC2y = 10377122056032769734282101693368444643449184346801692898595672266480707718599;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[2] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -67,7 +70,7 @@ contract Verifier_dsc_sha256_rsapss_3_32_3072 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -102,11 +105,10 @@ contract Verifier_dsc_sha256_rsapss_3_32_3072 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -132,7 +134,6 @@ contract Verifier_dsc_sha256_rsapss_3_32_3072 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -149,7 +150,6 @@ contract Verifier_dsc_sha256_rsapss_3_32_3072 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -159,17 +159,16 @@ contract Verifier_dsc_sha256_rsapss_3_32_3072 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_dsc_sha256_rsapss_65537_32_3072 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,24 +42,27 @@ contract Verifier_dsc_sha256_rsapss_65537_32_3072 {
|
||||
uint256 constant deltay1 = 3452760924868488115787557603097061457224840730939685141249091937251492206223;
|
||||
uint256 constant deltay2 = 9423633604022314255524124098880883774245557038013638234906364773514027500607;
|
||||
|
||||
|
||||
uint256 constant IC0x = 14813474503207570046610982310967746269243544059234641765135216737888053804829;
|
||||
uint256 constant IC0y = 9154691151039599375957188306571890456577516100636751566387645654267738411601;
|
||||
|
||||
|
||||
uint256 constant IC1x = 2764163313266009072057146860312810475115611108192406932118003881831423836973;
|
||||
uint256 constant IC1y = 19545020101052691117141309405141028493539208082424764278036823972884259054640;
|
||||
|
||||
|
||||
uint256 constant IC2x = 10526229662163874368857932991034397082279427227544621549031532129140736236429;
|
||||
uint256 constant IC2y = 3011706903789493036487088756766963655549402409867173019894262834743320055985;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[2] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -67,7 +70,7 @@ contract Verifier_dsc_sha256_rsapss_65537_32_3072 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -102,11 +105,10 @@ contract Verifier_dsc_sha256_rsapss_65537_32_3072 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -132,7 +134,6 @@ contract Verifier_dsc_sha256_rsapss_65537_32_3072 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -149,7 +150,6 @@ contract Verifier_dsc_sha256_rsapss_65537_32_3072 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -159,17 +159,16 @@ contract Verifier_dsc_sha256_rsapss_65537_32_3072 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_dsc_sha256_rsapss_65537_32_4096 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,24 +42,27 @@ contract Verifier_dsc_sha256_rsapss_65537_32_4096 {
|
||||
uint256 constant deltay1 = 2589398613433727282285672702070166671377906963271015685181070150452765350638;
|
||||
uint256 constant deltay2 = 4549130548838856553572072257366600539979637374865368325817346592762994580325;
|
||||
|
||||
|
||||
uint256 constant IC0x = 10777640084867471361146393097597090893654888869164898377029432359502626112469;
|
||||
uint256 constant IC0y = 20494567130868896678721094122076931742895456629840331660690065277736751914622;
|
||||
|
||||
|
||||
uint256 constant IC1x = 19201556443158676692189491419176576922349056990514229299010675855554920668808;
|
||||
uint256 constant IC1y = 8587660010847902995115369419819188141349854489350537948452533797376571629024;
|
||||
|
||||
|
||||
uint256 constant IC2x = 4784178454546895061300143369090412817442880785841947337501409752122515197376;
|
||||
uint256 constant IC2y = 9279502414267368124275170396046179750616701209127504670483264465302019374739;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[2] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -67,7 +70,7 @@ contract Verifier_dsc_sha256_rsapss_65537_32_4096 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -102,11 +105,10 @@ contract Verifier_dsc_sha256_rsapss_65537_32_4096 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -132,7 +134,6 @@ contract Verifier_dsc_sha256_rsapss_65537_32_4096 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -149,7 +150,6 @@ contract Verifier_dsc_sha256_rsapss_65537_32_4096 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -159,17 +159,16 @@ contract Verifier_dsc_sha256_rsapss_65537_32_4096 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_dsc_sha384_ecdsa_brainpoolP384r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,24 +42,27 @@ contract Verifier_dsc_sha384_ecdsa_brainpoolP384r1 {
|
||||
uint256 constant deltay1 = 2069564818639872727764109028571692796079865136168643667520460726036679827340;
|
||||
uint256 constant deltay2 = 10931236091611661445812279018578580556292434706798406928566475215591616175333;
|
||||
|
||||
|
||||
uint256 constant IC0x = 3078796548910792124867521966471565765478476660809266356296707871992775959653;
|
||||
uint256 constant IC0y = 6800666731786189648626735200695616790848337999099082477128772951414448347754;
|
||||
|
||||
|
||||
uint256 constant IC1x = 16251623726618682507268092714405322890177547973127006480412505399660459049309;
|
||||
uint256 constant IC1y = 1325569571213494511088961273289087278348163148790504942193097805327290721900;
|
||||
|
||||
|
||||
uint256 constant IC2x = 6135759906556602512033221677791515863312102500467760742997691814407836834208;
|
||||
uint256 constant IC2y = 8340907402047374494050668129923237269291489014758614848102437858941083505729;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[2] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -67,7 +70,7 @@ contract Verifier_dsc_sha384_ecdsa_brainpoolP384r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -102,11 +105,10 @@ contract Verifier_dsc_sha384_ecdsa_brainpoolP384r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -132,7 +134,6 @@ contract Verifier_dsc_sha384_ecdsa_brainpoolP384r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -149,7 +150,6 @@ contract Verifier_dsc_sha384_ecdsa_brainpoolP384r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -159,17 +159,16 @@ contract Verifier_dsc_sha384_ecdsa_brainpoolP384r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_dsc_sha384_ecdsa_brainpoolP512r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,24 +42,27 @@ contract Verifier_dsc_sha384_ecdsa_brainpoolP512r1 {
|
||||
uint256 constant deltay1 = 16047974943909860300676356846359424106067013301701903269259394127906204387924;
|
||||
uint256 constant deltay2 = 19121513428213240116044362882588137076351549644308466259528321350439646572263;
|
||||
|
||||
|
||||
uint256 constant IC0x = 7873767668004917131331802256306079363018497214917800406656003818258696939352;
|
||||
uint256 constant IC0y = 14912976041983106474346819001420266588695308519687724079672778493226556096333;
|
||||
|
||||
|
||||
uint256 constant IC1x = 4852604638607648213334720160588381103064185393513751826938979884897144830675;
|
||||
uint256 constant IC1y = 3477474541202451761549969552535751441286210351780330568982051126043768194976;
|
||||
|
||||
|
||||
uint256 constant IC2x = 8747441738906818716672964476834702185117504770235935488924766630345322944183;
|
||||
uint256 constant IC2y = 18164498138633665708832988193754261643195939997946514564956248753295561758554;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[2] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -67,7 +70,7 @@ contract Verifier_dsc_sha384_ecdsa_brainpoolP512r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -102,11 +105,10 @@ contract Verifier_dsc_sha384_ecdsa_brainpoolP512r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -132,7 +134,6 @@ contract Verifier_dsc_sha384_ecdsa_brainpoolP512r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -149,7 +150,6 @@ contract Verifier_dsc_sha384_ecdsa_brainpoolP512r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -159,17 +159,16 @@ contract Verifier_dsc_sha384_ecdsa_brainpoolP512r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_dsc_sha384_ecdsa_secp384r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,24 +42,27 @@ contract Verifier_dsc_sha384_ecdsa_secp384r1 {
|
||||
uint256 constant deltay1 = 3439375804488391682047032793111742890384740981260877667704217117698837635540;
|
||||
uint256 constant deltay2 = 10922495998532240778177754781915017080119363533174316459909222472814843353831;
|
||||
|
||||
|
||||
uint256 constant IC0x = 15428527398346470570204225423347884116167911703577531010770592316532112978289;
|
||||
uint256 constant IC0y = 11394444257441940827867166510282185266944605704751191013112365153909119560219;
|
||||
|
||||
|
||||
uint256 constant IC1x = 16251623726618682507268092714405322890177547973127006480412505399660459049309;
|
||||
uint256 constant IC1y = 1325569571213494511088961273289087278348163148790504942193097805327290721900;
|
||||
|
||||
|
||||
uint256 constant IC2x = 6135759906556602512033221677791515863312102500467760742997691814407836834208;
|
||||
uint256 constant IC2y = 8340907402047374494050668129923237269291489014758614848102437858941083505729;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[2] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -67,7 +70,7 @@ contract Verifier_dsc_sha384_ecdsa_secp384r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -102,11 +105,10 @@ contract Verifier_dsc_sha384_ecdsa_secp384r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -132,7 +134,6 @@ contract Verifier_dsc_sha384_ecdsa_secp384r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -149,7 +150,6 @@ contract Verifier_dsc_sha384_ecdsa_secp384r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -159,17 +159,16 @@ contract Verifier_dsc_sha384_ecdsa_secp384r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_dsc_sha512_ecdsa_brainpoolP512r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 20491192805390485299153009773594534940189261866228447918068658471970481763042;
|
||||
uint256 constant alphay = 9383485363053290200918347156157836566562967994039712273449902621266178545958;
|
||||
uint256 constant betax1 = 4252822878758300859123897981450591353533073413197771768651442665752259397132;
|
||||
uint256 constant betax2 = 6375614351688725206403948262868962793625744043794305715222011528459656738731;
|
||||
uint256 constant betay1 = 21847035105528745403288232691147584728191162732299865338377159692350059136679;
|
||||
uint256 constant betay2 = 10505242626370262277552901082094356697409835680220590971873171140371331206856;
|
||||
uint256 constant alphax = 20491192805390485299153009773594534940189261866228447918068658471970481763042;
|
||||
uint256 constant alphay = 9383485363053290200918347156157836566562967994039712273449902621266178545958;
|
||||
uint256 constant betax1 = 4252822878758300859123897981450591353533073413197771768651442665752259397132;
|
||||
uint256 constant betax2 = 6375614351688725206403948262868962793625744043794305715222011528459656738731;
|
||||
uint256 constant betay1 = 21847035105528745403288232691147584728191162732299865338377159692350059136679;
|
||||
uint256 constant betay2 = 10505242626370262277552901082094356697409835680220590971873171140371331206856;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,24 +42,27 @@ contract Verifier_dsc_sha512_ecdsa_brainpoolP512r1 {
|
||||
uint256 constant deltay1 = 12369278861826334826775785697613986489421427981532861159941565055302380388435;
|
||||
uint256 constant deltay2 = 268218501938740843576755870688043856015430017503150289273886004818951340211;
|
||||
|
||||
|
||||
uint256 constant IC0x = 2854580057122758363137747486193301686434303619633504875611831707366593193268;
|
||||
uint256 constant IC0y = 161152799478229153815090373143900568223205432805517132728553706296506229632;
|
||||
|
||||
|
||||
uint256 constant IC1x = 10581328066353360672004779124451298057967563611528666503152999442178364250207;
|
||||
uint256 constant IC1y = 21070158555862491580937045217249443996037523854845662139952858528560360285345;
|
||||
|
||||
|
||||
uint256 constant IC2x = 6535621112246865230629050883801747388199012560026269297051551123854305849670;
|
||||
uint256 constant IC2y = 12613639586408767324115549737218218464694013359987071410410390868145511841392;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[2] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -67,7 +70,7 @@ contract Verifier_dsc_sha512_ecdsa_brainpoolP512r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -102,11 +105,10 @@ contract Verifier_dsc_sha512_ecdsa_brainpoolP512r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -132,7 +134,6 @@ contract Verifier_dsc_sha512_ecdsa_brainpoolP512r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -149,7 +150,6 @@ contract Verifier_dsc_sha512_ecdsa_brainpoolP512r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -159,17 +159,16 @@ contract Verifier_dsc_sha512_ecdsa_brainpoolP512r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_dsc_sha512_ecdsa_secp521r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 20491192805390485299153009773594534940189261866228447918068658471970481763042;
|
||||
uint256 constant alphay = 9383485363053290200918347156157836566562967994039712273449902621266178545958;
|
||||
uint256 constant betax1 = 4252822878758300859123897981450591353533073413197771768651442665752259397132;
|
||||
uint256 constant betax2 = 6375614351688725206403948262868962793625744043794305715222011528459656738731;
|
||||
uint256 constant betay1 = 21847035105528745403288232691147584728191162732299865338377159692350059136679;
|
||||
uint256 constant betay2 = 10505242626370262277552901082094356697409835680220590971873171140371331206856;
|
||||
uint256 constant alphax = 20491192805390485299153009773594534940189261866228447918068658471970481763042;
|
||||
uint256 constant alphay = 9383485363053290200918347156157836566562967994039712273449902621266178545958;
|
||||
uint256 constant betax1 = 4252822878758300859123897981450591353533073413197771768651442665752259397132;
|
||||
uint256 constant betax2 = 6375614351688725206403948262868962793625744043794305715222011528459656738731;
|
||||
uint256 constant betay1 = 21847035105528745403288232691147584728191162732299865338377159692350059136679;
|
||||
uint256 constant betay2 = 10505242626370262277552901082094356697409835680220590971873171140371331206856;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,24 +42,27 @@ contract Verifier_dsc_sha512_ecdsa_secp521r1 {
|
||||
uint256 constant deltay1 = 12112251966035714986038310379728868813344813567575772425184620994375435183493;
|
||||
uint256 constant deltay2 = 541069664758689108623530630690631010640418421812375414721343442872115937402;
|
||||
|
||||
|
||||
uint256 constant IC0x = 136910311248568363820473562407939112717019551412068446334589064796761238234;
|
||||
uint256 constant IC0y = 14761093221964254612087739097195844172438739963995752455378640347842923505631;
|
||||
|
||||
|
||||
uint256 constant IC1x = 14447863318056301271860386878687738607655490531247166798405604042500135631279;
|
||||
uint256 constant IC1y = 11446576007344781410709246372588846223796059093966566576749323356136248268666;
|
||||
|
||||
|
||||
uint256 constant IC2x = 14358689694998711607953028013988003416714328323807188343803787983254880315583;
|
||||
uint256 constant IC2y = 11617460142005906950398539783051988683143041496653951656062385487051296621592;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[2] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -67,7 +70,7 @@ contract Verifier_dsc_sha512_ecdsa_secp521r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -102,11 +105,10 @@ contract Verifier_dsc_sha512_ecdsa_secp521r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -132,7 +134,6 @@ contract Verifier_dsc_sha512_ecdsa_secp521r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -149,7 +150,6 @@ contract Verifier_dsc_sha512_ecdsa_secp521r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -159,17 +159,16 @@ contract Verifier_dsc_sha512_ecdsa_secp521r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_dsc_sha512_rsa_65537_4096 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,24 +42,27 @@ contract Verifier_dsc_sha512_rsa_65537_4096 {
|
||||
uint256 constant deltay1 = 21428515931464385620730182368968406916666024874675101194599111378408011047428;
|
||||
uint256 constant deltay2 = 1558724681363422124783587676312168410700012697885378202020602107711575601861;
|
||||
|
||||
|
||||
uint256 constant IC0x = 8095362675719160713631337478379784798399194783598795655898223841598252282668;
|
||||
uint256 constant IC0y = 6439154585539636799954577345503253289769574438600314903172693070772761377678;
|
||||
|
||||
|
||||
uint256 constant IC1x = 13684650490658552646080842421267275883804013486458038403093889479842575945955;
|
||||
uint256 constant IC1y = 1175990068401163295765503425210475666399945678130089394509100947713002365508;
|
||||
|
||||
|
||||
uint256 constant IC2x = 3599149666568952753127446987051032893129278914420714886060131651834276339909;
|
||||
uint256 constant IC2y = 15474376648113943403208232183870381739764572044602735134638863326991559807772;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[2] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -67,7 +70,7 @@ contract Verifier_dsc_sha512_rsa_65537_4096 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -102,11 +105,10 @@ contract Verifier_dsc_sha512_rsa_65537_4096 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -132,7 +134,6 @@ contract Verifier_dsc_sha512_rsa_65537_4096 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -149,7 +150,6 @@ contract Verifier_dsc_sha512_rsa_65537_4096 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -159,17 +159,16 @@ contract Verifier_dsc_sha512_rsa_65537_4096 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_dsc_sha512_rsapss_65537_64_4096 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,24 +42,27 @@ contract Verifier_dsc_sha512_rsapss_65537_64_4096 {
|
||||
uint256 constant deltay1 = 14143847869780845305359522342602190877307021059040613866307785597405878613945;
|
||||
uint256 constant deltay2 = 11794579662045030403362807154209218712532002665441792443688263863248294733806;
|
||||
|
||||
|
||||
uint256 constant IC0x = 9696026138342026395279592597616245033004914829363120240538663976676310016503;
|
||||
uint256 constant IC0y = 1041019786294196872070965112981064093687515225465385286539234086481491269678;
|
||||
|
||||
|
||||
uint256 constant IC1x = 14805748700580410078435159536377520731405877412990087045642402017205296139722;
|
||||
uint256 constant IC1y = 7465807272236732895023727447789825478319979043512228376237998245795981843304;
|
||||
|
||||
|
||||
uint256 constant IC2x = 10054837955581817730135713476914697791847601592942603989577247562800734740144;
|
||||
uint256 constant IC2y = 20016446798323781782121888846141370599179508808492367607695725852906963635076;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[2] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -67,7 +70,7 @@ contract Verifier_dsc_sha512_rsapss_65537_64_4096 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -102,11 +105,10 @@ contract Verifier_dsc_sha512_rsapss_65537_64_4096 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -132,7 +134,6 @@ contract Verifier_dsc_sha512_rsapss_65537_64_4096 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -149,7 +150,6 @@ contract Verifier_dsc_sha512_rsapss_65537_64_4096 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -159,17 +159,16 @@ contract Verifier_dsc_sha512_rsapss_65537_64_4096 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha1_sha1_sha1_ecdsa_brainpoolP224r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha1_sha1_sha1_ecdsa_brainpoolP224r1 {
|
||||
uint256 constant deltay1 = 18031898897154963414025141677622297401219665295749636217410864667281772000433;
|
||||
uint256 constant deltay2 = 21831540883730035301413733264718453236289248639488942882934948388586980962845;
|
||||
|
||||
|
||||
uint256 constant IC0x = 19509572610092207288670808612793005292427088225084923989481790232834691421218;
|
||||
uint256 constant IC0y = 20981186445151391222764194225178707477545220084289882124966253025319330386716;
|
||||
|
||||
|
||||
uint256 constant IC1x = 19182868664324342013994173700755113757073855114423320637389181899716317837862;
|
||||
uint256 constant IC1y = 10122562937387529919092448092464314996344932396258314984541895784551115051381;
|
||||
|
||||
|
||||
uint256 constant IC2x = 10533989471740012078622118641855823945796164902442393083239425014935431072350;
|
||||
uint256 constant IC2y = 15136304145342409661923495077385049808129199590110451861747150066840788933500;
|
||||
|
||||
|
||||
uint256 constant IC3x = 11911512511832804727234578540995600437810078524965709720308124945378582921495;
|
||||
uint256 constant IC3y = 20562189586897282263315939558507913305487143843850828495916004211153189021293;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha1_sha1_sha1_ecdsa_brainpoolP224r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha1_sha1_sha1_ecdsa_brainpoolP224r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha1_sha1_sha1_ecdsa_brainpoolP224r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha1_sha1_sha1_ecdsa_brainpoolP224r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha1_sha1_sha1_ecdsa_brainpoolP224r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha1_sha1_sha1_ecdsa_secp256r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 20491192805390485299153009773594534940189261866228447918068658471970481763042;
|
||||
uint256 constant alphay = 9383485363053290200918347156157836566562967994039712273449902621266178545958;
|
||||
uint256 constant betax1 = 4252822878758300859123897981450591353533073413197771768651442665752259397132;
|
||||
uint256 constant betax2 = 6375614351688725206403948262868962793625744043794305715222011528459656738731;
|
||||
uint256 constant betay1 = 21847035105528745403288232691147584728191162732299865338377159692350059136679;
|
||||
uint256 constant betay2 = 10505242626370262277552901082094356697409835680220590971873171140371331206856;
|
||||
uint256 constant alphax = 20491192805390485299153009773594534940189261866228447918068658471970481763042;
|
||||
uint256 constant alphay = 9383485363053290200918347156157836566562967994039712273449902621266178545958;
|
||||
uint256 constant betax1 = 4252822878758300859123897981450591353533073413197771768651442665752259397132;
|
||||
uint256 constant betax2 = 6375614351688725206403948262868962793625744043794305715222011528459656738731;
|
||||
uint256 constant betay1 = 21847035105528745403288232691147584728191162732299865338377159692350059136679;
|
||||
uint256 constant betay2 = 10505242626370262277552901082094356697409835680220590971873171140371331206856;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha1_sha1_sha1_ecdsa_secp256r1 {
|
||||
uint256 constant deltay1 = 9448382163867444066295328702218988975263374023667830442650604436203430718782;
|
||||
uint256 constant deltay2 = 3390587171884285909512991075541156150549390244719272045010214315075006407592;
|
||||
|
||||
|
||||
uint256 constant IC0x = 16450632745264405183134879933548836357522771992781381371437352893044233134089;
|
||||
uint256 constant IC0y = 7406049893990952623098067634432868719037604070795933670159207846811098380152;
|
||||
|
||||
|
||||
uint256 constant IC1x = 4075022984801759765447880624616192959710270854476152884516923249069298970582;
|
||||
uint256 constant IC1y = 14465812661698088247096862482473992600825819637978412422678744038701325119175;
|
||||
|
||||
|
||||
uint256 constant IC2x = 19289177891812149972501122063055652003517902958032564042988169989187140669996;
|
||||
uint256 constant IC2y = 10334018884410138890108998996556287264542627150879424783840832054620221289103;
|
||||
|
||||
|
||||
uint256 constant IC3x = 3590539162724376220252043367439687121476794060909776981340467603542696454783;
|
||||
uint256 constant IC3y = 9817658469812892944717716328749390598728625285115805840044120011595137437624;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha1_sha1_sha1_ecdsa_secp256r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha1_sha1_sha1_ecdsa_secp256r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha1_sha1_sha1_ecdsa_secp256r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha1_sha1_sha1_ecdsa_secp256r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha1_sha1_sha1_ecdsa_secp256r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha1_sha1_sha1_rsa_65537_4096 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha1_sha1_sha1_rsa_65537_4096 {
|
||||
uint256 constant deltay1 = 3665741634116606936489770677276959138129221741447229704587025783098245795085;
|
||||
uint256 constant deltay2 = 403539896334743856854319107138699105727408472499380778544123756001283833378;
|
||||
|
||||
|
||||
uint256 constant IC0x = 20756451814539478249751219749430622694437886828255681030901283599531849607563;
|
||||
uint256 constant IC0y = 10515539338155791301560829975566985059585726032052087045959182102863044641627;
|
||||
|
||||
|
||||
uint256 constant IC1x = 5564562197397048598304370220394023178331361146076885262417117982817842490041;
|
||||
uint256 constant IC1y = 21154894302210965834465964743301723963246603449126626144265792369420471462519;
|
||||
|
||||
|
||||
uint256 constant IC2x = 5154501633986159218953427977257472970741782604514502453840876964136990001633;
|
||||
uint256 constant IC2y = 19590373510789635565294072443053760642652305250438676594604265975940768004868;
|
||||
|
||||
|
||||
uint256 constant IC3x = 21371077966007684491944419706317642834377204594723191303711655277642289355259;
|
||||
uint256 constant IC3y = 6514391881814533347944634607795370652611541523264920880959575958638411648255;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha1_sha1_sha1_rsa_65537_4096 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha1_sha1_sha1_rsa_65537_4096 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha1_sha1_sha1_rsa_65537_4096 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha1_sha1_sha1_rsa_65537_4096 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha1_sha1_sha1_rsa_65537_4096 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha1_sha256_sha256_rsa_65537_4096 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha1_sha256_sha256_rsa_65537_4096 {
|
||||
uint256 constant deltay1 = 12314715100513663962818487492216029300388813419191267519828806049674208132775;
|
||||
uint256 constant deltay2 = 10470523697438015174056330463148535375729117776768240109864817806935384204557;
|
||||
|
||||
|
||||
uint256 constant IC0x = 12361539322653261021360066647549205546373574859480447523007571711209362191471;
|
||||
uint256 constant IC0y = 3753815764472092148426692365780053324411980063589958862133181479142352994780;
|
||||
|
||||
|
||||
uint256 constant IC1x = 3709054380359458917683749937455535515552184103494415469844634615037922334277;
|
||||
uint256 constant IC1y = 18869808402305674549249558018924643540300060650305983217549705382983624154036;
|
||||
|
||||
|
||||
uint256 constant IC2x = 10089734822789836697306478964054100296820394610692316618549792183242300594248;
|
||||
uint256 constant IC2y = 19142665716389800648424629453855173684881049467838144090381524444628188050819;
|
||||
|
||||
|
||||
uint256 constant IC3x = 1197590734606895962055154260828783141953061515173288377871991535662924617440;
|
||||
uint256 constant IC3y = 18942239486191169122929828442458072434935876596191455341626876659481393360346;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha1_sha256_sha256_rsa_65537_4096 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha1_sha256_sha256_rsa_65537_4096 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha1_sha256_sha256_rsa_65537_4096 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha1_sha256_sha256_rsa_65537_4096 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha1_sha256_sha256_rsa_65537_4096 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha224_sha224_sha224_ecdsa_brainpoolP224r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha224_sha224_sha224_ecdsa_brainpoolP224r1 {
|
||||
uint256 constant deltay1 = 6309979045282778302942056209768770834937974278704411556356240326005027775108;
|
||||
uint256 constant deltay2 = 14431014253712863614953101637194770902839088329362669949449976361594501871386;
|
||||
|
||||
|
||||
uint256 constant IC0x = 7049014070845704797398804006160076365072552113538832823116300666708052900140;
|
||||
uint256 constant IC0y = 21442947750272735435847899362570529914949459321795987895055133600218265935805;
|
||||
|
||||
|
||||
uint256 constant IC1x = 14901800930595596475270981859969729449383998844699559546884267481312938883311;
|
||||
uint256 constant IC1y = 9987788914424712886677784716028005253285100122737999127155336189056960500739;
|
||||
|
||||
|
||||
uint256 constant IC2x = 11756261084070810905424247204044768982420231764336482808042196914833073264631;
|
||||
uint256 constant IC2y = 7774075862985643190224001482395218841088131833338894022590565319270858939292;
|
||||
|
||||
|
||||
uint256 constant IC3x = 2664951959234114136071060711363539347386341588709135442596514957836669271965;
|
||||
uint256 constant IC3y = 13235160485529120155109991361721968247548273207835323315920567269912250240966;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha224_sha224_sha224_ecdsa_brainpoolP224r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha224_sha224_sha224_ecdsa_brainpoolP224r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha224_sha224_sha224_ecdsa_brainpoolP224r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha224_sha224_sha224_ecdsa_brainpoolP224r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha224_sha224_sha224_ecdsa_brainpoolP224r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha256_sha224_sha224_ecdsa_secp224r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha256_sha224_sha224_ecdsa_secp224r1 {
|
||||
uint256 constant deltay1 = 17922238729206820258777005538508696344640087041630861737277811527798956341174;
|
||||
uint256 constant deltay2 = 19343082958961494620437916048299672564753840210138542937948538284994282503556;
|
||||
|
||||
|
||||
uint256 constant IC0x = 12521316718902993678296712934793473287690901468560324816920939082278543579014;
|
||||
uint256 constant IC0y = 8478119979955946440850520514866248107612719142562088893016150154822941492437;
|
||||
|
||||
|
||||
uint256 constant IC1x = 13615912043916642509268214012096038019187485190244568897732400669313161534289;
|
||||
uint256 constant IC1y = 2336242490526310607723367151056544341055507559641317319268595423467469490750;
|
||||
|
||||
|
||||
uint256 constant IC2x = 9964738432662011999730790618200441879694942263940840066881287946030548535213;
|
||||
uint256 constant IC2y = 10987920816797829909921115383190287198265145438505477799853266284042683798189;
|
||||
|
||||
|
||||
uint256 constant IC3x = 20913259597347413901976782093989664830906159344929838301034406870827489688402;
|
||||
uint256 constant IC3y = 3901488944428160131651382851952512860695104361610472292838012573652157077746;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha256_sha224_sha224_ecdsa_secp224r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha256_sha224_sha224_ecdsa_secp224r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha256_sha224_sha224_ecdsa_secp224r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha256_sha224_sha224_ecdsa_secp224r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha256_sha224_sha224_ecdsa_secp224r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha256_sha256_sha256_ecdsa_brainpoolP256r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_brainpoolP256r1 {
|
||||
uint256 constant deltay1 = 13063167950997764554295715260649179775160121935115344843116270981460011515045;
|
||||
uint256 constant deltay2 = 10894079596870145113454476183498886773244865923585175354140797804801878633159;
|
||||
|
||||
|
||||
uint256 constant IC0x = 8762998664314077566541074231125849912115544729350659715286518613692697344232;
|
||||
uint256 constant IC0y = 14001271104843473296871506767615367200344646326139246066177383985774884134036;
|
||||
|
||||
|
||||
uint256 constant IC1x = 18871746441291522433040172141199512517094020757638974169303451068805040108549;
|
||||
uint256 constant IC1y = 17481909845792025147795640059339300039909930587789741160089790055330297800629;
|
||||
|
||||
|
||||
uint256 constant IC2x = 17228496737134183162953404839083447494368305553814570677263820008304107136716;
|
||||
uint256 constant IC2y = 9169963094691275955348042974261987888722303177930700221830198485340995306823;
|
||||
|
||||
|
||||
uint256 constant IC3x = 12489076924452947445650770949126936558633478532726739743575890534382634119788;
|
||||
uint256 constant IC3y = 19184068330904123630217755441256337303398437062402964032554713882869223121187;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_brainpoolP256r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_brainpoolP256r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_brainpoolP256r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_brainpoolP256r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_brainpoolP256r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha256_sha256_sha256_ecdsa_brainpoolP384r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_brainpoolP384r1 {
|
||||
uint256 constant deltay1 = 9264189429064603261584419178333938947647064896232842698148291477622205695991;
|
||||
uint256 constant deltay2 = 6456822800838506843976332735258220771655353543944505822268251880234958843589;
|
||||
|
||||
|
||||
uint256 constant IC0x = 14329212318534927524909414573593840658332088808690549054063025133267761199977;
|
||||
uint256 constant IC0y = 6891575372982448157919314834426319637097322770954014095842802433794534683954;
|
||||
|
||||
|
||||
uint256 constant IC1x = 6088631761012793873872011176735311073044507020987158847792817166607547457190;
|
||||
uint256 constant IC1y = 5408178364023472781923470165151349921464641576197451679609061964630375727986;
|
||||
|
||||
|
||||
uint256 constant IC2x = 6554153663186353117117323926287388052308499874096390122598444026717953829298;
|
||||
uint256 constant IC2y = 20014754935043826097713376341913960822206666748023316988734720703049024153643;
|
||||
|
||||
|
||||
uint256 constant IC3x = 4770022706913284022426246361926495635078904750741043214268956075109086834012;
|
||||
uint256 constant IC3y = 15234126863934255697594075887866757176470841009005326054002736760043901137869;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_brainpoolP384r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_brainpoolP384r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_brainpoolP384r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_brainpoolP384r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_brainpoolP384r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha256_sha256_sha256_ecdsa_secp256r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_secp256r1 {
|
||||
uint256 constant deltay1 = 20799323163784559718261914492858317118523130378150092434435613338572110196932;
|
||||
uint256 constant deltay2 = 14990446910847906685728734892794375678795805883652589172884763012806420930819;
|
||||
|
||||
|
||||
uint256 constant IC0x = 15279862456791935189899436182918029011971810980820636137503798281596332644431;
|
||||
uint256 constant IC0y = 5875594256869355615925003865805275481889149778767531026103030843188849163042;
|
||||
|
||||
|
||||
uint256 constant IC1x = 18871746441291522433040172141199512517094020757638974169303451068805040108549;
|
||||
uint256 constant IC1y = 17481909845792025147795640059339300039909930587789741160089790055330297800629;
|
||||
|
||||
|
||||
uint256 constant IC2x = 17228496737134183162953404839083447494368305553814570677263820008304107136716;
|
||||
uint256 constant IC2y = 9169963094691275955348042974261987888722303177930700221830198485340995306823;
|
||||
|
||||
|
||||
uint256 constant IC3x = 12489076924452947445650770949126936558633478532726739743575890534382634119788;
|
||||
uint256 constant IC3y = 19184068330904123630217755441256337303398437062402964032554713882869223121187;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_secp256r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_secp256r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_secp256r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_secp256r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_secp256r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha256_sha256_sha256_ecdsa_secp384r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_secp384r1 {
|
||||
uint256 constant deltay1 = 20268971577229545954706935167010616285735836507513920429223288718088929943995;
|
||||
uint256 constant deltay2 = 21144325406167384882393518756777912265383436408998666310107848365852496419102;
|
||||
|
||||
|
||||
uint256 constant IC0x = 9442411342865165006604779210847282499145964678682843678247134860374634735655;
|
||||
uint256 constant IC0y = 19908889975223200197374227870824078479476658997752221093587493678364256098150;
|
||||
|
||||
|
||||
uint256 constant IC1x = 6088631761012793873872011176735311073044507020987158847792817166607547457190;
|
||||
uint256 constant IC1y = 5408178364023472781923470165151349921464641576197451679609061964630375727986;
|
||||
|
||||
|
||||
uint256 constant IC2x = 6554153663186353117117323926287388052308499874096390122598444026717953829298;
|
||||
uint256 constant IC2y = 20014754935043826097713376341913960822206666748023316988734720703049024153643;
|
||||
|
||||
|
||||
uint256 constant IC3x = 4770022706913284022426246361926495635078904750741043214268956075109086834012;
|
||||
uint256 constant IC3y = 15234126863934255697594075887866757176470841009005326054002736760043901137869;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_secp384r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_secp384r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_secp384r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_secp384r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha256_sha256_sha256_ecdsa_secp384r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha256_sha256_sha256_rsa_3_4096 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha256_sha256_sha256_rsa_3_4096 {
|
||||
uint256 constant deltay1 = 16912060044718566958760186965832621985233174684202860901065771441595930661;
|
||||
uint256 constant deltay2 = 6990904920712329146370660837771595296060103589737805809718454732421937412911;
|
||||
|
||||
|
||||
uint256 constant IC0x = 7147662374664978178528564902578191592241162703662598471403516878430958623540;
|
||||
uint256 constant IC0y = 20742545882978583745317608766583437072418450203393459898749008422742542408017;
|
||||
|
||||
|
||||
uint256 constant IC1x = 9192682958180330653299680478108990424077007761308196481987732759178070723926;
|
||||
uint256 constant IC1y = 13396666106360654883543908851938863985071523120160676247159633698209155563479;
|
||||
|
||||
|
||||
uint256 constant IC2x = 6895822624458243572446580093854034736053731337197123582953927396132522058301;
|
||||
uint256 constant IC2y = 9993027976932326188466065715608423961865557719995555109630364303141289309356;
|
||||
|
||||
|
||||
uint256 constant IC3x = 5040162780305494203626900935364986325906575444438264986007662724745613060233;
|
||||
uint256 constant IC3y = 3489728127071850413957238637352781132171576211336681477809188287120783210919;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha256_sha256_sha256_rsa_3_4096 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha256_sha256_sha256_rsa_3_4096 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha256_sha256_sha256_rsa_3_4096 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha256_sha256_sha256_rsa_3_4096 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha256_sha256_sha256_rsa_3_4096 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha256_sha256_sha256_rsa_65537_4096 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha256_sha256_sha256_rsa_65537_4096 {
|
||||
uint256 constant deltay1 = 21774177102224165726668027860055379505695373535738271243426634930654955477900;
|
||||
uint256 constant deltay2 = 1048058787444696992441125463798305262557229676029701658299423124050556506165;
|
||||
|
||||
|
||||
uint256 constant IC0x = 4203584187689189016146966776511744493003920506375581844626620523492362207984;
|
||||
uint256 constant IC0y = 9052081284249212023426781620778265204219325827617666210271990635080730218503;
|
||||
|
||||
|
||||
uint256 constant IC1x = 13074598523964145739549141836158998379234075559961766611764278518366452344199;
|
||||
uint256 constant IC1y = 10574946580048122671154557143146482135525368491045320079433812034618713679906;
|
||||
|
||||
|
||||
uint256 constant IC2x = 8617884471336852633122267689376629797397308765303690336656658481685741540059;
|
||||
uint256 constant IC2y = 20631244058132553562802645570277735937116738303508211566192819335710819938477;
|
||||
|
||||
|
||||
uint256 constant IC3x = 5708146574768159438095373888198192859966167122713346603306758508855474255629;
|
||||
uint256 constant IC3y = 7392468767845842343202171561885901283557240289513003767394888152058209685110;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha256_sha256_sha256_rsa_65537_4096 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha256_sha256_sha256_rsa_65537_4096 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha256_sha256_sha256_rsa_65537_4096 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha256_sha256_sha256_rsa_65537_4096 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha256_sha256_sha256_rsa_65537_4096 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha256_sha256_sha256_rsapss_3_32_2048 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_3_32_2048 {
|
||||
uint256 constant deltay1 = 8857763070540994305951412539908926535830206116302473035781309933327417423895;
|
||||
uint256 constant deltay2 = 16039701702536735810439617038019650947776334461700333220779823591886420216383;
|
||||
|
||||
|
||||
uint256 constant IC0x = 19023325689133548863703657224526039088381457377965323696245245439046610747144;
|
||||
uint256 constant IC0y = 18495120018510107318032766424788517531904003435620141063237139509825730519;
|
||||
|
||||
|
||||
uint256 constant IC1x = 18985635296364488899674404550197255533176668637350249569852209375402957384741;
|
||||
uint256 constant IC1y = 19738244818915278631711381555832692619494549146724799413410724728543642147258;
|
||||
|
||||
|
||||
uint256 constant IC2x = 3002127292353804733044565638602073044927799592862051013730858399863968866622;
|
||||
uint256 constant IC2y = 4483501688591264533407403607502557548973798360232097931151340430370493422091;
|
||||
|
||||
|
||||
uint256 constant IC3x = 1024972951926569974358687494937065172122524805144782023419355129238334286556;
|
||||
uint256 constant IC3y = 15440423366153868217034969510027375825542972135674805344487214674699015498714;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_3_32_2048 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_3_32_2048 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_3_32_2048 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_3_32_2048 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_3_32_2048 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha256_sha256_sha256_rsapss_65537_32_2048 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_65537_32_2048 {
|
||||
uint256 constant deltay1 = 17855601415401520282357849469203244544868276435666994083788576252104715952889;
|
||||
uint256 constant deltay2 = 20700679607291376795241183042865543121940947546969076159179984252908604602623;
|
||||
|
||||
|
||||
uint256 constant IC0x = 20650047058132213809662993089573414062005281673402818277748734247805350329312;
|
||||
uint256 constant IC0y = 8346431023551893201844483416096699802966095060511235070842889654340760885421;
|
||||
|
||||
|
||||
uint256 constant IC1x = 7156410243573370394042301961056447253334717941858266973944146684898929245329;
|
||||
uint256 constant IC1y = 3699089582581324597988193826202058432407833050241834739012624424831081782602;
|
||||
|
||||
|
||||
uint256 constant IC2x = 2102432397976399927648624749864021001283764118575077597316445921690395783696;
|
||||
uint256 constant IC2y = 16798169764499804754174865854060008887348825062558798204836592546740414897120;
|
||||
|
||||
|
||||
uint256 constant IC3x = 17317044777633640299119455114281927115644331466688145265926488556620349221911;
|
||||
uint256 constant IC3y = 8772760877485816523867159264654349840312402751202686541010425679352093361796;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_65537_32_2048 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_65537_32_2048 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_65537_32_2048 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_65537_32_2048 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_65537_32_2048 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha256_sha256_sha256_rsapss_65537_32_3072 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_65537_32_3072 {
|
||||
uint256 constant deltay1 = 10335149737728562397961334902612175311030426856662020462832946982440475945403;
|
||||
uint256 constant deltay2 = 7725990003319491530270603256668676379344028381959299917586866031204349994841;
|
||||
|
||||
|
||||
uint256 constant IC0x = 20273694991424696222089865695164764916021146867149536913591135292403542949895;
|
||||
uint256 constant IC0y = 12236098091629357084243416615405919483831387116612844842890607315845386223990;
|
||||
|
||||
|
||||
uint256 constant IC1x = 3562596969439552152612863105993299993130242993116017407051019998781015796603;
|
||||
uint256 constant IC1y = 21370152915257594517912410264059417212917743259603839376553415912319254855041;
|
||||
|
||||
|
||||
uint256 constant IC2x = 800746440784437703194280344050632892561863930250405038991072199550652220340;
|
||||
uint256 constant IC2y = 16621268396065904604338789414080301832939699450530232311671162312190575013762;
|
||||
|
||||
|
||||
uint256 constant IC3x = 12127347857146364994262050450136225135590745112775230995746041695314807204647;
|
||||
uint256 constant IC3y = 12605180488335893175829332325219421676947049720195349132644638356539735606902;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_65537_32_3072 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_65537_32_3072 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_65537_32_3072 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_65537_32_3072 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_65537_32_3072 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha256_sha256_sha256_rsapss_65537_64_2048 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 20491192805390485299153009773594534940189261866228447918068658471970481763042;
|
||||
uint256 constant alphay = 9383485363053290200918347156157836566562967994039712273449902621266178545958;
|
||||
uint256 constant betax1 = 4252822878758300859123897981450591353533073413197771768651442665752259397132;
|
||||
uint256 constant betax2 = 6375614351688725206403948262868962793625744043794305715222011528459656738731;
|
||||
uint256 constant betay1 = 21847035105528745403288232691147584728191162732299865338377159692350059136679;
|
||||
uint256 constant betay2 = 10505242626370262277552901082094356697409835680220590971873171140371331206856;
|
||||
uint256 constant alphax = 20491192805390485299153009773594534940189261866228447918068658471970481763042;
|
||||
uint256 constant alphay = 9383485363053290200918347156157836566562967994039712273449902621266178545958;
|
||||
uint256 constant betax1 = 4252822878758300859123897981450591353533073413197771768651442665752259397132;
|
||||
uint256 constant betax2 = 6375614351688725206403948262868962793625744043794305715222011528459656738731;
|
||||
uint256 constant betay1 = 21847035105528745403288232691147584728191162732299865338377159692350059136679;
|
||||
uint256 constant betay2 = 10505242626370262277552901082094356697409835680220590971873171140371331206856;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_65537_64_2048 {
|
||||
uint256 constant deltay1 = 21417331860517620213853557801012932528265294825667483000398760394460342854150;
|
||||
uint256 constant deltay2 = 3521621565182312756026882025146971753553266652119142711524309069960835034217;
|
||||
|
||||
|
||||
uint256 constant IC0x = 2650232139950799889519964811076582312005955772764804225189429907947120413540;
|
||||
uint256 constant IC0y = 657051112223451016707929555981496025456893729703484208440844641832356601238;
|
||||
|
||||
|
||||
uint256 constant IC1x = 8081229243468095616978100904972155801431572800975147543193820670895547157174;
|
||||
uint256 constant IC1y = 6616464201431027550515942297910935246754200163796742864613342027126029777305;
|
||||
|
||||
|
||||
uint256 constant IC2x = 1424093314374585694236524334500673650332535238237396379331013965340772391298;
|
||||
uint256 constant IC2y = 17279524849721986212308069874853781724901647454904174566414611247779877579068;
|
||||
|
||||
|
||||
uint256 constant IC3x = 20322713313159424926274301577889437312884792230033252132502625130351424539432;
|
||||
uint256 constant IC3y = 1436142875889436717857447601847861561066309444586720002288236204838004201424;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_65537_64_2048 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_65537_64_2048 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_65537_64_2048 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_65537_64_2048 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha256_sha256_sha256_rsapss_65537_64_2048 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha384_sha384_sha384_ecdsa_brainpoolP384r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha384_sha384_sha384_ecdsa_brainpoolP384r1 {
|
||||
uint256 constant deltay1 = 2655964634947877199609996494191289594643875256682371211458883798917414765294;
|
||||
uint256 constant deltay2 = 6529830897474966572891697442914666184318854305774824529178321388222091805665;
|
||||
|
||||
|
||||
uint256 constant IC0x = 14180127463576949511430389406985338707938226442458612272287141032641097433282;
|
||||
uint256 constant IC0y = 18520340001081201681341628889445882751413799061044855626444262669475231575998;
|
||||
|
||||
|
||||
uint256 constant IC1x = 4782359555423830141545707732871586569509309022786994020772279813916620676975;
|
||||
uint256 constant IC1y = 17341614882131225913344839704562691368602450866829959398461536604420641889440;
|
||||
|
||||
|
||||
uint256 constant IC2x = 12285354976663994516736760739963050694859226668742478417214500732084758641227;
|
||||
uint256 constant IC2y = 486008383723396168189793352768808154423191912311770952673873594493222775388;
|
||||
|
||||
|
||||
uint256 constant IC3x = 15983604734716803811176175475868936955531879564011132812169690299787697608343;
|
||||
uint256 constant IC3y = 5433234915278424150573590364928224011999313701986627480961475623393357074963;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha384_sha384_sha384_ecdsa_brainpoolP384r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha384_sha384_sha384_ecdsa_brainpoolP384r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha384_sha384_sha384_ecdsa_brainpoolP384r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha384_sha384_sha384_ecdsa_brainpoolP384r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha384_sha384_sha384_ecdsa_brainpoolP384r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha384_sha384_sha384_ecdsa_brainpoolP512r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha384_sha384_sha384_ecdsa_brainpoolP512r1 {
|
||||
uint256 constant deltay1 = 14873387777512603238202291899184271790755514580527473327518246092956340721506;
|
||||
uint256 constant deltay2 = 14390611362883461355955787694696658528915413320294561035084608364017878919822;
|
||||
|
||||
|
||||
uint256 constant IC0x = 8735192185444852843909796464662622311966954494624979798830494437573487040586;
|
||||
uint256 constant IC0y = 6050735154878376107549186154135524222506843051956047858431384872560380356975;
|
||||
|
||||
|
||||
uint256 constant IC1x = 5483196628939056089826409818400143037210780641446014927489547989787587699201;
|
||||
uint256 constant IC1y = 1171374649921067872693612253412870791859793815073010265752227736881757200924;
|
||||
|
||||
|
||||
uint256 constant IC2x = 16482995488537871424875041705348410284861593053282641089562844970643442627513;
|
||||
uint256 constant IC2y = 19176167821727984438488135935030091689049819304751596160342283375278346324312;
|
||||
|
||||
|
||||
uint256 constant IC3x = 15777780268455716462763947803251713833182250613008125174940265570223026085835;
|
||||
uint256 constant IC3y = 4875711447580581709474407572392202914066259658604550614725631006355405476979;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha384_sha384_sha384_ecdsa_brainpoolP512r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha384_sha384_sha384_ecdsa_brainpoolP512r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha384_sha384_sha384_ecdsa_brainpoolP512r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha384_sha384_sha384_ecdsa_brainpoolP512r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha384_sha384_sha384_ecdsa_brainpoolP512r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha384_sha384_sha384_ecdsa_secp384r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha384_sha384_sha384_ecdsa_secp384r1 {
|
||||
uint256 constant deltay1 = 5455169250604385419795219345075582044299579949122066670985590123551840944964;
|
||||
uint256 constant deltay2 = 10104015913070532250676370268025611554945382148400238036849663790115734541142;
|
||||
|
||||
|
||||
uint256 constant IC0x = 7908093383721926775469240343078448363521575177109101592873710160262939359547;
|
||||
uint256 constant IC0y = 15740067290358963763952194191806517899082061979771944799240661001956270328137;
|
||||
|
||||
|
||||
uint256 constant IC1x = 4782359555423830141545707732871586569509309022786994020772279813916620676975;
|
||||
uint256 constant IC1y = 17341614882131225913344839704562691368602450866829959398461536604420641889440;
|
||||
|
||||
|
||||
uint256 constant IC2x = 12285354976663994516736760739963050694859226668742478417214500732084758641227;
|
||||
uint256 constant IC2y = 486008383723396168189793352768808154423191912311770952673873594493222775388;
|
||||
|
||||
|
||||
uint256 constant IC3x = 15983604734716803811176175475868936955531879564011132812169690299787697608343;
|
||||
uint256 constant IC3y = 5433234915278424150573590364928224011999313701986627480961475623393357074963;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha384_sha384_sha384_ecdsa_secp384r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha384_sha384_sha384_ecdsa_secp384r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha384_sha384_sha384_ecdsa_secp384r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha384_sha384_sha384_ecdsa_secp384r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha384_sha384_sha384_ecdsa_secp384r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha384_sha384_sha384_rsapss_65537_48_2048 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha384_sha384_sha384_rsapss_65537_48_2048 {
|
||||
uint256 constant deltay1 = 8782002948712706591692122892777769887858927924877222024302273449842068580687;
|
||||
uint256 constant deltay2 = 9352362274075683037351887254389845200972649164871915897438615446650841042777;
|
||||
|
||||
|
||||
uint256 constant IC0x = 8544184508155231574977970852113755830620175462799939787804984445958495214999;
|
||||
uint256 constant IC0y = 18216913274830099676167841484944957272042369395734546840643108051729478468281;
|
||||
|
||||
|
||||
uint256 constant IC1x = 10980199056049801743192649744994203635958903017565289920643967426312426794443;
|
||||
uint256 constant IC1y = 15490465054471261396901238896985420634259128432564942043840378682425378426794;
|
||||
|
||||
|
||||
uint256 constant IC2x = 17991114514556254760956637236919015140729691076666899294137242499474421858730;
|
||||
uint256 constant IC2y = 14343060817456455801476227206111331196064201128326993909630396514088526624247;
|
||||
|
||||
|
||||
uint256 constant IC3x = 17925609596845562960145662666722247162134174553832555607981758300339142868368;
|
||||
uint256 constant IC3y = 1711339344858919485507118159910992082861313712569300995440460052671927530290;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha384_sha384_sha384_rsapss_65537_48_2048 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha384_sha384_sha384_rsapss_65537_48_2048 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha384_sha384_sha384_rsapss_65537_48_2048 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha384_sha384_sha384_rsapss_65537_48_2048 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha384_sha384_sha384_rsapss_65537_48_2048 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha512_sha512_sha256_rsa_65537_4096 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 20491192805390485299153009773594534940189261866228447918068658471970481763042;
|
||||
uint256 constant alphay = 9383485363053290200918347156157836566562967994039712273449902621266178545958;
|
||||
uint256 constant betax1 = 4252822878758300859123897981450591353533073413197771768651442665752259397132;
|
||||
uint256 constant betax2 = 6375614351688725206403948262868962793625744043794305715222011528459656738731;
|
||||
uint256 constant betay1 = 21847035105528745403288232691147584728191162732299865338377159692350059136679;
|
||||
uint256 constant betay2 = 10505242626370262277552901082094356697409835680220590971873171140371331206856;
|
||||
uint256 constant alphax = 20491192805390485299153009773594534940189261866228447918068658471970481763042;
|
||||
uint256 constant alphay = 9383485363053290200918347156157836566562967994039712273449902621266178545958;
|
||||
uint256 constant betax1 = 4252822878758300859123897981450591353533073413197771768651442665752259397132;
|
||||
uint256 constant betax2 = 6375614351688725206403948262868962793625744043794305715222011528459656738731;
|
||||
uint256 constant betay1 = 21847035105528745403288232691147584728191162732299865338377159692350059136679;
|
||||
uint256 constant betay2 = 10505242626370262277552901082094356697409835680220590971873171140371331206856;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha512_sha512_sha256_rsa_65537_4096 {
|
||||
uint256 constant deltay1 = 11939697202187053508707510976290905199551499409672263761474391291658710514837;
|
||||
uint256 constant deltay2 = 7404233723661255839394438230729423120454040735018080878441518168933906765047;
|
||||
|
||||
|
||||
uint256 constant IC0x = 1522312918359803988788512091755329622787453581365817416344334969305501826763;
|
||||
uint256 constant IC0y = 15103489129488920195567010010842048345426549759697537037237072176139672140741;
|
||||
|
||||
|
||||
uint256 constant IC1x = 3426092119649827904350580206849100879401424367721771401042697577618459121414;
|
||||
uint256 constant IC1y = 16770031840381000483094812067973347788614663626630281022545549244984270312425;
|
||||
|
||||
|
||||
uint256 constant IC2x = 18280226729999019912132031662127608679245235959717434252183320707840972425160;
|
||||
uint256 constant IC2y = 20341823113799900095011353295654597790475315229418008642852414296590357768541;
|
||||
|
||||
|
||||
uint256 constant IC3x = 9284316895527342666880616834392865785293585993469843715065175921767468731647;
|
||||
uint256 constant IC3y = 12546994336269880385565077660652394363324080564977267049945074848375882704903;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha512_sha512_sha256_rsa_65537_4096 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha512_sha512_sha256_rsa_65537_4096 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha512_sha512_sha256_rsa_65537_4096 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha512_sha512_sha256_rsa_65537_4096 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha512_sha512_sha256_rsa_65537_4096 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha512_sha512_sha512_ecdsa_brainpoolP512r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha512_sha512_sha512_ecdsa_brainpoolP512r1 {
|
||||
uint256 constant deltay1 = 18166959287221332415767368018929503078315106563710994156348604460979714762741;
|
||||
uint256 constant deltay2 = 14908064929580417939168737694833933618386052899840219036224614307551672747916;
|
||||
|
||||
|
||||
uint256 constant IC0x = 18710498748220767227705003302977305323071337506522987320895689013754828757421;
|
||||
uint256 constant IC0y = 16102011319913061201700546418800139175766194462922175370869548963760320631597;
|
||||
|
||||
|
||||
uint256 constant IC1x = 19286529769583304814784702520019126192803570206401018970719909847974158324329;
|
||||
uint256 constant IC1y = 1155242236517285926726013444715647056857111823469336078757282575745236301050;
|
||||
|
||||
|
||||
uint256 constant IC2x = 7121483107375013561864881366222242761945265932327408281758084321102607697296;
|
||||
uint256 constant IC2y = 13210769923775439019992165720378141251278877718479947970068953633811830722237;
|
||||
|
||||
|
||||
uint256 constant IC3x = 6342858539600635210736844370527058585508847306654018171123849143234084040487;
|
||||
uint256 constant IC3y = 8189602452833790560637976876815510209304393905453779032446627471985274992928;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha512_sha512_sha512_ecdsa_brainpoolP512r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha512_sha512_sha512_ecdsa_brainpoolP512r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha512_sha512_sha512_ecdsa_brainpoolP512r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha512_sha512_sha512_ecdsa_brainpoolP512r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha512_sha512_sha512_ecdsa_brainpoolP512r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha512_sha512_sha512_ecdsa_secp521r1 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 20491192805390485299153009773594534940189261866228447918068658471970481763042;
|
||||
uint256 constant alphay = 9383485363053290200918347156157836566562967994039712273449902621266178545958;
|
||||
uint256 constant betax1 = 4252822878758300859123897981450591353533073413197771768651442665752259397132;
|
||||
uint256 constant betax2 = 6375614351688725206403948262868962793625744043794305715222011528459656738731;
|
||||
uint256 constant betay1 = 21847035105528745403288232691147584728191162732299865338377159692350059136679;
|
||||
uint256 constant betay2 = 10505242626370262277552901082094356697409835680220590971873171140371331206856;
|
||||
uint256 constant alphax = 20491192805390485299153009773594534940189261866228447918068658471970481763042;
|
||||
uint256 constant alphay = 9383485363053290200918347156157836566562967994039712273449902621266178545958;
|
||||
uint256 constant betax1 = 4252822878758300859123897981450591353533073413197771768651442665752259397132;
|
||||
uint256 constant betax2 = 6375614351688725206403948262868962793625744043794305715222011528459656738731;
|
||||
uint256 constant betay1 = 21847035105528745403288232691147584728191162732299865338377159692350059136679;
|
||||
uint256 constant betay2 = 10505242626370262277552901082094356697409835680220590971873171140371331206856;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha512_sha512_sha512_ecdsa_secp521r1 {
|
||||
uint256 constant deltay1 = 6418076645836420671059748997176292536327596475671797721341469567563945325034;
|
||||
uint256 constant deltay2 = 20047489905314554657229962814302565457277706277614625796219965705986733016400;
|
||||
|
||||
|
||||
uint256 constant IC0x = 8213850473044923644372922865138955448896302402477327581557948020399125562390;
|
||||
uint256 constant IC0y = 7127144729850972239443830705584255154725231438062233874024536757991585918868;
|
||||
|
||||
|
||||
uint256 constant IC1x = 10748168300188027468131455001498882971501504192679851740673356495856022514072;
|
||||
uint256 constant IC1y = 19801403303372828407610128930377585605726313318856894500339976951193111704908;
|
||||
|
||||
|
||||
uint256 constant IC2x = 6379168317026520771879080773176084752194625610970132261699911666872334176519;
|
||||
uint256 constant IC2y = 14383832051031881193464421156619185396407821282167818109735802801005284536097;
|
||||
|
||||
|
||||
uint256 constant IC3x = 2412093987228821900950564577698223430910769162690133525007020355167634696396;
|
||||
uint256 constant IC3y = 19260582347247453329893161917118325457388005792864770063050983236893723593026;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha512_sha512_sha512_ecdsa_secp521r1 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha512_sha512_sha512_ecdsa_secp521r1 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha512_sha512_sha512_ecdsa_secp521r1 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha512_sha512_sha512_ecdsa_secp521r1 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha512_sha512_sha512_ecdsa_secp521r1 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha512_sha512_sha512_rsa_65537_4096 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha512_sha512_sha512_rsa_65537_4096 {
|
||||
uint256 constant deltay1 = 8016323471157868097210555378021863771129239692256048285686953910097496901175;
|
||||
uint256 constant deltay2 = 1268442858174232798041320890040058302231282153658837795419767784404409812927;
|
||||
|
||||
|
||||
uint256 constant IC0x = 788662153977020047487908440060519636608025586441517269900106807901228230078;
|
||||
uint256 constant IC0y = 20904598284048198472069371874145875403624827652749070067699932239193561364800;
|
||||
|
||||
|
||||
uint256 constant IC1x = 14855648460653108120707360034038773413341508672497258605770970338353104122533;
|
||||
uint256 constant IC1y = 10477699502316868257932599344091340226650405097060039939070557829893958206158;
|
||||
|
||||
|
||||
uint256 constant IC2x = 21221660522342547061103299874152131091872142905705749263521892331758174595305;
|
||||
uint256 constant IC2y = 10193500598764315366119442003401504739042508551394841743160496081766477687236;
|
||||
|
||||
|
||||
uint256 constant IC3x = 16582908753421460384147547461147864816075691546275678778406809963905097757166;
|
||||
uint256 constant IC3y = 6430293998872124339560152168701504895975370254752408653634784744388236898330;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha512_sha512_sha512_rsa_65537_4096 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha512_sha512_sha512_rsa_65537_4096 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha512_sha512_sha512_rsa_65537_4096 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha512_sha512_sha512_rsa_65537_4096 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha512_sha512_sha512_rsa_65537_4096 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
contract Verifier_register_sha512_sha512_sha512_rsapss_65537_64_2048 {
|
||||
// Scalar field size
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
// Base field size
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
||||
|
||||
// Verification Key data
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant alphax = 16428432848801857252194528405604668803277877773566238944394625302971855135431;
|
||||
uint256 constant alphay = 16846502678714586896801519656441059708016666274385668027902869494772365009666;
|
||||
uint256 constant betax1 = 3182164110458002340215786955198810119980427837186618912744689678939861918171;
|
||||
uint256 constant betax2 = 16348171800823588416173124589066524623406261996681292662100840445103873053252;
|
||||
uint256 constant betay1 = 4920802715848186258981584729175884379674325733638798907835771393452862684714;
|
||||
uint256 constant betay2 = 19687132236965066906216944365591810874384658708175106803089633851114028275753;
|
||||
uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
|
||||
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
|
||||
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
|
||||
@@ -42,27 +42,30 @@ contract Verifier_register_sha512_sha512_sha512_rsapss_65537_64_2048 {
|
||||
uint256 constant deltay1 = 15928828060852996611567735126472583606210784067107216934749365960478255705284;
|
||||
uint256 constant deltay2 = 15523148677555090064002432817799049564835503366137479497726812725171445608393;
|
||||
|
||||
|
||||
uint256 constant IC0x = 14970850053554520917871936978877373592008600599218183137399879767770614013397;
|
||||
uint256 constant IC0y = 4687518326098445506883764869131479730374051909081414100859780026635333412365;
|
||||
|
||||
|
||||
uint256 constant IC1x = 17519057430506274242660579323180660749957185840602314174101027004838762615614;
|
||||
uint256 constant IC1y = 20397105842066396737305711806336931478294098770396616144906441129648732795777;
|
||||
|
||||
|
||||
uint256 constant IC2x = 6492307408333236038748486132440948568538670079804654188433284307660596875120;
|
||||
uint256 constant IC2y = 13945884713404707015556782895314768293480859303445594848713737511334691582597;
|
||||
|
||||
|
||||
uint256 constant IC3x = 6401225548848035306725692880264920393627384820763938963945560767378047631985;
|
||||
uint256 constant IC3y = 3976547394444563928321174757780585113046713922808426955124252186710066806205;
|
||||
|
||||
|
||||
|
||||
// Memory data
|
||||
uint16 constant pVk = 0;
|
||||
uint16 constant pPairing = 128;
|
||||
|
||||
uint16 constant pLastMem = 896;
|
||||
|
||||
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
|
||||
function verifyProof(
|
||||
uint[2] calldata _pA,
|
||||
uint[2][2] calldata _pB,
|
||||
uint[2] calldata _pC,
|
||||
uint[3] calldata _pubSignals
|
||||
) public view returns (bool) {
|
||||
assembly {
|
||||
function checkField(v) {
|
||||
if iszero(lt(v, r)) {
|
||||
@@ -70,7 +73,7 @@ contract Verifier_register_sha512_sha512_sha512_rsapss_65537_64_2048 {
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G1 function to multiply a G1 value(x,y) to value in an address
|
||||
function g1_mulAccC(pR, x, y, s) {
|
||||
let success
|
||||
@@ -105,13 +108,12 @@ contract Verifier_register_sha512_sha512_sha512_rsapss_65537_64_2048 {
|
||||
mstore(add(_pVk, 32), IC0y)
|
||||
|
||||
// Compute the linear combination vk_x
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
|
||||
|
||||
|
||||
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
|
||||
|
||||
|
||||
// -A
|
||||
mstore(_pPairing, calldataload(pA))
|
||||
@@ -137,7 +139,6 @@ contract Verifier_register_sha512_sha512_sha512_rsapss_65537_64_2048 {
|
||||
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
|
||||
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
|
||||
|
||||
|
||||
// gamma2
|
||||
mstore(add(_pPairing, 448), gammax1)
|
||||
mstore(add(_pPairing, 480), gammax2)
|
||||
@@ -154,7 +155,6 @@ contract Verifier_register_sha512_sha512_sha512_rsapss_65537_64_2048 {
|
||||
mstore(add(_pPairing, 704), deltay1)
|
||||
mstore(add(_pPairing, 736), deltay2)
|
||||
|
||||
|
||||
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
|
||||
|
||||
isOk := and(success, mload(_pPairing))
|
||||
@@ -164,19 +164,18 @@ contract Verifier_register_sha512_sha512_sha512_rsapss_65537_64_2048 {
|
||||
mstore(0x40, add(pMem, pLastMem))
|
||||
|
||||
// Validate that all evaluations ∈ F
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 0)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 32)))
|
||||
|
||||
|
||||
checkField(calldataload(add(_pubSignals, 64)))
|
||||
|
||||
|
||||
// Validate all evaluations
|
||||
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
|
||||
|
||||
mstore(0, isValid)
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0, 0x20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import "@nomicfoundation/hardhat-toolbox";
|
||||
require("dotenv").config();
|
||||
import "hardhat-contract-sizer";
|
||||
import "@nomicfoundation/hardhat-ignition-ethers";
|
||||
import 'solidity-coverage';
|
||||
import "solidity-coverage";
|
||||
import "hardhat-gas-reporter";
|
||||
import "hardhat-contract-sizer";
|
||||
|
||||
@@ -15,11 +15,11 @@ const config: HardhatUserConfig = {
|
||||
enabled: true,
|
||||
runs: 200,
|
||||
details: {
|
||||
yul: true
|
||||
}
|
||||
yul: true,
|
||||
},
|
||||
},
|
||||
metadata: {
|
||||
bytecodeHash: "none"
|
||||
bytecodeHash: "none",
|
||||
},
|
||||
viaIR: false,
|
||||
},
|
||||
@@ -31,7 +31,7 @@ const config: HardhatUserConfig = {
|
||||
sources: "./contracts",
|
||||
tests: "./test",
|
||||
cache: "./cache",
|
||||
artifacts: "./artifacts"
|
||||
artifacts: "./artifacts",
|
||||
},
|
||||
defaultNetwork: "hardhat",
|
||||
networks: {
|
||||
@@ -40,8 +40,8 @@ const config: HardhatUserConfig = {
|
||||
url: "http://127.0.0.1:8545",
|
||||
accounts: {
|
||||
mnemonic: "test test test test test test test test test test test test",
|
||||
count: 20
|
||||
}
|
||||
count: 20,
|
||||
},
|
||||
},
|
||||
mainnet: {
|
||||
chainId: 1,
|
||||
@@ -81,11 +81,11 @@ const config: HardhatUserConfig = {
|
||||
chainId: 42220,
|
||||
urls: {
|
||||
apiURL: "https://api.celoscan.io/api",
|
||||
browserURL: "https://celoscan.io"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
browserURL: "https://celoscan.io",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f5c9d69e14610030575b600080fd5b61004361003e36600461051f565b610057565b604051901515815260200160405180910390f35b60006104ca565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f0bec78cbe0f6133772dd9fe085d9dd3fe06b79128a4204a396d053c0cc1aec5e85527f1c2c5cbcf2c354d79854abeee367a58bff9a096dd75466f1f181b639023a97d160208601526000608086018661019a87357f044195cbffa3d2fccbaebb7b69c8b2d7d511410758fec2b1b6dcef03c00884547f173f3268d7b2e73bebf2be4cb4782a22f43ae3c868a5bae3c0c5831c1b1f36c684610092565b6101ea60208801357f2c498ead77e28b6041204d3a1a16d63621c68cc54cb7847bbdb41f2f956932c57f1e29d576fb137572f34dc148fa70bfd40f45febdeeaa1c80f182a59fe880d7be84610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f0e7187c83b883d666f6eda41c38a6ec9708bb6ffe322b6377daa09d837d5a2566102808201527f052be60b1ec3b8c10de8111531a8bbce0240a6a7b727a3bf4ba74384db45eea96102a08201527f26605269c8ba64a6e3ae3e9e7b69c3fbd0d119ac28165a1a7cc7a01d8ea9ec8d6102c08201527f27754fb84c3e7f891f6a94c0c5cea6e3e48d93ea3ab81354c1e8f5144b479aab6102e08201526020816103008360086107d05a03fa9051169695505050505050565b60405161038081016040526104e2600084013561005e565b6104ef602084013561005e565b6104fc818486888a6100fd565b90508060005260206000f35b806040810183101561051957600080fd5b92915050565b600080600080610140858703121561053657600080fd5b6105408686610508565b935060c085018681111561055357600080fd5b6040860193506105638782610508565b925050610574866101008701610508565b90509295919450925056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f5c9d69e14610030575b600080fd5b61004361003e36600461051f565b610057565b604051901515815260200160405180910390f35b60006104ca565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f2afb5c649b1d2f5fb8a0bfa87e5bcf2abc3f08f2c41b2e4e195ab8adae68fa9c85527f22d72c41fa430e45b04cafcd0e901dd1fbcfb29840c9964a1b526626a3205b4860208601526000608086018661019a87357f16e000a3e9fc369fa7b959aab9b57528cfcde33f4946266a52cfedb2cbf12b1e7f17085de088ee7b3f50814d40baca4fc9880b9fc21faebe489ef8cc8149648cf984610092565b6101ea60208801357f2a2c5aca29027a9200b37327ec09269f6c560e8dbca8b0c4fa0e08f2e375ad997f09b70ffa47cce0ec62c20fadf329da3f1aabc0d2fa0164c01ff0ee1f4db1d53484610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f1d2b197a77b7a5f2784d06e25f2f08a2929dc5271561df785dfc306cbe6af2b86102808201527f2f91134f504a6faa1f3cda007a35af131cf1f28bd99d0d30fb4eeaff6e9c1b546102a08201527f1b62b7199a6c90e7f098361c1a81711a89af829ca43bd2676291de017b7249326102c08201527f2db555f99f2e32d022a48d4f3c88b959b2a672d1d08f6fc9292a7cfe693cb0dc6102e08201526020816103008360086107d05a03fa9051169695505050505050565b60405161038081016040526104e2600084013561005e565b6104ef602084013561005e565b6104fc818486888a6100fd565b90508060005260206000f35b806040810183101561051957600080fd5b92915050565b600080600080610140858703121561053657600080fd5b6105408686610508565b935060c085018681111561055357600080fd5b6040860193506105638782610508565b925050610574866101008701610508565b90509295919450925056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f5c9d69e14610030575b600080fd5b61004361003e36600461051e565b610057565b604051901515815260200160405180910390f35b60006104c9565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f21f987caa8fc6b0458cca9e08e5839f043d056bb1361e8231468ba3fa809aeb185527f2e8512e1ad88e096152861b89512450de08373a801c6d48fbd908a2c2d2356c360208601526000608086018661019987357e3eeb4b82d8824374b0a34f847752dbfc9a33df478d15db6a7d86592b87abbc7f1dd3f8ba8174ae05309882c15e2cbfd24f5d9d41572dea2ae41cb81f75b953ea84610092565b6101e960208801357f2d0e9e92c81deaca1da22d9db7bb0d3d155891821d632ee7413676b6527713227f1e325775cfeb5795a7b3c8df141b535fb3963754c240ce07506f22215dccb83684610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f23b7105d4435bcbf03afdad62401c7814153ba3ca486e73b089ce6ea55695cac6102808201527f1a32e76d3e5e4b8d57a6052828e5e248ea5c14fd46a84c1cc3cfcce298ab24ff6102a08201527f179a8d037db1562537237028fdb629c98bbff78e3a75fd31a041a649065066c26102c08201527f0cbf69b1086411da88cecaa28a54e2ba08b1dfe0b0a38c0043f559b2d4e96ea96102e08201526020816103008360086107d05a03fa9051169695505050505050565b60405161038081016040526104e1600084013561005e565b6104ee602084013561005e565b6104fb818486888a6100fd565b90508060005260206000f35b806040810183101561051857600080fd5b92915050565b600080600080610140858703121561053557600080fd5b61053f8686610507565b935060c085018681111561055257600080fd5b6040860193506105628782610507565b925050610573866101008701610507565b90509295919450925056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f5c9d69e14610030575b600080fd5b61004361003e36600461051f565b610057565b604051901515815260200160405180910390f35b60006104ca565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f01754f213ad71c49da99fc1e49fea1a850d87c3c9ee6d5b9d36d5fa74de0b51285527f23095d905f7ba9de0f28ac759bfa781ed7214ef85884768358abf41866e72ea060208601526000608086018661019a87357f0995d9aa33d61d7c4f6a6872712997ecb58c2cc6e674e0222645262ab982cff67f2edae5f83f3211961a78460756d5bbf1c85885e34a96a0eadbcb83ba3857e99784610092565b6101ea60208801357f2e5e7393db44c6bbc965dfa8dc4eadf0d9b15d0829499c21c2c26f60271ee2407f2ac0aeb04adfcbc3ba9fa944c50ece8fc93b09514760e330598b21a79ca5446f84610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f24dcb30d85389b93be1e42802e1fa5508168533e23b8b5e77f9b2a6333f480d06102808201527f1ae9a3802accd860801fb690caab706392ca2782c4a54fe3d63448dd27725e816102a08201527f0f3b23da96115eb676b6706c4c39133d2edb0721a02f842538fe13961cdcf6d46102c08201527f0458dda6e8453bbc314b77c8b12b6d9f7183f6721c3c3b316b03a7adcabfdd286102e08201526020816103008360086107d05a03fa9051169695505050505050565b60405161038081016040526104e2600084013561005e565b6104ef602084013561005e565b6104fc818486888a6100fd565b90508060005260206000f35b806040810183101561051957600080fd5b92915050565b600080600080610140858703121561053657600080fd5b6105408686610508565b935060c085018681111561055357600080fd5b6040860193506105638782610508565b925050610574866101008701610508565b90509295919450925056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f5c9d69e14610030575b600080fd5b61004361003e36600461051e565b610057565b604051901515815260200160405180910390f35b60006104c9565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f1b0a17c6fb19b6902b30e6e27bff687b3919c92e24bb24cd45c858445aff9a9d85527f0ebc64511482baae3e57366927fb4c883714d44e94153dba260d73aeb42cff7260208601526000608086018661019987357e3eeb4b82d8824374b0a34f847752dbfc9a33df478d15db6a7d86592b87abbc7f1dd3f8ba8174ae05309882c15e2cbfd24f5d9d41572dea2ae41cb81f75b953ea84610092565b6101e960208801357f2d0e9e92c81deaca1da22d9db7bb0d3d155891821d632ee7413676b6527713227f1e325775cfeb5795a7b3c8df141b535fb3963754c240ce07506f22215dccb83684610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f1dc2fc8ed50b9a3f450e3652357c991195d70bffab1abefa4f3deb7bed09b4cf6102808201527f2b27ed08f687f299fd9b80b41073897c10c2421048190e6d3910055a9616eac66102a08201527f030d0bf5fbf001fc27a335972949bf3549eebf4f557c7da714c7bf02fa67c6346102c08201527f2371eb3e12d2488503151d1bb6e5b9b2b4c3b1313593df526f06d9fc4fb827296102e08201526020816103008360086107d05a03fa9051169695505050505050565b60405161038081016040526104e1600084013561005e565b6104ee602084013561005e565b6104fb818486888a6100fd565b90508060005260206000f35b806040810183101561051857600080fd5b92915050565b600080600080610140858703121561053557600080fd5b61053f8686610507565b935060c085018681111561055257600080fd5b6040860193506105628782610507565b925050610573866101008701610507565b90509295919450925056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f5c9d69e14610030575b600080fd5b61004361003e36600461051f565b610057565b604051901515815260200160405180910390f35b60006104ca565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f2837d00b9ba5fd245ebce840daab0edce8888be6c2e2870eefadcdd6a4919e8085527f11689f5c55a3967ffa8a7e3af54e2465687800f35b1310db892737d366f1679060208601526000608086018661019a87357f0995d9aa33d61d7c4f6a6872712997ecb58c2cc6e674e0222645262ab982cff67f2edae5f83f3211961a78460756d5bbf1c85885e34a96a0eadbcb83ba3857e99784610092565b6101ea60208801357f2e5e7393db44c6bbc965dfa8dc4eadf0d9b15d0829499c21c2c26f60271ee2407f2ac0aeb04adfcbc3ba9fa944c50ece8fc93b09514760e330598b21a79ca5446f84610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f09b680e631103016d63f9e4cc12c405e3b36e36280712fddfcb17b3d58b100056102808201527f0fe2597e2bf44b17d6796acc28aad738d1f7df4efe8ce8c2a9a29dff136463d36102a08201527f1ddfe06f8174c12cdcedb87ddeadea5f982454d2934ba121614d2ea18d76c69c6102c08201527f24f8a9d0241267a5c6eed16a2683512742ce00a509e0ab596adcfcf722d968bb6102e08201526020816103008360086107d05a03fa9051169695505050505050565b60405161038081016040526104e2600084013561005e565b6104ef602084013561005e565b6104fc818486888a6100fd565b90508060005260206000f35b806040810183101561051957600080fd5b92915050565b600080600080610140858703121561053657600080fd5b6105408686610508565b935060c085018681111561055357600080fd5b6040860193506105638782610508565b925050610574866101008701610508565b90509295919450925056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f5c9d69e14610030575b600080fd5b61004361003e36600461051f565b610057565b604051901515815260200160405180910390f35b60006104ca565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f23e81549adac679446c0fc590ece112cc8b284df009de7a280d316af618e061085527f0882cef82c4665b16e8b8c7f7267e07a6c9f1b2acef279d753e6160125090e5d60208601526000608086018661019a87357f0c76cde28ecc2612bf776aa1892fc14c1c8a1aa5bcb59eb54a077907e539c5fb7f1277815364eef58f4c3c8e4476e8223f20b6d704fd1ac7396a7d87a7f5752f3884610092565b6101ea60208801357f2071b8e5864e712df885b7519012eade4a323f71533266680a5c765c994ce8d77f271a8edcc91c3da3d5470d64d8929ba474cc855e9ecc578bdbb1c6211835c3a884610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f25b9301eac23122d20e4bc9680461f9d7222ed33a0e4786878ba7fb496aa8d5b6102808201527f14d6654a528626884431ab9d62412f693c03231b2f00d266a0cb277581a24a1b6102a08201527f0176658b0cf24e80e64c6208a745e1fb18b8c9c30cf0cbbe5e014cab93023e596102c08201527f24a0d8848d35117103b9241c453237ec0dfa3ef9c71b1122b7c9501db961ecc06102e08201526020816103008360086107d05a03fa9051169695505050505050565b60405161038081016040526104e2600084013561005e565b6104ef602084013561005e565b6104fc818486888a6100fd565b90508060005260206000f35b806040810183101561051957600080fd5b92915050565b600080600080610140858703121561053657600080fd5b6105408686610508565b935060c085018681111561055357600080fd5b6040860193506105638782610508565b925050610574866101008701610508565b90509295919450925056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f5c9d69e14610030575b600080fd5b61004361003e36600461051e565b610057565b604051901515815260200160405180910390f35b60006104c9565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f1be6ee08a2538c00b92d7a2c4ed89ed1d14dd7fe1d02581b8cb781c3d0d38b7e85527f077f03570a47d52544a86d5e052560abf86a5539ebd07c47f56bd09d50796d6c60208601526000608086018661019a87357f1803eb33385294bbd35c582d4ae804a000ca601c64930ca523566a23400ff7197f04d51122bb77b7bacebc25f6f6ebf1f7d6ec0a6bd695e580080c7000de84537284610092565b6101ea60208801357f16f13e319113ceddfe6d9011025e0f7f32ee1410821d8892ec4b6fb5ffa84dc77f058101891e50a8dca0af3a3056c2457ecf73ad53f01bee569d2d6c1ed920a9be84610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f0a4f8efbbf1fb74bce226880ba54f91c862899ebe43e64cf3b48090356bc924b6102808201527f1a1f404c94199e60e8a2d7017a57734f3e33b1a14dcfe2b16fedc06ee970e8136102a08201527e83630c69f927c9e3ab6782991c11a277756118c75e7fb27bf338fe0fbc11026102c08201527f11f97824d81b6cc5b3c1115dcdfc6b706cda76f7cf6f47c29655354079357b086102e08201526020816103008360086107d05a03fa9051169695505050505050565b60405161038081016040526104e1600084013561005e565b6104ee602084013561005e565b6104fb818486888a6100fd565b90508060005260206000f35b806040810183101561051857600080fd5b92915050565b600080600080610140858703121561053557600080fd5b61053f8686610507565b935060c085018681111561055257600080fd5b6040860193506105628782610507565b925050610573866101008701610507565b90509295919450925056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f5c9d69e14610030575b600080fd5b61004361003e36600461051f565b610057565b604051901515815260200160405180910390f35b60006104ca565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f20c02123674aff76635a38fc11be2493f9843f379a1e27f09d8dec9675acbf1d85527f143d5f1f40344ac57f3756c3d0fc54bb345af00489d29d493da58b57ad2f525160208601526000608086018661019a87357f2b3616dfbdc869420bc05e130185c80940edde5148a0df2b5b7d6f8186a0a4307f061c7603a17614c0e3097b0df048a106216d8b2816c4239fd792d79b4bb0832d84610092565b6101ea60208801357f06a890d1b74e3d140971cc01afe5fbb48c5588fe4db14576b9d76a80505110b17f1745a2861080db7212b26d96201197bb73068a3e96e3c99d41e29b6b57739b8d84610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f0575f478b09b885ad2702f2da5f174bfaa948d620b4df21c319fdb3dd19209ab6102808201527f0caa5105e92e2b4c0e2dc13b16c1312b17fba6b44b20b18f4c664ace4024ca9b6102a08201527f07a23184980040b84274e85e29faf9f59e1ac5bd59ebd19e10ae75b42435968f6102c08201527f14d5966d4236636b457b1f14aec40e1d4e73226cd4f53a9d214f2c667b3c843f6102e08201526020816103008360086107d05a03fa9051169695505050505050565b60405161038081016040526104e2600084013561005e565b6104ef602084013561005e565b6104fc818486888a6100fd565b90508060005260206000f35b806040810183101561051957600080fd5b92915050565b600080600080610140858703121561053657600080fd5b6105408686610508565b935060c085018681111561055357600080fd5b6040860193506105638782610508565b925050610574866101008701610508565b90509295919450925056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f5c9d69e14610030575b600080fd5b61004361003e36600461051f565b610057565b604051901515815260200160405180910390f35b60006104ca565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f17d3ed98ed46849e453ee76c5f5a1005357365890a111a09b2636e3abb3f43d585527f2d4f8390933008e25b657ed542af9e208c6fb63511d6be7fb9fa518441dede7e60208601526000608086018661019a87357f12fc717d528effd38fcfb69659d9dca5585919de2ee946796d7aaaaee2a65de07f2a73b2209e0b34d41e5e38aeb80bca640782420eb31f5473e98c5ee9c24d5e8884610092565b6101ea60208801357f148403224d9e0e1d735f41def6a69d82fb4e657caf6a3a8c40c200c846b3fe937f0a93bfc17ef4575e3be9be149e4b945283f0fcb8256ef27a4238c3620ecf0dc084610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f268775de994dac26824f614d0d06a9eb66be0d9512dd79f529738d7fee5b8fa96102808201527f2574a1b38ed6f08cc70dd75147111c4e4417aea7094a1f0cf37255c2574d0e066102a08201527f05b98c34a2a2ee250c22add5b96bee1b7d0ed0f9ff445cff8cb7dcf9e4bd5aee6102c08201527f0a0eb7761ece087fc49df6d63c9818869da39fcd9cdd242639f99103c7475b656102e08201526020816103008360086107d05a03fa9051169695505050505050565b60405161038081016040526104e2600084013561005e565b6104ef602084013561005e565b6104fc818486888a6100fd565b90508060005260206000f35b806040810183101561051957600080fd5b92915050565b600080600080610140858703121561053657600080fd5b6105408686610508565b935060c085018681111561055357600080fd5b6040860193506105638782610508565b925050610574866101008701610508565b90509295919450925056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f5c9d69e14610030575b600080fd5b61004361003e36600461051f565b610057565b604051901515815260200160405180910390f35b60006104ca565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f06ce897ef59809b8d067d6674d26906940519258bb183a965ea9aafe47fbe46585527f0f090a7cb402b9be77c71bf8e3e6f9c6fe212aef35976d976f778bafe2f45a6a60208601526000608086018661019a87357f02ee3eec112cede6c5ca155b4eea1660f24448d740f65f400f5c9c4b9971e66c7f23ee17d2dab47c612e6b1f545adab5c72e3bd3ad36057aa09cc336ff2e33c15d84610092565b6101ea60208801357f1270c94a61400d94509717cd834e82d3400335df6cf132c04b64c849cedad4417f0d90b78fd86ccedda619f8df6b10f66710b777123e02ae73598bcbca39d099a084610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f0f40d920cb63e8428f2fad880b13a80b7bfc0cc9e3f18cfd1a7554d68778e2016102808201527f01d118dc46c44079a4ef02a4738b922f3e49cd6e363ef8342d9d2a98e2a131ec6102a08201527f049355098ba2d117bc5ed50d431f149513fb570b5581f92dd68dd15a5c131f8c6102c08201527f182adc4174cb08675de8e6416d4dd418d0720f37f12e0907b4487e7c331a5ce56102e08201526020816103008360086107d05a03fa9051169695505050505050565b60405161038081016040526104e2600084013561005e565b6104ef602084013561005e565b6104fc818486888a6100fd565b90508060005260206000f35b806040810183101561051957600080fd5b92915050565b600080600080610140858703121561053657600080fd5b6105408686610508565b935060c085018681111561055357600080fd5b6040860193506105638782610508565b925050610574866101008701610508565b90509295919450925056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f5c9d69e14610030575b600080fd5b61004361003e36600461051f565b610057565b604051901515815260200160405180910390f35b60006104ca565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f221c3caf384f61ee972d6a1fd637d46574ab585360e2f7bf7ef4354f3337717185527f193106e33bd2dafd3d408c33185c05405fbd067f58fc94979082fdfaf24aaa1b60208601526000608086018661019a87357f02ee3eec112cede6c5ca155b4eea1660f24448d740f65f400f5c9c4b9971e66c7f23ee17d2dab47c612e6b1f545adab5c72e3bd3ad36057aa09cc336ff2e33c15d84610092565b6101ea60208801357f1270c94a61400d94509717cd834e82d3400335df6cf132c04b64c849cedad4417f0d90b78fd86ccedda619f8df6b10f66710b777123e02ae73598bcbca39d099a084610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f2bc70c375d7ddb422778251f323a25b2fcdb645d5c8774b424f6587c83e9fc466102808201527f0b29895e434c3d97b937ad3e0f9b1f5aea337fe020d34b4d0be3db795b4afe836102a08201527f079a9e22e2a589a7e4a468814a2f8d3c819d4bc5d58ed922a20b38785c8ae1d46102c08201527f1825e9e562da6c1439f3c114204b31cf32f1c77cfe111c31701e3a95dfdf5ae76102e08201526020816103008360086107d05a03fa9051169695505050505050565b60405161038081016040526104e2600084013561005e565b6104ef602084013561005e565b6104fc818486888a6100fd565b90508060005260206000f35b806040810183101561051957600080fd5b92915050565b600080600080610140858703121561053657600080fd5b6105408686610508565b935060c085018681111561055357600080fd5b6040860193506105638782610508565b925050610574866101008701610508565b90509295919450925056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f5c9d69e14610030575b600080fd5b61004361003e36600461051f565b610057565b604051901515815260200160405180910390f35b60006104ca565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f11e5d01a49c95eda097034f83a5bba9492e527628bb971321ea00c6bd8f0732c85527f0e3c6eadf06956c449c2850ad406b373b59e6c8065131ca1bed940d79635bb8e60208601526000608086018661019a87357f02999637f2d80cd32e022ceac7b1e4f061ff2b699701507264ff1fefbb78e2447f1e413cd9b317e638208a96176798b44860afba6157728ff17a26d729fed010e384610092565b6101ea60208801357f22362fd26991c36a75f775ae83cb868984f06bdc3523cdd81aa227f6a2e5d31c7f07f50be8ce08c6b458679b6bbfa38748fba88d155c964582ad1177053341e0c584610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f11c4637fe4f146251ada6a35741bfd7a729af8b711c54b7e4700456282cfb4e26102808201527f095bcfd8eeb8345b1c9c92d3dc4e4df40282df6c2a34ab3505c3d8f9e5ac2b536102a08201527f2f601c36ee502e8c8b511e8d1e7e3ccb6da973a5d892da8d088c8f088a61a2046102c08201527f037234f7c0dfcd97286b440d4ecfb8fd2da71290ec389387083e8b5ec90cb2c56102e08201526020816103008360086107d05a03fa9051169695505050505050565b60405161038081016040526104e2600084013561005e565b6104ef602084013561005e565b6104fc818486888a6100fd565b90508060005260206000f35b806040810183101561051957600080fd5b92915050565b600080600080610140858703121561053657600080fd5b6105408686610508565b935060c085018681111561055357600080fd5b6040860193506105638782610508565b925050610574866101008701610508565b90509295919450925056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f5c9d69e14610030575b600080fd5b61004361003e36600461051f565b610057565b604051901515815260200160405180910390f35b60006104ca565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f156fc19de548d3d22ead836defb375446db63d7a9f4e5c7d6209001918c261f785527f024d3241f16ed4ca6d2c18d6dba9b4c5124947381c0769f7878b3c2b174e182e60208601526000608086018661019a87357f10817f468a4f607a850766f7bfd9ec33db63cd6177ad453514cd912e4a9a5b687f20bbc1bd750e6fd6f3e56587b3dd1f5437c18514112e21519542b5327d2d8dca84610092565b6101ea60208801357f2c40e84bcae15aeb3fd1f2ec4c27f0a977ff41af77e05ec7cc0cdfdf839c8b847f163ad62be3dd35f2b160a6e326d3f2984fe24ea57796e5f4ffabb0dd80e91eb084610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f18f842be3d5a1226e0c1f623441df7a8dbef39df8dfd08f47285e7fe2a51e1206102808201527f026f8c1484f30595e9e58524b67bb5090c19721aae73998cc98625893592b6f86102a08201527f1f45225b2139746d80561080ae9ca6e8569bd04eaa0f45ba71d689800508f7b96102c08201527f1a137eda45b594929e47381acbec7cef1b7cfeb3ee1b282f028db35e0b8367ee6102e08201526020816103008360086107d05a03fa9051169695505050505050565b60405161038081016040526104e2600084013561005e565b6104ef602084013561005e565b6104fc818486888a6100fd565b90508060005260206000f35b806040810183101561051957600080fd5b92915050565b600080600080610140858703121561053657600080fd5b6105408686610508565b935060c085018681111561055357600080fd5b6040860193506105638782610508565b925050610574866101008701610508565b90509295919450925056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806311479fea14610030575b600080fd5b61004361003e36600461057c565b610057565b604051901515815260200160405180910390f35b600061051a565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f2b2206db39f34bb32da9a3a5f30aec6920df207226b4af6bebf67a4ff7a5d42285527f2e62ee421c5a2c7cae54d4e0bc49d45c2560efc1908554f04620596d08b6131c60208601526000608086018661019a87357f16612ae714ae3b6dae203c9894bb4c0f79dfb5bd82d6359cfa5e80a25bd2d1757f2a691e70601ac559be237212064acd248a3d747b98b25c7ad536f79f6ef27a2684610092565b6101ea60208801357f2176d834588612a6c047186c48ef8c4d87ee32c2a99d1533ae6c5c3a25b61b7c7f174a06d966071b42ec2ba6f452f7cb0b07b798409a6867b599eeb9afa7d6ca5e84610092565b61023a60408801357f2d75c970df8a328f4e3ee8634883770e2cefae46dafc6bf5edf04427b71d266d7f1a55ad5aba92e8bb0b869360f65d6f3fad1e0345d38e783159324f2cde13011784610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f2019b03477df84d03fa8234a3b69d44ed4d6bff3ade433e7d6920f00334f67a26102808201527f06918ce2e7d0587258348d4b76cf7247e2c4d4aacfd53ed28c3f1c4f28a23b956102a08201527f27ddb16efaa058efa58efa8282468bb7780055206dbc85ded8ed9e6c12b434b16102c08201527f304436d93fc88614c0a91c8074c5330049cd71aa63ea1eca6e7cb8894c20f21d6102e08201526020816103008360086107d05a03fa9051169695505050505050565b6040516103808101604052610532600084013561005e565b61053f602084013561005e565b61054c604084013561005e565b610559818486888a6100fd565b90508060005260206000f35b806040810183101561057657600080fd5b92915050565b600080600080610160858703121561059357600080fd5b61059d8686610565565b935060c08501868111156105b057600080fd5b6040860193506105c08782610565565b92505085610160860111156105d457600080fd5b5091949093509091610100019056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806311479fea14610030575b600080fd5b61004361003e36600461057b565b610057565b604051901515815260200160405180910390f35b6000610519565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f2de3bc435e8efb05924e74395dc95564dd2edb97b96b6f02916b24212510e98b85527f173f9597e8a914c6fc1030a749e0976b5bb93d2f88ab3d565b4af833d917835b60208601526000608086018661019a87357f2ec53ef0a1083db4b3aaa197f57833cc256612df597a05eb6f602b65d0996a777f0c4d6e3b48e0aff7183bf6e3ec56dc473e265be32e40a72e8484bad9e1bdeab984610092565b6101ea60208801357f2b4fc22b3470f36a1b1755e70443222384d02f94c948341b4d3297d18f76fb047f0b655833a52528c19ab59a628c961ffb2cd080e1ef1a353712b582ab314bc9e184610092565b61023a60408801357f0e6703e05c329367b49c8696a62a085fb31965b1a1cf91cab87a7a2e6d740cff7f2f3f99fa6223f762b62d1094ec94fc89f59befa01944079dd73ab812770599fb84610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f2bc188a649e5e487719b907b85746577ab47ff716926f4979ae8bf570973aa856102808201527f210e7b95b8c8d91c89be6cceca4ab15bf03eb1df3455b63fa6333b087a68ac4c6102a08201527f081abc7a2934db3cc5cd6cefd2782cd13f77ea77260f5c5a64ec4553c3724d0d6102c08201527ee4653ea7c3713c79adde88be2c1e9ef5244d9a8f946fb90af7e8c0ea187e226102e08201526020816103008360086107d05a03fa9051169695505050505050565b6040516103808101604052610531600084013561005e565b61053e602084013561005e565b61054b604084013561005e565b610558818486888a6100fd565b90508060005260206000f35b806040810183101561057557600080fd5b92915050565b600080600080610160858703121561059257600080fd5b61059c8686610564565b935060c08501868111156105af57600080fd5b6040860193506105bf8782610564565b92505085610160860111156105d357600080fd5b5091949093509091610100019056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806311479fea14610030575b600080fd5b61004361003e36600461057b565b610057565b604051901515815260200160405180910390f35b6000610519565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f1b546220e020b3422d41613cd683fa0d619653b99f10adcbc62bcc581fc0746f85527f084c959d38a5570f3ee255c48ba00f2520f0886bd535764bb07e52eb21cbc1dc60208601526000608086018661019a87357f29b7eedde199db606114176b5725a9287849d12c8e2ae3101d7d42f9e799dbb47f0833401935690e4d3d797d331320d42cf1b23808cc7f4c6aeb01fbffe84b564584610092565b6101ea60208801357f2a525d662869b2a7d839f7c4f296ecf0d0b5a85c4f74d494a4b7a8e37b96b5837f164e9668a28d794cbd14f13b8609a1a5fa7f496c651cbb5e4e1ca82df60c184884610092565b61023a60408801357f29e0ed781988d6d8226db399f9b6b5b1f649861785030244bb5c0cd76e15edda7f02a5cff530276e262bedfde1d549dc19da46acedeeaa89d90d415140a19cd6e084610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527e958d19c2d113e5b27fcd633ab5d2fcc9ea51d3e8e7c9a3346951fc394ca0426102808201527f014fd8dc3de74841d42adfdafae45e551d2fa66f56aa82e2710f89a67db26ecc6102a08201527f1b39e1b9f2a89f9e042e443d670b2573c41823d35df0ef2dd69517d0f74ebea76102c08201527f17261b3cfe9b25e24f3ad460aa128033f1a3fbde14f910e8989a4fdad20d250d6102e08201526020816103008360086107d05a03fa9051169695505050505050565b6040516103808101604052610531600084013561005e565b61053e602084013561005e565b61054b604084013561005e565b610558818486888a6100fd565b90508060005260206000f35b806040810183101561057557600080fd5b92915050565b600080600080610160858703121561059257600080fd5b61059c8686610564565b935060c08501868111156105af57600080fd5b6040860193506105bf8782610564565b92505085610160860111156105d357600080fd5b5091949093509091610100019056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806311479fea14610030575b600080fd5b61004361003e36600461057c565b610057565b604051901515815260200160405180910390f35b600061051a565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f0f9599bf7a878a20a1d84032cb07c60c81ffa57ac05ec10c04e8368ec6f7792c85527f2f684740d7809f043e236bfc599a8579fc421fd960291867b6312e578a83dfbd60208601526000608086018661019a87357f1614e360bb44c18e3f0ed5d2557a5cfa384337f422b09ac822378f9bff6d14037f20f21ed4ae4c019634ceb0a42274b84a3f29653e73734bc8d5074b201f56f8ef84610092565b6101ea60208801357f112ff89411a7ffbc8857262d4b8289d615b54260a807b3a10c21ff896c72db9c7f19fdced738a2486f751293a0498bc8ef009da6e994aa944a33a9a0b615be57f784610092565b61023a60408801357f1d42d5dac8584c15b86abca94e006fc1e4eac57e5e6d41c50868c163e4b14fc67f05e44f31fc1a537a0f539adf82f43a248e65b4a49c29801be50bd74c1509bf9d84610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f0728d08e0bf7e19af8e193f0bd6a06cf126001b43cda966f5c232b184cf1435e6102808201527f2e98da41503f8b6a4130fdc42f8d08be9c28bb87b4cd2cc33926556badc459706102a08201527f0df35252daceaf077522242c66e07b80ecf9cca3e4dfb053be5d76cbb58822846102c08201527f1fe7aa244e27e13fefd56b7b2693b5ae52374b144c9d42a3a75564576722371a6102e08201526020816103008360086107d05a03fa9051169695505050505050565b6040516103808101604052610532600084013561005e565b61053f602084013561005e565b61054c604084013561005e565b610559818486888a6100fd565b90508060005260206000f35b806040810183101561057657600080fd5b92915050565b600080600080610160858703121561059357600080fd5b61059d8686610565565b935060c08501868111156105b057600080fd5b6040860193506105c08782610565565b92505085610160860111156105d457600080fd5b5091949093509091610100019056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806311479fea14610030575b600080fd5b61004361003e36600461057c565b610057565b604051901515815260200160405180910390f35b600061051a565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f1baed069e2754b3d56f75ec537a6b3a88ef8b297218e39ab823b99bcccd4578685527f12be7223c259f51ec0f5342e55659df025bb5cf826a0e570b1fa35a2451d44d560208601526000608086018661019a87357f052a44322750af73f0a00e842708f3fcba6c99152b5c2115fbbbbb21d8834a3e7f1e1a554701513719623151bcfdd599dc429a1b08358135da32812de99bf49b5184610092565b6101ea60208801357f184af15ac4f2b910627c533b9fb0818959934a2999ee92a3b0758209c819d2ad7f1607d792d81e52d4ea7aa17f0165b3b678691976f21bc027cccd3b59fdb847ad84610092565b61023a60408801357f08a02a1be52685f0157aa3e7fd34d6d5a50f3403b245b59918a23e894e3218f27f2e3c7c474b460e8bc6fc8ac0716b46cb796d83db27c95c1454d262de9165fb5284610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f14d4332d103bb22d3844b7710ba0cee3af4dc4aa90cf6c6a2e038ac7f85509836102808201527f2f393a17ff2b191d589ccda68226a972776036553322f014d3845b425e65bbae6102a08201527f279fa0ad48dd0594f15622237c1dc18a1ce9189c15a4200edfce37497cf9b7b66102c08201527f2ac3cc06d8abb80e4bd7f9c9d24eebf188f76fdbc4247ed87f0bacd5d411bd846102e08201526020816103008360086107d05a03fa9051169695505050505050565b6040516103808101604052610532600084013561005e565b61053f602084013561005e565b61054c604084013561005e565b610559818486888a6100fd565b90508060005260206000f35b806040810183101561057657600080fd5b92915050565b600080600080610160858703121561059357600080fd5b61059d8686610565565b935060c08501868111156105b057600080fd5b6040860193506105c08782610565565b92505085610160860111156105d457600080fd5b5091949093509091610100019056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806311479fea14610030575b600080fd5b61004361003e36600461057c565b610057565b604051901515815260200160405180910390f35b600061051a565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f135fae7570ff384e2323625f5d8576e1391113010185394bf443a13c8e78f8e885527f1ef47048feca5426f3db879e84088d0858b8f769e48d3cfccdd71eb56e299c9460208601526000608086018661019a87357f26a6690b41fbc0d5b70dfb0809f5a2d72b4ccc21e1c990ae84bfaa923611e7b57f29b907abbe15c590dc780fab9220c1985c350771045203749e77ddaf4aa8f40584610092565b6101ea60208801357f144603e31fc2188de3bf989a8a7ffafb9bb4eb5d2840db7be591d19ae57dc5477f2616fbcca50f2d361c747a1972898c79f8011b173ba605634c4c7ebc5e0926cc84610092565b61023a60408801357f2a69cc427b629d647eb6a6fd6192bc4a1c11896f8531b9b37d5937d815afe1237f1b9c91297225fd2f3d9e7b032e096cac898ecbdccffb511bd49166d65029b26c84610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f0bf0c49198beeed4209357118b2b93add067976963a674ebaf2fb1b93ab0ca7d6102808201527f072c8c0f0c01b0cf9c3c3223314fefdc78511a00f77907336749e4cbc5867f816102a08201527f1ce17db51cefff7f15cb8d5fc85322debc6c03ab3165230cbda104a602e3fca56102c08201527f1815d49e77c7b212a352cc337816b332adc3ac0b4e85ad9b7e7542d8e303aac76102e08201526020816103008360086107d05a03fa9051169695505050505050565b6040516103808101604052610532600084013561005e565b61053f602084013561005e565b61054c604084013561005e565b610559818486888a6100fd565b90508060005260206000f35b806040810183101561057657600080fd5b92915050565b600080600080610160858703121561059357600080fd5b61059d8686610565565b935060c08501868111156105b057600080fd5b6040860193506105c08782610565565b92505085610160860111156105d457600080fd5b5091949093509091610100019056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806311479fea14610030575b600080fd5b61004361003e36600461057c565b610057565b604051901515815260200160405180910390f35b600061051a565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f1fae0bf8aa0634a90d6e7f8318963130f77bbf4c245949df26ce9ad3a54f7b6985527f0f3c7e519d2a29179523e920a00c7db15aff38221c5e2bfbe24b4b4ae94a353260208601526000608086018661019a87357f0bf4eba484bcbea030bf3e7dcfcf906b7deb56ae8dbbc4bab40e59cea07303727f0d760b1fc5ae8866df0955790ca5a5ad95e3873acf399665b80f7c037bed5ea684610092565b6101ea60208801357f2c3ff329187d2945353be4843812e648883df75c2dc6477f88bbcb7e7fd8282b7f0e7d84fecce7e04d50c7962a3232dc515b20a89dc715dd5a1e3bf83e6c43a9b284610092565b61023a60408801357f21ae35d2a3fcab8dee88911d0244996771078fc1177bd6e7fce270c14ff5b3cd7f0a8bbcb7a24ec08c5bb90ce13b7e1192db0e0534326b13fd77c4eee77126ad5c84610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f0d9aea9d829b751d2bfe98621d84908edeba485175f56ff720f8044ad26fcf856102808201527f0796633687dd49b17b8d02f553682527a3fd169a0f674d687281ebf872393ff66102a08201527f147b586c1d3c1761b75150fe158f464c056820a4f1a678b9c0e22ecdf39bc7f76102c08201527f0e466ea477ba839747ad58c1709f8d808ee6875ef73ddb62dc14149b2619eec56102e08201526020816103008360086107d05a03fa9051169695505050505050565b6040516103808101604052610532600084013561005e565b61053f602084013561005e565b61054c604084013561005e565b610559818486888a6100fd565b90508060005260206000f35b806040810183101561057657600080fd5b92915050565b600080600080610160858703121561059357600080fd5b61059d8686610565565b935060c08501868111156105b057600080fd5b6040860193506105c08782610565565b92505085610160860111156105d457600080fd5b5091949093509091610100019056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806311479fea14610030575b600080fd5b61004361003e36600461057c565b610057565b604051901515815260200160405180910390f35b600061051a565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f21c8187e105c0d319d92f2eb54b77cabdbdbdb9280c30b52f8af5bc8093f984f85527f0cfd77ef90b33e255f8ea7c6eb4b546cd3a34c65295fb5b7bd67fb4103943b2260208601526000608086018661019a87357f26a6690b41fbc0d5b70dfb0809f5a2d72b4ccc21e1c990ae84bfaa923611e7b57f29b907abbe15c590dc780fab9220c1985c350771045203749e77ddaf4aa8f40584610092565b6101ea60208801357f144603e31fc2188de3bf989a8a7ffafb9bb4eb5d2840db7be591d19ae57dc5477f2616fbcca50f2d361c747a1972898c79f8011b173ba605634c4c7ebc5e0926cc84610092565b61023a60408801357f2a69cc427b629d647eb6a6fd6192bc4a1c11896f8531b9b37d5937d815afe1237f1b9c91297225fd2f3d9e7b032e096cac898ecbdccffb511bd49166d65029b26c84610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f2dd7c8b2d6f0ca40a81cf4cefb4972e5cc65738c1cb681c6c477db9e4a21ec3e6102808201527f031d951d0d7baaf2ef68ef0bad035371b893bb805698ac27c815ff0f8b74f3c46102a08201527f2dfbffee17aad54ac198444736d242db636f94863b2c04d52421c9a3abd870c46102c08201527f21244ad2d52c07efef181ede715dbbddffdf4609efba5b55d6adb2617b9b21036102e08201526020816103008360086107d05a03fa9051169695505050505050565b6040516103808101604052610532600084013561005e565b61053f602084013561005e565b61054c604084013561005e565b610559818486888a6100fd565b90508060005260206000f35b806040810183101561057657600080fd5b92915050565b600080600080610160858703121561059357600080fd5b61059d8686610565565b935060c08501868111156105b057600080fd5b6040860193506105c08782610565565b92505085610160860111156105d457600080fd5b5091949093509091610100019056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806311479fea14610030575b600080fd5b61004361003e36600461057c565b610057565b604051901515815260200160405180910390f35b600061051a565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f14e037264d81c619deedc34d63047e265b470e145d085523fc483c8eac9d282785527f2c04084b7e9c2a2e6e3d6eea40802c23628e89f1ddfb430f41ec34fabe33d76660208601526000608086018661019a87357f0bf4eba484bcbea030bf3e7dcfcf906b7deb56ae8dbbc4bab40e59cea07303727f0d760b1fc5ae8866df0955790ca5a5ad95e3873acf399665b80f7c037bed5ea684610092565b6101ea60208801357f2c3ff329187d2945353be4843812e648883df75c2dc6477f88bbcb7e7fd8282b7f0e7d84fecce7e04d50c7962a3232dc515b20a89dc715dd5a1e3bf83e6c43a9b284610092565b61023a60408801357f21ae35d2a3fcab8dee88911d0244996771078fc1177bd6e7fce270c14ff5b3cd7f0a8bbcb7a24ec08c5bb90ce13b7e1192db0e0534326b13fd77c4eee77126ad5c84610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f19e27f87d314e78d31f71a9fe0fab5f31d5e2f2634e338ce7befd28f145608a06102808201527f204ac63b93e59ae6bdbe4f881a01c070bbc3ceffc0844de89f51b9036afbe8cb6102a08201527f2ccfd4d46c7686a8e88d913e96671b2cc3df920548b749d9aa8fddb39d2221bb6102c08201527f2ebf439a7ca708a971f3e47df95a4163a077965b33f62990e76b7865542ad91e6102e08201526020816103008360086107d05a03fa9051169695505050505050565b6040516103808101604052610532600084013561005e565b61053f602084013561005e565b61054c604084013561005e565b610559818486888a6100fd565b90508060005260206000f35b806040810183101561057657600080fd5b92915050565b600080600080610160858703121561059357600080fd5b61059d8686610565565b935060c08501868111156105b057600080fd5b6040860193506105c08782610565565b92505085610160860111156105d457600080fd5b5091949093509091610100019056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806311479fea14610030575b600080fd5b61004361003e36600461057b565b610057565b604051901515815260200160405180910390f35b6000610519565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f0fcd6efc6e731cb6d0fbaae9f0a03df2a046769086e8b76b181b0b4ea6259b3485527f2ddbdd6bb35aa93a72a3bb80ebb89f075611f9563022d1167105a42cd11a595160208601526000608086018661019a87357f1d9e3e8b3445910366e678ba2250e7118d75d87af52f159cd2291562d300bfd77f1452dfc9b2b1633f4a0d2ccab5243bd3e1cab2d9feb364216eba6da95ffc0d5684610092565b6101ea60208801357f1617da785c3be043858c733c89643863d10c97bf491b4802eae7c4461c53b4ac7f0f3ee5b4ed4950681ce80559d961c07c603ebca01ee4288ba0f2eac7db10623d84610092565b61023a60408801357f07b71dba54e4eb48b124c84751decc746cda907340c1ee357784e5e3da3479a77f0b24a18bda0c41f4267a929cf90432f552095d1472560da6667805ca161ca88984610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f245229d9b076b3c0e8a4d70bde8c1cccffa08a9fae7557b165b3b0dbd653e2c760c08201527f253ec85988dbb84e46e94b5efa3373b47a000b4ac6c86b2d4b798d274a18230260e08201527f07090a82e8fabbd39299be24705b92cf208ee8b3487f6f2b39ff27978a29a1db6101008201527f2424bcc1f60a5472685fd50705b2809626e170120acaf441e133a2bd5e61d2446101208201527f0ae1135cffdaf227c5dc266740607aa930bc3bd92ddc2b135086d9da2dfd3e2a6101408201527f2b86859fd3d55c9d150fb3f0aeba798826493dd73d357ab0f9fdaced9fc81829610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f188ba6675c2574a87aac36e318cb5891ded3cd30931c282c44858eb9f2259c256102808201527f26c03e8df327bc4c2fc54f448014071b398dc1447354950eda44711b3aa0384e6102a08201527e0992672bdffedcd0c918a1a46cc6fd3570044755b344d511f856698324d8256102c08201527f0f74b6434eca19c7a11c57e981e10cf6eb649f01c7d418d7c403ce34ec86bb2f6102e08201526020816103008360086107d05a03fa9051169695505050505050565b6040516103808101604052610531600084013561005e565b61053e602084013561005e565b61054b604084013561005e565b610558818486888a6100fd565b90508060005260206000f35b806040810183101561057557600080fd5b92915050565b600080600080610160858703121561059257600080fd5b61059c8686610564565b935060c08501868111156105af57600080fd5b6040860193506105bf8782610564565b92505085610160860111156105d357600080fd5b5091949093509091610100019056fea164736f6c634300081c000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user