1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
contracts/contracts/RegisterASCII.txt
|
||||
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "app/witnesscalc/depends/json"]
|
||||
path = app/witnesscalc/depends/json
|
||||
url = https://github.com/nlohmann/json.git
|
||||
7
app/.gitignore
vendored
@@ -4,7 +4,7 @@
|
||||
|
||||
# Xcode
|
||||
#
|
||||
build/
|
||||
ios/build
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
@@ -24,7 +24,6 @@ ios/.xcode.env.local
|
||||
|
||||
# Android/IntelliJ
|
||||
#
|
||||
build/
|
||||
.idea
|
||||
.gradle
|
||||
local.properties
|
||||
@@ -67,6 +66,4 @@ yarn-error.log
|
||||
|
||||
.env
|
||||
|
||||
.expo/
|
||||
|
||||
libuniffi_mopro.so
|
||||
.expo/
|
||||
152
app/App.tsx
@@ -1,155 +1,37 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import {
|
||||
NativeModules,
|
||||
DeviceEventEmitter,
|
||||
} from 'react-native';
|
||||
import Toast from 'react-native-toast-message';
|
||||
import {
|
||||
DEFAULT_PNUMBER,
|
||||
DEFAULT_DOB,
|
||||
DEFAULT_DOE
|
||||
} from '@env';
|
||||
import { PassportData } from '../common/src/utils/types';
|
||||
import { samplePassportData } from '../common/src/utils/passportDataStatic';
|
||||
import React, { useEffect } from 'react';
|
||||
import "react-native-get-random-values"
|
||||
import "@ethersproject/shims"
|
||||
import { ethers } from "ethers";
|
||||
import MainScreen from './src/screens/MainScreen';
|
||||
import { Steps } from './src/utils/utils';
|
||||
import { startCameraScan } from './src/utils/cameraScanner';
|
||||
import { scan } from './src/utils/nfcScanner';
|
||||
import { mint } from './src/utils/minter';
|
||||
import { toastConfig } from './src/utils/toastConfig';
|
||||
import { Buffer } from 'buffer';
|
||||
import { YStack } from 'tamagui';
|
||||
import { prove } from './src/utils/prover';
|
||||
import { useToastController } from '@tamagui/toast';
|
||||
import useNavigationStore from './src/stores/navigationStore';
|
||||
import { AMPLITUDE_KEY } from '@env';
|
||||
import * as amplitude from '@amplitude/analytics-react-native';
|
||||
import useUserStore from './src/stores/userStore';
|
||||
global.Buffer = Buffer;
|
||||
|
||||
console.log('DEFAULT_PNUMBER', DEFAULT_PNUMBER);
|
||||
|
||||
function App(): JSX.Element {
|
||||
const [passportNumber, setPassportNumber] = useState(DEFAULT_PNUMBER ?? "");
|
||||
const [dateOfBirth, setDateOfBirth] = useState(DEFAULT_DOB ?? '');
|
||||
const [dateOfExpiry, setDateOfExpiry] = useState(DEFAULT_DOE ?? '');
|
||||
const [address, setAddress] = useState<string>(ethers.ZeroAddress);
|
||||
const [passportData, setPassportData] = useState<PassportData>(samplePassportData as PassportData);
|
||||
const [step, setStep] = useState<number>(Steps.MRZ_SCAN);
|
||||
const [generatingProof, setGeneratingProof] = useState<boolean>(false);
|
||||
const [proofTime, setProofTime] = useState<number>(0);
|
||||
const [proof, setProof] = useState<{ proof: string, inputs: string } | null>(null);
|
||||
const [mintText, setMintText] = useState<string>("");
|
||||
const [majority, setMajority] = useState<number>(18);
|
||||
|
||||
const [disclosure, setDisclosure] = useState({
|
||||
issuing_state: false,
|
||||
name: false,
|
||||
passport_number: false,
|
||||
nationality: false,
|
||||
date_of_birth: false,
|
||||
gender: false,
|
||||
expiry_date: false,
|
||||
older_than: false,
|
||||
});
|
||||
|
||||
const handleDisclosureChange = (field: string) => {
|
||||
setDisclosure(
|
||||
{
|
||||
...disclosure,
|
||||
[field]: !disclosure[field as keyof typeof disclosure]
|
||||
});
|
||||
};
|
||||
const toast = useToastController();
|
||||
const setToast = useNavigationStore((state) => state.setToast);
|
||||
const initUserStore = useUserStore((state) => state.initUserStore);
|
||||
|
||||
useEffect(() => {
|
||||
const logEventListener = DeviceEventEmitter.addListener('LOG_EVENT', e => {
|
||||
console.log(e);
|
||||
});
|
||||
|
||||
return () => {
|
||||
logEventListener.remove();
|
||||
};
|
||||
}, []);
|
||||
setToast(toast);
|
||||
}, [toast, setToast]);
|
||||
|
||||
useEffect(() => {
|
||||
init()
|
||||
amplitude.init(AMPLITUDE_KEY);
|
||||
initUserStore();
|
||||
}, []);
|
||||
|
||||
async function init() {
|
||||
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||
console.log('launching init')
|
||||
const res = await NativeModules.Prover.runInitAction()
|
||||
console.log('init done')
|
||||
console.log('init res', res)
|
||||
}
|
||||
|
||||
const handleStartCameraScan = () => {
|
||||
startCameraScan({
|
||||
setPassportNumber,
|
||||
setDateOfBirth,
|
||||
setDateOfExpiry,
|
||||
setStep,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
const handleNFCScan = () => {
|
||||
scan({
|
||||
passportNumber,
|
||||
dateOfBirth,
|
||||
dateOfExpiry,
|
||||
setPassportData,
|
||||
setStep,
|
||||
});
|
||||
};
|
||||
|
||||
const handleProve = (path: string) => {
|
||||
prove({
|
||||
passportData,
|
||||
disclosure,
|
||||
address,
|
||||
setStep,
|
||||
setGeneratingProof,
|
||||
setProofTime,
|
||||
setProof,
|
||||
}, path);
|
||||
};
|
||||
|
||||
const handleMint = () => {
|
||||
mint({
|
||||
proof,
|
||||
setStep,
|
||||
setMintText,
|
||||
});
|
||||
};
|
||||
// TODO: when passportData already stored, retrieve and jump to main screen
|
||||
|
||||
return (
|
||||
<YStack f={1} bg="white" h="100%" w="100%">
|
||||
<YStack f={1} bc="#161616" h="100%" w="100%">
|
||||
<YStack h="100%" w="100%">
|
||||
<MainScreen
|
||||
onStartCameraScan={handleStartCameraScan}
|
||||
nfcScan={handleNFCScan}
|
||||
passportData={passportData}
|
||||
disclosure={disclosure}
|
||||
handleDisclosureChange={handleDisclosureChange}
|
||||
address={address}
|
||||
setAddress={setAddress}
|
||||
generatingProof={generatingProof}
|
||||
handleProve={handleProve}
|
||||
step={step}
|
||||
mintText={mintText}
|
||||
proof={proof}
|
||||
proofTime={proofTime}
|
||||
handleMint={handleMint}
|
||||
setStep={setStep}
|
||||
passportNumber={passportNumber}
|
||||
setPassportNumber={setPassportNumber}
|
||||
dateOfBirth={dateOfBirth}
|
||||
setDateOfBirth={setDateOfBirth}
|
||||
dateOfExpiry={dateOfExpiry}
|
||||
setDateOfExpiry={setDateOfExpiry}
|
||||
majority={majority}
|
||||
setMajority={setMajority}
|
||||
/>
|
||||
<MainScreen />
|
||||
</YStack>
|
||||
<Toast config={toastConfig} />
|
||||
</YStack>
|
||||
);
|
||||
}
|
||||
|
||||
133
app/README.md
@@ -1,14 +1,14 @@
|
||||
# Proof of Passport App
|
||||
|
||||
### Requirements
|
||||
## Requirements
|
||||
|
||||
Install `nodejs v18`, [circom](https://docs.circom.io/) and [snarkjs](https://github.com/iden3/snarkjs)
|
||||
|
||||
For android, install java, android studio and the android sdk
|
||||
For Android, install Java, Android Studio and the Android SDK
|
||||
|
||||
For ios, install Xcode and [cocoapods](https://cocoapods.org/)
|
||||
For iOS, install Xcode and [cocoapods](https://cocoapods.org/)
|
||||
|
||||
### Installation
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
yarn
|
||||
@@ -19,74 +19,107 @@ In `/common`, also run:
|
||||
yarn
|
||||
```
|
||||
|
||||
### Build the app
|
||||
## Run the app
|
||||
|
||||
Go to the `circuit` folder of the monorepo and build the circuit.
|
||||
First, connect your phone to your computer and allow access.
|
||||
|
||||
#### Build the android native module
|
||||
### Android
|
||||
|
||||
Run:
|
||||
```
|
||||
./scripts/build_android_module.sh
|
||||
```
|
||||
|
||||
You might need to set the rust-toolchain rust version as global default. Example:
|
||||
```
|
||||
rustup default 1.67.0
|
||||
```
|
||||
|
||||
For macOS users you might also need to set-up the path to sdk:
|
||||
in /app/android create local.properties
|
||||
|
||||
Add the following line:
|
||||
sdk.dir=/Users/<user>/Library/Android/sdk or any relevant path to your sdk
|
||||
|
||||
#### Build the iOS native module
|
||||
|
||||
Run:
|
||||
```
|
||||
./scripts/build_ios_module.sh
|
||||
```
|
||||
|
||||
#### Run the server
|
||||
|
||||
To run the server, first connect your phone to your computer, allow access, then:
|
||||
Launch the react-native server:
|
||||
```
|
||||
yarn start
|
||||
```
|
||||
Then press `a` for android or `i` for iOS
|
||||
|
||||
If you want to see the logs and have a better ios developer experience, open `/ios` in Xcode and launch the app from there instead.
|
||||
Press `a` to open the app on Android.
|
||||
|
||||
> :warning: Due to the current limitations of mopro, see [#51](https://github.com/zk-passport/proof-of-passport/issues/51), the proving on iOS only works when the app is run on Xcode. It will not work with the react native server or in a .ipa build. We are working on fixing that.
|
||||
To see the Android logs you'll have to use the Android Studio Logcat.
|
||||
|
||||
To see the android logs you'll have to use the Android Studio Logcat.
|
||||
### iOS
|
||||
|
||||
To run the app on iOS, you will need an Apple Developer account. Free accounts can't run apps that use NFC reading.
|
||||
|
||||
Open the ios project on Xcode and add your provisionning profile in Targets > ProofOfPassport > Signing and Capabilities
|
||||
|
||||
Then, install pods:
|
||||
```
|
||||
cd ios
|
||||
pod install
|
||||
```
|
||||
|
||||
And run the app in Xcode.
|
||||
|
||||
## Modify the circuits
|
||||
|
||||
If you want to modify the circuits, you'll have to adapt a few things.
|
||||
|
||||
First, go to the `circuit` folder of the monorepo, modify the circuits and build them.
|
||||
|
||||
Then, upload the zipped zkeys built at publicly available urls and replace the urls in `app/src/utils/zkeyDownload.ts`. Be sure the zkey is named `<circuit_name>.zkey` before you zip it, and the zip is then named `<circuit_name>.zkey.zip`.
|
||||
|
||||
Adapt the inputs you pass in `app/src/utils/prover.ts`, and adapt and redeploy the contracts.
|
||||
|
||||
Run the common init script:
|
||||
```
|
||||
./scripts/common.sh
|
||||
```
|
||||
|
||||
### Android
|
||||
|
||||
Find your android ndk path. It should be something like `/Users/<your-user-name>/Library/Android/sdk/ndk/23.1.7779620`
|
||||
Build the android native module:
|
||||
```
|
||||
export ANDROID_NDK="<your-android-ndk-path>"
|
||||
./scripts/build_android_module.sh
|
||||
```
|
||||
|
||||
### iOS
|
||||
|
||||
Find your [development team id](https://chat.openai.com/share/9d52c37f-d9da-4a62-acb9-9e4ee8179f95) and run:
|
||||
```
|
||||
export DEVELOPMENT_TEAM="<your-development-team-id>"
|
||||
./scripts/build_ios_module.sh
|
||||
```
|
||||
|
||||
## Export a new release
|
||||
|
||||
### Android
|
||||
|
||||
#### Export as apk
|
||||
|
||||
To export an apk:
|
||||
```
|
||||
cd android
|
||||
./gradlew assembleRelease
|
||||
```
|
||||
The built apk it located at `android/app/build/outputs/apk/release/app-release.apk`
|
||||
|
||||
#### Download zkey
|
||||
If you want to mint a proof of passport SBT, instead of building the circuit yourself, run:
|
||||
```
|
||||
./scripts/download_current_zkey.sh
|
||||
```
|
||||
|
||||
This will download the zkey currently deployed onchain in the proof of passport contract and place it in `circuits/build``
|
||||
Then, build the android or iOS native module and run the app.
|
||||
|
||||
#### Releases
|
||||
|
||||
##### Play Store
|
||||
#### Publish on the Play Store
|
||||
As explained [here](https://reactnative.dev/docs/signed-apk-android), first setup `android/app/my-upload-key.keystore` and the private vars in `~/.gradle/gradle.properties`, then run:
|
||||
```
|
||||
npx react-native build-android --mode=release
|
||||
```
|
||||
This builds `android/app/build/outputs/bundle/release/app-release.aab`.
|
||||
|
||||
Then to test the release on an android phone, delete the previous version of the app and run:
|
||||
```
|
||||
yarn android --mode release
|
||||
```
|
||||
|
||||
Don't forget to bump `versionCode` in `android/app/build.gradle`.
|
||||
|
||||
### iOS
|
||||
|
||||
In Xcode, go to `Product>Archive` then follow the flow.
|
||||
|
||||
Don't forget to bump the build number.
|
||||
|
||||
## FAQ
|
||||
|
||||
If you get something like this:
|
||||
```
|
||||
'std::__1::system_error: open: /proof-of-passport/app: Operation not permitted'
|
||||
```
|
||||
You might want to try [this](https://stackoverflow.com/questions/49443341/watchman-crawl-failed-retrying-once-with-node-crawler):
|
||||
```
|
||||
watchman watch-del-all
|
||||
watchman shutdown-server
|
||||
```
|
||||
@@ -1,17 +0,0 @@
|
||||
/**
|
||||
* @format
|
||||
*/
|
||||
|
||||
import 'react-native';
|
||||
import React from 'react';
|
||||
import App from '../App';
|
||||
|
||||
// Note: import explicitly to use the types shiped with jest.
|
||||
import {it} from '@jest/globals';
|
||||
|
||||
// Note: test renderer must be required after react-native.
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
it('renders correctly', () => {
|
||||
renderer.create(<App />);
|
||||
});
|
||||
1
app/android/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
build
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:largeHeap="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
|
||||
@@ -80,8 +80,17 @@ android {
|
||||
applicationId "com.proofofpassport"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 1
|
||||
versionCode 2
|
||||
versionName "1.0"
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
cppFlags += "-fexceptions -frtti -std=c++11"
|
||||
arguments += "-DANDROID_STL=c++_shared"
|
||||
}
|
||||
ndk {
|
||||
abiFilters += "arm64-v8a"
|
||||
}
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
debug {
|
||||
@@ -109,6 +118,12 @@ android {
|
||||
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
||||
}
|
||||
}
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
path = file("src/main/cpp/CMakeLists.txt")
|
||||
version = "3.22.1"
|
||||
}
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
exclude 'META-INF/LICENSE'
|
||||
@@ -120,8 +135,8 @@ dependencies {
|
||||
// The version of react-native is set by the React Native Gradle Plugin
|
||||
implementation("com.facebook.react:react-android")
|
||||
implementation(project(":react-native-passport-reader")) {
|
||||
exclude group: 'edu.ucar', module: 'jj2000'
|
||||
}
|
||||
exclude group: 'edu.ucar', module: 'jj2000'
|
||||
}
|
||||
implementation project(':passportreader')
|
||||
implementation 'org.jmrtd:jmrtd:0.7.18'
|
||||
|
||||
@@ -139,7 +154,9 @@ dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
implementation("net.java.dev.jna:jna:5.13.0@aar")
|
||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android'
|
||||
implementation project(':react-native-fs')
|
||||
|
||||
implementation 'com.google.code.gson:gson:2.8.9'
|
||||
}
|
||||
|
||||
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<manifest
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="org.proofofpassport"
|
||||
>
|
||||
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
@@ -9,6 +13,7 @@
|
||||
|
||||
<application
|
||||
android:name=".MainApplication"
|
||||
android:largeHeap="true"
|
||||
android:label="@string/app_name"
|
||||
android:icon="@mipmap/passport_logo"
|
||||
android:allowBackup="false"
|
||||
|
||||
24
app/android/app/src/main/cpp/CMakeLists.txt
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.22.1)
|
||||
|
||||
project("proofofpassport")
|
||||
|
||||
include_directories(include)
|
||||
|
||||
link_directories(lib)
|
||||
|
||||
add_library(rapidsnark SHARED IMPORTED)
|
||||
set_target_properties(rapidsnark PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/lib/librapidsnark.so)
|
||||
|
||||
|
||||
add_library(register_sha256WithRSAEncryption_65537 SHARED IMPORTED)
|
||||
set_target_properties(register_sha256WithRSAEncryption_65537 PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/lib/libwitnesscalc_register_sha256WithRSAEncryption_65537.so)
|
||||
|
||||
add_library(disclose SHARED IMPORTED)
|
||||
set_target_properties(disclose PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/lib/libwitnesscalc_disclose.so)
|
||||
|
||||
add_library(${CMAKE_PROJECT_NAME} SHARED
|
||||
proofofpassport.cpp)
|
||||
|
||||
target_link_libraries(${CMAKE_PROJECT_NAME}
|
||||
rapidsnark register_sha256WithRSAEncryption_65537 disclose)
|
||||
47
app/android/app/src/main/cpp/include/prover.h
Normal file
@@ -0,0 +1,47 @@
|
||||
#ifndef PROVER_HPP
|
||||
#define PROVER_HPP
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//Error codes returned by the functions.
|
||||
#define PROVER_OK 0x0
|
||||
#define PROVER_ERROR 0x1
|
||||
#define PROVER_ERROR_SHORT_BUFFER 0x2
|
||||
#define PROVER_INVALID_WITNESS_LENGTH 0x3
|
||||
|
||||
/**
|
||||
* groth16_prover
|
||||
* @return error code:
|
||||
* PROVER_OK - in case of success
|
||||
* PPOVER_ERROR - in case of an error
|
||||
* PROVER_ERROR_SHORT_BUFFER - in case of a short buffer error, also updates proof_size and public_size with actual proof and public sizess
|
||||
*/
|
||||
int
|
||||
groth16_prover(const void *zkey_buffer, unsigned long zkey_size,
|
||||
const void *wtns_buffer, unsigned long wtns_size,
|
||||
char *proof_buffer, unsigned long *proof_size,
|
||||
char *public_buffer, unsigned long *public_size,
|
||||
char *error_msg, unsigned long error_msg_maxsize);
|
||||
|
||||
/**
|
||||
* groth16_prover_zkey_file
|
||||
* @return error code:
|
||||
* PROVER_OK - in case of success
|
||||
* PPOVER_ERROR - in case of an error
|
||||
* PROVER_ERROR_SHORT_BUFFER - in case of a short buffer error, also updates proof_size and public_size with actual proof and public sizess
|
||||
*/
|
||||
int
|
||||
groth16_prover_zkey_file(const char *zkeyPath,
|
||||
const void *wtns_buffer, unsigned long wtns_size,
|
||||
char *proof_buffer, unsigned long *proof_size,
|
||||
char *public_buffer, unsigned long *public_size,
|
||||
char *error_msg, unsigned long error_msg_maxsize);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif // PROVER_HPP
|
||||
39
app/android/app/src/main/cpp/include/witnesscalc_disclose.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef WITNESSCALC_disclose_H
|
||||
#define WITNESSCALC_disclose_H
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define WITNESSCALC_OK 0x0
|
||||
#define WITNESSCALC_ERROR 0x1
|
||||
#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
|
||||
|
||||
/**
|
||||
*
|
||||
* @return error code:
|
||||
* WITNESSCALC_OK - in case of success.
|
||||
* WITNESSCALC_ERROR - in case of an error.
|
||||
*
|
||||
* On success wtns_buffer is filled with witness data and
|
||||
* wtns_size contains the number bytes copied to wtns_buffer.
|
||||
*
|
||||
* If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
|
||||
* and the minimum size for wtns_buffer in wtns_size.
|
||||
*
|
||||
*/
|
||||
|
||||
int
|
||||
witnesscalc_disclose(
|
||||
const char *circuit_buffer, unsigned long circuit_size,
|
||||
const char *json_buffer, unsigned long json_size,
|
||||
char *wtns_buffer, unsigned long *wtns_size,
|
||||
char *error_msg, unsigned long error_msg_maxsize);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif // WITNESSCALC_disclose_H
|
||||
@@ -0,0 +1,39 @@
|
||||
#ifndef WITNESSCALC_register_sha256WithRSAEncryption_65537_H
|
||||
#define WITNESSCALC_register_sha256WithRSAEncryption_65537_H
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define WITNESSCALC_OK 0x0
|
||||
#define WITNESSCALC_ERROR 0x1
|
||||
#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
|
||||
|
||||
/**
|
||||
*
|
||||
* @return error code:
|
||||
* WITNESSCALC_OK - in case of success.
|
||||
* WITNESSCALC_ERROR - in case of an error.
|
||||
*
|
||||
* On success wtns_buffer is filled with witness data and
|
||||
* wtns_size contains the number bytes copied to wtns_buffer.
|
||||
*
|
||||
* If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
|
||||
* and the minimum size for wtns_buffer in wtns_size.
|
||||
*
|
||||
*/
|
||||
|
||||
int
|
||||
witnesscalc_register_sha256WithRSAEncryption_65537(
|
||||
const char *circuit_buffer, unsigned long circuit_size,
|
||||
const char *json_buffer, unsigned long json_size,
|
||||
char *wtns_buffer, unsigned long *wtns_size,
|
||||
char *error_msg, unsigned long error_msg_maxsize);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif // WITNESSCALC_register_sha256WithRSAEncryption_65537_H
|
||||
BIN
app/android/app/src/main/cpp/lib/librapidsnark.so
Normal file
BIN
app/android/app/src/main/cpp/lib/libwitnesscalc_disclose.so
Executable file
174
app/android/app/src/main/cpp/proofofpassport.cpp
Normal file
@@ -0,0 +1,174 @@
|
||||
#include "include/prover.h"
|
||||
#include "include/witnesscalc_register_sha256WithRSAEncryption_65537.h"
|
||||
#include "include/witnesscalc_disclose.h"
|
||||
|
||||
#include <jni.h>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_proofofpassport_prover_ZKPTools_groth16_1prover(JNIEnv *env, jobject thiz,
|
||||
jbyteArray zkey_buffer, jlong zkey_size,
|
||||
jbyteArray wtns_buffer, jlong wtns_size,
|
||||
jbyteArray proof_buffer, jlongArray proof_size,
|
||||
jbyteArray public_buffer,
|
||||
jlongArray public_size, jbyteArray error_msg,
|
||||
jlong error_msg_max_size) {
|
||||
const void *zkeyBuffer = env->GetByteArrayElements(zkey_buffer, nullptr);
|
||||
const void *wtnsBuffer = env->GetByteArrayElements(wtns_buffer, nullptr);
|
||||
char *proofBuffer = reinterpret_cast<char *>(env->GetByteArrayElements(proof_buffer,
|
||||
nullptr));
|
||||
char *publicBuffer = reinterpret_cast<char *>(env->GetByteArrayElements(public_buffer,
|
||||
nullptr));
|
||||
char *errorMsg = reinterpret_cast<char *>(env->GetByteArrayElements(error_msg, nullptr));
|
||||
|
||||
unsigned long proofSize = env->GetLongArrayElements(proof_size, nullptr)[0];
|
||||
unsigned long publicSize = env->GetLongArrayElements(public_size, nullptr)[0];
|
||||
|
||||
int result = groth16_prover(zkeyBuffer, static_cast<unsigned long>(zkey_size),
|
||||
wtnsBuffer, static_cast<unsigned long>(wtns_size),
|
||||
proofBuffer, &proofSize,
|
||||
publicBuffer, &publicSize,
|
||||
errorMsg, static_cast<unsigned long>(error_msg_max_size));
|
||||
|
||||
env->SetLongArrayRegion(proof_size, 0, 1, reinterpret_cast<const jlong *>(&proofSize));
|
||||
env->SetLongArrayRegion(public_size, 0, 1, reinterpret_cast<const jlong *>(&publicSize));
|
||||
|
||||
env->ReleaseByteArrayElements(zkey_buffer,
|
||||
reinterpret_cast<jbyte *>(const_cast<void *>(zkeyBuffer)), 0);
|
||||
env->ReleaseByteArrayElements(wtns_buffer,
|
||||
reinterpret_cast<jbyte *>(const_cast<void *>(wtnsBuffer)), 0);
|
||||
env->ReleaseByteArrayElements(proof_buffer, reinterpret_cast<jbyte *>(proofBuffer), 0);
|
||||
env->ReleaseByteArrayElements(public_buffer, reinterpret_cast<jbyte *>(publicBuffer), 0);
|
||||
env->ReleaseByteArrayElements(error_msg, reinterpret_cast<jbyte *>(errorMsg), 0);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_proofofpassport_prover_ZKPTools_witnesscalc_1register_1sha256WithRSAEncryption_165537(JNIEnv *env, jobject thiz,
|
||||
jbyteArray circuit_buffer,
|
||||
jlong circuit_size, jbyteArray json_buffer,
|
||||
jlong json_size, jbyteArray wtns_buffer,
|
||||
jlongArray wtns_size, jbyteArray error_msg,
|
||||
jlong error_msg_max_size) {
|
||||
const char *circuitBuffer = reinterpret_cast<const char *>(env->GetByteArrayElements(
|
||||
circuit_buffer, nullptr));
|
||||
const char *jsonBuffer = reinterpret_cast<const char *>(env->GetByteArrayElements(json_buffer,
|
||||
nullptr));
|
||||
char *wtnsBuffer = reinterpret_cast<char *>(env->GetByteArrayElements(wtns_buffer, nullptr));
|
||||
char *errorMsg = reinterpret_cast<char *>(env->GetByteArrayElements(error_msg, nullptr));
|
||||
|
||||
unsigned long wtnsSize = env->GetLongArrayElements(wtns_size, nullptr)[0];
|
||||
|
||||
|
||||
int result = witnesscalc_register_sha256WithRSAEncryption_65537(
|
||||
circuitBuffer, static_cast<unsigned long>(circuit_size),
|
||||
jsonBuffer, static_cast<unsigned long>(json_size),
|
||||
wtnsBuffer, &wtnsSize,
|
||||
errorMsg, static_cast<unsigned long>(error_msg_max_size));
|
||||
|
||||
// Set the result and release the resources
|
||||
env->SetLongArrayRegion(wtns_size, 0, 1, reinterpret_cast<jlong *>(&wtnsSize));
|
||||
|
||||
env->ReleaseByteArrayElements(circuit_buffer,
|
||||
reinterpret_cast<jbyte *>(const_cast<char *>(circuitBuffer)), 0);
|
||||
env->ReleaseByteArrayElements(json_buffer,
|
||||
reinterpret_cast<jbyte *>(const_cast<char *>(jsonBuffer)), 0);
|
||||
env->ReleaseByteArrayElements(wtns_buffer, reinterpret_cast<jbyte *>(wtnsBuffer), 0);
|
||||
env->ReleaseByteArrayElements(error_msg, reinterpret_cast<jbyte *>(errorMsg), 0);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_proofofpassport_prover_ZKPTools_witnesscalc_1disclose(JNIEnv *env, jobject thiz,
|
||||
jbyteArray circuit_buffer,
|
||||
jlong circuit_size, jbyteArray json_buffer,
|
||||
jlong json_size, jbyteArray wtns_buffer,
|
||||
jlongArray wtns_size, jbyteArray error_msg,
|
||||
jlong error_msg_max_size) {
|
||||
const char *circuitBuffer = reinterpret_cast<const char *>(env->GetByteArrayElements(
|
||||
circuit_buffer, nullptr));
|
||||
const char *jsonBuffer = reinterpret_cast<const char *>(env->GetByteArrayElements(json_buffer,
|
||||
nullptr));
|
||||
char *wtnsBuffer = reinterpret_cast<char *>(env->GetByteArrayElements(wtns_buffer, nullptr));
|
||||
char *errorMsg = reinterpret_cast<char *>(env->GetByteArrayElements(error_msg, nullptr));
|
||||
|
||||
unsigned long wtnsSize = env->GetLongArrayElements(wtns_size, nullptr)[0];
|
||||
|
||||
|
||||
int result = witnesscalc_disclose(
|
||||
circuitBuffer, static_cast<unsigned long>(circuit_size),
|
||||
jsonBuffer, static_cast<unsigned long>(json_size),
|
||||
wtnsBuffer, &wtnsSize,
|
||||
errorMsg, static_cast<unsigned long>(error_msg_max_size));
|
||||
|
||||
// Set the result and release the resources
|
||||
env->SetLongArrayRegion(wtns_size, 0, 1, reinterpret_cast<jlong *>(&wtnsSize));
|
||||
|
||||
env->ReleaseByteArrayElements(circuit_buffer,
|
||||
reinterpret_cast<jbyte *>(const_cast<char *>(circuitBuffer)), 0);
|
||||
env->ReleaseByteArrayElements(json_buffer,
|
||||
reinterpret_cast<jbyte *>(const_cast<char *>(jsonBuffer)), 0);
|
||||
env->ReleaseByteArrayElements(wtns_buffer, reinterpret_cast<jbyte *>(wtnsBuffer), 0);
|
||||
env->ReleaseByteArrayElements(error_msg, reinterpret_cast<jbyte *>(errorMsg), 0);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT jint JNICALL Java_com_proofofpassport_prover_ZKPTools_groth16_1prover_1zkey_1file(
|
||||
JNIEnv *env, jobject obj,
|
||||
jstring zkeyPath,
|
||||
jbyteArray wtnsBuffer, jlong wtnsSize,
|
||||
jbyteArray proofBuffer, jlongArray proofSize,
|
||||
jbyteArray publicBuffer, jlongArray publicSize,
|
||||
jbyteArray errorMsg, jlong errorMsgMaxSize
|
||||
) {
|
||||
// Convert jbyteArray to native types
|
||||
const char *nativeZkeyPath = env->GetStringUTFChars(zkeyPath, nullptr);
|
||||
|
||||
void *nativeWtnsBuffer = env->GetByteArrayElements(wtnsBuffer, nullptr);
|
||||
|
||||
char *nativeProofBuffer = (char *) env->GetByteArrayElements(proofBuffer, nullptr);
|
||||
char *nativePublicBuffer = (char *) env->GetByteArrayElements(publicBuffer, nullptr);
|
||||
char *nativeErrorMsg = (char *) env->GetByteArrayElements(errorMsg, nullptr);
|
||||
|
||||
jlong *nativeProofSizeArr = env->GetLongArrayElements(proofSize, 0);
|
||||
jlong *nativePublicSizeArr = env->GetLongArrayElements(publicSize, 0);
|
||||
|
||||
unsigned long nativeProofSize = nativeProofSizeArr[0];
|
||||
unsigned long nativePublicSize = nativePublicSizeArr[0];
|
||||
|
||||
// Call the groth16_prover function`
|
||||
int status_code = groth16_prover_zkey_file(
|
||||
nativeZkeyPath,
|
||||
nativeWtnsBuffer, wtnsSize,
|
||||
nativeProofBuffer, &nativeProofSize,
|
||||
nativePublicBuffer, &nativePublicSize,
|
||||
nativeErrorMsg, errorMsgMaxSize
|
||||
);
|
||||
|
||||
// Convert the results back to JNI types
|
||||
nativeProofSizeArr[0] = nativeProofSize;
|
||||
nativePublicSizeArr[0] = nativePublicSize;
|
||||
|
||||
env->SetLongArrayRegion(proofSize, 0, 1, (jlong *) nativeProofSizeArr);
|
||||
env->SetLongArrayRegion(publicSize, 0, 1, (jlong *) nativePublicSizeArr);
|
||||
|
||||
// Release the native buffers
|
||||
env->ReleaseByteArrayElements(wtnsBuffer, (jbyte *) nativeWtnsBuffer, 0);
|
||||
env->ReleaseByteArrayElements(proofBuffer, (jbyte *) nativeProofBuffer, 0);
|
||||
env->ReleaseByteArrayElements(publicBuffer, (jbyte *) nativePublicBuffer, 0);
|
||||
env->ReleaseByteArrayElements(errorMsg, (jbyte *) nativeErrorMsg, 0);
|
||||
|
||||
env->ReleaseLongArrayElements(proofSize, (jlong *) nativeProofSizeArr, 0);
|
||||
env->ReleaseLongArrayElements(publicSize, (jlong *) nativePublicSizeArr, 0);
|
||||
|
||||
return status_code;
|
||||
}
|
||||
@@ -8,11 +8,11 @@ import com.facebook.react.ReactPackage;
|
||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
|
||||
import com.facebook.react.defaults.DefaultReactNativeHost;
|
||||
import com.facebook.soloader.SoLoader;
|
||||
import com.proofofpassport.CameraActivityPackage; // import new package for mrz reading
|
||||
import com.proofofpassport.CameraActivityPackage;
|
||||
import io.tradle.nfc.RNPassportReaderPackage;
|
||||
import java.util.List;
|
||||
import com.proofofpassport.prover.ProverPackage;
|
||||
|
||||
import com.rnfs.RNFSPackage;
|
||||
|
||||
public class MainApplication extends Application implements ReactApplication {
|
||||
|
||||
|
||||
@@ -6,81 +6,47 @@ import com.facebook.react.bridge.ReactMethod
|
||||
import com.facebook.react.bridge.Promise
|
||||
|
||||
import android.util.Log
|
||||
import android.content.Context
|
||||
import java.io.ByteArrayOutputStream
|
||||
import com.facebook.react.bridge.ReadableMap
|
||||
import uniffi.mopro.GenerateProofResult
|
||||
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.GsonBuilder
|
||||
|
||||
import com.proofofpassport.R
|
||||
|
||||
class ProverModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
|
||||
private val TAG = "ProverModule"
|
||||
lateinit var res: GenerateProofResult
|
||||
|
||||
|
||||
override fun getName(): String {
|
||||
return "Prover"
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
fun runInitAction(promise: Promise) {
|
||||
// Launch a coroutine in the IO dispatcher for background tasks
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
try {
|
||||
val startTime = System.currentTimeMillis()
|
||||
uniffi.mopro.initializeMopro()
|
||||
val endTime = System.currentTimeMillis()
|
||||
val initTime = "init time: " + (endTime - startTime).toString() + " ms"
|
||||
|
||||
// Since the promise needs to be resolved in the main thread
|
||||
withContext(Dispatchers.Main) {
|
||||
promise.resolve(initTime)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
withContext(Dispatchers.Main) {
|
||||
promise.reject(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// @ReactMethod
|
||||
// fun downloadFile(url: String, fileName: String, promise: Promise) {
|
||||
// val client = OkHttpClient()
|
||||
// val request = Request.Builder().url(url).build()
|
||||
|
||||
// try {
|
||||
// client.newCall(request).execute().use { response ->
|
||||
// if (!response.isSuccessful) throw IOException("Failed to download file: $response")
|
||||
|
||||
// // Use the app's internal files directory
|
||||
// val fileOutputStream = reactContext.openFileOutput(fileName, Context.MODE_PRIVATE)
|
||||
|
||||
// val inputStream = response.body?.byteStream()
|
||||
// inputStream.use { input ->
|
||||
// fileOutputStream.use { output ->
|
||||
// input?.copyTo(output)
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Resolve the promise with the file path
|
||||
// val file = File(reactContext.filesDir, fileName)
|
||||
// promise.resolve(file.absolutePath)
|
||||
// }
|
||||
// } catch (e: Exception) {
|
||||
// // Reject the promise if an exception occurs
|
||||
// promise.reject(e)
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@ReactMethod
|
||||
// fun runProveAction(inputs: ReadableMap, zkeypath: String, promise: Promise) {
|
||||
fun runProveAction(inputs: ReadableMap, promise: Promise) {
|
||||
fun runProveAction(zkey_path: String, witness_calculator: String, dat_file_name: String, inputs: ReadableMap, promise: Promise) {
|
||||
Log.e(TAG, "zkey_path in provePassport kotlin: " + zkey_path)
|
||||
Log.e(TAG, "witness_calculator in provePassport kotlin: " + witness_calculator)
|
||||
Log.e(TAG, "dat_file_name in provePassport kotlin: " + dat_file_name)
|
||||
Log.e(TAG, "inputs in provePassport kotlin: " + inputs.toString())
|
||||
|
||||
// working example
|
||||
val formattedInputs = mutableMapOf<String, Any?>()
|
||||
|
||||
val iterator = inputs.keySetIterator()
|
||||
while (iterator.hasNextKey()) {
|
||||
val key = iterator.nextKey()
|
||||
val array = inputs.getArray(key)?.toArrayList()?.map { it.toString() }
|
||||
formattedInputs[key] = if (array?.size == 1) array.firstOrNull() else array
|
||||
}
|
||||
|
||||
val gson = GsonBuilder().setPrettyPrinting().create()
|
||||
Log.e(TAG, gson.toJson(formattedInputs))
|
||||
|
||||
// (used to be) working example
|
||||
// val inputs = mutableMapOf<String, List<String>>(
|
||||
// "mrz" to listOf("97","91","95","31","88","80","60","70","82","65","84","65","86","69","82","78","73","69","82","60","60","70","76","79","82","69","78","84","60","72","85","71","85","69","83","60","74","69","65","78","60","60","60","60","60","60","60","60","60","49","57","72","65","51","52","56","50","56","52","70","82","65","48","48","48","55","49","57","49","77","50","57","49","50","48","57","53","60","60","60","60","60","60","60","60","60","60","60","60","60","60","48","50"),
|
||||
// "reveal_bitmap" to listOf("0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"),
|
||||
@@ -96,35 +62,247 @@ class ProverModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
||||
// "address" to listOf("642829559307850963015472508762062935916233390536")
|
||||
// )
|
||||
|
||||
val convertedInputs = mutableMapOf<String, List<String>>()
|
||||
|
||||
for ((key, value) in inputs.toHashMap()) {
|
||||
val parsedArray = inputs.getArray(key)?.toArrayList()?.map { item ->
|
||||
item.toString()
|
||||
} ?: emptyList()
|
||||
convertedInputs[key] = parsedArray
|
||||
val jsonInputs = gson.toJson(formattedInputs).toByteArray()
|
||||
val zkpTools = ZKPTools(reactApplicationContext)
|
||||
|
||||
val witnessCalcFunction = when (witness_calculator) {
|
||||
"register_sha256WithRSAEncryption_65537" -> zkpTools::witnesscalc_register_sha256WithRSAEncryption_65537
|
||||
"disclose" -> zkpTools::witnesscalc_disclose
|
||||
else -> throw IllegalArgumentException("Invalid witness calculator name")
|
||||
}
|
||||
|
||||
// Get the resource ID dynamically
|
||||
val resId = reactApplicationContext.resources.getIdentifier(dat_file_name, "raw", reactApplicationContext.packageName)
|
||||
if (resId == 0) {
|
||||
throw IllegalArgumentException("Invalid dat file name")
|
||||
}
|
||||
|
||||
Log.e(TAG, "convertedInputs: $convertedInputs")
|
||||
val zkp: ZkProof = ZKPUseCase(reactApplicationContext).generateZKP(
|
||||
zkey_path,
|
||||
resId,
|
||||
jsonInputs,
|
||||
witnessCalcFunction
|
||||
)
|
||||
|
||||
val startTime = System.currentTimeMillis()
|
||||
res = uniffi.mopro.generateProof2(convertedInputs)
|
||||
val endTime = System.currentTimeMillis()
|
||||
val provingTime = "proving time: " + (endTime - startTime).toString() + " ms"
|
||||
Log.e(TAG, provingTime)
|
||||
|
||||
Log.e(TAG, "res: " + res.toString())
|
||||
Log.e("ZKP", gson.toJson(zkp))
|
||||
|
||||
promise.resolve(res.toString())
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
fun runVerifyAction(promise: Promise) {
|
||||
val startTime = System.currentTimeMillis()
|
||||
val valid = "valid: " + uniffi.mopro.verifyProof2(res.proof, res.inputs).toString()
|
||||
val endTime = System.currentTimeMillis()
|
||||
val verifyingTime = "verifying time: " + (endTime - startTime).toString() + " ms"
|
||||
Log.e(TAG, verifyingTime)
|
||||
promise.resolve(valid)
|
||||
promise.resolve(zkp.toString())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
data class Proof(
|
||||
val pi_a: List<String>,
|
||||
val pi_b: List<List<String>>,
|
||||
val pi_c: List<String>,
|
||||
val protocol: String,
|
||||
var curve: String = "bn128"
|
||||
) {
|
||||
companion object {
|
||||
fun fromJson(jsonString: String): Proof {
|
||||
Log.d("Proof", jsonString)
|
||||
val json = Gson().fromJson(jsonString, Proof::class.java)
|
||||
json.curve = getDefaultCurve()
|
||||
return json
|
||||
}
|
||||
|
||||
private fun getDefaultCurve(): String {
|
||||
return "bn128"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data class ZkProof(
|
||||
val proof: Proof,
|
||||
val pub_signals: List<String>
|
||||
)
|
||||
|
||||
class ZKPTools(val context: Context) {
|
||||
external fun witnesscalc_register_sha256WithRSAEncryption_65537(circuitBuffer: ByteArray,
|
||||
circuitSize: Long,
|
||||
jsonBuffer: ByteArray,
|
||||
jsonSize: Long,
|
||||
wtnsBuffer: ByteArray,
|
||||
wtnsSize: LongArray,
|
||||
errorMsg: ByteArray,
|
||||
errorMsgMaxSize: Long): Int
|
||||
external fun witnesscalc_disclose(circuitBuffer: ByteArray,
|
||||
circuitSize: Long,
|
||||
jsonBuffer: ByteArray,
|
||||
jsonSize: Long,
|
||||
wtnsBuffer: ByteArray,
|
||||
wtnsSize: LongArray,
|
||||
errorMsg: ByteArray,
|
||||
errorMsgMaxSize: Long): Int
|
||||
external fun groth16_prover(
|
||||
zkeyBuffer: ByteArray, zkeySize: Long,
|
||||
wtnsBuffer: ByteArray, wtnsSize: Long,
|
||||
proofBuffer: ByteArray, proofSize: LongArray,
|
||||
publicBuffer: ByteArray, publicSize: LongArray,
|
||||
errorMsg: ByteArray, errorMsgMaxSize: Long
|
||||
): Int
|
||||
external fun groth16_prover_zkey_file(
|
||||
zkeyPath: String,
|
||||
wtnsBuffer: ByteArray, wtnsSize: Long,
|
||||
proofBuffer: ByteArray, proofSize: LongArray,
|
||||
publicBuffer: ByteArray, publicSize: LongArray,
|
||||
errorMsg: ByteArray, errorMsgMaxSize: Long
|
||||
): Int
|
||||
|
||||
init {
|
||||
System.loadLibrary("rapidsnark");
|
||||
System.loadLibrary("proofofpassport")
|
||||
}
|
||||
|
||||
fun openRawResourceAsByteArray(resourceName: Int): ByteArray {
|
||||
val inputStream = context.resources.openRawResource(resourceName)
|
||||
val byteArrayOutputStream = ByteArrayOutputStream()
|
||||
|
||||
try {
|
||||
val buffer = ByteArray(1024)
|
||||
var length: Int
|
||||
|
||||
while (inputStream.read(buffer).also { length = it } != -1) {
|
||||
byteArrayOutputStream.write(buffer, 0, length)
|
||||
}
|
||||
|
||||
return byteArrayOutputStream.toByteArray()
|
||||
} finally {
|
||||
byteArrayOutputStream.close()
|
||||
inputStream.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ZKPUseCase(val context: Context) {
|
||||
|
||||
fun generateZKP(
|
||||
zkey_path: String,
|
||||
datId: Int,
|
||||
inputs: ByteArray,
|
||||
proofFunction: (
|
||||
circuitBuffer: ByteArray,
|
||||
circuitSize: Long,
|
||||
jsonBuffer: ByteArray,
|
||||
jsonSize: Long,
|
||||
wtnsBuffer: ByteArray,
|
||||
wtnsSize: LongArray,
|
||||
errorMsg: ByteArray,
|
||||
errorMsgMaxSize: Long
|
||||
) -> Int
|
||||
): ZkProof {
|
||||
val zkpTool = ZKPTools(context)
|
||||
val datFile = zkpTool.openRawResourceAsByteArray(datId)
|
||||
|
||||
val msg = ByteArray(256)
|
||||
|
||||
val witnessLen = LongArray(1)
|
||||
witnessLen[0] = 100 * 1024 * 1024
|
||||
|
||||
val byteArr = ByteArray(100 * 1024 * 1024)
|
||||
|
||||
val res = proofFunction(
|
||||
datFile,
|
||||
datFile.size.toLong(),
|
||||
inputs,
|
||||
inputs.size.toLong(),
|
||||
byteArr,
|
||||
witnessLen,
|
||||
msg,
|
||||
256
|
||||
)
|
||||
|
||||
Log.e("ZKPUseCase", "Witness gen res: $res")
|
||||
Log.e("ZKPUseCase", "Witness gen return length: ${byteArr.size}")
|
||||
|
||||
if (res == 3) {
|
||||
throw Exception("Error 3")
|
||||
}
|
||||
|
||||
if (res == 2) {
|
||||
throw Exception("Not enough memory for zkp")
|
||||
}
|
||||
|
||||
if (res == 1) {
|
||||
throw Exception("Error during zkp ${msg.decodeToString()}")
|
||||
}
|
||||
|
||||
val pubData = ByteArray(4 *1024 *1024)
|
||||
val pubLen = LongArray(1)
|
||||
pubLen[0] = pubData.size.toLong()
|
||||
|
||||
val proofData = ByteArray(4*1024*1024)
|
||||
val proofLen = LongArray(1)
|
||||
proofLen[0] = proofData.size.toLong()
|
||||
|
||||
val witnessData = byteArr.copyOfRange(0, witnessLen[0].toInt())
|
||||
|
||||
Log.e("ZKPUseCase", "zkey_path: $zkey_path")
|
||||
|
||||
val proofGen = zkpTool.groth16_prover_zkey_file(
|
||||
zkey_path,
|
||||
witnessData,
|
||||
witnessLen[0],
|
||||
proofData,
|
||||
proofLen,
|
||||
pubData,
|
||||
pubLen,
|
||||
msg,
|
||||
256
|
||||
)
|
||||
|
||||
Log.e("ZKPUseCase", "proofGen res: $proofGen")
|
||||
|
||||
if (proofGen == 2) {
|
||||
throw Exception("Not enough memory for proofGen ${msg.decodeToString()}")
|
||||
}
|
||||
|
||||
if (proofGen == 1) {
|
||||
throw Exception("Error during proofGen ${msg.decodeToString()}")
|
||||
}
|
||||
|
||||
val proofDataZip = proofData.copyOfRange(0, proofLen[0].toInt())
|
||||
|
||||
val index = findLastIndexOfSubstring(
|
||||
proofDataZip.toString(Charsets.UTF_8),
|
||||
"\"protocol\":\"groth16\"}"
|
||||
)
|
||||
val indexPubData = findLastIndexOfSubstring(
|
||||
pubData.decodeToString(),
|
||||
"]"
|
||||
)
|
||||
|
||||
val formattedPubData = pubData.decodeToString().slice(0..indexPubData)
|
||||
|
||||
val formattedProof = proofDataZip.toString(Charsets.UTF_8).slice(0..index)
|
||||
|
||||
Log.e("ZKPUseCase", "formattedProof: $formattedProof")
|
||||
|
||||
val proof = Proof.fromJson(formattedProof)
|
||||
|
||||
Log.e("ZKPUseCase", "Proof: $proof")
|
||||
|
||||
return ZkProof(
|
||||
proof = proof,
|
||||
pub_signals = getPubSignals(formattedPubData).toList()
|
||||
)
|
||||
}
|
||||
|
||||
private fun findLastIndexOfSubstring(mainString: String, searchString: String): Int {
|
||||
val index = mainString.lastIndexOf(searchString)
|
||||
|
||||
if (index != -1) {
|
||||
// If substring is found, calculate the last index of the substring
|
||||
return index + searchString.length - 1
|
||||
}
|
||||
|
||||
return -1
|
||||
}
|
||||
|
||||
private fun getPubSignals(jsonString: String): List<String> {
|
||||
val gson = Gson()
|
||||
val stringArray = gson.fromJson(jsonString, Array<String>::class.java)
|
||||
return stringArray.toList()
|
||||
}
|
||||
}
|
||||
|
||||
BIN
app/android/app/src/main/res/raw/disclose.dat
Normal file
@@ -20,7 +20,6 @@ buildscript {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
// classpath("com.android.tools.build:gradle")
|
||||
classpath("com.facebook.react:react-native-gradle-plugin")
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.android.tools.build:gradle:7.4.2'
|
||||
|
||||
@@ -6,3 +6,5 @@ include ':react-native-passport-reader'
|
||||
project(':react-native-passport-reader').projectDir = new File(rootProject.projectDir, './react-native-passport-reader/android')
|
||||
include ':passportreader'
|
||||
project(':passportreader').projectDir = new File(rootProject.projectDir, './android-passport-reader/app')
|
||||
include ':react-native-fs'
|
||||
project(':react-native-fs').projectDir = new File(settingsDir, '../node_modules/react-native-fs/android')
|
||||
14
app/ark-zkey/.gitignore
vendored
@@ -1,14 +0,0 @@
|
||||
# Generated by Cargo
|
||||
# will have compiled files and executables
|
||||
debug/
|
||||
target/
|
||||
|
||||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
||||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
||||
Cargo.lock
|
||||
|
||||
# These are backup files generated by rustfmt
|
||||
**/*.rs.bk
|
||||
|
||||
# MSVC Windows builds of rustc generate these, which store debugging information
|
||||
*.pdb
|
||||
@@ -1,32 +0,0 @@
|
||||
[package]
|
||||
name = "ark-zkey"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[[bin]]
|
||||
name = "arkzkey-util"
|
||||
path = "src/bin/arkzkey_util.rs"
|
||||
|
||||
# XXX: Shouldn't be necessary, but this way we stay consistent with wasmer version and fix
|
||||
# error[E0432]: unresolved import `wasmer` error
|
||||
# (likely due to other packages)
|
||||
[patch.crates-io]
|
||||
# NOTE: Forked wasmer to work around memory limits
|
||||
# See https://github.com/wasmerio/wasmer/commit/09c7070
|
||||
wasmer = { git = "https://github.com/oskarth/wasmer.git", rev = "09c7070" }
|
||||
|
||||
[dependencies]
|
||||
color-eyre = "0.6"
|
||||
memmap2 = "0.9"
|
||||
flame = "0.2"
|
||||
flamer = "0.5"
|
||||
|
||||
ark-serialize = { version = "=0.4.1", features = ["derive"] }
|
||||
ark-bn254 = { version = "=0.4.0" }
|
||||
ark-groth16 = { version = "=0.4.0" }
|
||||
ark-circom = { git = "https://github.com/arkworks-rs/circom-compat.git" }
|
||||
ark-relations = { version = "=0.4.0" }
|
||||
ark-ff = { version = "=0.4.1" }
|
||||
ark-ec = { version = "=0.4.1" }
|
||||
@@ -1,52 +0,0 @@
|
||||
# ark-zkey
|
||||
|
||||
Library to read `zkey` faster by serializing to `arkworks` friendly format.
|
||||
|
||||
See https://github.com/oskarth/mopro/issues/25 for context.
|
||||
|
||||
## How to use
|
||||
|
||||
Run the following to convert a `zkey` to an `arkzkey`. This should be done as a pre-processing step.
|
||||
|
||||
`cargo run --bin arkzkey-util --release -- ../mopro-core/examples/circom/keccak256/target/keccak256_256_test_final.zkey`
|
||||
|
||||
This will generate and place an `arkzkey` file in the same directory as the original zkey.
|
||||
|
||||
You can also install it locally:
|
||||
|
||||
`cargo install --bin arkzkey-util --path . --release`
|
||||
|
||||
## Tests
|
||||
|
||||
```
|
||||
cargo test multiplier2 --release -- --nocapture
|
||||
cargo test keccak256 --release -- --nocapture
|
||||
cargo test rsa --release -- --nocapture
|
||||
```
|
||||
|
||||
## Benchmark (Keccak)
|
||||
|
||||
`cargo test keccak256 --release -- --nocapture`
|
||||
|
||||
```
|
||||
[build] Processing zkey data...
|
||||
test tests::test_keccak256_serialization_deserialization has been running for over 60 seconds
|
||||
[build]Time to process zkey data: 158.753181958s
|
||||
[build] Serializing proving key and constraint matrices
|
||||
[build] Time to serialize proving key and constraint matrices: 42ns
|
||||
[build] Writing arkzkey to: ../mopro-core/examples/circom/keccak256/target/keccak256_256_test_final.arkzkey
|
||||
[build] Time to write arkzkey: 16.204274125s
|
||||
Reading arkzkey from: ../mopro-core/examples/circom/keccak256/target/keccak256_256_test_final.arkzkey
|
||||
Time to open arkzkey file: 51.75µs
|
||||
Time to mmap arkzkey: 17.25µs
|
||||
Time to deserialize proving key: 18.323550083s
|
||||
Time to deserialize matrices: 46.935792ms
|
||||
Time to read arkzkey: 18.3730695s
|
||||
test tests::test_keccak256_serialization_deserialization ... ok
|
||||
```
|
||||
|
||||
Vs naive:
|
||||
|
||||
`[build] Time to process zkey data: 158.753181958s`
|
||||
|
||||
**Result: 18s vs 158s**
|
||||
@@ -1,36 +0,0 @@
|
||||
use std::env;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
extern crate ark_zkey;
|
||||
use ark_zkey::{convert_zkey, read_proving_key_and_matrices_from_zkey};
|
||||
|
||||
fn main() -> color_eyre::eyre::Result<()> {
|
||||
color_eyre::install()?;
|
||||
|
||||
let args: Vec<String> = env::args().collect();
|
||||
if args.len() != 2 {
|
||||
eprintln!("Usage: zkey_to_arkzkey <path_to_zkey_file>");
|
||||
std::process::exit(1);
|
||||
}
|
||||
|
||||
let zkey_path = &args[1];
|
||||
let (proving_key, constraint_matrices) = read_proving_key_and_matrices_from_zkey(zkey_path)?;
|
||||
|
||||
let arkzkey_path = get_arkzkey_path(zkey_path);
|
||||
let arkzkey_path_str = arkzkey_path
|
||||
.to_str()
|
||||
.ok_or_else(|| color_eyre::eyre::eyre!("Failed to convert arkzkey path to string"))?;
|
||||
|
||||
convert_zkey(proving_key, constraint_matrices, &arkzkey_path_str)?;
|
||||
|
||||
println!("Converted zkey file saved to: {}", arkzkey_path.display());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn get_arkzkey_path(zkey_path: &str) -> PathBuf {
|
||||
let path = Path::new(zkey_path);
|
||||
let mut arkzkey_path = path.to_path_buf();
|
||||
arkzkey_path.set_extension("arkzkey");
|
||||
arkzkey_path
|
||||
}
|
||||
@@ -1,247 +0,0 @@
|
||||
use ark_bn254::{Bn254, Fr};
|
||||
use ark_circom::read_zkey;
|
||||
//use ark_ec::pairing::Pairing;
|
||||
use ark_ff::Field;
|
||||
use ark_groth16::ProvingKey;
|
||||
//use ark_groth16::VerifyingKey;
|
||||
use ark_relations::r1cs::ConstraintMatrices;
|
||||
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
|
||||
use color_eyre::eyre::{Result, WrapErr};
|
||||
use memmap2::Mmap;
|
||||
use std::fs::File;
|
||||
//use std::io::Cursor;
|
||||
//use std::io::{Read,self};
|
||||
use std::io::BufReader;
|
||||
use std::path::PathBuf;
|
||||
use std::time::Instant;
|
||||
|
||||
#[derive(CanonicalSerialize, CanonicalDeserialize, Clone, Debug, PartialEq)]
|
||||
pub struct SerializableProvingKey(pub ProvingKey<Bn254>);
|
||||
|
||||
#[derive(CanonicalSerialize, CanonicalDeserialize, Clone, Debug, PartialEq)]
|
||||
pub struct SerializableMatrix<F: Field> {
|
||||
pub data: Vec<Vec<(F, usize)>>,
|
||||
}
|
||||
|
||||
#[derive(CanonicalSerialize, CanonicalDeserialize, Clone, Debug, PartialEq)]
|
||||
pub struct SerializableConstraintMatrices<F: Field> {
|
||||
pub num_instance_variables: usize,
|
||||
pub num_witness_variables: usize,
|
||||
pub num_constraints: usize,
|
||||
pub a_num_non_zero: usize,
|
||||
pub b_num_non_zero: usize,
|
||||
pub c_num_non_zero: usize,
|
||||
pub a: SerializableMatrix<F>,
|
||||
pub b: SerializableMatrix<F>,
|
||||
pub c: SerializableMatrix<F>,
|
||||
}
|
||||
|
||||
impl<F: Field> From<Vec<Vec<(F, usize)>>> for SerializableMatrix<F> {
|
||||
fn from(matrix: Vec<Vec<(F, usize)>>) -> Self {
|
||||
SerializableMatrix { data: matrix }
|
||||
}
|
||||
}
|
||||
|
||||
impl<F: Field> From<SerializableMatrix<F>> for Vec<Vec<(F, usize)>> {
|
||||
fn from(serializable_matrix: SerializableMatrix<F>) -> Self {
|
||||
serializable_matrix.data
|
||||
}
|
||||
}
|
||||
|
||||
pub fn serialize_proving_key(pk: &SerializableProvingKey) -> Vec<u8> {
|
||||
let mut serialized_data = Vec::new();
|
||||
pk.serialize_compressed(&mut serialized_data)
|
||||
.expect("Serialization failed");
|
||||
serialized_data
|
||||
}
|
||||
|
||||
pub fn deserialize_proving_key(data: Vec<u8>) -> SerializableProvingKey {
|
||||
SerializableProvingKey::deserialize_compressed_unchecked(&mut &data[..])
|
||||
.expect("Deserialization failed")
|
||||
}
|
||||
|
||||
pub fn read_arkzkey(
|
||||
arkzkey_path: &str,
|
||||
) -> Result<(SerializableProvingKey, SerializableConstraintMatrices<Fr>)> {
|
||||
let now = std::time::Instant::now();
|
||||
let arkzkey_file_path = PathBuf::from(arkzkey_path);
|
||||
let arkzkey_file = File::open(arkzkey_file_path).wrap_err("Failed to open arkzkey file")?;
|
||||
println!("Time to open arkzkey file: {:?}", now.elapsed());
|
||||
|
||||
//let mut buf_reader = BufReader::new(arkzkey_file);
|
||||
|
||||
// Using mmap
|
||||
let now = std::time::Instant::now();
|
||||
let mmap = unsafe { Mmap::map(&arkzkey_file)? };
|
||||
let mut cursor = std::io::Cursor::new(mmap);
|
||||
println!("Time to mmap arkzkey: {:?}", now.elapsed());
|
||||
|
||||
// Was &mut buf_reader
|
||||
let now = std::time::Instant::now();
|
||||
let proving_key = SerializableProvingKey::deserialize_compressed_unchecked(&mut cursor)
|
||||
.wrap_err("Failed to deserialize proving key")?;
|
||||
println!("Time to deserialize proving key: {:?}", now.elapsed());
|
||||
|
||||
let now = std::time::Instant::now();
|
||||
let constraint_matrices =
|
||||
SerializableConstraintMatrices::deserialize_compressed_unchecked(&mut cursor)
|
||||
.wrap_err("Failed to deserialize constraint matrices")?;
|
||||
println!("Time to deserialize matrices: {:?}", now.elapsed());
|
||||
|
||||
Ok((proving_key, constraint_matrices))
|
||||
}
|
||||
|
||||
// TODO: Return ProvingKey<Bn254>, ConstraintMatrices<Fr>?
|
||||
pub fn read_arkzkey_from_bytes(
|
||||
arkzkey_bytes: &[u8],
|
||||
) -> Result<(ProvingKey<Bn254>, ConstraintMatrices<Fr>)> {
|
||||
let mut cursor = std::io::Cursor::new(arkzkey_bytes);
|
||||
|
||||
let now = std::time::Instant::now();
|
||||
let serialized_proving_key =
|
||||
SerializableProvingKey::deserialize_compressed_unchecked(&mut cursor)
|
||||
.wrap_err("Failed to deserialize proving key")?;
|
||||
println!("Time to deserialize proving key: {:?}", now.elapsed());
|
||||
|
||||
let now = std::time::Instant::now();
|
||||
let serialized_constraint_matrices =
|
||||
SerializableConstraintMatrices::deserialize_compressed_unchecked(&mut cursor)
|
||||
.wrap_err("Failed to deserialize constraint matrices")?;
|
||||
println!("Time to deserialize matrices: {:?}", now.elapsed());
|
||||
|
||||
// Get on right form for API
|
||||
let proving_key: ProvingKey<Bn254> = serialized_proving_key.0;
|
||||
let constraint_matrices: ConstraintMatrices<Fr> = ConstraintMatrices {
|
||||
num_instance_variables: serialized_constraint_matrices.num_instance_variables,
|
||||
num_witness_variables: serialized_constraint_matrices.num_witness_variables,
|
||||
num_constraints: serialized_constraint_matrices.num_constraints,
|
||||
a_num_non_zero: serialized_constraint_matrices.a_num_non_zero,
|
||||
b_num_non_zero: serialized_constraint_matrices.b_num_non_zero,
|
||||
c_num_non_zero: serialized_constraint_matrices.c_num_non_zero,
|
||||
a: serialized_constraint_matrices.a.data,
|
||||
b: serialized_constraint_matrices.b.data,
|
||||
c: serialized_constraint_matrices.c.data,
|
||||
};
|
||||
|
||||
Ok((proving_key, constraint_matrices))
|
||||
}
|
||||
|
||||
pub fn read_proving_key_and_matrices_from_zkey(
|
||||
zkey_path: &str,
|
||||
) -> Result<(SerializableProvingKey, SerializableConstraintMatrices<Fr>)> {
|
||||
println!("Reading zkey from: {}", zkey_path);
|
||||
let now = Instant::now();
|
||||
let zkey_file_path = PathBuf::from(zkey_path);
|
||||
let zkey_file = File::open(zkey_file_path).wrap_err("Failed to open zkey file")?;
|
||||
|
||||
let mut buf_reader = BufReader::new(zkey_file);
|
||||
|
||||
let (proving_key, matrices) =
|
||||
read_zkey(&mut buf_reader).wrap_err("Failed to read zkey file")?;
|
||||
println!("Time to read zkey: {:?}", now.elapsed());
|
||||
|
||||
println!("Serializing proving key and constraint matrices");
|
||||
let now = Instant::now();
|
||||
let serializable_proving_key = SerializableProvingKey(proving_key);
|
||||
let serializable_constrain_matrices = SerializableConstraintMatrices {
|
||||
num_instance_variables: matrices.num_instance_variables,
|
||||
num_witness_variables: matrices.num_witness_variables,
|
||||
num_constraints: matrices.num_constraints,
|
||||
a_num_non_zero: matrices.a_num_non_zero,
|
||||
b_num_non_zero: matrices.b_num_non_zero,
|
||||
c_num_non_zero: matrices.c_num_non_zero,
|
||||
a: SerializableMatrix { data: matrices.a },
|
||||
b: SerializableMatrix { data: matrices.b },
|
||||
c: SerializableMatrix { data: matrices.c },
|
||||
};
|
||||
println!(
|
||||
"Time to serialize proving key and constraint matrices: {:?}",
|
||||
now.elapsed()
|
||||
);
|
||||
|
||||
Ok((serializable_proving_key, serializable_constrain_matrices))
|
||||
}
|
||||
|
||||
pub fn convert_zkey(
|
||||
proving_key: SerializableProvingKey,
|
||||
constraint_matrices: SerializableConstraintMatrices<Fr>,
|
||||
arkzkey_path: &str,
|
||||
) -> Result<()> {
|
||||
let arkzkey_file_path = PathBuf::from(arkzkey_path);
|
||||
|
||||
let serialized_path = PathBuf::from(arkzkey_file_path);
|
||||
|
||||
let mut file =
|
||||
File::create(&serialized_path).wrap_err("Failed to create serialized proving key file")?;
|
||||
|
||||
proving_key
|
||||
.serialize_compressed(&mut file)
|
||||
.wrap_err("Failed to serialize proving key")?;
|
||||
|
||||
constraint_matrices
|
||||
.serialize_compressed(&mut file)
|
||||
.wrap_err("Failed to serialize constraint matrices")?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use std::time::Instant;
|
||||
|
||||
fn test_circuit_serialization_deserialization(zkey_path: &str) -> Result<()> {
|
||||
let arkzkey_path = zkey_path.replace(".zkey", ".arkzkey");
|
||||
|
||||
let (original_proving_key, original_constraint_matrices) =
|
||||
read_proving_key_and_matrices_from_zkey(zkey_path)?;
|
||||
|
||||
println!("[build] Writing arkzkey to: {}", arkzkey_path);
|
||||
let now = Instant::now();
|
||||
convert_zkey(
|
||||
original_proving_key.clone(),
|
||||
original_constraint_matrices.clone(),
|
||||
&arkzkey_path,
|
||||
)?;
|
||||
println!("[build] Time to write arkzkey: {:?}", now.elapsed());
|
||||
|
||||
println!("Reading arkzkey from: {}", arkzkey_path);
|
||||
let now = Instant::now();
|
||||
let (deserialized_proving_key, deserialized_constraint_matrices) =
|
||||
read_arkzkey(&arkzkey_path)?;
|
||||
println!("Time to read arkzkey: {:?}", now.elapsed());
|
||||
|
||||
assert_eq!(
|
||||
original_proving_key, deserialized_proving_key,
|
||||
"Original and deserialized proving keys do not match"
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
original_constraint_matrices, deserialized_constraint_matrices,
|
||||
"Original and deserialized constraint matrices do not match"
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_multiplier2_serialization_deserialization() -> Result<()> {
|
||||
test_circuit_serialization_deserialization(
|
||||
"../mopro-core/examples/circom/multiplier2/target/multiplier2_final.zkey",
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_keccak256_serialization_deserialization() -> Result<()> {
|
||||
test_circuit_serialization_deserialization(
|
||||
"../mopro-core/examples/circom/keccak256/target/keccak256_256_test_final.zkey",
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_rsa_serialization_deserialization() -> Result<()> {
|
||||
test_circuit_serialization_deserialization(
|
||||
"../mopro-core/examples/circom/rsa/target/main_final.zkey",
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{"ProofOfPassport":"0xF3F619aB057E3978204Be68549f9D4a503EAa535","Groth16Verifier":"0x2dbaF682BEdC0159C2E04663dF83C803FEC95D82"}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../build-info/d8fbe1f09e244f2ed82c9ecd6cc17dfb.json"
|
||||
}
|
||||
205
app/deployments/artifacts/Deploy_Registry#Formatter.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../build-info/d8fbe1f09e244f2ed82c9ecd6cc17dfb.json"
|
||||
}
|
||||
30
app/deployments/artifacts/Deploy_Registry#PoseidonT3.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../build-info/e55161abe8684cf1313e65dad587479f.json"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../build-info/d8fbe1f09e244f2ed82c9ecd6cc17dfb.json"
|
||||
}
|
||||
119
app/deployments/artifacts/Deploy_Registry#Registry.json
Normal file
@@ -0,0 +1,119 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "Registry",
|
||||
"sourceName": "contracts/Registry.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "_merkleRoot",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "constructor"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "previousOwner",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "OwnershipTransferred",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "_merkleRoot",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"name": "checkRoot",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "merkleRoot",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "owner",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "renounceOwnership",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "transferOwnership",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "_merkleRoot",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"name": "update",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x608060405234801561001057600080fd5b5060405161043038038061043083398101604081905261002f91610176565b6100383361004c565b60018190556100463361009c565b5061018f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100a461011a565b6001600160a01b03811661010e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6101178161004c565b50565b6000546001600160a01b031633146101745760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610105565b565b60006020828403121561018857600080fd5b5051919050565b6102928061019e6000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806306c8442b146100675780632eb4a7ab14610091578063715018a6146100a85780638b147245146100b25780638da5cb5b146100c5578063f2fde38b146100e0575b600080fd5b61007c61007536600461023c565b6001541490565b60405190151581526020015b60405180910390f35b61009a60015481565b604051908152602001610088565b6100b06100f3565b005b6100b06100c036600461023c565b610107565b6000546040516001600160a01b039091168152602001610088565b6100b06100ee366004610255565b610114565b6100fb610192565b61010560006101ec565b565b61010f610192565b600155565b61011c610192565b6001600160a01b0381166101865760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61018f816101ec565b50565b6000546001600160a01b031633146101055760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161017d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561024e57600080fd5b5035919050565b60006020828403121561026757600080fd5b81356001600160a01b038116811461027e57600080fd5b939250505056fea164736f6c6343000812000a",
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c806306c8442b146100675780632eb4a7ab14610091578063715018a6146100a85780638b147245146100b25780638da5cb5b146100c5578063f2fde38b146100e0575b600080fd5b61007c61007536600461023c565b6001541490565b60405190151581526020015b60405180910390f35b61009a60015481565b604051908152602001610088565b6100b06100f3565b005b6100b06100c036600461023c565b610107565b6000546040516001600160a01b039091168152602001610088565b6100b06100ee366004610255565b610114565b6100fb610192565b61010560006101ec565b565b61010f610192565b600155565b61011c610192565b6001600160a01b0381166101865760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61018f816101ec565b50565b6000546001600160a01b031633146101055760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161017d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561024e57600080fd5b5035919050565b60006020828403121561026757600080fd5b81356001600160a01b038116811461027e57600080fd5b939250505056fea164736f6c6343000812000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
4
app/deployments/artifacts/Deploy_Registry#SBT.dbg.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../build-info/1601dff1f349363c0426f6e38acaea94.json"
|
||||
}
|
||||
908
app/deployments/artifacts/Deploy_Registry#SBT.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../build-info/d8fbe1f09e244f2ed82c9ecd6cc17dfb.json"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../build-info/e930a132cd15a40163915f8e7206c704.json"
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "Verifier_register_sha256WithRSAEncryption_65537",
|
||||
"sourceName": "contracts/Verifier_register.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256[2]",
|
||||
"name": "_pA",
|
||||
"type": "uint256[2]"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256[2][2]",
|
||||
"name": "_pB",
|
||||
"type": "uint256[2][2]"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256[2]",
|
||||
"name": "_pC",
|
||||
"type": "uint256[2]"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256[4]",
|
||||
"name": "_pubSignals",
|
||||
"type": "uint256[4]"
|
||||
}
|
||||
],
|
||||
"name": "verifyProof",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x608060405234801561001057600080fd5b5061065e806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80635fe8c13b14610030575b600080fd5b61004361003e3660046105f7565b610057565b604051901515815260200160405180910390f35b600061056a565b7f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f0741c4a6333181bd706a8a033d5a85404e25496f1ac7de88d72485d183f254ab85527f28f0bd0e3df4a61721906ddcf3fab2bfec2653aa4b9445c0ce03469a3602e46860208601526000608086018661019a87357f180596a0a0ff036523011190f8339463af20c8e05ed417311f714951543d54857f0bb02eb704601e28b76faac986aee01262de5bff9aa2aedca60d955e0f20b6a284610092565b6101ea60208801357f0861c242170001b2853807f7704612fc50f6f11127d5475adea1ea077c65d6ef7f26669ae9d2d8ce61a428147ad8f4aa5ff7dfaaa572a6ad0d48c64c48e3851b0584610092565b61023a60408801357f0eba24afeb50182fce361a4c3fbaa0b2bad603408bab52789506653a06ce5a1d7f23b1f8ab87589d236f87b409171b9ed7f73352a2932570924960b2803521a6ca84610092565b61028a60608801357f2ff616ded463054c291848ced17ac3673aec5ebf4ec9fbc312eefb388440affe7f1b53979275b5f9012990d64397d1062d3efc33aec76fcc3f9aeeadfa603e63d984610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f2d4d9aa7e302d9df41749d5507949d05dbea33fbb16c643b22f599a2be6df2e260c08201527f14bedd503c37ceb061d8ec60209fe345ce89830a19230301f076caff004d192660e08201527f0967032fcbf776d1afc985f88877f182d38480a653f2decaa9794cbc3bf3060c6101008201527f0e187847ad4c798374d0d6732bf501847dd68bc0e071241e0213bc7fc13db7ab6101208201527f304cfbd1e08a704a99f5e847d93f8c3caafddec46b7a0d379da69a4d112346a76101408201527f1739c1b1a457a8c7313123d24d2f9192f896b7c63eea05a9d57f06547ad0cec8610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f130f9f7b4fa1c46d75e8ba089a19ff81ab6b793103f4573a95e27adc1c82c19f6102808201527f21640e27d7f4fed1cb30f67042e95e947181fc71298316d68ff78ff3bbf9cb286102a08201527f0eb10762f2b520903bbf4f29df1a67a7a2b277111b2488f682720ca6ca5e948e6102c08201527f17cc34a8b69fc78f2eae10ff468fa92220c9a2f72f20dc5281a8a9ee49e2154d6102e08201526020816103008360086107d05a03fa9051169695505050505050565b6040516103808101604052610582600084013561005e565b61058f602084013561005e565b61059c604084013561005e565b6105a9606084013561005e565b6105b6608084013561005e565b6105c3818486888a6100fd565b90508060005260206000f35b80604081018310156105e057600080fd5b92915050565b80608081018310156105e057600080fd5b600080600080610180858703121561060e57600080fd5b61061886866105cf565b935061062786604087016105e6565b92506106368660c087016105cf565b91506106468661010087016105e6565b90509295919450925056fea164736f6c6343000812000a",
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c80635fe8c13b14610030575b600080fd5b61004361003e3660046105f7565b610057565b604051901515815260200160405180910390f35b600061056a565b7f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47811061008f576000805260206000f35b50565b600060405183815284602082015285604082015260408160608360076107d05a03fa9150816100c5576000805260206000f35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100f6576000805260206000f35b5050505050565b7f0741c4a6333181bd706a8a033d5a85404e25496f1ac7de88d72485d183f254ab85527f28f0bd0e3df4a61721906ddcf3fab2bfec2653aa4b9445c0ce03469a3602e46860208601526000608086018661019a87357f180596a0a0ff036523011190f8339463af20c8e05ed417311f714951543d54857f0bb02eb704601e28b76faac986aee01262de5bff9aa2aedca60d955e0f20b6a284610092565b6101ea60208801357f0861c242170001b2853807f7704612fc50f6f11127d5475adea1ea077c65d6ef7f26669ae9d2d8ce61a428147ad8f4aa5ff7dfaaa572a6ad0d48c64c48e3851b0584610092565b61023a60408801357f0eba24afeb50182fce361a4c3fbaa0b2bad603408bab52789506653a06ce5a1d7f23b1f8ab87589d236f87b409171b9ed7f73352a2932570924960b2803521a6ca84610092565b61028a60608801357f2ff616ded463054c291848ced17ac3673aec5ebf4ec9fbc312eefb388440affe7f1b53979275b5f9012990d64397d1062d3efc33aec76fcc3f9aeeadfa603e63d984610092565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f2d4d9aa7e302d9df41749d5507949d05dbea33fbb16c643b22f599a2be6df2e260c08201527f14bedd503c37ceb061d8ec60209fe345ce89830a19230301f076caff004d192660e08201527f0967032fcbf776d1afc985f88877f182d38480a653f2decaa9794cbc3bf3060c6101008201527f0e187847ad4c798374d0d6732bf501847dd68bc0e071241e0213bc7fc13db7ab6101208201527f304cfbd1e08a704a99f5e847d93f8c3caafddec46b7a0d379da69a4d112346a76101408201527f1739c1b1a457a8c7313123d24d2f9192f896b7c63eea05a9d57f06547ad0cec8610160820152600087015161018082015260206000018701516101a08201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26101c08201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6101e08201527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b6102008201527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa610220820152843561024082015260208501356102608201527f130f9f7b4fa1c46d75e8ba089a19ff81ab6b793103f4573a95e27adc1c82c19f6102808201527f21640e27d7f4fed1cb30f67042e95e947181fc71298316d68ff78ff3bbf9cb286102a08201527f0eb10762f2b520903bbf4f29df1a67a7a2b277111b2488f682720ca6ca5e948e6102c08201527f17cc34a8b69fc78f2eae10ff468fa92220c9a2f72f20dc5281a8a9ee49e2154d6102e08201526020816103008360086107d05a03fa9051169695505050505050565b6040516103808101604052610582600084013561005e565b61058f602084013561005e565b61059c604084013561005e565b6105a9606084013561005e565b6105b6608084013561005e565b6105c3818486888a6100fd565b90508060005260206000f35b80604081018310156105e057600080fd5b92915050565b80608081018310156105e057600080fd5b600080600080610180858703121561060e57600080fd5b61061886866105cf565b935061062786604087016105e6565b92506106368660c087016105cf565b91506106468661010087016105e6565b90509295919450925056fea164736f6c6343000812000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
9
app/deployments/deployed_addresses.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"Deploy_Registry#Formatter": "0x24c919Dc3E5BA89c0898778D71435D566B05B4c5",
|
||||
"Deploy_Registry#PoseidonT3": "0x4572441E3A703f9557E81639282CcbEf88A8a1B1",
|
||||
"Deploy_Registry#Registry": "0x34a57F3421aDe65Ab4c0187BC8E12886Fd70ddCB",
|
||||
"Deploy_Registry#Verifier_disclose": "0x214007909475A4Eed3f0a8C827E86de55EcFc340",
|
||||
"Deploy_Registry#Verifier_register_sha256WithRSAEncryption_65537": "0x3C183200751Aa52958Ae2419D165ADA04Fba5c00",
|
||||
"Deploy_Registry#ProofOfPassportRegister": "0xFd84F23Be557133DCa47Fc9aa22031AcCE557335",
|
||||
"Deploy_Registry#SBT": "0x09082fb07341F4e664af8EBdcf16C95512fe3185"
|
||||
}
|
||||
@@ -7,16 +7,20 @@ import App from './App';
|
||||
import { name as appName } from './app.json';
|
||||
import { TamaguiProvider, createTamagui } from 'tamagui';
|
||||
import { config } from '@tamagui/config/v2-native'
|
||||
|
||||
import { ToastProvider } from '@tamagui/toast';
|
||||
const tamaguiConfig = createTamagui(config)
|
||||
|
||||
LogBox.ignoreLogs([
|
||||
/bad setState/,
|
||||
'Warning, duplicate ID for input',
|
||||
/Warning, duplicate ID for input/
|
||||
])
|
||||
|
||||
const Root = () => (
|
||||
<TamaguiProvider config={tamaguiConfig}>
|
||||
<App />
|
||||
<ToastProvider swipeDirection="up">
|
||||
<App />
|
||||
</ToastProvider>
|
||||
</TamaguiProvider>
|
||||
|
||||
);
|
||||
|
||||
52
app/ios/MoproKit/.gitignore
vendored
@@ -1,52 +0,0 @@
|
||||
# macOS
|
||||
.DS_Store
|
||||
|
||||
# Xcode
|
||||
build/
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
xcuserdata/
|
||||
*.xccheckout
|
||||
*.moved-aside
|
||||
DerivedData
|
||||
*.hmap
|
||||
*.ipa
|
||||
*.xcuserstate
|
||||
|
||||
# Bundler
|
||||
.bundle
|
||||
|
||||
# Add this line if you want to avoid checking in source code from Carthage dependencies.
|
||||
# Carthage/Checkouts
|
||||
|
||||
Carthage/Build
|
||||
|
||||
# We recommend against adding the Pods directory to your .gitignore. However
|
||||
# you should judge for yourself, the pros and cons are mentioned at:
|
||||
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
|
||||
#
|
||||
# Note: if you ignore the Pods directory, make sure to uncomment
|
||||
# `pod install` in .travis.yml
|
||||
#
|
||||
# Pods/
|
||||
|
||||
# Xcode
|
||||
#
|
||||
/.build
|
||||
/Packages
|
||||
/*.xcodeproj
|
||||
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
|
||||
|
||||
# CocoaPods
|
||||
Podfile.lock
|
||||
Pods
|
||||
*.xcworkspace
|
||||
|
||||
# Ignore static libs
|
||||
*.a
|
||||
@@ -1,14 +0,0 @@
|
||||
# references:
|
||||
# * https://www.objc.io/issues/6-build-tools/travis-ci/
|
||||
# * https://github.com/supermarin/xcpretty#usage
|
||||
|
||||
osx_image: xcode7.3
|
||||
language: objective-c
|
||||
# cache: cocoapods
|
||||
# podfile: Example/Podfile
|
||||
# before_install:
|
||||
# - gem install cocoapods # Since Travis is not always on latest version
|
||||
# - pod install --project-directory=Example
|
||||
script:
|
||||
- set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/MoproKit.xcworkspace -scheme MoproKit-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty
|
||||
- pod lib lint
|
||||
@@ -1,805 +0,0 @@
|
||||
// This file was autogenerated by some hot garbage in the `uniffi` crate.
|
||||
// Trust me, you don't want to mess with it!
|
||||
import Foundation
|
||||
|
||||
// Depending on the consumer's build setup, the low-level FFI code
|
||||
// might be in a separate module, or it might be compiled inline into
|
||||
// this module. This is a bit of light hackery to work with both.
|
||||
#if canImport(moproFFI)
|
||||
import moproFFI
|
||||
#endif
|
||||
|
||||
fileprivate extension RustBuffer {
|
||||
// Allocate a new buffer, copying the contents of a `UInt8` array.
|
||||
init(bytes: [UInt8]) {
|
||||
let rbuf = bytes.withUnsafeBufferPointer { ptr in
|
||||
RustBuffer.from(ptr)
|
||||
}
|
||||
self.init(capacity: rbuf.capacity, len: rbuf.len, data: rbuf.data)
|
||||
}
|
||||
|
||||
static func from(_ ptr: UnsafeBufferPointer<UInt8>) -> RustBuffer {
|
||||
try! rustCall { ffi_mopro_ffi_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) }
|
||||
}
|
||||
|
||||
// Frees the buffer in place.
|
||||
// The buffer must not be used after this is called.
|
||||
func deallocate() {
|
||||
try! rustCall { ffi_mopro_ffi_rustbuffer_free(self, $0) }
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate extension ForeignBytes {
|
||||
init(bufferPointer: UnsafeBufferPointer<UInt8>) {
|
||||
self.init(len: Int32(bufferPointer.count), data: bufferPointer.baseAddress)
|
||||
}
|
||||
}
|
||||
|
||||
// For every type used in the interface, we provide helper methods for conveniently
|
||||
// lifting and lowering that type from C-compatible data, and for reading and writing
|
||||
// values of that type in a buffer.
|
||||
|
||||
// Helper classes/extensions that don't change.
|
||||
// Someday, this will be in a library of its own.
|
||||
|
||||
fileprivate extension Data {
|
||||
init(rustBuffer: RustBuffer) {
|
||||
// TODO: This copies the buffer. Can we read directly from a
|
||||
// Rust buffer?
|
||||
self.init(bytes: rustBuffer.data!, count: Int(rustBuffer.len))
|
||||
}
|
||||
}
|
||||
|
||||
// Define reader functionality. Normally this would be defined in a class or
|
||||
// struct, but we use standalone functions instead in order to make external
|
||||
// types work.
|
||||
//
|
||||
// With external types, one swift source file needs to be able to call the read
|
||||
// method on another source file's FfiConverter, but then what visibility
|
||||
// should Reader have?
|
||||
// - If Reader is fileprivate, then this means the read() must also
|
||||
// be fileprivate, which doesn't work with external types.
|
||||
// - If Reader is internal/public, we'll get compile errors since both source
|
||||
// files will try define the same type.
|
||||
//
|
||||
// Instead, the read() method and these helper functions input a tuple of data
|
||||
|
||||
fileprivate func createReader(data: Data) -> (data: Data, offset: Data.Index) {
|
||||
(data: data, offset: 0)
|
||||
}
|
||||
|
||||
// Reads an integer at the current offset, in big-endian order, and advances
|
||||
// the offset on success. Throws if reading the integer would move the
|
||||
// offset past the end of the buffer.
|
||||
fileprivate func readInt<T: FixedWidthInteger>(_ reader: inout (data: Data, offset: Data.Index)) throws -> T {
|
||||
let range = reader.offset..<reader.offset + MemoryLayout<T>.size
|
||||
guard reader.data.count >= range.upperBound else {
|
||||
throw UniffiInternalError.bufferOverflow
|
||||
}
|
||||
if T.self == UInt8.self {
|
||||
let value = reader.data[reader.offset]
|
||||
reader.offset += 1
|
||||
return value as! T
|
||||
}
|
||||
var value: T = 0
|
||||
let _ = withUnsafeMutableBytes(of: &value, { reader.data.copyBytes(to: $0, from: range)})
|
||||
reader.offset = range.upperBound
|
||||
return value.bigEndian
|
||||
}
|
||||
|
||||
// Reads an arbitrary number of bytes, to be used to read
|
||||
// raw bytes, this is useful when lifting strings
|
||||
fileprivate func readBytes(_ reader: inout (data: Data, offset: Data.Index), count: Int) throws -> Array<UInt8> {
|
||||
let range = reader.offset..<(reader.offset+count)
|
||||
guard reader.data.count >= range.upperBound else {
|
||||
throw UniffiInternalError.bufferOverflow
|
||||
}
|
||||
var value = [UInt8](repeating: 0, count: count)
|
||||
value.withUnsafeMutableBufferPointer({ buffer in
|
||||
reader.data.copyBytes(to: buffer, from: range)
|
||||
})
|
||||
reader.offset = range.upperBound
|
||||
return value
|
||||
}
|
||||
|
||||
// Reads a float at the current offset.
|
||||
fileprivate func readFloat(_ reader: inout (data: Data, offset: Data.Index)) throws -> Float {
|
||||
return Float(bitPattern: try readInt(&reader))
|
||||
}
|
||||
|
||||
// Reads a float at the current offset.
|
||||
fileprivate func readDouble(_ reader: inout (data: Data, offset: Data.Index)) throws -> Double {
|
||||
return Double(bitPattern: try readInt(&reader))
|
||||
}
|
||||
|
||||
// Indicates if the offset has reached the end of the buffer.
|
||||
fileprivate func hasRemaining(_ reader: (data: Data, offset: Data.Index)) -> Bool {
|
||||
return reader.offset < reader.data.count
|
||||
}
|
||||
|
||||
// Define writer functionality. Normally this would be defined in a class or
|
||||
// struct, but we use standalone functions instead in order to make external
|
||||
// types work. See the above discussion on Readers for details.
|
||||
|
||||
fileprivate func createWriter() -> [UInt8] {
|
||||
return []
|
||||
}
|
||||
|
||||
fileprivate func writeBytes<S>(_ writer: inout [UInt8], _ byteArr: S) where S: Sequence, S.Element == UInt8 {
|
||||
writer.append(contentsOf: byteArr)
|
||||
}
|
||||
|
||||
// Writes an integer in big-endian order.
|
||||
//
|
||||
// Warning: make sure what you are trying to write
|
||||
// is in the correct type!
|
||||
fileprivate func writeInt<T: FixedWidthInteger>(_ writer: inout [UInt8], _ value: T) {
|
||||
var value = value.bigEndian
|
||||
withUnsafeBytes(of: &value) { writer.append(contentsOf: $0) }
|
||||
}
|
||||
|
||||
fileprivate func writeFloat(_ writer: inout [UInt8], _ value: Float) {
|
||||
writeInt(&writer, value.bitPattern)
|
||||
}
|
||||
|
||||
fileprivate func writeDouble(_ writer: inout [UInt8], _ value: Double) {
|
||||
writeInt(&writer, value.bitPattern)
|
||||
}
|
||||
|
||||
// Protocol for types that transfer other types across the FFI. This is
|
||||
// analogous go the Rust trait of the same name.
|
||||
fileprivate protocol FfiConverter {
|
||||
associatedtype FfiType
|
||||
associatedtype SwiftType
|
||||
|
||||
static func lift(_ value: FfiType) throws -> SwiftType
|
||||
static func lower(_ value: SwiftType) -> FfiType
|
||||
static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType
|
||||
static func write(_ value: SwiftType, into buf: inout [UInt8])
|
||||
}
|
||||
|
||||
// Types conforming to `Primitive` pass themselves directly over the FFI.
|
||||
fileprivate protocol FfiConverterPrimitive: FfiConverter where FfiType == SwiftType { }
|
||||
|
||||
extension FfiConverterPrimitive {
|
||||
public static func lift(_ value: FfiType) throws -> SwiftType {
|
||||
return value
|
||||
}
|
||||
|
||||
public static func lower(_ value: SwiftType) -> FfiType {
|
||||
return value
|
||||
}
|
||||
}
|
||||
|
||||
// Types conforming to `FfiConverterRustBuffer` lift and lower into a `RustBuffer`.
|
||||
// Used for complex types where it's hard to write a custom lift/lower.
|
||||
fileprivate protocol FfiConverterRustBuffer: FfiConverter where FfiType == RustBuffer {}
|
||||
|
||||
extension FfiConverterRustBuffer {
|
||||
public static func lift(_ buf: RustBuffer) throws -> SwiftType {
|
||||
var reader = createReader(data: Data(rustBuffer: buf))
|
||||
let value = try read(from: &reader)
|
||||
if hasRemaining(reader) {
|
||||
throw UniffiInternalError.incompleteData
|
||||
}
|
||||
buf.deallocate()
|
||||
return value
|
||||
}
|
||||
|
||||
public static func lower(_ value: SwiftType) -> RustBuffer {
|
||||
var writer = createWriter()
|
||||
write(value, into: &writer)
|
||||
return RustBuffer(bytes: writer)
|
||||
}
|
||||
}
|
||||
// An error type for FFI errors. These errors occur at the UniFFI level, not
|
||||
// the library level.
|
||||
fileprivate enum UniffiInternalError: LocalizedError {
|
||||
case bufferOverflow
|
||||
case incompleteData
|
||||
case unexpectedOptionalTag
|
||||
case unexpectedEnumCase
|
||||
case unexpectedNullPointer
|
||||
case unexpectedRustCallStatusCode
|
||||
case unexpectedRustCallError
|
||||
case unexpectedStaleHandle
|
||||
case rustPanic(_ message: String)
|
||||
|
||||
public var errorDescription: String? {
|
||||
switch self {
|
||||
case .bufferOverflow: return "Reading the requested value would read past the end of the buffer"
|
||||
case .incompleteData: return "The buffer still has data after lifting its containing value"
|
||||
case .unexpectedOptionalTag: return "Unexpected optional tag; should be 0 or 1"
|
||||
case .unexpectedEnumCase: return "Raw enum value doesn't match any cases"
|
||||
case .unexpectedNullPointer: return "Raw pointer value was null"
|
||||
case .unexpectedRustCallStatusCode: return "Unexpected RustCallStatus code"
|
||||
case .unexpectedRustCallError: return "CALL_ERROR but no errorClass specified"
|
||||
case .unexpectedStaleHandle: return "The object in the handle map has been dropped already"
|
||||
case let .rustPanic(message): return message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate let CALL_SUCCESS: Int8 = 0
|
||||
fileprivate let CALL_ERROR: Int8 = 1
|
||||
fileprivate let CALL_PANIC: Int8 = 2
|
||||
fileprivate let CALL_CANCELLED: Int8 = 3
|
||||
|
||||
fileprivate extension RustCallStatus {
|
||||
init() {
|
||||
self.init(
|
||||
code: CALL_SUCCESS,
|
||||
errorBuf: RustBuffer.init(
|
||||
capacity: 0,
|
||||
len: 0,
|
||||
data: nil
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private func rustCall<T>(_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T) throws -> T {
|
||||
try makeRustCall(callback, errorHandler: nil)
|
||||
}
|
||||
|
||||
private func rustCallWithError<T>(
|
||||
_ errorHandler: @escaping (RustBuffer) throws -> Error,
|
||||
_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T) throws -> T {
|
||||
try makeRustCall(callback, errorHandler: errorHandler)
|
||||
}
|
||||
|
||||
private func makeRustCall<T>(
|
||||
_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T,
|
||||
errorHandler: ((RustBuffer) throws -> Error)?
|
||||
) throws -> T {
|
||||
uniffiEnsureInitialized()
|
||||
var callStatus = RustCallStatus.init()
|
||||
let returnedVal = callback(&callStatus)
|
||||
try uniffiCheckCallStatus(callStatus: callStatus, errorHandler: errorHandler)
|
||||
return returnedVal
|
||||
}
|
||||
|
||||
private func uniffiCheckCallStatus(
|
||||
callStatus: RustCallStatus,
|
||||
errorHandler: ((RustBuffer) throws -> Error)?
|
||||
) throws {
|
||||
switch callStatus.code {
|
||||
case CALL_SUCCESS:
|
||||
return
|
||||
|
||||
case CALL_ERROR:
|
||||
if let errorHandler = errorHandler {
|
||||
throw try errorHandler(callStatus.errorBuf)
|
||||
} else {
|
||||
callStatus.errorBuf.deallocate()
|
||||
throw UniffiInternalError.unexpectedRustCallError
|
||||
}
|
||||
|
||||
case CALL_PANIC:
|
||||
// When the rust code sees a panic, it tries to construct a RustBuffer
|
||||
// with the message. But if that code panics, then it just sends back
|
||||
// an empty buffer.
|
||||
if callStatus.errorBuf.len > 0 {
|
||||
throw UniffiInternalError.rustPanic(try FfiConverterString.lift(callStatus.errorBuf))
|
||||
} else {
|
||||
callStatus.errorBuf.deallocate()
|
||||
throw UniffiInternalError.rustPanic("Rust panic")
|
||||
}
|
||||
|
||||
case CALL_CANCELLED:
|
||||
throw CancellationError()
|
||||
|
||||
default:
|
||||
throw UniffiInternalError.unexpectedRustCallStatusCode
|
||||
}
|
||||
}
|
||||
|
||||
// Public interface members begin here.
|
||||
|
||||
|
||||
fileprivate struct FfiConverterUInt32: FfiConverterPrimitive {
|
||||
typealias FfiType = UInt32
|
||||
typealias SwiftType = UInt32
|
||||
|
||||
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UInt32 {
|
||||
return try lift(readInt(&buf))
|
||||
}
|
||||
|
||||
public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
|
||||
writeInt(&buf, lower(value))
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate struct FfiConverterBool : FfiConverter {
|
||||
typealias FfiType = Int8
|
||||
typealias SwiftType = Bool
|
||||
|
||||
public static func lift(_ value: Int8) throws -> Bool {
|
||||
return value != 0
|
||||
}
|
||||
|
||||
public static func lower(_ value: Bool) -> Int8 {
|
||||
return value ? 1 : 0
|
||||
}
|
||||
|
||||
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Bool {
|
||||
return try lift(readInt(&buf))
|
||||
}
|
||||
|
||||
public static func write(_ value: Bool, into buf: inout [UInt8]) {
|
||||
writeInt(&buf, lower(value))
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate struct FfiConverterString: FfiConverter {
|
||||
typealias SwiftType = String
|
||||
typealias FfiType = RustBuffer
|
||||
|
||||
public static func lift(_ value: RustBuffer) throws -> String {
|
||||
defer {
|
||||
value.deallocate()
|
||||
}
|
||||
if value.data == nil {
|
||||
return String()
|
||||
}
|
||||
let bytes = UnsafeBufferPointer<UInt8>(start: value.data!, count: Int(value.len))
|
||||
return String(bytes: bytes, encoding: String.Encoding.utf8)!
|
||||
}
|
||||
|
||||
public static func lower(_ value: String) -> RustBuffer {
|
||||
return value.utf8CString.withUnsafeBufferPointer { ptr in
|
||||
// The swift string gives us int8_t, we want uint8_t.
|
||||
ptr.withMemoryRebound(to: UInt8.self) { ptr in
|
||||
// The swift string gives us a trailing null byte, we don't want it.
|
||||
let buf = UnsafeBufferPointer(rebasing: ptr.prefix(upTo: ptr.count - 1))
|
||||
return RustBuffer.from(buf)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> String {
|
||||
let len: Int32 = try readInt(&buf)
|
||||
return String(bytes: try readBytes(&buf, count: Int(len)), encoding: String.Encoding.utf8)!
|
||||
}
|
||||
|
||||
public static func write(_ value: String, into buf: inout [UInt8]) {
|
||||
let len = Int32(value.utf8.count)
|
||||
writeInt(&buf, len)
|
||||
writeBytes(&buf, value.utf8)
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate struct FfiConverterData: FfiConverterRustBuffer {
|
||||
typealias SwiftType = Data
|
||||
|
||||
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Data {
|
||||
let len: Int32 = try readInt(&buf)
|
||||
return Data(try readBytes(&buf, count: Int(len)))
|
||||
}
|
||||
|
||||
public static func write(_ value: Data, into buf: inout [UInt8]) {
|
||||
let len = Int32(value.count)
|
||||
writeInt(&buf, len)
|
||||
writeBytes(&buf, value)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public protocol MoproCircomProtocol {
|
||||
func generateProof(circuitInputs: [String: [String]]) throws -> GenerateProofResult
|
||||
func setup(wasmPath: String, r1csPath: String) throws -> SetupResult
|
||||
func verifyProof(proof: Data, publicInput: Data) throws -> Bool
|
||||
|
||||
}
|
||||
|
||||
public class MoproCircom: MoproCircomProtocol {
|
||||
fileprivate let pointer: UnsafeMutableRawPointer
|
||||
|
||||
// TODO: We'd like this to be `private` but for Swifty reasons,
|
||||
// we can't implement `FfiConverter` without making this `required` and we can't
|
||||
// make it `required` without making it `public`.
|
||||
required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) {
|
||||
self.pointer = pointer
|
||||
}
|
||||
public convenience init() {
|
||||
self.init(unsafeFromRawPointer: try! rustCall() {
|
||||
uniffi_mopro_ffi_fn_constructor_moprocircom_new($0)
|
||||
})
|
||||
}
|
||||
|
||||
deinit {
|
||||
try! rustCall { uniffi_mopro_ffi_fn_free_moprocircom(pointer, $0) }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public func generateProof(circuitInputs: [String: [String]]) throws -> GenerateProofResult {
|
||||
return try FfiConverterTypeGenerateProofResult.lift(
|
||||
try
|
||||
rustCallWithError(FfiConverterTypeMoproError.lift) {
|
||||
uniffi_mopro_ffi_fn_method_moprocircom_generate_proof(self.pointer,
|
||||
FfiConverterDictionaryStringSequenceString.lower(circuitInputs),$0
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
public func setup(wasmPath: String, r1csPath: String) throws -> SetupResult {
|
||||
return try FfiConverterTypeSetupResult.lift(
|
||||
try
|
||||
rustCallWithError(FfiConverterTypeMoproError.lift) {
|
||||
uniffi_mopro_ffi_fn_method_moprocircom_setup(self.pointer,
|
||||
FfiConverterString.lower(wasmPath),
|
||||
FfiConverterString.lower(r1csPath),$0
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
public func verifyProof(proof: Data, publicInput: Data) throws -> Bool {
|
||||
return try FfiConverterBool.lift(
|
||||
try
|
||||
rustCallWithError(FfiConverterTypeMoproError.lift) {
|
||||
uniffi_mopro_ffi_fn_method_moprocircom_verify_proof(self.pointer,
|
||||
FfiConverterData.lower(proof),
|
||||
FfiConverterData.lower(publicInput),$0
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
public struct FfiConverterTypeMoproCircom: FfiConverter {
|
||||
typealias FfiType = UnsafeMutableRawPointer
|
||||
typealias SwiftType = MoproCircom
|
||||
|
||||
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MoproCircom {
|
||||
let v: UInt64 = try readInt(&buf)
|
||||
// The Rust code won't compile if a pointer won't fit in a UInt64.
|
||||
// We have to go via `UInt` because that's the thing that's the size of a pointer.
|
||||
let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v))
|
||||
if (ptr == nil) {
|
||||
throw UniffiInternalError.unexpectedNullPointer
|
||||
}
|
||||
return try lift(ptr!)
|
||||
}
|
||||
|
||||
public static func write(_ value: MoproCircom, into buf: inout [UInt8]) {
|
||||
// This fiddling is because `Int` is the thing that's the same size as a pointer.
|
||||
// The Rust code won't compile if a pointer won't fit in a `UInt64`.
|
||||
writeInt(&buf, UInt64(bitPattern: Int64(Int(bitPattern: lower(value)))))
|
||||
}
|
||||
|
||||
public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> MoproCircom {
|
||||
return MoproCircom(unsafeFromRawPointer: pointer)
|
||||
}
|
||||
|
||||
public static func lower(_ value: MoproCircom) -> UnsafeMutableRawPointer {
|
||||
return value.pointer
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public func FfiConverterTypeMoproCircom_lift(_ pointer: UnsafeMutableRawPointer) throws -> MoproCircom {
|
||||
return try FfiConverterTypeMoproCircom.lift(pointer)
|
||||
}
|
||||
|
||||
public func FfiConverterTypeMoproCircom_lower(_ value: MoproCircom) -> UnsafeMutableRawPointer {
|
||||
return FfiConverterTypeMoproCircom.lower(value)
|
||||
}
|
||||
|
||||
|
||||
public struct GenerateProofResult {
|
||||
public var proof: Data
|
||||
public var inputs: Data
|
||||
|
||||
// Default memberwise initializers are never public by default, so we
|
||||
// declare one manually.
|
||||
public init(proof: Data, inputs: Data) {
|
||||
self.proof = proof
|
||||
self.inputs = inputs
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extension GenerateProofResult: Equatable, Hashable {
|
||||
public static func ==(lhs: GenerateProofResult, rhs: GenerateProofResult) -> Bool {
|
||||
if lhs.proof != rhs.proof {
|
||||
return false
|
||||
}
|
||||
if lhs.inputs != rhs.inputs {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(proof)
|
||||
hasher.combine(inputs)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public struct FfiConverterTypeGenerateProofResult: FfiConverterRustBuffer {
|
||||
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> GenerateProofResult {
|
||||
return try GenerateProofResult(
|
||||
proof: FfiConverterData.read(from: &buf),
|
||||
inputs: FfiConverterData.read(from: &buf)
|
||||
)
|
||||
}
|
||||
|
||||
public static func write(_ value: GenerateProofResult, into buf: inout [UInt8]) {
|
||||
FfiConverterData.write(value.proof, into: &buf)
|
||||
FfiConverterData.write(value.inputs, into: &buf)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public func FfiConverterTypeGenerateProofResult_lift(_ buf: RustBuffer) throws -> GenerateProofResult {
|
||||
return try FfiConverterTypeGenerateProofResult.lift(buf)
|
||||
}
|
||||
|
||||
public func FfiConverterTypeGenerateProofResult_lower(_ value: GenerateProofResult) -> RustBuffer {
|
||||
return FfiConverterTypeGenerateProofResult.lower(value)
|
||||
}
|
||||
|
||||
|
||||
public struct SetupResult {
|
||||
public var provingKey: Data
|
||||
|
||||
// Default memberwise initializers are never public by default, so we
|
||||
// declare one manually.
|
||||
public init(provingKey: Data) {
|
||||
self.provingKey = provingKey
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extension SetupResult: Equatable, Hashable {
|
||||
public static func ==(lhs: SetupResult, rhs: SetupResult) -> Bool {
|
||||
if lhs.provingKey != rhs.provingKey {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(provingKey)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public struct FfiConverterTypeSetupResult: FfiConverterRustBuffer {
|
||||
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SetupResult {
|
||||
return try SetupResult(
|
||||
provingKey: FfiConverterData.read(from: &buf)
|
||||
)
|
||||
}
|
||||
|
||||
public static func write(_ value: SetupResult, into buf: inout [UInt8]) {
|
||||
FfiConverterData.write(value.provingKey, into: &buf)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public func FfiConverterTypeSetupResult_lift(_ buf: RustBuffer) throws -> SetupResult {
|
||||
return try FfiConverterTypeSetupResult.lift(buf)
|
||||
}
|
||||
|
||||
public func FfiConverterTypeSetupResult_lower(_ value: SetupResult) -> RustBuffer {
|
||||
return FfiConverterTypeSetupResult.lower(value)
|
||||
}
|
||||
|
||||
public enum MoproError {
|
||||
|
||||
|
||||
|
||||
// Simple error enums only carry a message
|
||||
case CircomError(message: String)
|
||||
|
||||
|
||||
fileprivate static func uniffiErrorHandler(_ error: RustBuffer) throws -> Error {
|
||||
return try FfiConverterTypeMoproError.lift(error)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public struct FfiConverterTypeMoproError: FfiConverterRustBuffer {
|
||||
typealias SwiftType = MoproError
|
||||
|
||||
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MoproError {
|
||||
let variant: Int32 = try readInt(&buf)
|
||||
switch variant {
|
||||
|
||||
|
||||
|
||||
|
||||
case 1: return .CircomError(
|
||||
message: try FfiConverterString.read(from: &buf)
|
||||
)
|
||||
|
||||
|
||||
default: throw UniffiInternalError.unexpectedEnumCase
|
||||
}
|
||||
}
|
||||
|
||||
public static func write(_ value: MoproError, into buf: inout [UInt8]) {
|
||||
switch value {
|
||||
|
||||
|
||||
|
||||
|
||||
case .CircomError(_ /* message is ignored*/):
|
||||
writeInt(&buf, Int32(1))
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extension MoproError: Equatable, Hashable {}
|
||||
|
||||
extension MoproError: Error { }
|
||||
|
||||
fileprivate struct FfiConverterSequenceString: FfiConverterRustBuffer {
|
||||
typealias SwiftType = [String]
|
||||
|
||||
public static func write(_ value: [String], into buf: inout [UInt8]) {
|
||||
let len = Int32(value.count)
|
||||
writeInt(&buf, len)
|
||||
for item in value {
|
||||
FfiConverterString.write(item, into: &buf)
|
||||
}
|
||||
}
|
||||
|
||||
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [String] {
|
||||
let len: Int32 = try readInt(&buf)
|
||||
var seq = [String]()
|
||||
seq.reserveCapacity(Int(len))
|
||||
for _ in 0 ..< len {
|
||||
seq.append(try FfiConverterString.read(from: &buf))
|
||||
}
|
||||
return seq
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate struct FfiConverterDictionaryStringSequenceString: FfiConverterRustBuffer {
|
||||
public static func write(_ value: [String: [String]], into buf: inout [UInt8]) {
|
||||
let len = Int32(value.count)
|
||||
writeInt(&buf, len)
|
||||
for (key, value) in value {
|
||||
FfiConverterString.write(key, into: &buf)
|
||||
FfiConverterSequenceString.write(value, into: &buf)
|
||||
}
|
||||
}
|
||||
|
||||
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [String: [String]] {
|
||||
let len: Int32 = try readInt(&buf)
|
||||
var dict = [String: [String]]()
|
||||
dict.reserveCapacity(Int(len))
|
||||
for _ in 0..<len {
|
||||
let key = try FfiConverterString.read(from: &buf)
|
||||
let value = try FfiConverterSequenceString.read(from: &buf)
|
||||
dict[key] = value
|
||||
}
|
||||
return dict
|
||||
}
|
||||
}
|
||||
|
||||
public func add(a: UInt32, b: UInt32) -> UInt32 {
|
||||
return try! FfiConverterUInt32.lift(
|
||||
try! rustCall() {
|
||||
uniffi_mopro_ffi_fn_func_add(
|
||||
FfiConverterUInt32.lower(a),
|
||||
FfiConverterUInt32.lower(b),$0)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
public func generateProof2(circuitInputs: [String: [String]]) throws -> GenerateProofResult {
|
||||
return try FfiConverterTypeGenerateProofResult.lift(
|
||||
try rustCallWithError(FfiConverterTypeMoproError.lift) {
|
||||
uniffi_mopro_ffi_fn_func_generate_proof2(
|
||||
FfiConverterDictionaryStringSequenceString.lower(circuitInputs),$0)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
public func hello() -> String {
|
||||
return try! FfiConverterString.lift(
|
||||
try! rustCall() {
|
||||
uniffi_mopro_ffi_fn_func_hello($0)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
public func initializeMopro() throws {
|
||||
try rustCallWithError(FfiConverterTypeMoproError.lift) {
|
||||
uniffi_mopro_ffi_fn_func_initialize_mopro($0)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public func initializeMoproDylib(dylibPath: String) throws {
|
||||
try rustCallWithError(FfiConverterTypeMoproError.lift) {
|
||||
uniffi_mopro_ffi_fn_func_initialize_mopro_dylib(
|
||||
FfiConverterString.lower(dylibPath),$0)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public func verifyProof2(proof: Data, publicInput: Data) throws -> Bool {
|
||||
return try FfiConverterBool.lift(
|
||||
try rustCallWithError(FfiConverterTypeMoproError.lift) {
|
||||
uniffi_mopro_ffi_fn_func_verify_proof2(
|
||||
FfiConverterData.lower(proof),
|
||||
FfiConverterData.lower(publicInput),$0)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
private enum InitializationResult {
|
||||
case ok
|
||||
case contractVersionMismatch
|
||||
case apiChecksumMismatch
|
||||
}
|
||||
// Use a global variables to perform the versioning checks. Swift ensures that
|
||||
// the code inside is only computed once.
|
||||
private var initializationResult: InitializationResult {
|
||||
// Get the bindings contract version from our ComponentInterface
|
||||
let bindings_contract_version = 24
|
||||
// Get the scaffolding contract version by calling the into the dylib
|
||||
let scaffolding_contract_version = ffi_mopro_ffi_uniffi_contract_version()
|
||||
if bindings_contract_version != scaffolding_contract_version {
|
||||
return InitializationResult.contractVersionMismatch
|
||||
}
|
||||
if (uniffi_mopro_ffi_checksum_func_add() != 8411) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_mopro_ffi_checksum_func_generate_proof2() != 40187) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_mopro_ffi_checksum_func_hello() != 46136) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_mopro_ffi_checksum_func_initialize_mopro() != 17540) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_mopro_ffi_checksum_func_initialize_mopro_dylib() != 64476) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_mopro_ffi_checksum_func_verify_proof2() != 37192) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_mopro_ffi_checksum_method_moprocircom_generate_proof() != 64602) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_mopro_ffi_checksum_method_moprocircom_setup() != 57700) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_mopro_ffi_checksum_method_moprocircom_verify_proof() != 61522) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_mopro_ffi_checksum_constructor_moprocircom_new() != 42205) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
|
||||
return InitializationResult.ok
|
||||
}
|
||||
|
||||
private func uniffiEnsureInitialized() {
|
||||
switch initializationResult {
|
||||
case .ok:
|
||||
break
|
||||
case .contractVersionMismatch:
|
||||
fatalError("UniFFI contract version mismatch: try cleaning and rebuilding your project")
|
||||
case .apiChecksumMismatch:
|
||||
fatalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
||||
}
|
||||
}
|
||||
@@ -1,670 +0,0 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
2A418AB02AF4B1200004B747 /* CircomUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A418AAF2AF4B1200004B747 /* CircomUITests.swift */; };
|
||||
2A6E5BAF2AF499460052A601 /* CircomTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A6E5BAE2AF499460052A601 /* CircomTests.swift */; };
|
||||
4384FD09A96F702A375841EE /* Pods_MoproKit_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 78B0F9CBE5DD22576996A993 /* Pods_MoproKit_Tests.framework */; };
|
||||
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; };
|
||||
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; };
|
||||
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
|
||||
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
|
||||
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
|
||||
7A38AEC233A3880A843B0133 /* Pods_MoproKit_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BE5A40EAC7D019B9C7566CA /* Pods_MoproKit_Example.framework */; };
|
||||
CE2C1B8C2AFFCC5E002AF8BC /* main.wasm in Resources */ = {isa = PBXBuildFile; fileRef = CE2C1B8B2AFFCC5E002AF8BC /* main.wasm */; };
|
||||
CE2C1B8D2AFFCC5E002AF8BC /* main.wasm in Resources */ = {isa = PBXBuildFile; fileRef = CE2C1B8B2AFFCC5E002AF8BC /* main.wasm */; };
|
||||
CE5A5C062AD43A790074539D /* keccak256_256_test.wasm in Resources */ = {isa = PBXBuildFile; fileRef = CE5A5C052AD43A790074539D /* keccak256_256_test.wasm */; };
|
||||
CE5A5C072AD43A790074539D /* keccak256_256_test.wasm in Resources */ = {isa = PBXBuildFile; fileRef = CE5A5C052AD43A790074539D /* keccak256_256_test.wasm */; };
|
||||
CE5A5C092AD43A860074539D /* keccak256_256_test.r1cs in Resources */ = {isa = PBXBuildFile; fileRef = CE5A5C082AD43A860074539D /* keccak256_256_test.r1cs */; };
|
||||
CE5A5C0A2AD43A860074539D /* keccak256_256_test.r1cs in Resources */ = {isa = PBXBuildFile; fileRef = CE5A5C082AD43A860074539D /* keccak256_256_test.r1cs */; };
|
||||
CEA2D12F2AB96A7A00F292D2 /* multiplier2.wasm in Resources */ = {isa = PBXBuildFile; fileRef = CEA2D12E2AB96A7A00F292D2 /* multiplier2.wasm */; };
|
||||
CEA2D1302AB96A7A00F292D2 /* multiplier2.wasm in Resources */ = {isa = PBXBuildFile; fileRef = CEA2D12E2AB96A7A00F292D2 /* multiplier2.wasm */; };
|
||||
CEA2D1322AB96AB500F292D2 /* multiplier2.r1cs in Resources */ = {isa = PBXBuildFile; fileRef = CEA2D1312AB96AB500F292D2 /* multiplier2.r1cs */; };
|
||||
CEA2D1332AB96AB500F292D2 /* multiplier2.r1cs in Resources */ = {isa = PBXBuildFile; fileRef = CEA2D1312AB96AB500F292D2 /* multiplier2.r1cs */; };
|
||||
CEB804502AFF81960063F091 /* KeccakSetupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEB8044F2AFF81960063F091 /* KeccakSetupViewController.swift */; };
|
||||
CEB804562AFF81AF0063F091 /* KeccakZkeyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEB804552AFF81AF0063F091 /* KeccakZkeyViewController.swift */; };
|
||||
CEB804582AFF81BF0063F091 /* RSAViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEB804572AFF81BF0063F091 /* RSAViewController.swift */; };
|
||||
E69338642AFFDB1A00B80312 /* AnonAadhaarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E69338632AFFDB1A00B80312 /* AnonAadhaarViewController.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 607FACC81AFB9204008FA782 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 607FACCF1AFB9204008FA782;
|
||||
remoteInfo = MoproKit;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
1E5E014D70B48C9A59F14658 /* Pods-MoproKit_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MoproKit_Example.release.xcconfig"; path = "Target Support Files/Pods-MoproKit_Example/Pods-MoproKit_Example.release.xcconfig"; sourceTree = "<group>"; };
|
||||
2A418AAF2AF4B1200004B747 /* CircomUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircomUITests.swift; sourceTree = "<group>"; };
|
||||
2A6E5BAE2AF499460052A601 /* CircomTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircomTests.swift; sourceTree = "<group>"; };
|
||||
47F8ADB0AC4168C6E874818D /* MoproKit.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = MoproKit.podspec; path = ../MoproKit.podspec; sourceTree = "<group>"; };
|
||||
5DAF212A114DFA0C9F4282B2 /* Pods-MoproKit_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MoproKit_Tests.debug.xcconfig"; path = "Target Support Files/Pods-MoproKit_Tests/Pods-MoproKit_Tests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
607FACD01AFB9204008FA782 /* MoproKit_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MoproKit_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
||||
607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
|
||||
607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
|
||||
607FACE51AFB9204008FA782 /* MoproKit_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MoproKit_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
78B0F9CBE5DD22576996A993 /* Pods_MoproKit_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MoproKit_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8BE5A40EAC7D019B9C7566CA /* Pods_MoproKit_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MoproKit_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
90EAF1BEF8AD3C193665DBED /* Pods-MoproKit_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MoproKit_Tests.release.xcconfig"; path = "Target Support Files/Pods-MoproKit_Tests/Pods-MoproKit_Tests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
92580ABC3B6DBAD1A9544456 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
|
||||
B4016A34BBB20BC381CCFC2D /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
|
||||
C61628A63419B5C140B24AF7 /* Pods-MoproKit_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MoproKit_Example.debug.xcconfig"; path = "Target Support Files/Pods-MoproKit_Example/Pods-MoproKit_Example.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
CE2C1B8B2AFFCC5E002AF8BC /* main.wasm */ = {isa = PBXFileReference; lastKnownFileType = file; name = main.wasm; path = "../../../../../mopro-core/examples/circom/rsa/target/main_js/main.wasm"; sourceTree = "<group>"; };
|
||||
CE5A5C052AD43A790074539D /* keccak256_256_test.wasm */ = {isa = PBXFileReference; lastKnownFileType = file; name = keccak256_256_test.wasm; path = "../../../../../mopro-core/examples/circom/keccak256/target/keccak256_256_test_js/keccak256_256_test.wasm"; sourceTree = "<group>"; };
|
||||
CE5A5C082AD43A860074539D /* keccak256_256_test.r1cs */ = {isa = PBXFileReference; lastKnownFileType = file; name = keccak256_256_test.r1cs; path = "../../../../../mopro-core/examples/circom/keccak256/target/keccak256_256_test.r1cs"; sourceTree = "<group>"; };
|
||||
CEA2D12E2AB96A7A00F292D2 /* multiplier2.wasm */ = {isa = PBXFileReference; lastKnownFileType = file; name = multiplier2.wasm; path = "../../../../../mopro-core/examples/circom/multiplier2/target/multiplier2_js/multiplier2.wasm"; sourceTree = "<group>"; };
|
||||
CEA2D1312AB96AB500F292D2 /* multiplier2.r1cs */ = {isa = PBXFileReference; lastKnownFileType = file; name = multiplier2.r1cs; path = "../../../../../mopro-core/examples/circom/multiplier2/target/multiplier2.r1cs"; sourceTree = "<group>"; };
|
||||
CEB8044F2AFF81960063F091 /* KeccakSetupViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KeccakSetupViewController.swift; sourceTree = "<group>"; };
|
||||
CEB804552AFF81AF0063F091 /* KeccakZkeyViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KeccakZkeyViewController.swift; sourceTree = "<group>"; };
|
||||
CEB804572AFF81BF0063F091 /* RSAViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RSAViewController.swift; sourceTree = "<group>"; };
|
||||
E69338632AFFDB1A00B80312 /* AnonAadhaarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnonAadhaarViewController.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
607FACCD1AFB9204008FA782 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
7A38AEC233A3880A843B0133 /* Pods_MoproKit_Example.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
607FACE21AFB9204008FA782 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
4384FD09A96F702A375841EE /* Pods_MoproKit_Tests.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
164B820D208F5EFE221D6A86 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8BE5A40EAC7D019B9C7566CA /* Pods_MoproKit_Example.framework */,
|
||||
78B0F9CBE5DD22576996A993 /* Pods_MoproKit_Tests.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
607FACC71AFB9204008FA782 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
607FACF51AFB993E008FA782 /* Podspec Metadata */,
|
||||
607FACD21AFB9204008FA782 /* Example for MoproKit */,
|
||||
607FACE81AFB9204008FA782 /* Tests */,
|
||||
607FACD11AFB9204008FA782 /* Products */,
|
||||
EEB809FA0FFBEC7559BC7169 /* Pods */,
|
||||
164B820D208F5EFE221D6A86 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
607FACD11AFB9204008FA782 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
607FACD01AFB9204008FA782 /* MoproKit_Example.app */,
|
||||
607FACE51AFB9204008FA782 /* MoproKit_Tests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
607FACD21AFB9204008FA782 /* Example for MoproKit */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CEB804572AFF81BF0063F091 /* RSAViewController.swift */,
|
||||
E69338632AFFDB1A00B80312 /* AnonAadhaarViewController.swift */,
|
||||
CEB804552AFF81AF0063F091 /* KeccakZkeyViewController.swift */,
|
||||
CEB8044F2AFF81960063F091 /* KeccakSetupViewController.swift */,
|
||||
CEA2D1282AB9681E00F292D2 /* Resources */,
|
||||
607FACD51AFB9204008FA782 /* AppDelegate.swift */,
|
||||
607FACD71AFB9204008FA782 /* ViewController.swift */,
|
||||
607FACD91AFB9204008FA782 /* Main.storyboard */,
|
||||
607FACDC1AFB9204008FA782 /* Images.xcassets */,
|
||||
607FACDE1AFB9204008FA782 /* LaunchScreen.xib */,
|
||||
607FACD31AFB9204008FA782 /* Supporting Files */,
|
||||
);
|
||||
name = "Example for MoproKit";
|
||||
path = MoproKit;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
607FACD31AFB9204008FA782 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
607FACD41AFB9204008FA782 /* Info.plist */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
607FACE81AFB9204008FA782 /* Tests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2A418AAF2AF4B1200004B747 /* CircomUITests.swift */,
|
||||
607FACE91AFB9204008FA782 /* Supporting Files */,
|
||||
2A6E5BAE2AF499460052A601 /* CircomTests.swift */,
|
||||
);
|
||||
path = Tests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
607FACE91AFB9204008FA782 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
607FACEA1AFB9204008FA782 /* Info.plist */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
607FACF51AFB993E008FA782 /* Podspec Metadata */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
47F8ADB0AC4168C6E874818D /* MoproKit.podspec */,
|
||||
B4016A34BBB20BC381CCFC2D /* README.md */,
|
||||
92580ABC3B6DBAD1A9544456 /* LICENSE */,
|
||||
);
|
||||
name = "Podspec Metadata";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CEA2D1282AB9681E00F292D2 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CE2C1B8B2AFFCC5E002AF8BC /* main.wasm */,
|
||||
CE5A5C082AD43A860074539D /* keccak256_256_test.r1cs */,
|
||||
CE5A5C052AD43A790074539D /* keccak256_256_test.wasm */,
|
||||
CEA2D12E2AB96A7A00F292D2 /* multiplier2.wasm */,
|
||||
CEA2D1312AB96AB500F292D2 /* multiplier2.r1cs */,
|
||||
);
|
||||
path = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
EEB809FA0FFBEC7559BC7169 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C61628A63419B5C140B24AF7 /* Pods-MoproKit_Example.debug.xcconfig */,
|
||||
1E5E014D70B48C9A59F14658 /* Pods-MoproKit_Example.release.xcconfig */,
|
||||
5DAF212A114DFA0C9F4282B2 /* Pods-MoproKit_Tests.debug.xcconfig */,
|
||||
90EAF1BEF8AD3C193665DBED /* Pods-MoproKit_Tests.release.xcconfig */,
|
||||
);
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
607FACCF1AFB9204008FA782 /* MoproKit_Example */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "MoproKit_Example" */;
|
||||
buildPhases = (
|
||||
C880BC635097821F74482E9F /* [CP] Check Pods Manifest.lock */,
|
||||
607FACCC1AFB9204008FA782 /* Sources */,
|
||||
607FACCD1AFB9204008FA782 /* Frameworks */,
|
||||
607FACCE1AFB9204008FA782 /* Resources */,
|
||||
AE90EE4FFCA95237FBC047A3 /* [CP] Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = MoproKit_Example;
|
||||
productName = MoproKit;
|
||||
productReference = 607FACD01AFB9204008FA782 /* MoproKit_Example.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
607FACE41AFB9204008FA782 /* MoproKit_Tests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "MoproKit_Tests" */;
|
||||
buildPhases = (
|
||||
2A673A4155C4EBC1B609897B /* [CP] Check Pods Manifest.lock */,
|
||||
607FACE11AFB9204008FA782 /* Sources */,
|
||||
607FACE21AFB9204008FA782 /* Frameworks */,
|
||||
607FACE31AFB9204008FA782 /* Resources */,
|
||||
2B1BB55A83D0E5B7D03D5DA0 /* [CP] Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
607FACE71AFB9204008FA782 /* PBXTargetDependency */,
|
||||
);
|
||||
name = MoproKit_Tests;
|
||||
productName = Tests;
|
||||
productReference = 607FACE51AFB9204008FA782 /* MoproKit_Tests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
607FACC81AFB9204008FA782 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0830;
|
||||
LastUpgradeCheck = 0830;
|
||||
ORGANIZATIONNAME = CocoaPods;
|
||||
TargetAttributes = {
|
||||
607FACCF1AFB9204008FA782 = {
|
||||
CreatedOnToolsVersion = 6.3.1;
|
||||
DevelopmentTeam = 5B29R5LYHQ;
|
||||
LastSwiftMigration = 0900;
|
||||
};
|
||||
607FACE41AFB9204008FA782 = {
|
||||
CreatedOnToolsVersion = 6.3.1;
|
||||
DevelopmentTeam = 5B29R5LYHQ;
|
||||
LastSwiftMigration = 0900;
|
||||
TestTargetID = 607FACCF1AFB9204008FA782;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "MoproKit" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 607FACC71AFB9204008FA782;
|
||||
productRefGroup = 607FACD11AFB9204008FA782 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
607FACCF1AFB9204008FA782 /* MoproKit_Example */,
|
||||
607FACE41AFB9204008FA782 /* MoproKit_Tests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
607FACCE1AFB9204008FA782 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
CEA2D1322AB96AB500F292D2 /* multiplier2.r1cs in Resources */,
|
||||
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */,
|
||||
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */,
|
||||
CE5A5C062AD43A790074539D /* keccak256_256_test.wasm in Resources */,
|
||||
CE2C1B8C2AFFCC5E002AF8BC /* main.wasm in Resources */,
|
||||
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */,
|
||||
CEA2D12F2AB96A7A00F292D2 /* multiplier2.wasm in Resources */,
|
||||
CE5A5C092AD43A860074539D /* keccak256_256_test.r1cs in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
607FACE31AFB9204008FA782 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
CE5A5C0A2AD43A860074539D /* keccak256_256_test.r1cs in Resources */,
|
||||
CE5A5C072AD43A790074539D /* keccak256_256_test.wasm in Resources */,
|
||||
CE2C1B8D2AFFCC5E002AF8BC /* main.wasm in Resources */,
|
||||
CEA2D1332AB96AB500F292D2 /* multiplier2.r1cs in Resources */,
|
||||
CEA2D1302AB96A7A00F292D2 /* multiplier2.wasm in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
2A673A4155C4EBC1B609897B /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-MoproKit_Tests-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
2B1BB55A83D0E5B7D03D5DA0 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-MoproKit_Tests/Pods-MoproKit_Tests-frameworks.sh",
|
||||
"${BUILT_PRODUCTS_DIR}/Nimble/Nimble.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/Quick/Quick.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Nimble.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Quick.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MoproKit_Tests/Pods-MoproKit_Tests-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
AE90EE4FFCA95237FBC047A3 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-MoproKit_Example/Pods-MoproKit_Example-frameworks.sh",
|
||||
"${BUILT_PRODUCTS_DIR}/MoproKit/MoproKit.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MoproKit.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MoproKit_Example/Pods-MoproKit_Example-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
C880BC635097821F74482E9F /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-MoproKit_Example-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
607FACCC1AFB9204008FA782 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
CEB804582AFF81BF0063F091 /* RSAViewController.swift in Sources */,
|
||||
CEB804562AFF81AF0063F091 /* KeccakZkeyViewController.swift in Sources */,
|
||||
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */,
|
||||
CEB804502AFF81960063F091 /* KeccakSetupViewController.swift in Sources */,
|
||||
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */,
|
||||
E69338642AFFDB1A00B80312 /* AnonAadhaarViewController.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
607FACE11AFB9204008FA782 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2A6E5BAF2AF499460052A601 /* CircomTests.swift in Sources */,
|
||||
2A418AB02AF4B1200004B747 /* CircomUITests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
607FACE71AFB9204008FA782 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 607FACCF1AFB9204008FA782 /* MoproKit_Example */;
|
||||
targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
607FACD91AFB9204008FA782 /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
607FACDA1AFB9204008FA782 /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
607FACDF1AFB9204008FA782 /* Base */,
|
||||
);
|
||||
name = LaunchScreen.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
607FACED1AFB9204008FA782 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
607FACEE1AFB9204008FA782 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
607FACF01AFB9204008FA782 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = C61628A63419B5C140B24AF7 /* Pods-MoproKit_Example.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
DEVELOPMENT_TEAM = 5B29R5LYHQ;
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
INFOPLIST_FILE = MoproKit/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MODULE_NAME = ExampleApp;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.mopro.examples;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
||||
SWIFT_VERSION = 4.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
607FACF11AFB9204008FA782 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 1E5E014D70B48C9A59F14658 /* Pods-MoproKit_Example.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
DEVELOPMENT_TEAM = 5B29R5LYHQ;
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
INFOPLIST_FILE = MoproKit/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MODULE_NAME = ExampleApp;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.mopro.examples;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
||||
SWIFT_VERSION = 4.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
607FACF31AFB9204008FA782 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 5DAF212A114DFA0C9F4282B2 /* Pods-MoproKit_Tests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MoproKit_Example.app/MoproKit_Example";
|
||||
DEVELOPMENT_TEAM = 5B29R5LYHQ;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(PLATFORM_DIR)/Developer/Library/Frameworks",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
INFOPLIST_FILE = Tests/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.mopro.examples.test;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
||||
SWIFT_VERSION = 4.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MoproKit_Example.app/MoproKit_Example";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
607FACF41AFB9204008FA782 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 90EAF1BEF8AD3C193665DBED /* Pods-MoproKit_Tests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MoproKit_Example.app/MoproKit_Example";
|
||||
DEVELOPMENT_TEAM = 5B29R5LYHQ;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(PLATFORM_DIR)/Developer/Library/Frameworks",
|
||||
"$(inherited)",
|
||||
);
|
||||
INFOPLIST_FILE = Tests/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.mopro.examples.test;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
||||
SWIFT_VERSION = 4.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MoproKit_Example.app/MoproKit_Example";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "MoproKit" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
607FACED1AFB9204008FA782 /* Debug */,
|
||||
607FACEE1AFB9204008FA782 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "MoproKit_Example" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
607FACF01AFB9204008FA782 /* Debug */,
|
||||
607FACF11AFB9204008FA782 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "MoproKit_Tests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
607FACF31AFB9204008FA782 /* Debug */,
|
||||
607FACF41AFB9204008FA782 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 607FACC81AFB9204008FA782 /* Project object */;
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0900"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
|
||||
BuildableName = "MoproKit_Example.app"
|
||||
BlueprintName = "MoproKit_Example"
|
||||
ReferencedContainer = "container:MoproKit.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "NO"
|
||||
buildForArchiving = "NO"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "607FACE41AFB9204008FA782"
|
||||
BuildableName = "MoproKit_Tests.xctest"
|
||||
BlueprintName = "MoproKit_Tests"
|
||||
ReferencedContainer = "container:MoproKit.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
codeCoverageEnabled = "YES"
|
||||
onlyGenerateCoverageForSpecifiedTargets = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
|
||||
BuildableName = "MoproKit_Example.app"
|
||||
BlueprintName = "MoproKit_Example"
|
||||
ReferencedContainer = "container:MoproKit.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<CodeCoverageTargets>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
|
||||
BuildableName = "MoproKit_Example.app"
|
||||
BlueprintName = "MoproKit_Example"
|
||||
ReferencedContainer = "container:MoproKit.xcodeproj">
|
||||
</BuildableReference>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "37729DE650F35D13EA7BF03F8E697892"
|
||||
BuildableName = "MoproKit.framework"
|
||||
BlueprintName = "MoproKit"
|
||||
ReferencedContainer = "container:Pods/Pods.xcodeproj">
|
||||
</BuildableReference>
|
||||
</CodeCoverageTargets>
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "607FACE41AFB9204008FA782"
|
||||
BuildableName = "MoproKit_Tests.xctest"
|
||||
BlueprintName = "MoproKit_Tests"
|
||||
ReferencedContainer = "container:MoproKit.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
|
||||
BuildableName = "MoproKit_Example.app"
|
||||
BlueprintName = "MoproKit_Example"
|
||||
ReferencedContainer = "container:MoproKit.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
|
||||
BuildableName = "MoproKit_Example.app"
|
||||
BlueprintName = "MoproKit_Example"
|
||||
ReferencedContainer = "container:MoproKit.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -1,192 +0,0 @@
|
||||
//
|
||||
// AnonAadhaarViewController.swift
|
||||
// MoproKit_Example
|
||||
//
|
||||
// Created by Yanis Meziane on 11/11/2023.
|
||||
// Copyright © 2023 CocoaPods. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import WebKit
|
||||
import MoproKit
|
||||
|
||||
class AnonAadhaarViewController: UIViewController, WKScriptMessageHandler, WKNavigationDelegate {
|
||||
let webView = WKWebView()
|
||||
let moproCircom = MoproKit.MoproCircom()
|
||||
//var setupResult: SetupResult?
|
||||
var generatedProof: Data?
|
||||
var publicInputs: Data?
|
||||
let containerView = UIView()
|
||||
var textView = UITextView()
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
runInitAction()
|
||||
setupUI()
|
||||
|
||||
let contentController = WKUserContentController()
|
||||
contentController.add(self, name: "startProvingHandler")
|
||||
contentController.add(self, name: "messageHandler")
|
||||
|
||||
let configuration = WKWebViewConfiguration()
|
||||
configuration.userContentController = contentController
|
||||
configuration.preferences.javaScriptEnabled = true
|
||||
|
||||
// Assign the configuration to the WKWebView
|
||||
let webView = WKWebView(frame: view.bounds, configuration: configuration)
|
||||
webView.navigationDelegate = self
|
||||
|
||||
view.addSubview(webView)
|
||||
view.addSubview(textView)
|
||||
|
||||
guard let url = URL(string: "https://webview-anon-adhaar.vercel.app/") else { return }
|
||||
webView.load(URLRequest(url: url))
|
||||
}
|
||||
|
||||
func setupUI() {
|
||||
textView.isEditable = false
|
||||
|
||||
textView.translatesAutoresizingMaskIntoConstraints = false
|
||||
view.addSubview(textView)
|
||||
|
||||
// Make text view visible
|
||||
textView.heightAnchor.constraint(equalToConstant: 200).isActive = true
|
||||
|
||||
NSLayoutConstraint.activate([
|
||||
textView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20),
|
||||
textView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -20),
|
||||
textView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: -20)
|
||||
])
|
||||
}
|
||||
|
||||
|
||||
|
||||
@objc func runInitAction() {
|
||||
// Update the textView on the main thread
|
||||
DispatchQueue.main.async {
|
||||
self.textView.text += "Initializing library\n"
|
||||
}
|
||||
|
||||
// Execute long-running tasks in the background
|
||||
DispatchQueue.global(qos: .userInitiated).async {
|
||||
// Record start time
|
||||
let start = CFAbsoluteTimeGetCurrent()
|
||||
|
||||
do {
|
||||
try initializeMopro()
|
||||
|
||||
// Record end time and compute duration
|
||||
let end = CFAbsoluteTimeGetCurrent()
|
||||
let timeTaken = end - start
|
||||
|
||||
// Again, update the UI on the main thread
|
||||
DispatchQueue.main.async {
|
||||
self.textView.text += "Initializing arkzkey took \(timeTaken) seconds.\n"
|
||||
}
|
||||
} catch {
|
||||
// Handle errors - update UI on main thread
|
||||
DispatchQueue.main.async {
|
||||
self.textView.text += "An error occurred during initialization: \(error)\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc func runProveAction(inputs: [String: [String]]) {
|
||||
// Logic for prove (generate_proof2)
|
||||
do {
|
||||
textView.text += "Starts proving...\n"
|
||||
// Record start time
|
||||
let start = CFAbsoluteTimeGetCurrent()
|
||||
|
||||
// Generate Proof
|
||||
let generateProofResult = try generateProof2(circuitInputs: inputs)
|
||||
assert(!generateProofResult.proof.isEmpty, "Proof should not be empty")
|
||||
//assert(Data(expectedOutput) == generateProofResult.inputs, "Circuit outputs mismatch the expected outputs")
|
||||
|
||||
// Record end time and compute duration
|
||||
let end = CFAbsoluteTimeGetCurrent()
|
||||
let timeTaken = end - start
|
||||
|
||||
// Store the generated proof and public inputs for later verification
|
||||
generatedProof = generateProofResult.proof
|
||||
publicInputs = generateProofResult.inputs
|
||||
|
||||
print("Proof generation took \(timeTaken) seconds.\n")
|
||||
|
||||
textView.text += "Proof generated!!! \n"
|
||||
textView.text += "Proof generation took \(timeTaken) seconds.\n"
|
||||
textView.text += "---\n"
|
||||
runVerifyAction()
|
||||
} catch let error as MoproError {
|
||||
print("MoproError: \(error)")
|
||||
} catch {
|
||||
print("Unexpected error: \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
override func viewDidLayoutSubviews() {
|
||||
super.viewDidLayoutSubviews()
|
||||
webView.frame = view.bounds
|
||||
}
|
||||
|
||||
struct Witness {
|
||||
let signature: [String]
|
||||
let modulus: [String]
|
||||
let base_message: [String]
|
||||
}
|
||||
|
||||
// Implement WKScriptMessageHandler method
|
||||
func provingContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
|
||||
if message.name == "messageHandler" {
|
||||
// Handle messages for "messageHandler"
|
||||
print("Received message from JavaScript:", message.body)
|
||||
}
|
||||
}
|
||||
|
||||
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
|
||||
if message.name == "startProvingHandler", let data = message.body as? [String: Any] {
|
||||
// Check for the "witness" key in the received data
|
||||
if let witnessData = data["witness"] as? [String: [String]] {
|
||||
if let signature = witnessData["signature"],
|
||||
let modulus = witnessData["modulus"],
|
||||
let baseMessage = witnessData["base_message"] {
|
||||
|
||||
let inputs: [String: [String]] = [
|
||||
"signature": signature,
|
||||
"modulus": modulus,
|
||||
"base_message": baseMessage
|
||||
]
|
||||
|
||||
// Call your Swift function with the received witness data
|
||||
runProveAction(inputs: inputs)
|
||||
}
|
||||
} else if let error = data["error"] as? String {
|
||||
// Handle error data
|
||||
print("Received error value from JavaScript:", error)
|
||||
} else {
|
||||
print("No valid data keys found in the message data.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc func runVerifyAction() {
|
||||
// Logic for verify
|
||||
guard let proof = generatedProof,
|
||||
let publicInputs = publicInputs else {
|
||||
print("Proof has not been generated yet.")
|
||||
return
|
||||
}
|
||||
do {
|
||||
// Verify Proof
|
||||
let isValid = try verifyProof2(proof: proof, publicInput: publicInputs)
|
||||
assert(isValid, "Proof verification should succeed")
|
||||
|
||||
textView.text += "Proof verification succeeded.\n"
|
||||
} catch let error as MoproError {
|
||||
print("MoproError: \(error)")
|
||||
} catch {
|
||||
print("Unexpected error: \(error)")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// MoproKit
|
||||
//
|
||||
// Created by 1552237 on 09/16/2023.
|
||||
// Copyright (c) 2023 1552237. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
|
||||
window = UIWindow(frame: UIScreen.main.bounds)
|
||||
let viewController = ViewController()
|
||||
let navigationController = UINavigationController(rootViewController: viewController)
|
||||
window?.rootViewController = navigationController
|
||||
window?.makeKeyAndVisible()
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func applicationWillResignActive(_ application: UIApplication) {
|
||||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
||||
}
|
||||
|
||||
func applicationDidEnterBackground(_ application: UIApplication) {
|
||||
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||
}
|
||||
|
||||
func applicationWillEnterForeground(_ application: UIApplication) {
|
||||
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
|
||||
}
|
||||
|
||||
func applicationDidBecomeActive(_ application: UIApplication) {
|
||||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||
}
|
||||
|
||||
func applicationWillTerminate(_ application: UIApplication) {
|
||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
|
||||
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view contentMode="scaleToFill" id="iN0-l3-epB">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 CocoaPods. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
|
||||
<rect key="frame" x="20" y="439" width="441" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="MoproKit" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
|
||||
<rect key="frame" x="20" y="140" width="441" height="43"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
|
||||
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
|
||||
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
|
||||
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
|
||||
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
|
||||
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
|
||||
</constraints>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<point key="canvasLocation" x="548" y="455"/>
|
||||
</view>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -1,30 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="ufC-wZ-h7g">
|
||||
<objects>
|
||||
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="MoproKit_Example" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
@@ -1,53 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ios-marketing",
|
||||
"size" : "1024x1024",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,186 +0,0 @@
|
||||
//
|
||||
// ViewController.swift
|
||||
// MoproKit
|
||||
//
|
||||
// Created by 1552237 on 09/16/2023.
|
||||
// Copyright (c) 2023 1552237. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import MoproKit
|
||||
|
||||
class KeccakSetupViewController: UIViewController {
|
||||
|
||||
var setupButton = UIButton(type: .system)
|
||||
var proveButton = UIButton(type: .system)
|
||||
var verifyButton = UIButton(type: .system)
|
||||
var textView = UITextView()
|
||||
|
||||
let moproCircom = MoproKit.MoproCircom()
|
||||
var setupResult: SetupResult?
|
||||
var generatedProof: Data?
|
||||
var publicInputs: Data?
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
// Set title
|
||||
let title = UILabel()
|
||||
title.text = "Keccak256 (setup)"
|
||||
title.textColor = .white
|
||||
title.textAlignment = .center
|
||||
navigationItem.titleView = title
|
||||
navigationController?.navigationBar.isHidden = false
|
||||
navigationController?.navigationBar.prefersLargeTitles = true
|
||||
|
||||
// view.backgroundColor = .white
|
||||
// navigationController?.navigationBar.prefersLargeTitles = true
|
||||
// navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.black]
|
||||
// navigationController?.navigationBar.barTintColor = UIColor.white // or any other contrasting color
|
||||
// self.title = "Keccak256 (setup)"
|
||||
|
||||
setupUI()
|
||||
}
|
||||
|
||||
func setupUI() {
|
||||
setupButton.setTitle("Setup", for: .normal)
|
||||
proveButton.setTitle("Prove", for: .normal)
|
||||
verifyButton.setTitle("Verify", for: .normal)
|
||||
|
||||
textView.isEditable = false
|
||||
|
||||
//self.title = "Keccak256 (setup)"
|
||||
//view.backgroundColor = .black
|
||||
|
||||
// Setup actions for buttons
|
||||
setupButton.addTarget(self, action: #selector(runSetupAction), for: .touchUpInside)
|
||||
proveButton.addTarget(self, action: #selector(runProveAction), for: .touchUpInside)
|
||||
verifyButton.addTarget(self, action: #selector(runVerifyAction), for: .touchUpInside)
|
||||
|
||||
setupButton.contentEdgeInsets = UIEdgeInsets(top: 12, left: 16, bottom: 12, right: 16)
|
||||
proveButton.contentEdgeInsets = UIEdgeInsets(top: 12, left: 16, bottom: 12, right: 16)
|
||||
verifyButton.contentEdgeInsets = UIEdgeInsets(top: 12, left: 16, bottom: 12, right: 16)
|
||||
|
||||
let stackView = UIStackView(arrangedSubviews: [setupButton, proveButton, verifyButton, textView])
|
||||
stackView.axis = .vertical
|
||||
stackView.spacing = 10
|
||||
stackView.translatesAutoresizingMaskIntoConstraints = false
|
||||
view.addSubview(stackView)
|
||||
|
||||
// Make text view visible
|
||||
textView.heightAnchor.constraint(equalToConstant: 200).isActive = true
|
||||
|
||||
NSLayoutConstraint.activate([
|
||||
stackView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
|
||||
stackView.centerYAnchor.constraint(equalTo: view.centerYAnchor),
|
||||
stackView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20),
|
||||
stackView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -20)
|
||||
])
|
||||
}
|
||||
|
||||
@objc func runSetupAction() {
|
||||
// Logic for setup
|
||||
if let wasmPath = Bundle.main.path(forResource: "keccak256_256_test", ofType: "wasm"),
|
||||
let r1csPath = Bundle.main.path(forResource: "keccak256_256_test", ofType: "r1cs") {
|
||||
|
||||
// Multiplier example
|
||||
// if let wasmPath = Bundle.main.path(forResource: "multiplier2", ofType: "wasm"),
|
||||
// let r1csPath = Bundle.main.path(forResource: "multiplier2", ofType: "r1cs") {
|
||||
|
||||
do {
|
||||
setupResult = try moproCircom.setup(wasmPath: wasmPath, r1csPath: r1csPath)
|
||||
proveButton.isEnabled = true // Enable the Prove button upon successful setup
|
||||
} catch let error as MoproError {
|
||||
print("MoproError: \(error)")
|
||||
} catch {
|
||||
print("Unexpected error: \(error)")
|
||||
}
|
||||
} else {
|
||||
print("Error getting paths for resources")
|
||||
}
|
||||
}
|
||||
|
||||
@objc func runProveAction() {
|
||||
// Logic for prove
|
||||
guard let setupResult = setupResult else {
|
||||
print("Setup is not completed yet.")
|
||||
return
|
||||
}
|
||||
do {
|
||||
// Prepare inputs
|
||||
let inputVec: [UInt8] = [
|
||||
116, 101, 115, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
]
|
||||
let bits = bytesToBits(bytes: inputVec)
|
||||
var inputs = [String: [String]]()
|
||||
inputs["in"] = bits
|
||||
|
||||
// Multiplier example
|
||||
// var inputs = [String: [String]]()
|
||||
// let a = 3
|
||||
// let b = 5
|
||||
// inputs["a"] = [String(a)]
|
||||
// inputs["b"] = [String(b)]
|
||||
|
||||
// Record start time
|
||||
let start = CFAbsoluteTimeGetCurrent()
|
||||
|
||||
// Generate Proof
|
||||
let generateProofResult = try moproCircom.generateProof(circuitInputs: inputs)
|
||||
assert(!generateProofResult.proof.isEmpty, "Proof should not be empty")
|
||||
|
||||
// Record end time and compute duration
|
||||
let end = CFAbsoluteTimeGetCurrent()
|
||||
let timeTaken = end - start
|
||||
|
||||
// Store the generated proof and public inputs for later verification
|
||||
generatedProof = generateProofResult.proof
|
||||
publicInputs = generateProofResult.inputs
|
||||
|
||||
textView.text += "Proof generation took \(timeTaken) seconds.\n"
|
||||
verifyButton.isEnabled = true // Enable the Verify button once proof has been generated
|
||||
} catch let error as MoproError {
|
||||
print("MoproError: \(error)")
|
||||
} catch {
|
||||
print("Unexpected error: \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
@objc func runVerifyAction() {
|
||||
// Logic for verify
|
||||
guard let setupResult = setupResult,
|
||||
let proof = generatedProof,
|
||||
let publicInputs = publicInputs else {
|
||||
print("Setup is not completed or proof has not been generated yet.")
|
||||
return
|
||||
}
|
||||
do {
|
||||
// Verify Proof
|
||||
let isValid = try moproCircom.verifyProof(proof: proof, publicInput: publicInputs)
|
||||
assert(isValid, "Proof verification should succeed")
|
||||
|
||||
textView.text += "Proof verification succeeded.\n"
|
||||
} catch let error as MoproError {
|
||||
print("MoproError: \(error)")
|
||||
} catch {
|
||||
print("Unexpected error: \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
override func didReceiveMemoryWarning() {
|
||||
super.didReceiveMemoryWarning()
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
}
|
||||
|
||||
func bytesToBits(bytes: [UInt8]) -> [String] {
|
||||
var bits = [String]()
|
||||
for byte in bytes {
|
||||
for j in 0..<8 {
|
||||
let bit = (byte >> j) & 1
|
||||
bits.append(String(bit))
|
||||
}
|
||||
}
|
||||
return bits
|
||||
}
|
||||
@@ -1,147 +0,0 @@
|
||||
//
|
||||
// ViewController.swift
|
||||
// MoproKit
|
||||
//
|
||||
// Created by 1552237 on 09/16/2023.
|
||||
// Copyright (c) 2023 1552237. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import MoproKit
|
||||
|
||||
class KeccakZkeyViewController: UIViewController {
|
||||
|
||||
var initButton = UIButton(type: .system)
|
||||
var proveButton = UIButton(type: .system)
|
||||
var verifyButton = UIButton(type: .system)
|
||||
var textView = UITextView()
|
||||
|
||||
let moproCircom = MoproKit.MoproCircom()
|
||||
//var setupResult: SetupResult?
|
||||
var generatedProof: Data?
|
||||
var publicInputs: Data?
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
// Set title
|
||||
let title = UILabel()
|
||||
title.text = "Keccak256 (Zkey)"
|
||||
title.textColor = .white
|
||||
title.textAlignment = .center
|
||||
navigationItem.titleView = title
|
||||
navigationController?.navigationBar.isHidden = false
|
||||
navigationController?.navigationBar.prefersLargeTitles = true
|
||||
|
||||
setupUI()
|
||||
}
|
||||
|
||||
func setupUI() {
|
||||
initButton.setTitle("Init", for: .normal)
|
||||
proveButton.setTitle("Prove", for: .normal)
|
||||
verifyButton.setTitle("Verify", for: .normal)
|
||||
|
||||
// Uncomment once init separate
|
||||
//proveButton.isEnabled = false
|
||||
proveButton.isEnabled = true
|
||||
verifyButton.isEnabled = false
|
||||
textView.isEditable = false
|
||||
|
||||
// Setup actions for buttons
|
||||
initButton.addTarget(self, action: #selector(runInitAction), for: .touchUpInside)
|
||||
proveButton.addTarget(self, action: #selector(runProveAction), for: .touchUpInside)
|
||||
verifyButton.addTarget(self, action: #selector(runVerifyAction), for: .touchUpInside)
|
||||
|
||||
initButton.contentEdgeInsets = UIEdgeInsets(top: 12, left: 16, bottom: 12, right: 16)
|
||||
proveButton.contentEdgeInsets = UIEdgeInsets(top: 12, left: 16, bottom: 12, right: 16)
|
||||
verifyButton.contentEdgeInsets = UIEdgeInsets(top: 12, left: 16, bottom: 12, right: 16)
|
||||
|
||||
let stackView = UIStackView(arrangedSubviews: [initButton, proveButton, verifyButton, textView])
|
||||
stackView.axis = .vertical
|
||||
stackView.spacing = 10
|
||||
stackView.translatesAutoresizingMaskIntoConstraints = false
|
||||
view.addSubview(stackView)
|
||||
|
||||
// Make text view visible
|
||||
textView.heightAnchor.constraint(equalToConstant: 200).isActive = true
|
||||
|
||||
NSLayoutConstraint.activate([
|
||||
stackView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
|
||||
stackView.centerYAnchor.constraint(equalTo: view.centerYAnchor),
|
||||
stackView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20),
|
||||
stackView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -20)
|
||||
])
|
||||
}
|
||||
|
||||
@objc func runInitAction() {
|
||||
// Logic for init
|
||||
do {
|
||||
textView.text += "Initializing library\n"
|
||||
// Record start time
|
||||
let start = CFAbsoluteTimeGetCurrent()
|
||||
|
||||
try initializeMopro()
|
||||
|
||||
// Record end time and compute duration
|
||||
let end = CFAbsoluteTimeGetCurrent()
|
||||
let timeTaken = end - start
|
||||
|
||||
textView.text += "Initializing arkzkey took \(timeTaken) seconds.\n"
|
||||
} catch let error as MoproError {
|
||||
print("MoproError: \(error)")
|
||||
} catch {
|
||||
print("Unexpected error: \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
@objc func runProveAction() {
|
||||
// Logic for prove (generate_proof2)
|
||||
do {
|
||||
// Prepare inputs
|
||||
let inputVec: [UInt8] = [
|
||||
116, 101, 115, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
]
|
||||
let bits = bytesToBits(bytes: inputVec)
|
||||
var inputs = [String: [String]]()
|
||||
inputs["in"] = bits
|
||||
|
||||
// Expected outputs
|
||||
let outputVec: [UInt8] = [
|
||||
37, 17, 98, 135, 161, 178, 88, 97, 125, 150, 143, 65, 228, 211, 170, 133, 153, 9, 88,
|
||||
212, 4, 212, 175, 238, 249, 210, 214, 116, 170, 85, 45, 21,
|
||||
]
|
||||
let outputBits: [String] = bytesToBits(bytes: outputVec)
|
||||
// let expectedOutput: [UInt8] = serializeOutputs(outputBits)
|
||||
|
||||
// Record start time
|
||||
let start = CFAbsoluteTimeGetCurrent()
|
||||
|
||||
// Generate Proof
|
||||
let generateProofResult = try generateProof2(circuitInputs: inputs)
|
||||
assert(!generateProofResult.proof.isEmpty, "Proof should not be empty")
|
||||
//assert(Data(expectedOutput) == generateProofResult.inputs, "Circuit outputs mismatch the expected outputs")
|
||||
|
||||
// Record end time and compute duration
|
||||
let end = CFAbsoluteTimeGetCurrent()
|
||||
let timeTaken = end - start
|
||||
|
||||
// Store the generated proof and public inputs for later verification
|
||||
generatedProof = generateProofResult.proof
|
||||
publicInputs = generateProofResult.inputs
|
||||
|
||||
textView.text += "Proof generation took \(timeTaken) seconds.\n"
|
||||
// TODO: Enable verify
|
||||
verifyButton.isEnabled = false
|
||||
//verifyButton.isEnabled = true // Enable the Verify button once proof has been generated
|
||||
} catch let error as MoproError {
|
||||
print("MoproError: \(error)")
|
||||
} catch {
|
||||
print("Unexpected error: \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
@objc func runVerifyAction() {
|
||||
// Logic for verify
|
||||
}
|
||||
}
|
||||
@@ -1,235 +0,0 @@
|
||||
//
|
||||
// ViewController.swift
|
||||
// MoproKit
|
||||
//
|
||||
// Created by 1552237 on 09/16/2023.
|
||||
// Copyright (c) 2023 1552237. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import MoproKit
|
||||
|
||||
class RSAViewController: UIViewController {
|
||||
|
||||
var initButton = UIButton(type: .system)
|
||||
var proveButton = UIButton(type: .system)
|
||||
var verifyButton = UIButton(type: .system)
|
||||
var textView = UITextView()
|
||||
|
||||
let moproCircom = MoproKit.MoproCircom()
|
||||
//var setupResult: SetupResult?
|
||||
var generatedProof: Data?
|
||||
var publicInputs: Data?
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
// Set title
|
||||
let title = UILabel()
|
||||
title.text = "RSA (Zkey)"
|
||||
title.textColor = .white
|
||||
title.textAlignment = .center
|
||||
navigationItem.titleView = title
|
||||
navigationController?.navigationBar.isHidden = false
|
||||
navigationController?.navigationBar.prefersLargeTitles = true
|
||||
|
||||
setupUI()
|
||||
}
|
||||
|
||||
func setupUI() {
|
||||
initButton.setTitle("Init", for: .normal)
|
||||
proveButton.setTitle("Prove", for: .normal)
|
||||
verifyButton.setTitle("Verify", for: .normal)
|
||||
|
||||
// Uncomment once init separate
|
||||
//proveButton.isEnabled = false
|
||||
proveButton.isEnabled = true
|
||||
verifyButton.isEnabled = false
|
||||
textView.isEditable = false
|
||||
|
||||
// Setup actions for buttons
|
||||
initButton.addTarget(self, action: #selector(runInitAction), for: .touchUpInside)
|
||||
proveButton.addTarget(self, action: #selector(runProveAction), for: .touchUpInside)
|
||||
verifyButton.addTarget(self, action: #selector(runVerifyAction), for: .touchUpInside)
|
||||
|
||||
initButton.contentEdgeInsets = UIEdgeInsets(top: 12, left: 16, bottom: 12, right: 16)
|
||||
proveButton.contentEdgeInsets = UIEdgeInsets(top: 12, left: 16, bottom: 12, right: 16)
|
||||
verifyButton.contentEdgeInsets = UIEdgeInsets(top: 12, left: 16, bottom: 12, right: 16)
|
||||
|
||||
let stackView = UIStackView(arrangedSubviews: [initButton, proveButton, verifyButton, textView])
|
||||
stackView.axis = .vertical
|
||||
stackView.spacing = 10
|
||||
stackView.translatesAutoresizingMaskIntoConstraints = false
|
||||
view.addSubview(stackView)
|
||||
|
||||
// Make text view visible
|
||||
textView.heightAnchor.constraint(equalToConstant: 200).isActive = true
|
||||
|
||||
NSLayoutConstraint.activate([
|
||||
stackView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
|
||||
stackView.centerYAnchor.constraint(equalTo: view.centerYAnchor),
|
||||
stackView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20),
|
||||
stackView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -20)
|
||||
])
|
||||
}
|
||||
|
||||
@objc func runInitAction() {
|
||||
// Update the textView on the main thread
|
||||
DispatchQueue.main.async {
|
||||
self.textView.text += "Initializing library\n"
|
||||
}
|
||||
|
||||
// Execute long-running tasks in the background
|
||||
DispatchQueue.global(qos: .userInitiated).async {
|
||||
// Record start time
|
||||
let start = CFAbsoluteTimeGetCurrent()
|
||||
|
||||
do {
|
||||
try initializeMopro()
|
||||
|
||||
// Record end time and compute duration
|
||||
let end = CFAbsoluteTimeGetCurrent()
|
||||
let timeTaken = end - start
|
||||
|
||||
// Again, update the UI on the main thread
|
||||
DispatchQueue.main.async {
|
||||
self.textView.text += "Initializing arkzkey took \(timeTaken) seconds.\n"
|
||||
}
|
||||
} catch {
|
||||
// Handle errors - update UI on main thread
|
||||
DispatchQueue.main.async {
|
||||
self.textView.text += "An error occurred during initialization: \(error)\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc func runProveAction() {
|
||||
// Logic for prove (generate_proof2)
|
||||
do {
|
||||
// Prepare inputs
|
||||
let signature: [String] = [
|
||||
"3582320600048169363",
|
||||
"7163546589759624213",
|
||||
"18262551396327275695",
|
||||
"4479772254206047016",
|
||||
"1970274621151677644",
|
||||
"6547632513799968987",
|
||||
"921117808165172908",
|
||||
"7155116889028933260",
|
||||
"16769940396381196125",
|
||||
"17141182191056257954",
|
||||
"4376997046052607007",
|
||||
"17471823348423771450",
|
||||
"16282311012391954891",
|
||||
"70286524413490741",
|
||||
"1588836847166444745",
|
||||
"15693430141227594668",
|
||||
"13832254169115286697",
|
||||
"15936550641925323613",
|
||||
"323842208142565220",
|
||||
"6558662646882345749",
|
||||
"15268061661646212265",
|
||||
"14962976685717212593",
|
||||
"15773505053543368901",
|
||||
"9586594741348111792",
|
||||
"1455720481014374292",
|
||||
"13945813312010515080",
|
||||
"6352059456732816887",
|
||||
"17556873002865047035",
|
||||
"2412591065060484384",
|
||||
"11512123092407778330",
|
||||
"8499281165724578877",
|
||||
"12768005853882726493",
|
||||
]
|
||||
|
||||
let modulus: [String] = [
|
||||
"13792647154200341559",
|
||||
"12773492180790982043",
|
||||
"13046321649363433702",
|
||||
"10174370803876824128",
|
||||
"7282572246071034406",
|
||||
"1524365412687682781",
|
||||
"4900829043004737418",
|
||||
"6195884386932410966",
|
||||
"13554217876979843574",
|
||||
"17902692039595931737",
|
||||
"12433028734895890975",
|
||||
"15971442058448435996",
|
||||
"4591894758077129763",
|
||||
"11258250015882429548",
|
||||
"16399550288873254981",
|
||||
"8246389845141771315",
|
||||
"14040203746442788850",
|
||||
"7283856864330834987",
|
||||
"12297563098718697441",
|
||||
"13560928146585163504",
|
||||
"7380926829734048483",
|
||||
"14591299561622291080",
|
||||
"8439722381984777599",
|
||||
"17375431987296514829",
|
||||
"16727607878674407272",
|
||||
"3233954801381564296",
|
||||
"17255435698225160983",
|
||||
"15093748890170255670",
|
||||
"15810389980847260072",
|
||||
"11120056430439037392",
|
||||
"5866130971823719482",
|
||||
"13327552690270163501",
|
||||
]
|
||||
|
||||
let base_message: [String] = ["18114495772705111902", "2254271930739856077",
|
||||
"2068851770", "0","0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
|
||||
"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0","0", "0", "0","0",
|
||||
]
|
||||
|
||||
var inputs = [String: [String]]()
|
||||
inputs["signature"] = signature;
|
||||
inputs["modulus"] = modulus;
|
||||
inputs["base_message"] = base_message;
|
||||
|
||||
let start = CFAbsoluteTimeGetCurrent()
|
||||
|
||||
// Generate Proof
|
||||
let generateProofResult = try generateProof2(circuitInputs: inputs)
|
||||
assert(!generateProofResult.proof.isEmpty, "Proof should not be empty")
|
||||
|
||||
// Record end time and compute duration
|
||||
let end = CFAbsoluteTimeGetCurrent()
|
||||
let timeTaken = end - start
|
||||
|
||||
// Store the generated proof and public inputs for later verification
|
||||
generatedProof = generateProofResult.proof
|
||||
publicInputs = generateProofResult.inputs
|
||||
|
||||
textView.text += "Proof generation took \(timeTaken) seconds.\n"
|
||||
verifyButton.isEnabled = true
|
||||
} catch let error as MoproError {
|
||||
print("MoproError: \(error)")
|
||||
textView.text += "MoproError: \(error)\n"
|
||||
} catch {
|
||||
print("Unexpected error: \(error)")
|
||||
textView.text += "Unexpected error: \(error)\n"
|
||||
}
|
||||
}
|
||||
|
||||
@objc func runVerifyAction() {
|
||||
// Logic for verify
|
||||
guard let proof = generatedProof,
|
||||
let publicInputs = publicInputs else {
|
||||
print("Proof has not been generated yet.")
|
||||
return
|
||||
}
|
||||
do {
|
||||
// Verify Proof
|
||||
let isValid = try verifyProof2(proof: proof, publicInput: publicInputs)
|
||||
assert(isValid, "Proof verification should succeed")
|
||||
|
||||
textView.text += "Proof verification succeeded.\n"
|
||||
} catch let error as MoproError {
|
||||
print("MoproError: \(error)")
|
||||
} catch {
|
||||
print("Unexpected error: \(error)")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
//
|
||||
// ViewController.swift
|
||||
// MoproKit
|
||||
//
|
||||
// Created by 1552237 on 09/16/2023.
|
||||
// Copyright (c) 2023 1552237. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import MoproKit
|
||||
|
||||
|
||||
// Main ViewController
|
||||
class ViewController: UIViewController {
|
||||
|
||||
let keccakSetupButton = UIButton(type: .system)
|
||||
let keccakZkeyButton = UIButton(type: .system)
|
||||
let rsaButton = UIButton(type: .system)
|
||||
let aadhaarButton = UIButton(type: .system)
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
// TODO: Improve style
|
||||
|
||||
// Set title
|
||||
let title = UILabel()
|
||||
title.text = "Mopro Examples"
|
||||
title.textColor = .white
|
||||
title.textAlignment = .center
|
||||
navigationItem.titleView = title
|
||||
navigationController?.navigationBar.isHidden = false
|
||||
navigationController?.navigationBar.prefersLargeTitles = true
|
||||
|
||||
setupMainUI()
|
||||
}
|
||||
|
||||
func setupMainUI() {
|
||||
keccakSetupButton.setTitle("Keccak (Setup)", for: .normal)
|
||||
keccakSetupButton.addTarget(self, action: #selector(openKeccakSetup), for: .touchUpInside)
|
||||
|
||||
keccakZkeyButton.setTitle("Keccak (Zkey)", for: .normal)
|
||||
keccakZkeyButton.addTarget(self, action: #selector(openKeccakZkey), for: .touchUpInside)
|
||||
|
||||
rsaButton.setTitle("RSA", for: .normal)
|
||||
rsaButton.addTarget(self, action: #selector(openRSA), for: .touchUpInside)
|
||||
|
||||
aadhaarButton.setTitle("Anon Aadhaar", for: .normal)
|
||||
aadhaarButton.addTarget(self, action: #selector(openAnonAadhaar), for: .touchUpInside)
|
||||
|
||||
|
||||
keccakSetupButton.contentEdgeInsets = UIEdgeInsets(top: 12, left: 16, bottom: 12, right: 16)
|
||||
keccakZkeyButton.contentEdgeInsets = UIEdgeInsets(top: 12, left: 16, bottom: 12, right: 16)
|
||||
rsaButton.contentEdgeInsets = UIEdgeInsets(top: 12, left: 16, bottom: 12, right: 16)
|
||||
|
||||
// self.title = "Mopro Examples"
|
||||
// navigationController?.navigationBar.prefersLargeTitles = true
|
||||
|
||||
|
||||
let stackView = UIStackView(arrangedSubviews: [keccakSetupButton, keccakZkeyButton, rsaButton, aadhaarButton])
|
||||
stackView.axis = .vertical
|
||||
stackView.spacing = 20
|
||||
stackView.translatesAutoresizingMaskIntoConstraints = false
|
||||
view.addSubview(stackView)
|
||||
|
||||
NSLayoutConstraint.activate([
|
||||
stackView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
|
||||
stackView.centerYAnchor.constraint(equalTo: view.centerYAnchor)
|
||||
])
|
||||
}
|
||||
|
||||
@objc func openKeccakSetup() {
|
||||
let keccakSetupVC = KeccakSetupViewController()
|
||||
navigationController?.pushViewController(keccakSetupVC, animated: true)
|
||||
}
|
||||
|
||||
@objc func openKeccakZkey() {
|
||||
let keccakZkeyVC = KeccakZkeyViewController()
|
||||
navigationController?.pushViewController(keccakZkeyVC, animated: true)
|
||||
}
|
||||
|
||||
@objc func openRSA() {
|
||||
let rsaVC = RSAViewController()
|
||||
navigationController?.pushViewController(rsaVC, animated: true)
|
||||
}
|
||||
|
||||
@objc func openAnonAadhaar() {
|
||||
let anonAadhaarVC = AnonAadhaarViewController()
|
||||
navigationController?.pushViewController(anonAadhaarVC, animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
// // Make buttons bigger
|
||||
// proveButton.contentEdgeInsets = UIEdgeInsets(top: 12, left: 16, bottom: 12, right: 16)
|
||||
// verifyButton.contentEdgeInsets = UIEdgeInsets(top: 12, left: 16, bottom: 12, right: 16)
|
||||
|
||||
// NSLayoutConstraint.activate([
|
||||
// stackView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20),
|
||||
// stackView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -20),
|
||||
// stackView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 20)
|
||||
// ])
|
||||
@@ -1,24 +0,0 @@
|
||||
use_frameworks!
|
||||
|
||||
platform :ios, '13.0'
|
||||
|
||||
target 'MoproKit_Example' do
|
||||
pod 'MoproKit', :path => '../'
|
||||
|
||||
target 'MoproKit_Tests' do
|
||||
inherit! :search_paths
|
||||
|
||||
pod 'Quick', '~> 2.2.0'
|
||||
pod 'Nimble', '~> 10.0.0'
|
||||
end
|
||||
end
|
||||
|
||||
post_install do |installer|
|
||||
installer.generated_projects.each do |project|
|
||||
project.targets.each do |target|
|
||||
target.build_configurations.each do |config|
|
||||
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,109 +0,0 @@
|
||||
@testable import MoproKit
|
||||
import XCTest
|
||||
|
||||
final class CircomTests: XCTestCase {
|
||||
|
||||
let moproCircom = MoproKit.MoproCircom()
|
||||
|
||||
func testMultiplier() {
|
||||
let wasmPath = Bundle.main.path(forResource: "multiplier2", ofType: "wasm")!
|
||||
let r1csPath = Bundle.main.path(forResource: "multiplier2", ofType: "r1cs")!
|
||||
XCTAssertNoThrow(try moproCircom.setup(wasmPath: wasmPath, r1csPath: r1csPath), "Mopro circom setup failed")
|
||||
|
||||
do {
|
||||
var inputs = [String: [String]]()
|
||||
let a = 3
|
||||
let b = 5
|
||||
let c = a*b
|
||||
inputs["a"] = [String(a)]
|
||||
inputs["b"] = [String(b)]
|
||||
let outputs: [String] = [String(c), String(a)]
|
||||
let expectedOutput: [UInt8] = serializeOutputs(outputs)
|
||||
|
||||
// Generate Proof
|
||||
let generateProofResult = try moproCircom.generateProof(circuitInputs: inputs)
|
||||
XCTAssertFalse(generateProofResult.proof.isEmpty, "Proof should not be empty")
|
||||
XCTAssertEqual(Data(expectedOutput), generateProofResult.inputs, "Circuit outputs mismatch the expected outputs")
|
||||
|
||||
let isValid = try moproCircom.verifyProof(proof: generateProofResult.proof, publicInput: generateProofResult.inputs)
|
||||
XCTAssertTrue(isValid, "Proof verification should succeed")
|
||||
} catch let error as MoproError {
|
||||
print("MoproError: \(error)")
|
||||
} catch {
|
||||
print("Unexpected error: \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
func testKeccak256() {
|
||||
let wasmPath = Bundle.main.path(forResource: "keccak256_256_test", ofType: "wasm")!
|
||||
let r1csPath = Bundle.main.path(forResource: "keccak256_256_test", ofType: "r1cs")!
|
||||
XCTAssertNoThrow(try moproCircom.setup(wasmPath: wasmPath, r1csPath: r1csPath), "Mopro circom setup failed")
|
||||
|
||||
do {
|
||||
// Prepare inputs
|
||||
let inputVec: [UInt8] = [
|
||||
116, 101, 115, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
]
|
||||
let bits = bytesToBits(bytes: inputVec)
|
||||
var inputs = [String: [String]]()
|
||||
inputs["in"] = bits
|
||||
|
||||
// Expected outputs
|
||||
let outputVec: [UInt8] = [
|
||||
37, 17, 98, 135, 161, 178, 88, 97, 125, 150, 143, 65, 228, 211, 170, 133, 153, 9, 88,
|
||||
212, 4, 212, 175, 238, 249, 210, 214, 116, 170, 85, 45, 21,
|
||||
]
|
||||
let outputBits: [String] = bytesToBits(bytes: outputVec)
|
||||
let expectedOutput: [UInt8] = serializeOutputs(outputBits)
|
||||
|
||||
// Generate Proof
|
||||
let generateProofResult = try moproCircom.generateProof(circuitInputs: inputs)
|
||||
XCTAssertFalse(generateProofResult.proof.isEmpty, "Proof should not be empty")
|
||||
XCTAssertEqual(Data(expectedOutput), generateProofResult.inputs, "Circuit outputs mismatch the expected outputs")
|
||||
|
||||
let isValid = try moproCircom.verifyProof(proof: generateProofResult.proof, publicInput: generateProofResult.inputs)
|
||||
XCTAssertTrue(isValid, "Proof verification should succeed")
|
||||
} catch let error as MoproError {
|
||||
print("MoproError: \(error)")
|
||||
} catch {
|
||||
print("Unexpected error: \(error)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func bytesToBits(bytes: [UInt8]) -> [String] {
|
||||
var bits = [String]()
|
||||
for byte in bytes {
|
||||
for j in 0..<8 {
|
||||
let bit = (byte >> j) & 1
|
||||
bits.append(String(bit))
|
||||
}
|
||||
}
|
||||
return bits
|
||||
}
|
||||
|
||||
func serializeOutputs(_ stringArray: [String]) -> [UInt8] {
|
||||
var bytesArray: [UInt8] = []
|
||||
let length = stringArray.count
|
||||
var littleEndianLength = length.littleEndian
|
||||
let targetLength = 32
|
||||
withUnsafeBytes(of: &littleEndianLength) {
|
||||
bytesArray.append(contentsOf: $0)
|
||||
}
|
||||
for value in stringArray {
|
||||
// TODO: should handle 254-bit input
|
||||
var littleEndian = Int32(value)!.littleEndian
|
||||
var byteLength = 0
|
||||
withUnsafeBytes(of: &littleEndian) {
|
||||
bytesArray.append(contentsOf: $0)
|
||||
byteLength = byteLength + $0.count
|
||||
}
|
||||
if byteLength < targetLength {
|
||||
let paddingCount = targetLength - byteLength
|
||||
let paddingArray = [UInt8](repeating: 0, count: paddingCount)
|
||||
bytesArray.append(contentsOf: paddingArray)
|
||||
}
|
||||
}
|
||||
return bytesArray
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
import XCTest
|
||||
@testable import MoproKit_Example
|
||||
|
||||
final class CircomUITests: XCTestCase {
|
||||
|
||||
let ui = KeccakSetupViewController()
|
||||
|
||||
func testSuccessUI() {
|
||||
XCTAssertNoThrow(ui.setupUI(), "Setup UI failed")
|
||||
XCTAssertNoThrow(ui.runProveAction(), "Prove action failed")
|
||||
XCTAssertNoThrow(ui.runVerifyAction(), "Verify action failed")
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,238 +0,0 @@
|
||||
// This file was autogenerated by some hot garbage in the `uniffi` crate.
|
||||
// Trust me, you don't want to mess with it!
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
// The following structs are used to implement the lowest level
|
||||
// of the FFI, and thus useful to multiple uniffied crates.
|
||||
// We ensure they are declared exactly once, with a header guard, UNIFFI_SHARED_H.
|
||||
#ifdef UNIFFI_SHARED_H
|
||||
// We also try to prevent mixing versions of shared uniffi header structs.
|
||||
// If you add anything to the #else block, you must increment the version suffix in UNIFFI_SHARED_HEADER_V4
|
||||
#ifndef UNIFFI_SHARED_HEADER_V4
|
||||
#error Combining helper code from multiple versions of uniffi is not supported
|
||||
#endif // ndef UNIFFI_SHARED_HEADER_V4
|
||||
#else
|
||||
#define UNIFFI_SHARED_H
|
||||
#define UNIFFI_SHARED_HEADER_V4
|
||||
// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️
|
||||
// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️
|
||||
|
||||
typedef struct RustBuffer
|
||||
{
|
||||
int32_t capacity;
|
||||
int32_t len;
|
||||
uint8_t *_Nullable data;
|
||||
} RustBuffer;
|
||||
|
||||
typedef int32_t (*ForeignCallback)(uint64_t, int32_t, const uint8_t *_Nonnull, int32_t, RustBuffer *_Nonnull);
|
||||
|
||||
// Task defined in Rust that Swift executes
|
||||
typedef void (*UniFfiRustTaskCallback)(const void * _Nullable, int8_t);
|
||||
|
||||
// Callback to execute Rust tasks using a Swift Task
|
||||
//
|
||||
// Args:
|
||||
// executor: ForeignExecutor lowered into a size_t value
|
||||
// delay: Delay in MS
|
||||
// task: UniFfiRustTaskCallback to call
|
||||
// task_data: data to pass the task callback
|
||||
typedef int8_t (*UniFfiForeignExecutorCallback)(size_t, uint32_t, UniFfiRustTaskCallback _Nullable, const void * _Nullable);
|
||||
|
||||
typedef struct ForeignBytes
|
||||
{
|
||||
int32_t len;
|
||||
const uint8_t *_Nullable data;
|
||||
} ForeignBytes;
|
||||
|
||||
// Error definitions
|
||||
typedef struct RustCallStatus {
|
||||
int8_t code;
|
||||
RustBuffer errorBuf;
|
||||
} RustCallStatus;
|
||||
|
||||
// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️
|
||||
// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️
|
||||
#endif // def UNIFFI_SHARED_H
|
||||
|
||||
// Continuation callback for UniFFI Futures
|
||||
typedef void (*UniFfiRustFutureContinuation)(void * _Nonnull, int8_t);
|
||||
|
||||
// Scaffolding functions
|
||||
void uniffi_mopro_ffi_fn_free_moprocircom(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
void*_Nonnull uniffi_mopro_ffi_fn_constructor_moprocircom_new(RustCallStatus *_Nonnull out_status
|
||||
|
||||
);
|
||||
RustBuffer uniffi_mopro_ffi_fn_method_moprocircom_generate_proof(void*_Nonnull ptr, RustBuffer circuit_inputs, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
RustBuffer uniffi_mopro_ffi_fn_method_moprocircom_setup(void*_Nonnull ptr, RustBuffer wasm_path, RustBuffer r1cs_path, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
int8_t uniffi_mopro_ffi_fn_method_moprocircom_verify_proof(void*_Nonnull ptr, RustBuffer proof, RustBuffer public_input, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
uint32_t uniffi_mopro_ffi_fn_func_add(uint32_t a, uint32_t b, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
RustBuffer uniffi_mopro_ffi_fn_func_generate_proof2(RustBuffer circuit_inputs, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
RustBuffer uniffi_mopro_ffi_fn_func_hello(RustCallStatus *_Nonnull out_status
|
||||
|
||||
);
|
||||
void uniffi_mopro_ffi_fn_func_initialize_mopro(RustCallStatus *_Nonnull out_status
|
||||
|
||||
);
|
||||
void uniffi_mopro_ffi_fn_func_initialize_mopro_dylib(RustBuffer dylib_path, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
int8_t uniffi_mopro_ffi_fn_func_verify_proof2(RustBuffer proof, RustBuffer public_input, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
RustBuffer ffi_mopro_ffi_rustbuffer_alloc(int32_t size, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
RustBuffer ffi_mopro_ffi_rustbuffer_from_bytes(ForeignBytes bytes, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
void ffi_mopro_ffi_rustbuffer_free(RustBuffer buf, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
RustBuffer ffi_mopro_ffi_rustbuffer_reserve(RustBuffer buf, int32_t additional, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_continuation_callback_set(UniFfiRustFutureContinuation _Nonnull callback
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_poll_u8(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_cancel_u8(void* _Nonnull handle
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_free_u8(void* _Nonnull handle
|
||||
);
|
||||
uint8_t ffi_mopro_ffi_rust_future_complete_u8(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_poll_i8(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_cancel_i8(void* _Nonnull handle
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_free_i8(void* _Nonnull handle
|
||||
);
|
||||
int8_t ffi_mopro_ffi_rust_future_complete_i8(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_poll_u16(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_cancel_u16(void* _Nonnull handle
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_free_u16(void* _Nonnull handle
|
||||
);
|
||||
uint16_t ffi_mopro_ffi_rust_future_complete_u16(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_poll_i16(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_cancel_i16(void* _Nonnull handle
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_free_i16(void* _Nonnull handle
|
||||
);
|
||||
int16_t ffi_mopro_ffi_rust_future_complete_i16(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_poll_u32(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_cancel_u32(void* _Nonnull handle
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_free_u32(void* _Nonnull handle
|
||||
);
|
||||
uint32_t ffi_mopro_ffi_rust_future_complete_u32(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_poll_i32(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_cancel_i32(void* _Nonnull handle
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_free_i32(void* _Nonnull handle
|
||||
);
|
||||
int32_t ffi_mopro_ffi_rust_future_complete_i32(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_poll_u64(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_cancel_u64(void* _Nonnull handle
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_free_u64(void* _Nonnull handle
|
||||
);
|
||||
uint64_t ffi_mopro_ffi_rust_future_complete_u64(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_poll_i64(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_cancel_i64(void* _Nonnull handle
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_free_i64(void* _Nonnull handle
|
||||
);
|
||||
int64_t ffi_mopro_ffi_rust_future_complete_i64(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_poll_f32(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_cancel_f32(void* _Nonnull handle
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_free_f32(void* _Nonnull handle
|
||||
);
|
||||
float ffi_mopro_ffi_rust_future_complete_f32(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_poll_f64(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_cancel_f64(void* _Nonnull handle
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_free_f64(void* _Nonnull handle
|
||||
);
|
||||
double ffi_mopro_ffi_rust_future_complete_f64(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_poll_pointer(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_cancel_pointer(void* _Nonnull handle
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_free_pointer(void* _Nonnull handle
|
||||
);
|
||||
void*_Nonnull ffi_mopro_ffi_rust_future_complete_pointer(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_poll_rust_buffer(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_cancel_rust_buffer(void* _Nonnull handle
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_free_rust_buffer(void* _Nonnull handle
|
||||
);
|
||||
RustBuffer ffi_mopro_ffi_rust_future_complete_rust_buffer(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_poll_void(void* _Nonnull handle, void* _Nonnull uniffi_callback
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_cancel_void(void* _Nonnull handle
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_free_void(void* _Nonnull handle
|
||||
);
|
||||
void ffi_mopro_ffi_rust_future_complete_void(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
uint16_t uniffi_mopro_ffi_checksum_func_add(void
|
||||
|
||||
);
|
||||
uint16_t uniffi_mopro_ffi_checksum_func_generate_proof2(void
|
||||
|
||||
);
|
||||
uint16_t uniffi_mopro_ffi_checksum_func_hello(void
|
||||
|
||||
);
|
||||
uint16_t uniffi_mopro_ffi_checksum_func_initialize_mopro(void
|
||||
|
||||
);
|
||||
uint16_t uniffi_mopro_ffi_checksum_func_initialize_mopro_dylib(void
|
||||
|
||||
);
|
||||
uint16_t uniffi_mopro_ffi_checksum_func_verify_proof2(void
|
||||
|
||||
);
|
||||
uint16_t uniffi_mopro_ffi_checksum_method_moprocircom_generate_proof(void
|
||||
|
||||
);
|
||||
uint16_t uniffi_mopro_ffi_checksum_method_moprocircom_setup(void
|
||||
|
||||
);
|
||||
uint16_t uniffi_mopro_ffi_checksum_method_moprocircom_verify_proof(void
|
||||
|
||||
);
|
||||
uint16_t uniffi_mopro_ffi_checksum_constructor_moprocircom_new(void
|
||||
|
||||
);
|
||||
uint32_t ffi_mopro_ffi_uniffi_contract_version(void
|
||||
|
||||
);
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
Copyright (c) 2023 1552237 <oskarth@titanproxy.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -1,50 +0,0 @@
|
||||
#
|
||||
# Be sure to run `pod lib lint MoproKit.podspec' to ensure this is a
|
||||
# valid spec before submitting.
|
||||
#
|
||||
# Any lines starting with a # are optional, but their use is encouraged
|
||||
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
|
||||
#
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'MoproKit'
|
||||
s.version = '0.1.0'
|
||||
s.summary = 'A short description of MoproKit.'
|
||||
|
||||
# This description is used to generate tags and improve search results.
|
||||
# * Think: What does it do? Why did you write it? What is the focus?
|
||||
# * Try to keep it short, snappy and to the point.
|
||||
# * Write the description between the DESC delimiters below.
|
||||
# * Finally, don't worry about the indent, CocoaPods strips it!
|
||||
|
||||
s.description = <<-DESC
|
||||
TODO: Add long description of the pod here.
|
||||
DESC
|
||||
|
||||
s.homepage = 'https://github.com/1552237/MoproKit'
|
||||
# s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
|
||||
s.license = { :type => 'MIT', :file => 'LICENSE' }
|
||||
s.author = { '1552237' => 'oskarth@titanproxy.com' }
|
||||
s.source = { :git => 'https://github.com/1552237/MoproKit.git', :tag => s.version.to_s }
|
||||
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
|
||||
|
||||
s.ios.deployment_target = '13.0'
|
||||
|
||||
s.source_files = 'MoproKit/Classes/**/*'
|
||||
|
||||
# libmopro library, headers and modulemap
|
||||
# XXX: static library is not in source control, and needs to be inlcuded manually
|
||||
# Have to be mindful of architecture and simulator or not here, should be improved
|
||||
s.preserve_paths = 'Libs/libmopro_uniffi.a'
|
||||
s.vendored_libraries = 'Libs/libmopro_uniffi.a'
|
||||
s.source_files = 'Include/*.h', 'Bindings/*.swift'
|
||||
s.resource = 'Resources/moproFFI.modulemap'
|
||||
|
||||
# s.resource_bundles = {
|
||||
# 'MoproKit' => ['MoproKit/Assets/*.png']
|
||||
# }
|
||||
|
||||
# s.public_header_files = 'Pod/Classes/**/*.h'
|
||||
# s.frameworks = 'UIKit', 'MapKit'
|
||||
# s.dependency 'AFNetworking', '~> 2.3'
|
||||
end
|
||||
@@ -1,29 +0,0 @@
|
||||
# MoproKit
|
||||
|
||||
[](https://travis-ci.org/1552237/MoproKit)
|
||||
[](https://cocoapods.org/pods/MoproKit)
|
||||
[](https://cocoapods.org/pods/MoproKit)
|
||||
[](https://cocoapods.org/pods/MoproKit)
|
||||
|
||||
## Example
|
||||
|
||||
To run the example project, clone the repo, and run `pod install` from the Example directory first.
|
||||
|
||||
## Requirements
|
||||
|
||||
## Installation
|
||||
|
||||
MoproKit is available through [CocoaPods](https://cocoapods.org). To install
|
||||
it, simply add the following line to your Podfile:
|
||||
|
||||
```ruby
|
||||
pod 'MoproKit'
|
||||
```
|
||||
|
||||
## Author
|
||||
|
||||
1552237, oskarth@titanproxy.com
|
||||
|
||||
## License
|
||||
|
||||
MoproKit is available under the MIT license. See the LICENSE file for more info.
|
||||
@@ -1,6 +0,0 @@
|
||||
// This file was autogenerated by some hot garbage in the `uniffi` crate.
|
||||
// Trust me, you don't want to mess with it!
|
||||
module moproFFI {
|
||||
header "moproFFI.h"
|
||||
export *
|
||||
}
|
||||
@@ -225,14 +225,14 @@ class PassportReader: NSObject{
|
||||
|
||||
} catch {
|
||||
print("Error serializing SOD data: \(error)")
|
||||
reject("E_PASSPORT_READ", "Failed to read passport", error)
|
||||
reject("E_PASSPORT_READ", error.localizedDescription, error)
|
||||
}
|
||||
|
||||
let stringified = String(data: try JSONEncoder().encode(ret), encoding: .utf8)
|
||||
|
||||
resolve(stringified)
|
||||
} catch {
|
||||
reject("E_PASSPORT_READ", "Failed to read passport", error)
|
||||
reject("E_PASSPORT_READ", error.localizedDescription, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,8 @@ target 'ProofOfPassport' do
|
||||
|
||||
use_frameworks!
|
||||
pod 'NFCPassportReader', git: 'https://github.com/0xturboblitz/NFCPassportReader.git', commit: '310ecb519655d9ed8b1afc5eb490b2f51a4d3595'
|
||||
pod 'MoproKit', :path => './MoproKit'
|
||||
pod 'QKMRZScanner'
|
||||
pod 'RNFS', :path => '../node_modules/react-native-fs'
|
||||
|
||||
use_react_native!(
|
||||
:path => config[:reactNativePath],
|
||||
@@ -66,6 +66,7 @@ target 'ProofOfPassport' do
|
||||
project.targets.each do |target|
|
||||
target.build_configurations.each do |config|
|
||||
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
|
||||
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
PODS:
|
||||
- amplitude-react-native (1.4.7):
|
||||
- React-Core
|
||||
- boost (1.76.0)
|
||||
- DoubleConversion (1.1.6)
|
||||
- FBLazyVector (0.72.3)
|
||||
@@ -11,7 +13,6 @@ PODS:
|
||||
- ReactCommon/turbomodule/core (= 0.72.3)
|
||||
- fmt (6.2.1)
|
||||
- glog (0.3.5)
|
||||
- MoproKit (0.1.0)
|
||||
- NFCPassportReader (2.0.3):
|
||||
- OpenSSL-Universal (= 1.1.1100)
|
||||
- OpenSSL-Universal (1.1.1100)
|
||||
@@ -290,6 +291,10 @@ PODS:
|
||||
- React-jsinspector (0.72.3)
|
||||
- React-logger (0.72.3):
|
||||
- glog
|
||||
- react-native-get-random-values (1.11.0):
|
||||
- React-Core
|
||||
- react-native-netinfo (11.3.1):
|
||||
- React-Core
|
||||
- React-NativeModulesApple (0.72.3):
|
||||
- React-callinvoker
|
||||
- React-Core
|
||||
@@ -395,21 +400,35 @@ PODS:
|
||||
- React-jsi (= 0.72.3)
|
||||
- React-logger (= 0.72.3)
|
||||
- React-perflogger (= 0.72.3)
|
||||
- RNCAsyncStorage (1.23.1):
|
||||
- React-Core
|
||||
- RNCClipboard (1.5.1):
|
||||
- React-Core
|
||||
- RNFS (2.20.0):
|
||||
- React-Core
|
||||
- RNKeychain (8.2.0):
|
||||
- React-Core
|
||||
- RNSVG (13.4.0):
|
||||
- React-Core
|
||||
- RNZipArchive (6.1.0):
|
||||
- React-Core
|
||||
- RNZipArchive/Core (= 6.1.0)
|
||||
- SSZipArchive (~> 2.2)
|
||||
- RNZipArchive/Core (6.1.0):
|
||||
- React-Core
|
||||
- SSZipArchive (~> 2.2)
|
||||
- SocketRocket (0.6.1)
|
||||
- SSZipArchive (2.4.3)
|
||||
- SwiftyTesseract (3.1.3)
|
||||
- Yoga (1.14.0)
|
||||
|
||||
DEPENDENCIES:
|
||||
- "amplitude-react-native (from `../node_modules/@amplitude/analytics-react-native`)"
|
||||
- boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
|
||||
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
|
||||
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
|
||||
- FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
|
||||
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
|
||||
- MoproKit (from `./MoproKit`)
|
||||
- NFCPassportReader (from `https://github.com/0xturboblitz/NFCPassportReader.git`, commit `310ecb519655d9ed8b1afc5eb490b2f51a4d3595`)
|
||||
- QKMRZScanner
|
||||
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
|
||||
@@ -428,6 +447,8 @@ DEPENDENCIES:
|
||||
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
|
||||
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
|
||||
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
|
||||
- react-native-get-random-values (from `../node_modules/react-native-get-random-values`)
|
||||
- "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)"
|
||||
- React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
|
||||
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
|
||||
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
|
||||
@@ -445,8 +466,12 @@ DEPENDENCIES:
|
||||
- React-runtimescheduler (from `../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler`)
|
||||
- React-utils (from `../node_modules/react-native/ReactCommon/react/utils`)
|
||||
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
|
||||
- "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)"
|
||||
- "RNCClipboard (from `../node_modules/@react-native-community/clipboard`)"
|
||||
- RNFS (from `../node_modules/react-native-fs`)
|
||||
- RNKeychain (from `../node_modules/react-native-keychain`)
|
||||
- RNSVG (from `../node_modules/react-native-svg`)
|
||||
- RNZipArchive (from `../node_modules/react-native-zip-archive`)
|
||||
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
|
||||
|
||||
SPEC REPOS:
|
||||
@@ -456,9 +481,12 @@ SPEC REPOS:
|
||||
- QKMRZParser
|
||||
- QKMRZScanner
|
||||
- SocketRocket
|
||||
- SSZipArchive
|
||||
- SwiftyTesseract
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
amplitude-react-native:
|
||||
:path: "../node_modules/@amplitude/analytics-react-native"
|
||||
boost:
|
||||
:podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec"
|
||||
DoubleConversion:
|
||||
@@ -469,8 +497,6 @@ EXTERNAL SOURCES:
|
||||
:path: "../node_modules/react-native/React/FBReactNativeSpec"
|
||||
glog:
|
||||
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
|
||||
MoproKit:
|
||||
:path: "./MoproKit"
|
||||
NFCPassportReader:
|
||||
:commit: 310ecb519655d9ed8b1afc5eb490b2f51a4d3595
|
||||
:git: https://github.com/0xturboblitz/NFCPassportReader.git
|
||||
@@ -504,6 +530,10 @@ EXTERNAL SOURCES:
|
||||
:path: "../node_modules/react-native/ReactCommon/jsinspector"
|
||||
React-logger:
|
||||
:path: "../node_modules/react-native/ReactCommon/logger"
|
||||
react-native-get-random-values:
|
||||
:path: "../node_modules/react-native-get-random-values"
|
||||
react-native-netinfo:
|
||||
:path: "../node_modules/@react-native-community/netinfo"
|
||||
React-NativeModulesApple:
|
||||
:path: "../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios"
|
||||
React-perflogger:
|
||||
@@ -538,10 +568,18 @@ EXTERNAL SOURCES:
|
||||
:path: "../node_modules/react-native/ReactCommon/react/utils"
|
||||
ReactCommon:
|
||||
:path: "../node_modules/react-native/ReactCommon"
|
||||
RNCAsyncStorage:
|
||||
:path: "../node_modules/@react-native-async-storage/async-storage"
|
||||
RNCClipboard:
|
||||
:path: "../node_modules/@react-native-community/clipboard"
|
||||
RNFS:
|
||||
:path: "../node_modules/react-native-fs"
|
||||
RNKeychain:
|
||||
:path: "../node_modules/react-native-keychain"
|
||||
RNSVG:
|
||||
:path: "../node_modules/react-native-svg"
|
||||
RNZipArchive:
|
||||
:path: "../node_modules/react-native-zip-archive"
|
||||
Yoga:
|
||||
:path: "../node_modules/react-native/ReactCommon/yoga"
|
||||
|
||||
@@ -551,13 +589,13 @@ CHECKOUT OPTIONS:
|
||||
:git: https://github.com/0xturboblitz/NFCPassportReader.git
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
amplitude-react-native: 43098dfcfe1dcd6f0e9426017258ba79289d7a21
|
||||
boost: 57d2868c099736d80fcd648bf211b4431e51a558
|
||||
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
|
||||
FBLazyVector: 4cce221dd782d3ff7c4172167bba09d58af67ccb
|
||||
FBReactNativeSpec: c6bd9e179757b3c0ecf815864fae8032377903ef
|
||||
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
|
||||
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
|
||||
MoproKit: d1faf8f9495e8e84d085f6c4e57e36f951e6f07e
|
||||
NFCPassportReader: a160b80e3df3b5325c13902f90405f5eef7520b3
|
||||
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
|
||||
QKMRZParser: 6b419b6f07d6bff6b50429b97de10846dc902c29
|
||||
@@ -577,6 +615,8 @@ SPEC CHECKSUMS:
|
||||
React-jsiexecutor: 2c15ba1bace70177492368d5180b564f165870fd
|
||||
React-jsinspector: b511447170f561157547bc0bef3f169663860be7
|
||||
React-logger: c5b527272d5f22eaa09bb3c3a690fee8f237ae95
|
||||
react-native-get-random-values: 21325b2244dfa6b58878f51f9aa42821e7ba3d06
|
||||
react-native-netinfo: bdb108d340cdb41875c9ced535977cac6d2ff321
|
||||
React-NativeModulesApple: 0438665fc7473be6edc496e823e6ea0b0537b46c
|
||||
React-perflogger: 6bd153e776e6beed54c56b0847e1220a3ff92ba5
|
||||
React-RCTActionSheet: c0b62af44e610e69d9a2049a682f5dba4e9dff17
|
||||
@@ -594,12 +634,17 @@ SPEC CHECKSUMS:
|
||||
React-runtimescheduler: ec1066a4f2d1152eb1bc3fb61d69376b3bc0dde0
|
||||
React-utils: d55ba834beb39f01b0b470ae43478c0a3a024abe
|
||||
ReactCommon: 68e3a815fbb69af3bb4196e04c6ae7abb306e7a8
|
||||
RNCAsyncStorage: 826b603ae9c0f88b5ac4e956801f755109fa4d5c
|
||||
RNCClipboard: 41d8d918092ae8e676f18adada19104fa3e68495
|
||||
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
|
||||
RNKeychain: bfe3d12bf4620fe488771c414530bf16e88f3678
|
||||
RNSVG: 07dbd870b0dcdecc99b3a202fa37c8ca163caec2
|
||||
RNZipArchive: ef9451b849c45a29509bf44e65b788829ab07801
|
||||
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
|
||||
SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef
|
||||
SwiftyTesseract: 1f3d96668ae92dc2208d9842c8a59bea9fad2cbb
|
||||
Yoga: 8796b55dba14d7004f980b54bcc9833ee45b28ce
|
||||
|
||||
PODFILE CHECKSUM: bfa6f6f947d05938da674ddbd61afd65fc7ece34
|
||||
PODFILE CHECKSUM: 2e0fb25883367cd333873ac29cbb9f28ba88c30f
|
||||
|
||||
COCOAPODS: 1.14.3
|
||||
COCOAPODS: 1.15.2
|
||||
|
||||
@@ -2,4 +2,6 @@
|
||||
// Use this file to import your target's public headers that you would like to expose to Swift.
|
||||
//
|
||||
|
||||
#import "React/RCTBridgeModule.h"
|
||||
#include "witnesscalc_register_sha256WithRSAEncryption_65537.h"
|
||||
#include "witnesscalc_disclose.h"
|
||||
#include "groth16_prover.h"
|
||||
|
||||
@@ -7,10 +7,13 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
00E356F31AD99517003FC87E /* ProofOfPassportTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ProofOfPassportTests.m */; };
|
||||
057DFC5F2B56DC0D003D24A3 /* libmopro_ffi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 057DFC5E2B56DC0D003D24A3 /* libmopro_ffi.a */; };
|
||||
05BD9DCC2B548AA900823023 /* MoproKit in Resources */ = {isa = PBXBuildFile; fileRef = 05BD9DCB2B548AA900823023 /* MoproKit */; };
|
||||
05BD9DCE2B554FA300823023 /* libmopro_ffi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 05BD9DCD2B554FA300823023 /* libmopro_ffi.a */; };
|
||||
0569F35B2BBC9015006670BD /* librapidsnark.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0569F35A2BBC900D006670BD /* librapidsnark.a */; };
|
||||
0569F35F2BBC98D5006670BD /* libfq.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0569F35E2BBC98C9006670BD /* libfq.a */; };
|
||||
058516D42BF49B98006A14DA /* libwitnesscalc_disclose.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 058516D32BF49B91006A14DA /* libwitnesscalc_disclose.a */; };
|
||||
058516D52BF49B98006A14DA /* libwitnesscalc_register_sha256WithRSAEncryption_65537.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 058516D22BF49B91006A14DA /* libwitnesscalc_register_sha256WithRSAEncryption_65537.a */; };
|
||||
05D985F52BB331AB00F58EEA /* libgmp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 05D985F22BB331AB00F58EEA /* libgmp.a */; };
|
||||
05D985F62BB331AB00F58EEA /* libfr.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 05D985F32BB331AB00F58EEA /* libfr.a */; };
|
||||
05D985FB2BB3344600F58EEA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 05D985FA2BB3344600F58EEA /* Assets.xcassets */; };
|
||||
05E2174E2E7E48EB80B9C8D8 /* Luciole-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = ABB740B68A8141229E6118AC /* Luciole-Bold.ttf */; };
|
||||
05EDEDC62B52D25D00AA51AD /* Prover.m in Sources */ = {isa = PBXBuildFile; fileRef = 05EDEDC42B52D25D00AA51AD /* Prover.m */; };
|
||||
05EDEDC72B52D25D00AA51AD /* Prover.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05EDEDC52B52D25D00AA51AD /* Prover.swift */; };
|
||||
@@ -65,12 +68,13 @@
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
00E356EE1AD99517003FC87E /* ProofOfPassportTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ProofOfPassportTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
00E356F21AD99517003FC87E /* ProofOfPassportTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ProofOfPassportTests.m; sourceTree = "<group>"; };
|
||||
057DFC5E2B56DC0D003D24A3 /* libmopro_ffi.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmopro_ffi.a; path = MoproKit/Libs/libmopro_ffi.a; sourceTree = "<group>"; };
|
||||
05A0773D2B5333CE0037E489 /* MoproKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = MoproKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
05BD9DCB2B548AA900823023 /* MoproKit */ = {isa = PBXFileReference; lastKnownFileType = folder; path = MoproKit; sourceTree = "<group>"; };
|
||||
05BD9DCD2B554FA300823023 /* libmopro_ffi.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmopro_ffi.a; path = MoproKit/Libs/libmopro_ffi.a; sourceTree = "<group>"; };
|
||||
0569F35A2BBC900D006670BD /* librapidsnark.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = librapidsnark.a; sourceTree = "<group>"; };
|
||||
0569F35E2BBC98C9006670BD /* libfq.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libfq.a; sourceTree = "<group>"; };
|
||||
058516D22BF49B91006A14DA /* libwitnesscalc_register_sha256WithRSAEncryption_65537.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwitnesscalc_register_sha256WithRSAEncryption_65537.a; sourceTree = "<group>"; };
|
||||
058516D32BF49B91006A14DA /* libwitnesscalc_disclose.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwitnesscalc_disclose.a; sourceTree = "<group>"; };
|
||||
05D985F22BB331AB00F58EEA /* libgmp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libgmp.a; sourceTree = "<group>"; };
|
||||
05D985F32BB331AB00F58EEA /* libfr.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libfr.a; sourceTree = "<group>"; };
|
||||
05D985FA2BB3344600F58EEA /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = ProofOfPassport/Assets.xcassets; sourceTree = "<group>"; };
|
||||
05EDEDC42B52D25D00AA51AD /* Prover.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Prover.m; sourceTree = "<group>"; };
|
||||
05EDEDC52B52D25D00AA51AD /* Prover.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Prover.swift; sourceTree = "<group>"; };
|
||||
066DD67BD55B4E90941F2B97 /* Inter-Black.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Inter-Black.otf"; path = "../node_modules/@tamagui/font-inter/otf/Inter-Black.otf"; sourceTree = "<group>"; };
|
||||
@@ -136,32 +140,19 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
058516D52BF49B98006A14DA /* libwitnesscalc_register_sha256WithRSAEncryption_65537.a in Frameworks */,
|
||||
0651723A94C70A2B31E3E4F8 /* Pods_ProofOfPassport.framework in Frameworks */,
|
||||
05BD9DCE2B554FA300823023 /* libmopro_ffi.a in Frameworks */,
|
||||
057DFC5F2B56DC0D003D24A3 /* libmopro_ffi.a in Frameworks */,
|
||||
05D985F52BB331AB00F58EEA /* libgmp.a in Frameworks */,
|
||||
0569F35F2BBC98D5006670BD /* libfq.a in Frameworks */,
|
||||
0569F35B2BBC9015006670BD /* librapidsnark.a in Frameworks */,
|
||||
058516D42BF49B98006A14DA /* libwitnesscalc_disclose.a in Frameworks */,
|
||||
05D985F62BB331AB00F58EEA /* libfr.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
00E356EF1AD99517003FC87E /* ProofOfPassportTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
00E356F21AD99517003FC87E /* ProofOfPassportTests.m */,
|
||||
00E356F01AD99517003FC87E /* Supporting Files */,
|
||||
);
|
||||
path = ProofOfPassportTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
00E356F01AD99517003FC87E /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
00E356F11AD99517003FC87E /* Info.plist */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
13B07FAE1A68108700A75B9A /* ProofOfPassport */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -169,13 +160,13 @@
|
||||
05EDEDC52B52D25D00AA51AD /* Prover.swift */,
|
||||
905B700A2A72A5E900AFA232 /* masterList.pem */,
|
||||
905B70082A729CD400AFA232 /* ProofOfPassport.entitlements */,
|
||||
057DFC5E2B56DC0D003D24A3 /* libmopro_ffi.a */,
|
||||
05D985F32BB331AB00F58EEA /* libfr.a */,
|
||||
05D985FA2BB3344600F58EEA /* Assets.xcassets */,
|
||||
05D985F22BB331AB00F58EEA /* libgmp.a */,
|
||||
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
|
||||
05BD9DCB2B548AA900823023 /* MoproKit */,
|
||||
13B07FB01A68108700A75B9A /* AppDelegate.mm */,
|
||||
13B07FB51A68108700A75B9A /* Images.xcassets */,
|
||||
13B07FB61A68108700A75B9A /* Info.plist */,
|
||||
05BD9DCD2B554FA300823023 /* libmopro_ffi.a */,
|
||||
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
|
||||
13B07FB71A68108700A75B9A /* main.m */,
|
||||
905B70042A72767900AFA232 /* PassportReader.swift */,
|
||||
@@ -192,7 +183,10 @@
|
||||
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
05A0773D2B5333CE0037E489 /* MoproKit.framework */,
|
||||
058516D32BF49B91006A14DA /* libwitnesscalc_disclose.a */,
|
||||
058516D22BF49B91006A14DA /* libwitnesscalc_register_sha256WithRSAEncryption_65537.a */,
|
||||
0569F35E2BBC98C9006670BD /* libfq.a */,
|
||||
0569F35A2BBC900D006670BD /* librapidsnark.a */,
|
||||
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
|
||||
3DAAF621B99F62C9ED35AA07 /* Pods_ProofOfPassport.framework */,
|
||||
CFAE0EE7E1942128592D0CC4 /* Pods_ProofOfPassport_ProofOfPassportTests.framework */,
|
||||
@@ -244,7 +238,6 @@
|
||||
children = (
|
||||
13B07FAE1A68108700A75B9A /* ProofOfPassport */,
|
||||
832341AE1AAA6A7D00B99B32 /* Libraries */,
|
||||
00E356EF1AD99517003FC87E /* ProofOfPassportTests */,
|
||||
83CBBA001A601CBA00E9B192 /* Products */,
|
||||
2D16E6871FA4F8E400B85C8A /* Frameworks */,
|
||||
BBD78D7AC51CEA395F1C20DB /* Pods */,
|
||||
@@ -325,7 +318,7 @@
|
||||
83CBB9F71A601CBA00E9B192 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1210;
|
||||
LastUpgradeCheck = 1520;
|
||||
TargetAttributes = {
|
||||
00E356ED1AD99517003FC87E = {
|
||||
CreatedOnToolsVersion = 6.2;
|
||||
@@ -368,7 +361,6 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
905B700B2A72A5E900AFA232 /* masterList.pem in Resources */,
|
||||
05BD9DCC2B548AA900823023 /* MoproKit in Resources */,
|
||||
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
|
||||
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
|
||||
2FA7C90AFAF5417DAA7BCB1E /* Inter-Black.otf in Resources */,
|
||||
@@ -377,6 +369,7 @@
|
||||
1D2A11340C7041909B820A90 /* Inter-ExtraBold.otf in Resources */,
|
||||
E4BC7CC193684992A11E3135 /* Inter-ExtraBoldItalic.otf in Resources */,
|
||||
1BA25F26C91C45F697D55099 /* Inter-ExtraLight.otf in Resources */,
|
||||
05D985FB2BB3344600F58EEA /* Assets.xcassets in Resources */,
|
||||
625D35EA2F1643E89F9887CE /* Inter-ExtraLightItalic.otf in Resources */,
|
||||
EEC491DF41A44001A577E8C5 /* Inter-Italic.otf in Resources */,
|
||||
0A6918EB0654476189741475 /* Inter-Light.otf in Resources */,
|
||||
@@ -522,7 +515,6 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
00E356F31AD99517003FC87E /* ProofOfPassportTests.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -616,9 +608,105 @@
|
||||
CODE_SIGN_ENTITLEMENTS = ProofOfPassport/ProofOfPassport.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
CURRENT_PROJECT_VERSION = 44;
|
||||
DEVELOPMENT_TEAM = 5B29R5LYHQ;
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/DoubleConversion\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/MoproKit\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/NFCPassportReader\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/QKMRZParser\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/QKMRZScanner\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/RCT-Folly\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/RCTTypeSafety\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/RNCClipboard\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/RNSVG\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-Core\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-CoreModules\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTAnimation\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTAppDelegate\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTBlob\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTImage\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTLinking\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTNetwork\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTSettings\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTText\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTVibration\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-cxxreact\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-jsc\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-jsi\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-jsiexecutor\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-jsinspector\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-logger\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-perflogger\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimescheduler\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-utils\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/SocketRocket\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/SwiftyTesseract\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/Yoga\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/fmt\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/glog\"",
|
||||
"\"${PODS_ROOT}/OpenSSL-Universal/Frameworks\"",
|
||||
"\"${PODS_ROOT}/SwiftyTesseract/SwiftyTesseract\"",
|
||||
"\"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal\"",
|
||||
"\"${PODS_XCFRAMEWORKS_BUILD_DIR}/SwiftyTesseract\"",
|
||||
"$(PROJECT_DIR)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/DoubleConversion/DoubleConversion.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/MoproKit/MoproKit.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/NFCPassportReader/NFCPassportReader.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/QKMRZParser/QKMRZParser.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/QKMRZScanner/QKMRZScanner.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/RCT-Folly/folly.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/RCTTypeSafety/RCTTypeSafety.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/RNCClipboard/RNCClipboard.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/RNSVG/RNSVG.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/React.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-CoreModules/CoreModules.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTAnimation/RCTAnimation.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTAppDelegate/React_RCTAppDelegate.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTBlob/RCTBlob.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTImage/RCTImage.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTLinking/RCTLinking.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTNetwork/RCTNetwork.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTSettings/RCTSettings.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTText/RCTText.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTVibration/RCTVibration.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-cxxreact/cxxreact.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-jsc/React_jsc.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-jsi/jsi.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-jsiexecutor/jsireact.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-jsinspector/jsinspector.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-logger/logger.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-perflogger/reactperflogger.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimescheduler/React_runtimescheduler.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/SocketRocket/SocketRocket.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/SwiftyTesseract/SwiftyTesseract.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/Yoga/yoga.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/fmt/fmt.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/glog/glog.framework/Headers\"",
|
||||
"\"${PODS_ROOT}/Headers/Public\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/FBLazyVector\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/RCTRequired\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/React-callinvoker\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/React-runtimeexecutor\"",
|
||||
"\"$(PODS_ROOT)/DoubleConversion\"",
|
||||
"\"$(PODS_ROOT)/boost\"",
|
||||
"\"$(PODS_ROOT)/Headers/Private/React-Core\"",
|
||||
"$(PROJECT_DIR)",
|
||||
);
|
||||
INFOPLIST_FILE = ProofOfPassport/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
@@ -641,6 +729,7 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.warroom.proofofpassport;
|
||||
PRODUCT_NAME = ProofOfPassport;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/ProofOfPassport-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
@@ -654,8 +743,104 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = ProofOfPassport/ProofOfPassport.entitlements;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
CURRENT_PROJECT_VERSION = 44;
|
||||
DEVELOPMENT_TEAM = 5B29R5LYHQ;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/DoubleConversion\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/MoproKit\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/NFCPassportReader\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/QKMRZParser\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/QKMRZScanner\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/RCT-Folly\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/RCTTypeSafety\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/RNCClipboard\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/RNSVG\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-Core\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-CoreModules\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTAnimation\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTAppDelegate\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTBlob\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTImage\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTLinking\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTNetwork\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTSettings\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTText\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTVibration\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-cxxreact\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-jsc\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-jsi\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-jsiexecutor\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-jsinspector\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-logger\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-perflogger\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimescheduler\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-utils\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/SocketRocket\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/SwiftyTesseract\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/Yoga\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/fmt\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/glog\"",
|
||||
"\"${PODS_ROOT}/OpenSSL-Universal/Frameworks\"",
|
||||
"\"${PODS_ROOT}/SwiftyTesseract/SwiftyTesseract\"",
|
||||
"\"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal\"",
|
||||
"\"${PODS_XCFRAMEWORKS_BUILD_DIR}/SwiftyTesseract\"",
|
||||
"$(PROJECT_DIR)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/DoubleConversion/DoubleConversion.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/MoproKit/MoproKit.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/NFCPassportReader/NFCPassportReader.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/QKMRZParser/QKMRZParser.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/QKMRZScanner/QKMRZScanner.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/RCT-Folly/folly.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/RCTTypeSafety/RCTTypeSafety.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/RNCClipboard/RNCClipboard.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/RNSVG/RNSVG.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/React.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-CoreModules/CoreModules.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTAnimation/RCTAnimation.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTAppDelegate/React_RCTAppDelegate.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTBlob/RCTBlob.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTImage/RCTImage.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTLinking/RCTLinking.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTNetwork/RCTNetwork.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTSettings/RCTSettings.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTText/RCTText.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTVibration/RCTVibration.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-cxxreact/cxxreact.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-jsc/React_jsc.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-jsi/jsi.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-jsiexecutor/jsireact.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-jsinspector/jsinspector.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-logger/logger.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-perflogger/reactperflogger.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimescheduler/React_runtimescheduler.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/SocketRocket/SocketRocket.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/SwiftyTesseract/SwiftyTesseract.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/Yoga/yoga.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/fmt/fmt.framework/Headers\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/glog/glog.framework/Headers\"",
|
||||
"\"${PODS_ROOT}/Headers/Public\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/FBLazyVector\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/RCTRequired\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/React-callinvoker\"",
|
||||
"\"${PODS_ROOT}/Headers/Public/React-runtimeexecutor\"",
|
||||
"\"$(PODS_ROOT)/DoubleConversion\"",
|
||||
"\"$(PODS_ROOT)/boost\"",
|
||||
"\"$(PODS_ROOT)/Headers/Private/React-Core\"",
|
||||
"$(PROJECT_DIR)",
|
||||
);
|
||||
INFOPLIST_FILE = ProofOfPassport/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
@@ -676,6 +861,7 @@
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.warroom.proofofpassport;
|
||||
PRODUCT_NAME = ProofOfPassport;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/ProofOfPassport-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"data" : [
|
||||
{
|
||||
"filename" : "disclose.dat",
|
||||
"idiom" : "universal",
|
||||
"universal-type-identifier" : "dyn.ah62d4rv4ge80k2py"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"data" : [
|
||||
{
|
||||
"filename" : "register_sha256WithRSAEncryption_65537.dat",
|
||||
"idiom" : "universal",
|
||||
"universal-type-identifier" : "dyn.ah62d4rv4ge80k2py"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 295 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 722 B |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 948 B |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 25 KiB |