mirror of
https://github.com/selfxyz/self.git
synced 2026-01-22 13:08:05 -05:00
calculating multiplier circuit witness
This commit is contained in:
27
app/App.tsx
27
app/App.tsx
@@ -75,18 +75,27 @@ function App(): JSX.Element {
|
||||
async function init() {
|
||||
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||
console.log('launching init')
|
||||
const res = await NativeModules.Prover.runInitAction()
|
||||
// const res = await NativeModules.Prover.runInitAction()
|
||||
console.log('init done')
|
||||
console.log('init res', res)
|
||||
// console.log('init res', res)
|
||||
}
|
||||
|
||||
const handleStartCameraScan = () => {
|
||||
startCameraScan({
|
||||
setPassportNumber,
|
||||
setDateOfBirth,
|
||||
setDateOfExpiry,
|
||||
setStep,
|
||||
});
|
||||
const handleStartCameraScan = async () => {
|
||||
// await NativeModules.Prover.runInitAction();
|
||||
|
||||
const startTime = Date.now();
|
||||
console.log('running mopro prove action');
|
||||
const response = await NativeModules.Prover.runProveAction({});
|
||||
console.log('proof response:', response);
|
||||
const endTime = Date.now();
|
||||
console.log('Total proof time from frontend:', endTime - startTime);
|
||||
|
||||
// startCameraScan({
|
||||
// setPassportNumber,
|
||||
// setDateOfBirth,
|
||||
// setDateOfExpiry,
|
||||
// setStep,
|
||||
// });
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
// Use this file to import your target's public headers that you would like to expose to Swift.
|
||||
//
|
||||
|
||||
#import "React/RCTBridgeModule.h"
|
||||
#include "witnesscalc_authV2.h"
|
||||
|
||||
@@ -8,10 +8,17 @@
|
||||
|
||||
/* 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 */; };
|
||||
056247BA2BB26D4400FFBD3B /* Contents.json in Resources */ = {isa = PBXBuildFile; fileRef = 056247B82BB26D4400FFBD3B /* Contents.json */; };
|
||||
056247BB2BB26D4400FFBD3B /* authV2.dat in Resources */ = {isa = PBXBuildFile; fileRef = 056247B92BB26D4400FFBD3B /* authV2.dat */; };
|
||||
05BD9DCC2B548AA900823023 /* MoproKit in Resources */ = {isa = PBXBuildFile; fileRef = 05BD9DCB2B548AA900823023 /* MoproKit */; };
|
||||
05BD9DCE2B554FA300823023 /* libmopro_ffi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 05BD9DCD2B554FA300823023 /* libmopro_ffi.a */; };
|
||||
05D985F52BB331AB00F58EEA /* libgmp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 05D985F22BB331AB00F58EEA /* libgmp.a */; };
|
||||
05D985F62BB331AB00F58EEA /* libfr.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 05D985F32BB331AB00F58EEA /* libfr.a */; };
|
||||
05D985F72BB331AB00F58EEA /* libfq.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 05D985F42BB331AB00F58EEA /* libfq.a */; };
|
||||
05D985F92BB3335B00F58EEA /* authV2.dat in Resources */ = {isa = PBXBuildFile; fileRef = 05D985F82BB3335B00F58EEA /* authV2.dat */; };
|
||||
05D985FB2BB3344600F58EEA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 05D985FA2BB3344600F58EEA /* Assets.xcassets */; };
|
||||
05E2174E2E7E48EB80B9C8D8 /* Luciole-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = ABB740B68A8141229E6118AC /* Luciole-Bold.ttf */; };
|
||||
05E439192BB32D5800E57227 /* libwitnesscalc_authV2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 056247BD2BB328C800FFBD3B /* libwitnesscalc_authV2.a */; };
|
||||
05EDEDC62B52D25D00AA51AD /* Prover.m in Sources */ = {isa = PBXBuildFile; fileRef = 05EDEDC42B52D25D00AA51AD /* Prover.m */; };
|
||||
05EDEDC72B52D25D00AA51AD /* Prover.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05EDEDC52B52D25D00AA51AD /* Prover.swift */; };
|
||||
0651723A94C70A2B31E3E4F8 /* Pods_ProofOfPassport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAAF621B99F62C9ED35AA07 /* Pods_ProofOfPassport.framework */; };
|
||||
@@ -67,10 +74,18 @@
|
||||
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>"; };
|
||||
056247B82BB26D4400FFBD3B /* Contents.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = Contents.json; sourceTree = "<group>"; };
|
||||
056247B92BB26D4400FFBD3B /* authV2.dat */ = {isa = PBXFileReference; lastKnownFileType = file; path = authV2.dat; sourceTree = "<group>"; };
|
||||
056247BD2BB328C800FFBD3B /* libwitnesscalc_authV2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwitnesscalc_authV2.a; 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>"; };
|
||||
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>"; };
|
||||
05D985F42BB331AB00F58EEA /* libfq.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libfq.a; sourceTree = "<group>"; };
|
||||
05D985F82BB3335B00F58EEA /* authV2.dat */ = {isa = PBXFileReference; lastKnownFileType = file; name = authV2.dat; path = ProofOfPassport/Assets.xcassets/authV2.dat.dataset/authV2.dat; 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,9 +151,12 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
05D985F72BB331AB00F58EEA /* libfq.a in Frameworks */,
|
||||
05E439192BB32D5800E57227 /* libwitnesscalc_authV2.a in Frameworks */,
|
||||
0651723A94C70A2B31E3E4F8 /* Pods_ProofOfPassport.framework in Frameworks */,
|
||||
05D985F52BB331AB00F58EEA /* libgmp.a in Frameworks */,
|
||||
05BD9DCE2B554FA300823023 /* libmopro_ffi.a in Frameworks */,
|
||||
057DFC5F2B56DC0D003D24A3 /* libmopro_ffi.a in Frameworks */,
|
||||
05D985F62BB331AB00F58EEA /* libfr.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -162,6 +180,16 @@
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
056247B72BB26D4400FFBD3B /* authV2.dat.dataset */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
056247B82BB26D4400FFBD3B /* Contents.json */,
|
||||
056247B92BB26D4400FFBD3B /* authV2.dat */,
|
||||
);
|
||||
name = authV2.dat.dataset;
|
||||
path = ProofOfPassport/Assets.xcassets/authV2.dat.dataset;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
13B07FAE1A68108700A75B9A /* ProofOfPassport */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -169,7 +197,13 @@
|
||||
05EDEDC52B52D25D00AA51AD /* Prover.swift */,
|
||||
905B700A2A72A5E900AFA232 /* masterList.pem */,
|
||||
905B70082A729CD400AFA232 /* ProofOfPassport.entitlements */,
|
||||
05D985F42BB331AB00F58EEA /* libfq.a */,
|
||||
05D985F32BB331AB00F58EEA /* libfr.a */,
|
||||
05D985F82BB3335B00F58EEA /* authV2.dat */,
|
||||
05D985FA2BB3344600F58EEA /* Assets.xcassets */,
|
||||
05D985F22BB331AB00F58EEA /* libgmp.a */,
|
||||
057DFC5E2B56DC0D003D24A3 /* libmopro_ffi.a */,
|
||||
056247B72BB26D4400FFBD3B /* authV2.dat.dataset */,
|
||||
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
|
||||
05BD9DCB2B548AA900823023 /* MoproKit */,
|
||||
13B07FB01A68108700A75B9A /* AppDelegate.mm */,
|
||||
@@ -180,6 +214,7 @@
|
||||
13B07FB71A68108700A75B9A /* main.m */,
|
||||
905B70042A72767900AFA232 /* PassportReader.swift */,
|
||||
905B70032A72767800AFA232 /* ProofOfPassport-Bridging-Header.h */,
|
||||
056247BD2BB328C800FFBD3B /* libwitnesscalc_authV2.a */,
|
||||
165E76C22B8DC8370000FA90 /* ScannerHostingController.swift */,
|
||||
905B70062A72774000AFA232 /* PassportReader.m */,
|
||||
165E76BC2B8DC4A00000FA90 /* MRZScannerModule.swift */,
|
||||
@@ -325,7 +360,7 @@
|
||||
83CBB9F71A601CBA00E9B192 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1210;
|
||||
LastUpgradeCheck = 1520;
|
||||
TargetAttributes = {
|
||||
00E356ED1AD99517003FC87E = {
|
||||
CreatedOnToolsVersion = 6.2;
|
||||
@@ -367,16 +402,20 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
056247BB2BB26D4400FFBD3B /* authV2.dat in Resources */,
|
||||
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 */,
|
||||
056247BA2BB26D4400FFBD3B /* Contents.json in Resources */,
|
||||
C9B733B168F84BBA818C6CB8 /* Inter-BlackItalic.otf in Resources */,
|
||||
15AAF7651FCF40EB993543A3 /* Inter-BoldItalic.otf in Resources */,
|
||||
1D2A11340C7041909B820A90 /* Inter-ExtraBold.otf in Resources */,
|
||||
E4BC7CC193684992A11E3135 /* Inter-ExtraBoldItalic.otf in Resources */,
|
||||
05D985F92BB3335B00F58EEA /* authV2.dat 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 */,
|
||||
@@ -619,6 +658,102 @@
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
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 +776,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";
|
||||
@@ -656,6 +792,102 @@
|
||||
CODE_SIGN_ENTITLEMENTS = ProofOfPassport/ProofOfPassport.entitlements;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
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 +908,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" : "authV2.dat",
|
||||
"idiom" : "universal",
|
||||
"universal-type-identifier" : "dyn.ah62d4rv4ge80k2py"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -10,6 +10,10 @@ import React
|
||||
import Security
|
||||
import MoproKit
|
||||
|
||||
#if canImport(witnesscalc_authV2)
|
||||
import witnesscalc_authV2
|
||||
#endif
|
||||
|
||||
@available(iOS 15, *)
|
||||
@objc(Prover)
|
||||
class Prover: NSObject {
|
||||
@@ -69,42 +73,49 @@ class Prover: NSObject {
|
||||
// inputs["pubkey"] = pubkey;
|
||||
// inputs["address"] = address;
|
||||
|
||||
print(inputs)
|
||||
let inputsDict = ["a": "2", "b": "4"]
|
||||
let inputsMul = try! JSONEncoder().encode(inputsDict)
|
||||
print("inputsMul size: \(inputsMul.count) bytes")
|
||||
print("inputsMul data: \(String(data: inputsMul, encoding: .utf8) ?? "")")
|
||||
|
||||
let start = CFAbsoluteTimeGetCurrent()
|
||||
|
||||
// Generate Proof
|
||||
let generateProofResult = try generateProof2(circuitInputs: inputs)
|
||||
assert(!generateProofResult.proof.isEmpty, "Proof should not be empty")
|
||||
let wtns = try! calcWtnsAuthV2(inputsJson: inputsMul)
|
||||
print("wtns size: \(wtns.count) bytes")
|
||||
print("wtns data (hex): \(wtns.map { String(format: "%02hhx", $0) }.joined())")
|
||||
|
||||
// Record end time and compute duration
|
||||
let end = CFAbsoluteTimeGetCurrent()
|
||||
let timeTaken = end - start
|
||||
print("Proof generation took \(timeTaken) seconds.")
|
||||
// // Generate Proof
|
||||
// let generateProofResult = try generateProof2(circuitInputs: inputs)
|
||||
// assert(!generateProofResult.proof.isEmpty, "Proof should not be empty")
|
||||
|
||||
// Store the generated proof and public inputs for later verification
|
||||
print("generateProofResult", generateProofResult)
|
||||
generatedProof = generateProofResult.proof
|
||||
publicInputs = generateProofResult.inputs
|
||||
// // Record end time and compute duration
|
||||
// let end = CFAbsoluteTimeGetCurrent()
|
||||
// let timeTaken = end - start
|
||||
// print("Proof generation took \(timeTaken) seconds.")
|
||||
|
||||
// Convert Data to array of bytes
|
||||
let proofBytes = [UInt8](generateProofResult.proof)
|
||||
let inputsBytes = [UInt8](generateProofResult.inputs)
|
||||
// // Store the generated proof and public inputs for later verification
|
||||
// print("generateProofResult", generateProofResult)
|
||||
// generatedProof = generateProofResult.proof
|
||||
// publicInputs = generateProofResult.inputs
|
||||
|
||||
print("proofBytes", proofBytes)
|
||||
print("inputsBytes", inputsBytes)
|
||||
// // Convert Data to array of bytes
|
||||
// let proofBytes = [UInt8](generateProofResult.proof)
|
||||
// let inputsBytes = [UInt8](generateProofResult.inputs)
|
||||
|
||||
// Create a dictionary with byte arrays
|
||||
let resultDict: [String: [UInt8]] = [
|
||||
"proof": proofBytes,
|
||||
"inputs": inputsBytes
|
||||
]
|
||||
// print("proofBytes", proofBytes)
|
||||
// print("inputsBytes", inputsBytes)
|
||||
|
||||
// Serialize dictionary to JSON
|
||||
let jsonData = try JSONSerialization.data(withJSONObject: resultDict, options: [])
|
||||
let jsonString = String(data: jsonData, encoding: .utf8)!
|
||||
// // Create a dictionary with byte arrays
|
||||
// let resultDict: [String: [UInt8]] = [
|
||||
// "proof": proofBytes,
|
||||
// "inputs": inputsBytes
|
||||
// ]
|
||||
|
||||
resolve(jsonString)
|
||||
// // Serialize dictionary to JSON
|
||||
// let jsonData = try JSONSerialization.data(withJSONObject: resultDict, options: [])
|
||||
// let jsonString = String(data: jsonData, encoding: .utf8)!
|
||||
|
||||
// resolve(jsonString)
|
||||
} catch let error as MoproError {
|
||||
print("MoproError: \(error)")
|
||||
reject("PROVER", "An error occurred during proof generation", error)
|
||||
@@ -138,3 +149,47 @@ class Prover: NSObject {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public func calcWtnsAuthV2(inputsJson: Data) throws -> Data {
|
||||
let dat = NSDataAsset(name: "authV2.dat")!.data
|
||||
return try _calcWtnsAuthV2(dat: dat, jsonData: inputsJson)
|
||||
}
|
||||
|
||||
enum WitnessCalculationError: Error {
|
||||
case error(String)
|
||||
case shortBuffer(requiredSize: UInt)
|
||||
}
|
||||
|
||||
private func _calcWtnsAuthV2(dat: Data, jsonData: Data) throws -> Data {
|
||||
let datSize = UInt(dat.count)
|
||||
let jsonDataSize = UInt(jsonData.count)
|
||||
|
||||
let errorSize = UInt(256);
|
||||
|
||||
let wtnsSize = UnsafeMutablePointer<UInt>.allocate(capacity: Int(1));
|
||||
wtnsSize.initialize(to: UInt(100 * 1024 * 1024 ))
|
||||
|
||||
let wtnsBuffer = UnsafeMutablePointer<UInt8>.allocate(capacity: (100 * 1024 * 1024))
|
||||
let errorBuffer = UnsafeMutablePointer<UInt8>.allocate(capacity: Int(errorSize))
|
||||
|
||||
let result = witnesscalc_authV2(
|
||||
(dat as NSData).bytes, datSize,
|
||||
(jsonData as NSData).bytes, jsonDataSize,
|
||||
wtnsBuffer, wtnsSize,
|
||||
errorBuffer, errorSize
|
||||
)
|
||||
|
||||
if result == WITNESSCALC_ERROR {
|
||||
let errorMessage = String(bytes: Data(bytes: errorBuffer, count: Int(errorSize)), encoding: .utf8)!
|
||||
.replacingOccurrences(of: "\0", with: "")
|
||||
throw WitnessCalculationError.error(errorMessage)
|
||||
}
|
||||
|
||||
if result == WITNESSCALC_ERROR_SHORT_BUFFER {
|
||||
throw WitnessCalculationError.shortBuffer(requiredSize: wtnsSize.pointee)
|
||||
}
|
||||
|
||||
return Data(bytes: wtnsBuffer, count: Int(wtnsSize.pointee))
|
||||
}
|
||||
|
||||
|
||||
BIN
app/ios/authV2.dat
Normal file
BIN
app/ios/authV2.dat
Normal file
Binary file not shown.
BIN
app/ios/libfq.a
Normal file
BIN
app/ios/libfq.a
Normal file
Binary file not shown.
BIN
app/ios/libfr.a
Normal file
BIN
app/ios/libfr.a
Normal file
Binary file not shown.
BIN
app/ios/libgmp.a
Normal file
BIN
app/ios/libgmp.a
Normal file
Binary file not shown.
BIN
app/ios/libwitnesscalc_authV2.a
Normal file
BIN
app/ios/libwitnesscalc_authV2.a
Normal file
Binary file not shown.
41
app/ios/witnesscalc_authV2.h
Normal file
41
app/ios/witnesscalc_authV2.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef WITNESSCALC_AUTHV2_H
|
||||
#define WITNESSCALC_AUTHV2_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_authV2(
|
||||
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 // WITNESSCALC_AUTHV2_H
|
||||
|
||||
|
||||
#endif // WITNESSCALC_AUTHV2_H
|
||||
@@ -34,6 +34,9 @@ describe('Circuit tests', function () {
|
||||
);
|
||||
|
||||
console.log('inputs', inputs)
|
||||
const inputsFilePath = path.join(__dirname, './inputs.json');
|
||||
fs.writeFileSync(inputsFilePath, JSON.stringify(inputs, null, 2));
|
||||
console.log(`Inputs written to file: ${inputsFilePath}`);
|
||||
})
|
||||
|
||||
describe('Proof', function () {
|
||||
|
||||
Reference in New Issue
Block a user