From eb8882050712e6bcba93f02a0930578d18de3580 Mon Sep 17 00:00:00 2001 From: Yaroslav Moria <5eeman@users.noreply.github.com> Date: Mon, 9 Sep 2024 12:32:34 +0200 Subject: [PATCH] Updated example dependencies. Fixes. --- Example/Podfile.lock | 2 +- .../Local Podspecs/rapidsnark.podspec.json | 10 +---- Example/Pods/Manifest.lock | 2 +- Example/Pods/Pods.xcodeproj/project.pbxproj | 15 +++---- .../rapidsnark/rapidsnark-xcframeworks.sh | 16 ++++---- Example/rapidsnark.xcodeproj/project.pbxproj | 8 ---- .../rapidsnark_Example-Bridging-Header.h | 1 - Example/rapidsnark/witness_calc.h | 17 -------- Example/rapidsnark/witness_calc.m | 40 ------------------- 9 files changed, 20 insertions(+), 91 deletions(-) delete mode 100644 Example/rapidsnark/witness_calc.h delete mode 100644 Example/rapidsnark/witness_calc.m diff --git a/Example/Podfile.lock b/Example/Podfile.lock index e9e1e7d..3877afc 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -13,7 +13,7 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - rapidsnark: 710c019bf8e269e371220a71ebc449487ee04448 + rapidsnark: 4e70fa2f70e3b0846a0c1bf94a635113f261ada9 PODFILE CHECKSUM: 96331fd92ed9651d0ec43feadad116a15c20e7c7 diff --git a/Example/Pods/Local Podspecs/rapidsnark.podspec.json b/Example/Pods/Local Podspecs/rapidsnark.podspec.json index ed48012..1e29a38 100644 --- a/Example/Pods/Local Podspecs/rapidsnark.podspec.json +++ b/Example/Pods/Local Podspecs/rapidsnark.podspec.json @@ -34,15 +34,9 @@ { "name": "C", "source_files": "Sources/C/**/*", - "vendored_frameworks": [ - "Libs/Rapidsnark.xcframework", - "Libs/libwitness.xcframework" - ], + "vendored_frameworks": "Libs/Rapidsnark.xcframework", "ios": { - "vendored_frameworks": [ - "Libs/Rapidsnark.xcframework", - "Libs/libwitness.xcframework" - ] + "vendored_frameworks": "Libs/Rapidsnark.xcframework" } }, { diff --git a/Example/Pods/Manifest.lock b/Example/Pods/Manifest.lock index e9e1e7d..3877afc 100644 --- a/Example/Pods/Manifest.lock +++ b/Example/Pods/Manifest.lock @@ -13,7 +13,7 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - rapidsnark: 710c019bf8e269e371220a71ebc449487ee04448 + rapidsnark: 4e70fa2f70e3b0846a0c1bf94a635113f261ada9 PODFILE CHECKSUM: 96331fd92ed9651d0ec43feadad116a15c20e7c7 diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index eb5d96a..b6a98ba 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -41,11 +41,11 @@ /* Begin PBXFileReference section */ 0B1CC5558D5F46D78AD249BB36D5CE9D /* rapidsnark-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "rapidsnark-umbrella.h"; sourceTree = ""; }; - 0D3EBEEDB5781BAA504937D0CE54CE9C /* rapidsnark.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; path = rapidsnark.podspec; sourceTree = ""; tabWidth = 2; }; + 0D3EBEEDB5781BAA504937D0CE54CE9C /* rapidsnark.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; path = rapidsnark.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 1D5899759DF610C2AF6977162817A5D1 /* rapidsnark-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "rapidsnark-prefix.pch"; sourceTree = ""; }; 1FFFFEB8E9CA0EB9B095451F5E8A8111 /* C-Bridging-Header.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "C-Bridging-Header.h"; sourceTree = ""; }; 2EDF728739FE44D99A01A1007D11AD38 /* Pods-rapidsnark_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-rapidsnark_Example.debug.xcconfig"; sourceTree = ""; }; - 3297154E96442E4AF9B3E1BCCA82FD24 /* rapidsnark_bridge.c */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.c; name = rapidsnark_bridge.c; path = Sources/C/rapidsnark_bridge.c; sourceTree = ""; }; + 3297154E96442E4AF9B3E1BCCA82FD24 /* rapidsnark_bridge.c */ = {isa = PBXFileReference; includeInIndex = 1; name = rapidsnark_bridge.c; path = Sources/C/rapidsnark_bridge.c; sourceTree = ""; }; 3393ACECE2DF5C09AB9A11B1C3ACAF41 /* rapidsnark-xcframeworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "rapidsnark-xcframeworks.sh"; sourceTree = ""; }; 568B79C12BD0EBB3CF7CF37C17DACEB8 /* Pods-rapidsnark_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-rapidsnark_Example.release.xcconfig"; sourceTree = ""; }; 56F740B89351C287F2EA40972DE4BBA6 /* Pods-rapidsnark_Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-rapidsnark_Example.modulemap"; sourceTree = ""; }; @@ -62,21 +62,21 @@ 94EDAAF05D5B9E35186735040941C164 /* rapidsnark-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "rapidsnark-Info.plist"; sourceTree = ""; }; 9CB6D6DFA7C222ABB045C55F31C39A8A /* Pods-rapidsnark_Tests-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-rapidsnark_Tests-Info.plist"; sourceTree = ""; }; 9CD1D239AE74110D078D41C1D444BB83 /* rapidsnark.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = rapidsnark.swift; path = Sources/rapidsnark/rapidsnark.swift; sourceTree = ""; }; - 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; A569A10243CAE1F40C87BDEB37AEA6DD /* Pods-rapidsnark_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-rapidsnark_Example-acknowledgements.markdown"; sourceTree = ""; }; A6624F195D257917C9DC5513A950CCD4 /* Pods-rapidsnark_Tests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-rapidsnark_Tests-dummy.m"; sourceTree = ""; }; AC25AFE96E0A75769DA9985299899A2D /* Pods-rapidsnark_Tests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-rapidsnark_Tests-umbrella.h"; sourceTree = ""; }; B8A0BB562FF061F3FFC8098C8D0ED60C /* rapidsnark.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = rapidsnark.debug.xcconfig; sourceTree = ""; }; - B95D4AFC4856E615D8EEC695079A3B38 /* Rapidsnark.xcframework */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = wrapper.xcframework; name = Rapidsnark.xcframework; path = Libs/Rapidsnark.xcframework; sourceTree = ""; }; + B95D4AFC4856E615D8EEC695079A3B38 /* Rapidsnark.xcframework */ = {isa = PBXFileReference; includeInIndex = 1; name = Rapidsnark.xcframework; path = Libs/Rapidsnark.xcframework; sourceTree = ""; }; BAF36CCA8B685373C065E139387D93D5 /* rapidsnark-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "rapidsnark-dummy.m"; sourceTree = ""; }; C228B39DD808FB1161112BC129BAE3A3 /* Pods-rapidsnark_Example */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = "Pods-rapidsnark_Example"; path = Pods_rapidsnark_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C43D58E0CF2728E7C99EB0E2B8F21759 /* Pods-rapidsnark_Tests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-rapidsnark_Tests-acknowledgements.markdown"; sourceTree = ""; }; C5A404E75F23017CF4FA6F1FA1869528 /* rapidsnark.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = rapidsnark.modulemap; sourceTree = ""; }; CD43A66DA02D309D968DE3798B032584 /* Pods-rapidsnark_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-rapidsnark_Tests.release.xcconfig"; sourceTree = ""; }; DBCB6FAAEAF31C1C9293C55B59985662 /* Pods-rapidsnark_Tests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-rapidsnark_Tests-acknowledgements.plist"; sourceTree = ""; }; - E29CEB80F7252DF46D7F8190BDB238F2 /* COPYING */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = COPYING; sourceTree = ""; }; + E29CEB80F7252DF46D7F8190BDB238F2 /* COPYING */ = {isa = PBXFileReference; includeInIndex = 1; path = COPYING; sourceTree = ""; }; E63A7C92FEF387690050BCAE08EB485A /* Pods-rapidsnark_Tests */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = "Pods-rapidsnark_Tests"; path = Pods_rapidsnark_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - EB738F80AFF922D4873ADF570EFE968F /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; + EB738F80AFF922D4873ADF570EFE968F /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; path = README.md; sourceTree = ""; }; F2B63BA11319EDB5D68EA4E939729D0A /* Pods-rapidsnark_Tests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-rapidsnark_Tests.modulemap"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -733,7 +733,8 @@ MTL_FAST_MATH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; STRIP_INSTALLED_PRODUCT = NO; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; SYMROOT = "${SRCROOT}/../build"; }; diff --git a/Example/Pods/Target Support Files/rapidsnark/rapidsnark-xcframeworks.sh b/Example/Pods/Target Support Files/rapidsnark/rapidsnark-xcframeworks.sh index c9ff89c..b65d44c 100755 --- a/Example/Pods/Target Support Files/rapidsnark/rapidsnark-xcframeworks.sh +++ b/Example/Pods/Target Support Files/rapidsnark/rapidsnark-xcframeworks.sh @@ -17,23 +17,23 @@ RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") variant_for_slice() { case "$1" in - "Rapidsnark.xcframework/ios-arm64-simulator") - echo "simulator" - ;; - "Rapidsnark.xcframework/ios-arm64_arm64e") + "Rapidsnark.xcframework/ios-arm64") echo "" ;; + "Rapidsnark.xcframework/ios-arm64_arm64e_x86_64-simulator") + echo "simulator" + ;; esac } archs_for_slice() { case "$1" in - "Rapidsnark.xcframework/ios-arm64-simulator") + "Rapidsnark.xcframework/ios-arm64") echo "arm64" ;; - "Rapidsnark.xcframework/ios-arm64_arm64e") - echo "arm64 arm64e" + "Rapidsnark.xcframework/ios-arm64_arm64e_x86_64-simulator") + echo "arm64 arm64e x86_64" ;; esac } @@ -117,5 +117,5 @@ install_xcframework() { echo "Copied $source to $destination" } -install_xcframework "${PODS_ROOT}/../../Libs/Rapidsnark.xcframework" "rapidsnark/C" "library" "ios-arm64-simulator" "ios-arm64_arm64e" +install_xcframework "${PODS_ROOT}/../../Libs/Rapidsnark.xcframework" "rapidsnark/C" "library" "ios-arm64" "ios-arm64_arm64e_x86_64-simulator" diff --git a/Example/rapidsnark.xcodeproj/project.pbxproj b/Example/rapidsnark.xcodeproj/project.pbxproj index 5531f1b..5507e27 100644 --- a/Example/rapidsnark.xcodeproj/project.pbxproj +++ b/Example/rapidsnark.xcodeproj/project.pbxproj @@ -16,7 +16,6 @@ 8D9235412BC56EE200B05BF1 /* circuit_final.zkey in Resources */ = {isa = PBXBuildFile; fileRef = 8D9235402BC56EE200B05BF1 /* circuit_final.zkey */; }; 8D9235442BC56EF500B05BF1 /* witness.wtns in Resources */ = {isa = PBXBuildFile; fileRef = 8D9235422BC56EF500B05BF1 /* witness.wtns */; }; 8D9235452BC56EF500B05BF1 /* verification_key.json in Resources */ = {isa = PBXBuildFile; fileRef = 8D9235432BC56EF500B05BF1 /* verification_key.json */; }; - 8DEDA6BB2C539EBC00862F04 /* witness_calc.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DEDA6BA2C539EBC00862F04 /* witness_calc.m */; }; B33479556ECA93BC7700D51F /* Pods_rapidsnark_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A753C822247CC94544145747 /* Pods_rapidsnark_Example.framework */; }; EEE2AFE81C3AE89742557FBC /* Pods_rapidsnark_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F39D437746DADFB4102250B /* Pods_rapidsnark_Tests.framework */; }; /* End PBXBuildFile section */ @@ -61,9 +60,6 @@ 8D9235402BC56EE200B05BF1 /* circuit_final.zkey */ = {isa = PBXFileReference; lastKnownFileType = file; path = circuit_final.zkey; sourceTree = ""; }; 8D9235422BC56EF500B05BF1 /* witness.wtns */ = {isa = PBXFileReference; lastKnownFileType = file; path = witness.wtns; sourceTree = ""; }; 8D9235432BC56EF500B05BF1 /* verification_key.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = verification_key.json; sourceTree = ""; }; - 8DEDA6B82C539EA800862F04 /* witness_calc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = witness_calc.h; sourceTree = ""; }; - 8DEDA6B92C539EBB00862F04 /* rapidsnark_Example-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "rapidsnark_Example-Bridging-Header.h"; sourceTree = ""; }; - 8DEDA6BA2C539EBC00862F04 /* witness_calc.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = witness_calc.m; sourceTree = ""; }; 927BBA4BCDCC94C20BA8C102 /* rapidsnark.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = rapidsnark.podspec; path = ../rapidsnark.podspec; sourceTree = ""; }; A753C822247CC94544145747 /* Pods_rapidsnark_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_rapidsnark_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; CBB106B1B7F5EEE63BF3E4BA /* Pods-rapidsnark_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-rapidsnark_Tests.debug.xcconfig"; path = "Target Support Files/Pods-rapidsnark_Tests/Pods-rapidsnark_Tests.debug.xcconfig"; sourceTree = ""; }; @@ -131,13 +127,10 @@ children = ( 607FACD51AFB9204008FA782 /* AppDelegate.swift */, 607FACD71AFB9204008FA782 /* ViewController.swift */, - 8DEDA6B82C539EA800862F04 /* witness_calc.h */, - 8DEDA6BA2C539EBC00862F04 /* witness_calc.m */, 607FACD91AFB9204008FA782 /* Main.storyboard */, 607FACDC1AFB9204008FA782 /* Images.xcassets */, 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */, 607FACD31AFB9204008FA782 /* Supporting Files */, - 8DEDA6B92C539EBB00862F04 /* rapidsnark_Example-Bridging-Header.h */, ); name = "Example for rapidsnark"; path = rapidsnark; @@ -364,7 +357,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8DEDA6BB2C539EBC00862F04 /* witness_calc.m in Sources */, 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */, 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, ); diff --git a/Example/rapidsnark/rapidsnark_Example-Bridging-Header.h b/Example/rapidsnark/rapidsnark_Example-Bridging-Header.h index 3641471..1b2cb5d 100644 --- a/Example/rapidsnark/rapidsnark_Example-Bridging-Header.h +++ b/Example/rapidsnark/rapidsnark_Example-Bridging-Header.h @@ -2,4 +2,3 @@ // Use this file to import your target's public headers that you would like to expose to Swift. // -#import "witness_calc.h" diff --git a/Example/rapidsnark/witness_calc.h b/Example/rapidsnark/witness_calc.h deleted file mode 100644 index 75a1234..0000000 --- a/Example/rapidsnark/witness_calc.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// witness_calc.h -// rapidsnark -// -// Created by Yaroslav Moria on 26.07.2024. -// Copyright © 2024 CocoaPods. All rights reserved. -// - -#import "graph_witness.h" -#import "libbabyjubjub.h" - -#ifndef witness_calc_h -#define witness_calc_h - -void* test(const char *inputs, const void *graph_data, const size_t graph_data_len); - -#endif /* witness_calc_h */ diff --git a/Example/rapidsnark/witness_calc.m b/Example/rapidsnark/witness_calc.m deleted file mode 100644 index 56d0c86..0000000 --- a/Example/rapidsnark/witness_calc.m +++ /dev/null @@ -1,40 +0,0 @@ -// -// witness_calc.m -// rapidsnark_Example -// -// Created by Yaroslav Moria on 26.07.2024. -// Copyright © 2024 CocoaPods. All rights reserved. -// - -#import "witness_calc.h" - -#import - - -void* test(const char *inputs, const void *graph_data, const size_t graph_data_len) { - void* witness; - size_t witness_len; - - const gw_status_t status; - - int result = gw_calc_witness(inputs, graph_data, graph_data_len, &witness, &witness_len, &status); - - if (result == 0) { - return witness; - } else { - NSLog(@"Witness calc error: %s", status.error_msg); - return nil; - } -} - - -void* testJubJub(const char *inputs, const void *graph_data, const size_t graph_data_len) { - char* signature = "415b8523177be6153b1e05161d471caa40ad1dc5b8ad3ed810b4b3dfca30d0b65c9446fff76af58343ec2502c0637fe9b2f519023c22adcbe98f2f33fa98ab0f"; - - char* packed = pack_signature(signature); - - NSData *dataData = [NSData dataWithBytes:packed length:sizeof(packed)]; - NSLog(@"data = %@", dataData); - - return nil; -}